продолжение рефакторинга. создал предка для класса current
This commit is contained in:
30
src/Common/CurrentAnchestor.java
Normal file
30
src/Common/CurrentAnchestor.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package Common;
|
||||
import Common.Utils.TextLog;
|
||||
import Common_old.Current;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
public interface CurrentAnchestor {
|
||||
//-
|
||||
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
|
||||
static Object get(CurrentAnchestor name) {
|
||||
if (!objects.containsKey(name))
|
||||
objects.put(name,null);
|
||||
return objects.get(name);
|
||||
}
|
||||
static Object set(CurrentAnchestor name, Object object) {
|
||||
if (objects.containsKey(name))
|
||||
objects.replace(name, object);
|
||||
else objects.put(name, object);
|
||||
return object;
|
||||
}
|
||||
default String getDescription(){
|
||||
return "?";
|
||||
}
|
||||
static boolean Check(TextLog Log, CurrentAnchestor... names) {
|
||||
for (CurrentAnchestor name : names)
|
||||
if (CurrentAnchestor.get(name) == null)
|
||||
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
||||
return Log.isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package Common.Database.Tables;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common.Visual.DataSetFilter;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.DataMenuBar;
|
||||
import Common_old.UI.Tables.ColumnFilter;
|
||||
import Common_old.UI.UI;
|
||||
@@ -90,7 +91,6 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
ui_.Select(pk);
|
||||
}
|
||||
}
|
||||
//столбы/ потом переименовать обратно в getUIColumnNames.сейчас так для скорости переноса.
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{};
|
||||
}
|
||||
@@ -149,25 +149,6 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
public String getSingleDescription() {
|
||||
return "";
|
||||
}
|
||||
//времянки
|
||||
public Current CurrentName() {
|
||||
return Current.Undefined;
|
||||
}
|
||||
public boolean CheckCurrent(TextLog log) {
|
||||
return Current.Check(log, CurrentName());
|
||||
}
|
||||
public boolean hasCurrent() {
|
||||
return Current.get(CurrentName()) != null;
|
||||
}
|
||||
public void dropCurrent() {
|
||||
Current.set(CurrentName(), null);
|
||||
}
|
||||
public D getCurrent() {
|
||||
return (D) Current.get(CurrentName());
|
||||
}
|
||||
public void setCurrent(D o) {
|
||||
Current.set(CurrentName(), o);
|
||||
}
|
||||
//-
|
||||
public void put(Object key, D object) {
|
||||
Data.put((K) key, object);
|
||||
@@ -220,25 +201,6 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
return Data.values().stream().filter(DBObject::isSelected).map(d -> (K) d.getPK()).collect(Collectors.toCollection(Vector::new));
|
||||
}
|
||||
//--
|
||||
public void SaveLastSelections() {
|
||||
if (hasUI()) {
|
||||
Object lastPk = null;
|
||||
if ((CurrentName() != Current.Undefined) && (getCurrent() != null))
|
||||
lastPk = getCurrent().getPK();
|
||||
if (!selections.containsKey(getClass()))
|
||||
selections.put(getClass(), lastPk);
|
||||
else selections.replace(getClass(), lastPk);
|
||||
}
|
||||
}
|
||||
public void RestoreLastSelections() {
|
||||
if (hasUI()) {
|
||||
Object lastPk = selections.get(getClass());
|
||||
if ((CurrentName() != Current.Undefined) && (lastPk != null)) {
|
||||
ui_.Select(lastPk);
|
||||
}
|
||||
}
|
||||
}
|
||||
//---
|
||||
// применить значение фильтра к фильру объекта напирмер Message.filterValue = text;
|
||||
public void changeColumnFilterValue(int columnIndex, String text) {
|
||||
}
|
||||
@@ -279,13 +241,31 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//--
|
||||
//------------------------------------------------------------------------------------
|
||||
public CurrentAnchestor CurrentName() {
|
||||
return null;
|
||||
}
|
||||
public boolean CheckCurrent(TextLog log) {
|
||||
return CurrentAnchestor.Check(log, CurrentName());
|
||||
}
|
||||
public boolean hasCurrent() {
|
||||
return CurrentAnchestor.get(CurrentName()) != null;
|
||||
}
|
||||
public void dropCurrent() {
|
||||
CurrentAnchestor.set(CurrentName(), null);
|
||||
}
|
||||
public D getCurrent() {
|
||||
return (D) CurrentAnchestor.get(CurrentName());
|
||||
}
|
||||
public void setCurrent(D o) {
|
||||
CurrentAnchestor.set(CurrentName(), o);
|
||||
}
|
||||
public Vector<D> getCheckedOrCurrent() {
|
||||
Vector<D> res = new Vector<>();
|
||||
if (getCheckedCount() > 0)
|
||||
res = getCheckedItems();
|
||||
else {
|
||||
if (!CurrentName().equals(Current.Undefined)) {
|
||||
if (CurrentName()!=null) {
|
||||
if (getCurrent() != null) {
|
||||
res.add(getCurrent());
|
||||
}
|
||||
@@ -293,4 +273,23 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public void SaveLastSelections() {
|
||||
if (hasUI()) {
|
||||
Object lastPk = null;
|
||||
if ((CurrentName() != null) && (getCurrent() != null))
|
||||
lastPk = getCurrent().getPK();
|
||||
if (!selections.containsKey(getClass()))
|
||||
selections.put(getClass(), lastPk);
|
||||
else selections.replace(getClass(), lastPk);
|
||||
}
|
||||
}
|
||||
public void RestoreLastSelections() {
|
||||
if (hasUI()) {
|
||||
Object lastPk = selections.get(getClass());
|
||||
if ((CurrentName() != null) && (lastPk != null)) {
|
||||
ui_.Select(lastPk);
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public class CommonUtils {
|
||||
.mapToObj(Character.UnicodeBlock::of)
|
||||
.anyMatch(b -> b.equals(Character.UnicodeBlock.CYRILLIC));
|
||||
}
|
||||
public static boolean isDigit(String s) {
|
||||
public static boolean isIntegerValue(String s) {
|
||||
try {
|
||||
Integer.parseInt(s);
|
||||
return true;
|
||||
@@ -445,4 +445,7 @@ public class CommonUtils {
|
||||
public static String getDateName(String name_) {
|
||||
return name_ + "_" + getDateNumber();
|
||||
}
|
||||
public static int fromBoolean(boolean flag) {
|
||||
return flag ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Common_old.UI;
|
||||
package Common.Visual;
|
||||
import Common.Utils.CommonUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common_old.UI;
|
||||
package Common.Visual;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -7,8 +8,8 @@ public class ControlWithCurrentForm<C extends Component> extends ControlForm<C>
|
||||
super(class_in);
|
||||
}
|
||||
//-
|
||||
public Current CurrentName() {
|
||||
return Current.Undefined;
|
||||
public CurrentAnchestor CurrentName() {
|
||||
return null;
|
||||
}
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package Common_old.UI.ComboBox;
|
||||
package Common.Visual.Controls;
|
||||
import Common_old.UI.Menus.TextComboBoxMenu;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Common_old.UI;
|
||||
package Common.Visual;
|
||||
import Common.Database.Objects.DBObject;
|
||||
public interface DataControl {
|
||||
DBObject getRowObject(int rowIndex); //получить объект, сответствующий данной строке.
|
||||
@@ -1,9 +1,10 @@
|
||||
package Common_old.UI;
|
||||
package Common.Visual;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
public interface DataControl_OLD {
|
||||
//todo скорее всего устареет.
|
||||
default Current getCurrent() {
|
||||
return Current.Undefined;
|
||||
default CurrentAnchestor getCurrent() {
|
||||
return null;
|
||||
}
|
||||
//-?
|
||||
default void ShowCurrentObject() throws Exception {
|
||||
@@ -1,18 +1,18 @@
|
||||
package Common_old.UI;
|
||||
package Common.Visual;
|
||||
import Common.CommonConstants;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common_old.UI.UI;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.Menus.TableMenu;
|
||||
import Common_old.UI.Tables.ColumnInfo;
|
||||
import Common_old.UI.Tables.DataTable;
|
||||
import Common_old.UI.Tables.Grid.GridAnchestor;
|
||||
import GlobalData.Grid.Grid;
|
||||
import GlobalData.Grid.TableVisualData;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableColumn;
|
||||
@@ -61,24 +61,25 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
return dataSource;
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
public CurrentAnchestor CurrentName() {
|
||||
return getDataSource().CurrentName();
|
||||
}
|
||||
public void SaveColumns() {
|
||||
if (Global.db != null) {
|
||||
try {
|
||||
if ((CurrentName() != Current.Undefined)) {
|
||||
if ((CurrentName() != null)) {
|
||||
String tableName= CurrentName().toString();
|
||||
Vector<String> widths = IntStream.range(0, columns.size()).mapToObj(i -> String.valueOf(control.getColumnModel().getColumn(i).getWidth())).collect(Collectors.toCollection(Vector::new));
|
||||
String packed = String.join("|", widths);
|
||||
Grid grid;
|
||||
if (Global.db.grids.containsKey(CurrentName())) {
|
||||
grid = Global.db.grids.get(CurrentName());
|
||||
TableVisualData tableVisualData;
|
||||
if (Global.db.tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = Global.db.tablesVisualData.get(tableName);
|
||||
} else {
|
||||
grid = new Grid(CurrentName());
|
||||
Global.db.Insert(grid);
|
||||
tableVisualData = new TableVisualData(tableName);
|
||||
Global.db.Insert(tableVisualData);
|
||||
}
|
||||
grid.sizes = packed;
|
||||
Global.db.Update(grid);
|
||||
tableVisualData.sizes = packed;
|
||||
Global.db.Update(tableVisualData);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -149,10 +150,10 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
//-----------------------------NEW-------------------------------------
|
||||
@Override
|
||||
public void CorrectColumnsSizes() {
|
||||
if ((Global.db != null) && CurrentName() != Current.Undefined && Global.db.grids.containsKey(CurrentName())) {
|
||||
if ((Global.db != null) && CurrentName() != null && Global.db.tablesVisualData.containsKey(CurrentName())) {
|
||||
//Undefined может оказаться в таблице, например если енум устарел. Поэтому надо проверять.
|
||||
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
||||
Grid grid = Global.db.grids.get(CurrentName());
|
||||
TableVisualData grid = Global.db.tablesVisualData.get(CurrentName());
|
||||
String[] data = grid.sizes.split("\\|");
|
||||
for (int i = 0; i < columns.size(); ++i) {
|
||||
if (i <= (data.length - 1)) {
|
||||
@@ -208,7 +209,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
//------------------------->>
|
||||
}
|
||||
};
|
||||
if (CurrentName() != Current.Undefined) {
|
||||
if (CurrentName() != null) {
|
||||
current_row_i = CommonConstants.Nan;
|
||||
ListSelectionModel selModel = control.getSelectionModel();
|
||||
selModel.addListSelectionListener(e -> {
|
||||
@@ -1,7 +1,7 @@
|
||||
package Common_old;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Syntax.VisualiserTheme;
|
||||
import Common.Utils.TextLog;
|
||||
import GlobalData.Account.Account;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Machine.Machine;
|
||||
@@ -26,15 +26,13 @@ import Visual_DVM_2021.Passes.UI.PassForm;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
public enum Current {
|
||||
Undefined,
|
||||
public enum Current implements CurrentAnchestor {
|
||||
//--
|
||||
DVMPackage,
|
||||
SapforPackage,
|
||||
//--
|
||||
ServerSapfor,
|
||||
SapforEtalonVersion,//самый левый пакет
|
||||
SapforEtalonVersion,
|
||||
SapforVersion,
|
||||
//--
|
||||
//--
|
||||
@@ -109,159 +107,155 @@ public enum Current {
|
||||
DVMRunTask,
|
||||
SapforSettings,
|
||||
SapforSettingsCommand,
|
||||
DVMSettings,
|
||||
;
|
||||
//-
|
||||
private static final LinkedHashMap<Current, Object> objects = new LinkedHashMap<>();
|
||||
DVMSettings;
|
||||
public static Mode mode;
|
||||
public static boolean hasUI() {
|
||||
return Current.mode.equals(Current.Mode.Normal);
|
||||
}
|
||||
public static boolean HasProject() {
|
||||
return get(Project) != null;
|
||||
return CurrentAnchestor.get(Project) != null;
|
||||
}
|
||||
public static boolean HasFile() {
|
||||
return get(File) != null;
|
||||
return CurrentAnchestor.get(File) != null;
|
||||
}
|
||||
public static boolean HasSelectedFile() {
|
||||
return get(SelectedFile) != null;
|
||||
return CurrentAnchestor.get(SelectedFile) != null;
|
||||
}
|
||||
public static boolean HasAccount() {
|
||||
return get(Account) != null;
|
||||
return CurrentAnchestor.get(Account) != null;
|
||||
}
|
||||
public static boolean HasMachine() {
|
||||
return get(Machine) != null;
|
||||
return CurrentAnchestor.get(Machine) != null;
|
||||
}
|
||||
public static boolean HasUser() {
|
||||
return get(User) != null;
|
||||
return CurrentAnchestor.get(User) != null;
|
||||
}
|
||||
public static boolean HasCompiler() {
|
||||
return get(Compiler) != null;
|
||||
return CurrentAnchestor.get(Compiler) != null;
|
||||
}
|
||||
public static boolean HasRemoteFile() {
|
||||
return get(RemoteFile) != null;
|
||||
return CurrentAnchestor.get(RemoteFile) != null;
|
||||
}
|
||||
public static boolean HasMakefile() {
|
||||
return get(Makefile) != null;
|
||||
return CurrentAnchestor.get(Makefile) != null;
|
||||
}
|
||||
public static boolean HasRunConfiguration() {
|
||||
return get(RunConfiguration) != null;
|
||||
return CurrentAnchestor.get(RunConfiguration) != null;
|
||||
}
|
||||
public static boolean HasCompilationTask() {
|
||||
return get(CompilationTask) != null;
|
||||
return CurrentAnchestor.get(CompilationTask) != null;
|
||||
}
|
||||
public static boolean HasRunTask() {
|
||||
return get(RunTask) != null;
|
||||
return CurrentAnchestor.get(RunTask) != null;
|
||||
}
|
||||
public static boolean HasPassForm() {
|
||||
return get(PassForm) != null;
|
||||
return CurrentAnchestor.get(PassForm) != null;
|
||||
}
|
||||
public static boolean HasProjectView() {
|
||||
return get(ProjectView) != null;
|
||||
return CurrentAnchestor.get(ProjectView) != null;
|
||||
}
|
||||
//для быстрого доступа на чтение. слишком много на нем завязано.
|
||||
public static SapforSettings getSapforSettings() {
|
||||
return (SapforSettings) get(SapforSettings);
|
||||
return (SapforSettings) CurrentAnchestor.get(SapforSettings);
|
||||
}
|
||||
public static boolean HasSapforSettings() {
|
||||
return get(SapforSettings) != null;
|
||||
return CurrentAnchestor.get(SapforSettings) != null;
|
||||
}
|
||||
|
||||
public static db_project_info getProject() {
|
||||
return (db_project_info) get(Project);
|
||||
return (db_project_info) CurrentAnchestor.get(Project);
|
||||
}
|
||||
public static DBProjectFile getFile() {
|
||||
return (DBProjectFile) get(File);
|
||||
return (DBProjectFile) CurrentAnchestor.get(File);
|
||||
}
|
||||
public static Repository.Component.Component getComponent() {
|
||||
return (Repository.Component.Component) get(Component);
|
||||
return (Repository.Component.Component) CurrentAnchestor.get(Component);
|
||||
}
|
||||
public static Repository.BugReport.BugReport getBugReport() {
|
||||
return (BugReport) get(BugReport);
|
||||
return (BugReport) CurrentAnchestor.get(BugReport);
|
||||
}
|
||||
public static db_project_info getRoot() {
|
||||
return (db_project_info) get(Root);
|
||||
return (db_project_info) CurrentAnchestor.get(Root);
|
||||
}
|
||||
public static boolean HasRoot() {
|
||||
return get(Root) != null;
|
||||
return CurrentAnchestor.get(Root) != null;
|
||||
}
|
||||
public static db_project_info getVersion() {
|
||||
return (db_project_info) get(Version);
|
||||
return (db_project_info) CurrentAnchestor.get(Version);
|
||||
}
|
||||
public static Account getAccount() {
|
||||
return (Account) get(Account);
|
||||
return (Account) CurrentAnchestor.get(Account);
|
||||
}
|
||||
public static boolean HasSubscriber() {
|
||||
return get(Current.Subscriber) != null;
|
||||
return CurrentAnchestor.get(Current.Subscriber) != null;
|
||||
}
|
||||
public static Repository.Subscribes.Subscriber getSubscriber() {
|
||||
return (Subscriber) get(Current.Subscriber);
|
||||
return (Subscriber) CurrentAnchestor.get(Current.Subscriber);
|
||||
}
|
||||
public static Machine getMachine() {
|
||||
return (Machine) get(Current.Machine);
|
||||
return (Machine) CurrentAnchestor.get(Current.Machine);
|
||||
}
|
||||
public static User getUser() {
|
||||
return (User) get(Current.User);
|
||||
return (User) CurrentAnchestor.get(Current.User);
|
||||
}
|
||||
public static Compiler getCompiler() {
|
||||
return (Compiler) get(Current.Compiler);
|
||||
return (Compiler) CurrentAnchestor.get(Current.Compiler);
|
||||
}
|
||||
public static CompilationTask getCompilationTask() {
|
||||
return (CompilationTask) get(Current.CompilationTask);
|
||||
return (CompilationTask) CurrentAnchestor.get(Current.CompilationTask);
|
||||
}
|
||||
public static RunTask getRunTask() {
|
||||
return (RunTask) get(Current.RunTask);
|
||||
return (RunTask) CurrentAnchestor.get(Current.RunTask);
|
||||
}
|
||||
public static RemoteFile getRemoteFile() {
|
||||
return (RemoteFile) get(Current.RemoteFile);
|
||||
return (RemoteFile) CurrentAnchestor.get(Current.RemoteFile);
|
||||
}
|
||||
public static Makefile getMakefile() {
|
||||
return (Makefile) get(Current.Makefile);
|
||||
return (Makefile) CurrentAnchestor.get(Current.Makefile);
|
||||
}
|
||||
public static Module getModule() {
|
||||
return (Module) get(Current.Module);
|
||||
return (Module) CurrentAnchestor.get(Current.Module);
|
||||
}
|
||||
public static RunConfiguration getRunConfiguration() {
|
||||
return (RunConfiguration) get(Current.RunConfiguration);
|
||||
return (RunConfiguration) CurrentAnchestor.get(Current.RunConfiguration);
|
||||
}
|
||||
public static Repository.Component.Sapfor.Sapfor getSapfor() {
|
||||
return (Repository.Component.Sapfor.Sapfor) get(Current.Sapfor);
|
||||
return (Repository.Component.Sapfor.Sapfor) CurrentAnchestor.get(Current.Sapfor);
|
||||
}
|
||||
public static boolean HasGroup() {
|
||||
return get(Current.Group) != null;
|
||||
return CurrentAnchestor.get(Current.Group) != null;
|
||||
}
|
||||
public static TestingSystem.Common.Group.Group getGroup() {
|
||||
return (TestingSystem.Common.Group.Group) get(Current.Group);
|
||||
return (TestingSystem.Common.Group.Group) CurrentAnchestor.get(Current.Group);
|
||||
}
|
||||
//--
|
||||
public static boolean HasConfiguration() {
|
||||
return get(Current.DVMConfiguration) != null;
|
||||
return CurrentAnchestor.get(Current.DVMConfiguration) != null;
|
||||
}
|
||||
public static DVMConfiguration getDVMConfiguration() {
|
||||
return (DVMConfiguration) get(Current.DVMConfiguration);
|
||||
return (DVMConfiguration) CurrentAnchestor.get(Current.DVMConfiguration);
|
||||
}
|
||||
public static SapforConfiguration getSapforConfiguration() {
|
||||
return (TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) get(Current.SapforConfiguration);
|
||||
return (TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) CurrentAnchestor.get(Current.SapforConfiguration);
|
||||
}
|
||||
//--
|
||||
public static Test getTest() {
|
||||
return (TestingSystem.Common.Test.Test) get(Current.Test);
|
||||
return (TestingSystem.Common.Test.Test) CurrentAnchestor.get(Current.Test);
|
||||
}
|
||||
public static boolean HasTest() {
|
||||
return get(Current.Test) != null;
|
||||
return CurrentAnchestor.get(Current.Test) != null;
|
||||
}
|
||||
public static boolean HasVersion() {
|
||||
return get(Current.Version) != null;
|
||||
return CurrentAnchestor.get(Current.Version) != null;
|
||||
}
|
||||
public static RemoteFile getComponentServerBackup() {
|
||||
return (RemoteFile) get(Current.ComponentServerBackup);
|
||||
return (RemoteFile) CurrentAnchestor.get(Current.ComponentServerBackup);
|
||||
}
|
||||
public static boolean HasComponentServerBackup() {
|
||||
return get(Current.ComponentServerBackup) != null;
|
||||
return CurrentAnchestor.get(Current.ComponentServerBackup) != null;
|
||||
}
|
||||
//-
|
||||
public static DefaultMutableTreeNode getProjectNode() {
|
||||
return (DefaultMutableTreeNode) get(Current.ProjectNode);
|
||||
return (DefaultMutableTreeNode) CurrentAnchestor.get(Current.ProjectNode);
|
||||
}
|
||||
public static DefaultMutableTreeNode getProjectCurrentParentNode() {
|
||||
DefaultMutableTreeNode node = Current.getProjectNode();
|
||||
@@ -271,116 +265,100 @@ public enum Current {
|
||||
return (node.getUserObject() instanceof DBProjectFile) ? (DefaultMutableTreeNode) node.getParent() : node;
|
||||
}
|
||||
public static File getSelectedDirectory() {
|
||||
return (File) get(Current.SelectedDirectory);
|
||||
return (File) CurrentAnchestor.get(Current.SelectedDirectory);
|
||||
}
|
||||
public static DBProjectFile getSelectedFile() {
|
||||
return (DBProjectFile) get(Current.SelectedFile);
|
||||
return (DBProjectFile) CurrentAnchestor.get(Current.SelectedFile);
|
||||
}
|
||||
//-
|
||||
public static boolean HasBugReport() {
|
||||
return get(Current.BugReport) != null;
|
||||
return CurrentAnchestor.get(Current.BugReport) != null;
|
||||
}
|
||||
public static PassForm getPassForm() {
|
||||
return (Visual_DVM_2021.Passes.UI.PassForm) get(Current.PassForm);
|
||||
return (Visual_DVM_2021.Passes.UI.PassForm) CurrentAnchestor.get(Current.PassForm);
|
||||
}
|
||||
public static VisualiserTheme getTheme() {
|
||||
return (VisualiserTheme) get(Current.Theme);
|
||||
return (VisualiserTheme) CurrentAnchestor.get(Current.Theme);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
public static ParallelRegion getParallelRegion() {
|
||||
return (ParallelRegion) get(Current.ParallelRegion);
|
||||
return (ParallelRegion) CurrentAnchestor.get(Current.ParallelRegion);
|
||||
}
|
||||
public static boolean HasParallelRegion() {
|
||||
return get(Current.ParallelRegion) != null;
|
||||
return CurrentAnchestor.get(Current.ParallelRegion) != null;
|
||||
}
|
||||
public static boolean HasFunction() {
|
||||
return get(Current.Function) != null;
|
||||
return CurrentAnchestor.get(Current.Function) != null;
|
||||
}
|
||||
public static boolean HasSelectedFunction() {
|
||||
return get(Current.SelectedFunction) != null;
|
||||
return CurrentAnchestor.get(Current.SelectedFunction) != null;
|
||||
}
|
||||
public static FuncInfo getFunction() {
|
||||
return (FuncInfo) get(Current.Function);
|
||||
return (FuncInfo) CurrentAnchestor.get(Current.Function);
|
||||
}
|
||||
public static FuncInfo getSelectionFunction() {
|
||||
return (FuncInfo) get(Current.SelectedFunction);
|
||||
return (FuncInfo) CurrentAnchestor.get(Current.SelectedFunction);
|
||||
}
|
||||
public static boolean HasScenario() {
|
||||
return get(Current.Scenario) != null;
|
||||
return CurrentAnchestor.get(Current.Scenario) != null;
|
||||
}
|
||||
public static db_project_info getPackageVersion() {
|
||||
return (db_project_info) get(Current.PackageVersion);
|
||||
return (db_project_info) CurrentAnchestor.get(Current.PackageVersion);
|
||||
}
|
||||
public static boolean HasPackageVersion() {
|
||||
return get(Current.PackageVersion) != null;
|
||||
return CurrentAnchestor.get(Current.PackageVersion) != null;
|
||||
}
|
||||
public static boolean HasSapforConfiguration() {
|
||||
return get(Current.SapforConfiguration) != null;
|
||||
return CurrentAnchestor.get(Current.SapforConfiguration) != null;
|
||||
}
|
||||
public static ProjectData.ProjectView getProjectView() {
|
||||
return (ProjectData.ProjectView) get(ProjectView);
|
||||
}
|
||||
public static boolean Check(TextLog Log, Current... names) {
|
||||
for (Current name : names)
|
||||
if (get(name) == null)
|
||||
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
||||
return Log.isEmpty();
|
||||
}
|
||||
public static void CreateAll() {
|
||||
for (Current c : values())
|
||||
objects.put(c, null);
|
||||
return (ProjectData.ProjectView) CurrentAnchestor.get(ProjectView);
|
||||
}
|
||||
//-----------------------------------------
|
||||
public static Object get(Current name) {
|
||||
return objects.get(name);
|
||||
}
|
||||
public static Object set(Current name, Object object) {
|
||||
objects.replace(name, object);
|
||||
return object;
|
||||
}
|
||||
//применять только для наследников iDBObject
|
||||
public static boolean CheckID(Current name, int id) {
|
||||
return (get(name) != null) && (((iDBObject) get(name)).id == id);
|
||||
return (CurrentAnchestor.get(name) != null) && (((iDBObject) CurrentAnchestor.get(name)).id == id);
|
||||
}
|
||||
public static boolean HasSapforProfile() {
|
||||
return get(Current.SapforProfile) != null;
|
||||
return CurrentAnchestor.get(Current.SapforProfile) != null;
|
||||
}
|
||||
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
|
||||
return (GlobalData.SapforProfile.SapforProfile) get(Current.SapforProfile);
|
||||
return (GlobalData.SapforProfile.SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
|
||||
}
|
||||
//сапфоры установленные на тестовый сервер.
|
||||
public static boolean HasServerSapfor() {
|
||||
return get(Current.ServerSapfor) != null;
|
||||
return CurrentAnchestor.get(Current.ServerSapfor) != null;
|
||||
}
|
||||
public static TestingSystem.SAPFOR.ServerSapfor.ServerSapfor getServerSapfor() {
|
||||
return (TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) get(Current.ServerSapfor);
|
||||
return (TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) CurrentAnchestor.get(Current.ServerSapfor);
|
||||
}
|
||||
public static boolean HasSubscriberWorkspace() {
|
||||
return get(Current.SubscriberWorkspace) != null;
|
||||
return CurrentAnchestor.get(Current.SubscriberWorkspace) != null;
|
||||
}
|
||||
public static Repository.SubscriberWorkspace.SubscriberWorkspace getSubscriberWorkspace() {
|
||||
return (Repository.SubscriberWorkspace.SubscriberWorkspace) get(Current.SubscriberWorkspace);
|
||||
return (Repository.SubscriberWorkspace.SubscriberWorkspace) CurrentAnchestor.get(Current.SubscriberWorkspace);
|
||||
}
|
||||
//----->>
|
||||
public static boolean HasDVMPackage() {
|
||||
return get(Current.DVMPackage) != null;
|
||||
return CurrentAnchestor.get(Current.DVMPackage) != null;
|
||||
}
|
||||
public static TestingSystem.DVM.DVMPackage.DVMPackage getDVMPackage() {
|
||||
return (TestingSystem.DVM.DVMPackage.DVMPackage) get(Current.DVMPackage);
|
||||
return (TestingSystem.DVM.DVMPackage.DVMPackage) CurrentAnchestor.get(Current.DVMPackage);
|
||||
}
|
||||
public static boolean HasSapforPackage() {
|
||||
return get(Current.SapforPackage) != null;
|
||||
return CurrentAnchestor.get(Current.SapforPackage) != null;
|
||||
}
|
||||
public static TestingSystem.SAPFOR.SapforPackage.SapforPackage getSapforPackage() {
|
||||
return (TestingSystem.SAPFOR.SapforPackage.SapforPackage) get(Current.SapforPackage);
|
||||
return (TestingSystem.SAPFOR.SapforPackage.SapforPackage) CurrentAnchestor.get(Current.SapforPackage);
|
||||
}
|
||||
public static boolean HasDVMRunTask() {
|
||||
return get(Current.DVMRunTask) != null;
|
||||
return CurrentAnchestor.get(Current.DVMRunTask) != null;
|
||||
}
|
||||
public static TestingSystem.DVM.DVMTasks.DVMRunTask getDVMRunTask() {
|
||||
return (TestingSystem.DVM.DVMTasks.DVMRunTask) Current.get(Current.DVMRunTask);
|
||||
return (TestingSystem.DVM.DVMTasks.DVMRunTask) CurrentAnchestor.get(Current.DVMRunTask);
|
||||
}
|
||||
//--------------------------------------------
|
||||
@Override
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case DVMSettings:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common_old.UI.Menus;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Menus_2023.StableMenuItem;
|
||||
@@ -41,7 +42,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
|
||||
m_select_for_current.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Object o = Current.get(tree.getCurrent());
|
||||
Object o = CurrentAnchestor.get(tree.getCurrent());
|
||||
if (o instanceof Selectable) {
|
||||
((Selectable) o).SelectAllChildren(true);
|
||||
}
|
||||
@@ -54,7 +55,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
|
||||
m_unselect_for_current.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Object o = Current.get(tree.getCurrent());
|
||||
Object o = CurrentAnchestor.get(tree.getCurrent());
|
||||
if (o instanceof Selectable) {
|
||||
((Selectable) o).SelectAllChildren(false);
|
||||
}
|
||||
@@ -68,7 +69,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
|
||||
public abstract void SelectAll(boolean select);
|
||||
@Override
|
||||
public void CheckElementsVisibility() {
|
||||
Object current = Current.get(tree.getCurrent());
|
||||
Object current = CurrentAnchestor.get(tree.getCurrent());
|
||||
if ((current != null) && (current.getClass().equals(getTargetClass()))) {
|
||||
String name = ((Selectable) current).getSelectionText();
|
||||
m_select_for_current.setText("Выбрать всё для " +
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common_old.UI.Menus_2023.ProjectMenuBar;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Menus_2023.VisualiserMenu;
|
||||
@@ -19,7 +20,7 @@ public class ProjectViewMenu extends VisualiserMenu {
|
||||
setIcon(CommonUtils.getIcon(view.getIcon()));
|
||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
addActionListener(e -> {
|
||||
Current.set(Current.ProjectView, view);
|
||||
CurrentAnchestor.set(Current.ProjectView, view);
|
||||
UI.getMainWindow().getProjectWindow().ShowProjectView();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common_old.UI.Tables;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common_old.UI.DataControl;
|
||||
import Common.Visual.DataControl;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.CellEditorListener;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common_old.UI.Tables;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common_old.UI.DataControl;
|
||||
import Common.Visual.DataControl;
|
||||
|
||||
import javax.swing.*;
|
||||
public abstract class DBObjectRenderer extends RendererCell<DBObject> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common_old.UI.Tables;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common_old.UI.DataControl;
|
||||
import Common.Visual.DataControl;
|
||||
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
public abstract class DataTable extends StyledTable implements DataControl {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package Common_old.UI.Trees;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataControl_OLD;
|
||||
import Common.Visual.DataControl_OLD;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
@@ -10,8 +11,8 @@ public class DataTree extends StyledTree implements DataControl_OLD {
|
||||
super(root_in);
|
||||
}
|
||||
public void ChangeCurrentObject(DefaultMutableTreeNode node) {
|
||||
if (getCurrent() != Current.Undefined)
|
||||
Current.set(getCurrent(), node.getUserObject());
|
||||
if (getCurrent() != null)
|
||||
CurrentAnchestor.set(getCurrent(), node.getUserObject());
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common_old.UI.Trees;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common.Visual.Selectable;
|
||||
|
||||
@@ -9,7 +10,7 @@ public class SelectableTree extends DataTree {
|
||||
}
|
||||
@Override
|
||||
public void LeftMouseAction1() {
|
||||
Object element = Current.get(getCurrent());
|
||||
Object element = CurrentAnchestor.get(getCurrent());
|
||||
if ((element instanceof Selectable)) {
|
||||
((Selectable) element).SwitchSelection();
|
||||
updateUI();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common_old.UI.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.UI.ControlForm;
|
||||
import Common.Visual.ControlForm;
|
||||
|
||||
import java.awt.*;
|
||||
public class TreeForm<C extends StyledTree> extends ControlForm<C> {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common_old.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Menus_2023.CredentialsBar.CredentialsBar;
|
||||
@@ -240,9 +241,8 @@ public class UI {
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Темы(всегда создавать первыми)">
|
||||
themes.put(VisualiserThemeName.Light, new LightVisualiserTheme());
|
||||
themes.put(VisualiserThemeName.Dark, new DarkVisualiserTheme());
|
||||
//по умолчанию поставить светлую тему. потому что до загрузки бд работаем с таблицей компонент.
|
||||
Current.set(Current.Theme, themes.get(VisualiserThemeName.Light));
|
||||
CurrentAnchestor.set(Current.Theme, themes.get(VisualiserThemeName.Light));
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Объекты отрисовки и редактирования деревьев и таблиц">
|
||||
TableRenderers.put(RendererDate, new DateRenderer_());
|
||||
|
||||
@@ -558,15 +558,12 @@ public class Utils {
|
||||
}
|
||||
//---
|
||||
for (int i = 1; i < letters.length; ++i) {
|
||||
if (!(CommonUtils.isEnglishLetter(letters[i]) || letters[i] == '_' || CommonUtils.isDigit(String.valueOf(letters[i])))) {
|
||||
if (!(CommonUtils.isEnglishLetter(letters[i]) || letters[i] == '_' || CommonUtils.isIntegerValue(String.valueOf(letters[i])))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static int fromBoolean(boolean flag) {
|
||||
return flag ? 1 : 0;
|
||||
}
|
||||
public static void keepNewFiles(File directory, int count) throws Exception {
|
||||
if (count > 0) {
|
||||
File[] old_ = directory.listFiles(pathname -> pathname.isFile());
|
||||
|
||||
@@ -2,7 +2,7 @@ package GlobalData.Compiler;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common_old.Utils.Utils;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.CompilerEnvironment;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.TableEditors;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.CompilerOption;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.TableEditors;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.DVMParameter.UI.DVMParameterFields;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.DVMParameter.UI;
|
||||
import Common_old.UI.ComboBox.StyledTextComboBox;
|
||||
import Common.Visual.Controls.StyledTextComboBox;
|
||||
import Common_old.UI.TextField.StyledTextField;
|
||||
import Common_old.UI.Windows.Dialog.DialogFields;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.EnvironmentValue.UI.EnvironmentValueFields;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.FileObject;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
|
||||
import static Common_old.UI.Tables.TableRenderers.*;
|
||||
public class DirInfosDataSet extends DataSet<String, DirInfo> {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
@@ -58,7 +59,7 @@ public class GlobalDatabase extends SQLiteDatabase {
|
||||
public AccountsDBTable accounts;
|
||||
public PassStatsDBTable passStats;
|
||||
public SplittersDBTable splitters;
|
||||
public GridsDBTable grids;
|
||||
public GridsDBTable tablesVisualData;
|
||||
//-
|
||||
public SapforProfilesDBTable sapforProfiles = null;
|
||||
//---------
|
||||
@@ -87,18 +88,18 @@ public class GlobalDatabase extends SQLiteDatabase {
|
||||
addTable(passStats = new PassStatsDBTable());
|
||||
addTable(splitters = new SplittersDBTable());
|
||||
addTable(dvmParameters = new DVMParameterDBTable());
|
||||
addTable(grids = new GridsDBTable());
|
||||
addTable(tablesVisualData = new GridsDBTable());
|
||||
addTable(sapforProfiles = new SapforProfilesDBTable());
|
||||
addTable(sapforProfilesSettings = new SapforProfileSettingsDBTable());
|
||||
}
|
||||
//---------------------------------------------------------------------------------
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
Current.set(Current.Account,
|
||||
CurrentAnchestor.set(Current.Account,
|
||||
accounts.Data.isEmpty() ? Insert(new Account()) :
|
||||
accounts.getFirstRecord()
|
||||
);
|
||||
Current.set(Current.Credentials,
|
||||
CurrentAnchestor.set(Current.Credentials,
|
||||
credentials.Data.isEmpty() ? Insert(new Credentials()) :
|
||||
credentials.getFirstRecord());
|
||||
//настройки компонент
|
||||
@@ -111,7 +112,7 @@ public class GlobalDatabase extends SQLiteDatabase {
|
||||
}
|
||||
public void SaveCredentials(){
|
||||
try {
|
||||
Credentials credentials = (Credentials) Current.get(Current.Credentials);
|
||||
Credentials credentials = (Credentials) CurrentAnchestor.get(Current.Credentials);
|
||||
if (Current.HasMachine())
|
||||
credentials.machine_id = Current.getMachine().id;
|
||||
if (Current.HasUser())
|
||||
@@ -130,7 +131,7 @@ public class GlobalDatabase extends SQLiteDatabase {
|
||||
}
|
||||
public void UpdateCredentials() {
|
||||
try {
|
||||
Global.db.Update((DBObject) Current.get(Current.Credentials));
|
||||
Global.db.Update((DBObject) CurrentAnchestor.get(Current.Credentials));
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package GlobalData.Grid;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DBTable;
|
||||
public class GridsDBTable extends DBTable<Current, Grid> {
|
||||
public class GridsDBTable extends DBTable<String, TableVisualData> {
|
||||
public GridsDBTable() {
|
||||
super(Current.class, Grid.class);
|
||||
super(String.class, TableVisualData.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package GlobalData.Grid;
|
||||
import Common_old.Current;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
public class Grid extends DBObject {
|
||||
public class TableVisualData extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE") //имя таблицы
|
||||
public Current name = Current.Undefined;
|
||||
public String name = null;
|
||||
@Description("DEFAULT ''")
|
||||
public String sizes = ""; //ширины столбцов запакованные через |. вводить объекты ради них нецелесообразно.
|
||||
public Grid() {
|
||||
public TableVisualData() {
|
||||
}
|
||||
public Grid(Current name_in) {
|
||||
public TableVisualData(String name_in) {
|
||||
name = name_in;
|
||||
sizes = "";
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.Machine;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.Makefile;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.Module;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common_old.UI.Windows.Dialog.DialogFields;
|
||||
import GlobalData.Module.UI.ModuleAnchestorForm;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.Module.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.ComboBox.StyledTextComboBox;
|
||||
import Common.Visual.Controls.StyledTextComboBox;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.UI.Windows.Dialog.DialogFields;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.RemoteFile.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -39,7 +40,7 @@ public class RemoteFileChooser extends Dialog<String, RemoteFileChooserFields> {
|
||||
}
|
||||
public void Refresh(String path) {
|
||||
try {
|
||||
Current.set(Current.RemoteFile, null);//сброс текущего файла перед любым обновлением.
|
||||
CurrentAnchestor.set(Current.RemoteFile, null);//сброс текущего файла перед любым обновлением.
|
||||
fields.lCurrentFile.setText("?");
|
||||
//-------------------------------------------------------------------
|
||||
root_file = new RemoteFile(path, true);
|
||||
|
||||
@@ -3,7 +3,7 @@ import Common.CommonConstants;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.SapforProfile;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.SapforProfileSetting;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
public class SapforProfileSettingsDBTable extends iDBTable<SapforProfileSetting> {
|
||||
public SapforProfileSettingsDBTable() {
|
||||
super(SapforProfileSetting.class);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.Tasks.CompilationTask;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Menus.TableMenu;
|
||||
import Common_old.UI.UI;
|
||||
import Common.Database.Objects.DBObject;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.Tasks.RunTask;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Menus.TableMenu;
|
||||
import Common_old.UI.UI;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.User;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ProjectData.DBArray;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
public class ArraysDBTable extends DBTable<String, DBArray> {
|
||||
public ArraysDBTable() {
|
||||
super(String.class, DBArray.class);
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ProjectFile extends DBObject {
|
||||
fileType = FileType.forbidden;
|
||||
break;
|
||||
case "":
|
||||
if (CommonUtils.isDigit(name_in)) {
|
||||
if (CommonUtils.isIntegerValue(name_in)) {
|
||||
fileType = FileType.forbidden;
|
||||
} else {
|
||||
state = FileState.Excluded;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.Files.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Trees.DataTree;
|
||||
import Common_old.UI.Trees.TreeRenderers;
|
||||
@@ -22,7 +23,7 @@ public class FileGraphTree extends DataTree {
|
||||
@Override
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
Current.getFile().form.EventsOff();
|
||||
Object o = Current.get(getCurrent());
|
||||
Object o = CurrentAnchestor.get(getCurrent());
|
||||
Current.getFile().form.getEditor().gotoLine((o instanceof FileObjectWithMessages) ? (((FileObjectWithMessages) o).line) : 1);
|
||||
Current.getFile().form.ShowMessages();
|
||||
Current.getFile().form.EventsOn();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.Files.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DragDrop.FileDrop;
|
||||
@@ -47,7 +48,7 @@ public class FilesTree extends StyledTree {
|
||||
new FileDrop(System.out, this, files -> {
|
||||
Pass_2021.passes.get(PassCode_2021.ImportFiles).Do(files);
|
||||
});
|
||||
Current.set(Current.File, null);
|
||||
CurrentAnchestor.set(Current.File, null);
|
||||
}
|
||||
private static void forkFD(PassCode_2021 file_pass, PassCode_2021 folder_pass) {
|
||||
DefaultMutableTreeNode node = Current.getProjectNode();
|
||||
@@ -66,16 +67,16 @@ public class FilesTree extends StyledTree {
|
||||
@Override
|
||||
public void SelectionAction(TreePath e) {
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getLastPathComponent();
|
||||
Current.set(Current.ProjectNode, node);
|
||||
CurrentAnchestor.set(Current.ProjectNode, node);
|
||||
Object o = node.getUserObject();
|
||||
if (o instanceof File) {
|
||||
Current.set(Current.SelectedDirectory, o);
|
||||
Current.set(Current.SelectedFile, null);
|
||||
CurrentAnchestor.set(Current.SelectedDirectory, o);
|
||||
CurrentAnchestor.set(Current.SelectedFile, null);
|
||||
UI.getMainWindow().getProjectWindow().ShowNoSelectedFile();
|
||||
} else if (o instanceof DBProjectFile) {
|
||||
Current.set(Current.SelectedFile, o);
|
||||
CurrentAnchestor.set(Current.SelectedFile, o);
|
||||
File file = ((DBProjectFile) o).file;
|
||||
Current.set(Current.SelectedDirectory, file.getParentFile());
|
||||
CurrentAnchestor.set(Current.SelectedDirectory, file.getParentFile());
|
||||
UI.getMainWindow().getProjectWindow().ShowSelectedFile();
|
||||
}
|
||||
UI.getMainWindow().getProjectWindow().ShowSelectedDirectory();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.Messages;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Current;
|
||||
@@ -447,7 +448,7 @@ public class Message extends FileObject {
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
if (Current.HasFile() && Current.getFile().name.equals(file)) {
|
||||
Object o = Current.get(Current.FileGraphElement);
|
||||
Object o = CurrentAnchestor.get(Current.FileGraphElement);
|
||||
return !(o instanceof FileObjectWithMessages) || ((FileObjectWithMessages) o).HasMessage(this);
|
||||
} else return false;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package ProjectData.Messages;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.ColumnFilter;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ProjectData.Messages.Recommendations;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.Project.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.Menus.GraphMenu;
|
||||
@@ -50,7 +51,7 @@ public class VersionsTree extends DataTree {
|
||||
public void LeftMouseAction1() {
|
||||
if (Global.versions_multiselection) {
|
||||
// только если есть режим выбора версий.
|
||||
Object element = Current.get(getCurrent());
|
||||
Object element = CurrentAnchestor.get(getCurrent());
|
||||
if ((element instanceof Selectable)) {
|
||||
((Selectable) element).SwitchSelection();
|
||||
updateUI();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package ProjectData.Project;
|
||||
import Common.CommonConstants;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Current;
|
||||
@@ -311,7 +312,7 @@ public class db_project_info extends DBObject {
|
||||
}
|
||||
public boolean IsMCopy() {
|
||||
String lname = name.toLowerCase();
|
||||
return (lname.startsWith("m") && CommonUtils.isDigit(lname.substring(1)));
|
||||
return (lname.startsWith("m") && CommonUtils.isIntegerValue(lname.substring(1)));
|
||||
}
|
||||
public String getTitle() {
|
||||
return name + " " + CommonUtils.DQuotes(description);
|
||||
@@ -432,8 +433,8 @@ public class db_project_info extends DBObject {
|
||||
db.ResetAI(MessageWarning.class);
|
||||
db.ResetAI(MessageRecommendation.class);
|
||||
//-
|
||||
Current.set(Current.Function, null);
|
||||
Current.set(Current.SelectedFunction, null);
|
||||
CurrentAnchestor.set(Current.Function, null);
|
||||
CurrentAnchestor.set(Current.SelectedFunction, null);
|
||||
}
|
||||
public void CleanVersions() throws Exception {
|
||||
node.removeAllChildren();
|
||||
@@ -845,7 +846,7 @@ public class db_project_info extends DBObject {
|
||||
for (String key_ : versions.keySet()) {
|
||||
String[] data_ = key_.split(letter);
|
||||
String last = data_[data_.length - 1];
|
||||
if (CommonUtils.isDigit(last)) {
|
||||
if (CommonUtils.isIntegerValue(last)) {
|
||||
int vn = Integer.parseInt(last);
|
||||
if (vn > max_vn)
|
||||
max_vn = vn;
|
||||
@@ -1066,7 +1067,7 @@ public class db_project_info extends DBObject {
|
||||
target.Close();
|
||||
}
|
||||
public void undoLastTransformation() throws Exception {
|
||||
Current.set(Current.Version, null);
|
||||
CurrentAnchestor.set(Current.Version, null);
|
||||
//---
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_version.node);
|
||||
Utils.forceDeleteWithCheck(last_version.Home);
|
||||
|
||||
@@ -2,7 +2,7 @@ package ProjectData.SapforData.Arrays;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ProjectData.SapforData.Arrays.UI;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.ControlForm;
|
||||
import Common.Visual.ControlForm;
|
||||
import Common_old.UI.Tables.Grid.GridAnchestor;
|
||||
import Common_old.UI.Tables.StyledTable;
|
||||
import Common_old.UI.UI;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.SapforData.Arrays.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Menus.GraphMenu;
|
||||
import Common_old.UI.Trees.StyledTree;
|
||||
@@ -15,7 +16,7 @@ public class RulesTree extends StyledTree {
|
||||
setRootVisible(false);
|
||||
expandRow(0);
|
||||
ExpandAll();
|
||||
Current.set(Current.ParallelRegion, null);
|
||||
CurrentAnchestor.set(Current.ParallelRegion, null);
|
||||
}
|
||||
@Override
|
||||
protected GraphMenu createMenu() {
|
||||
@@ -38,6 +39,6 @@ public class RulesTree extends StyledTree {
|
||||
region = (ParallelRegion) o;
|
||||
}
|
||||
}
|
||||
Current.set(Current.ParallelRegion, region);
|
||||
CurrentAnchestor.set(Current.ParallelRegion, region);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ProjectData.SapforData.Functions.UI.Graph;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.ControlForm;
|
||||
import Common.Visual.ControlForm;
|
||||
import com.mxgraph.swing.mxGraphComponent;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.SapforData.Functions.UI.Graph;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Menus.VisualiserMenuItem;
|
||||
@@ -19,7 +20,7 @@ public class FunctionsGraphMenu extends StyledPopupMenu {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (Current.HasSelectedFunction()) {
|
||||
Current.set(Current.Function, Current.getSelectionFunction());
|
||||
CurrentAnchestor.set(Current.Function, Current.getSelectionFunction());
|
||||
UI.getMainWindow().getProjectWindow().getFunctionsWindow().ShowCurrentFunction();
|
||||
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
|
||||
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.SapforData.Functions.UI.Graph;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -140,7 +141,7 @@ public class FunctionsGraphUI extends mxGraph {
|
||||
funcInfo = Current.getProject().allFunctions.get(name);
|
||||
String vertexType = funcInfo.type.toString();
|
||||
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
|
||||
FuncInfo current_fi = (FuncInfo) Current.get(Current.Function);
|
||||
FuncInfo current_fi = (FuncInfo) CurrentAnchestor.get(Current.Function);
|
||||
if ((current_fi != null) && (funcInfo.funcName.equals(current_fi.funcName))) {
|
||||
vertexType = "current";
|
||||
}
|
||||
@@ -233,7 +234,7 @@ public class FunctionsGraphUI extends mxGraph {
|
||||
FuncInfo fi = Current.getProject().allFunctions.get(func_name);
|
||||
switch (e.getClickCount()) {
|
||||
case 1:
|
||||
Current.set(Current.SelectedFunction, fi);
|
||||
CurrentAnchestor.set(Current.SelectedFunction, fi);
|
||||
break;
|
||||
case 2:
|
||||
switch (fi.type) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.SapforData.Functions.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Menus.GraphMenu;
|
||||
import Common_old.UI.Trees.SelectableTree;
|
||||
@@ -18,7 +19,7 @@ public class InlineTree extends SelectableTree {
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentObject() {
|
||||
Object o = Current.get(getCurrent());
|
||||
Object o = CurrentAnchestor.get(getCurrent());
|
||||
if (o instanceof FileObject) {
|
||||
((FileObject) o).Show(false);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package ProjectData.SapforData.Functions.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Menus.GraphMenu;
|
||||
import Common_old.UI.Trees.SelectableTree;
|
||||
@@ -22,7 +23,7 @@ public class InlineTree2 extends SelectableTree {
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentObject() {
|
||||
Object o = Current.get(getCurrent());
|
||||
Object o = CurrentAnchestor.get(getCurrent());
|
||||
if (o instanceof FileObject) {
|
||||
((FileObject) o).Show(false);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ProjectData.SapforData.Regions;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ProjectData.SapforData.Variants;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
|
||||
import static Common_old.UI.Tables.TableRenderers.*;
|
||||
public class VariantsSet extends DataSet<String, ParallelVariant> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Repository.BugReport;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.UI;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Repository.Component;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Repository.SubscriberWorkspace;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
public class SubscriberWorkspaceDBTable extends iDBTable<SubscriberWorkspace> {
|
||||
public SubscriberWorkspaceDBTable() {
|
||||
super(SubscriberWorkspace.class);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Repository.Subscribes;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package TestingSystem.Common.Group;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package TestingSystem.Common.Test;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.UI.TestFields;
|
||||
|
||||
@@ -2,7 +2,7 @@ package TestingSystem.DVM.DVMConfiguration;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
import Common_old.UI.VisualCache.ConfigurationCache;
|
||||
import Common_old.UI.VisualCache.VisualCaches;
|
||||
|
||||
@@ -2,7 +2,7 @@ package TestingSystem.DVM.DVMPackage;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.UI.VisualCache.PackageCache;
|
||||
import Common_old.UI.VisualCache.VisualCaches;
|
||||
|
||||
@@ -2,7 +2,7 @@ package TestingSystem.DVM.DVMSettings;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import TestingSystem.DVM.DVMSettings.UI.DVMSettingsFields;
|
||||
public class DVMSettingsDBTable extends iDBTable<DVMSettings> {
|
||||
|
||||
@@ -3,7 +3,7 @@ import Common_old.Current;
|
||||
import Common.Visual.DBObjectFilter;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetFilter;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package TestingSystem.SAPFOR.SapforConfiguration;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.TableEditors;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
import Common_old.UI.VisualCache.ConfigurationCache;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package TestingSystem.SAPFOR.SapforPackage;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.VisualCache.PackageCache;
|
||||
import Common_old.UI.VisualCache.VisualCaches;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package TestingSystem.SAPFOR.SapforSettings;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common_old.Utils.Utils;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
@@ -96,10 +96,10 @@ public class SapforSettingsDBTable extends iDBTable<SapforSettings> {
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
Result.FREE_FORM = Utils.fromBoolean(fields.cbFREE_FORM.isSelected());
|
||||
Result.KEEP_DVM_DIRECTIVES = Utils.fromBoolean(fields.cbKEEP_DVM_DIRECTIVES.isSelected());
|
||||
Result.KEEP_SPF_DIRECTIVES = Utils.fromBoolean(fields.cbKEEP_SPF_DIRECTIVES.isSelected());
|
||||
Result.STATIC_SHADOW_ANALYSIS = Utils.fromBoolean(fields.cbSTATIC_SHADOW_ANALYSIS.isSelected());
|
||||
Result.FREE_FORM = CommonUtils.fromBoolean(fields.cbFREE_FORM.isSelected());
|
||||
Result.KEEP_DVM_DIRECTIVES = CommonUtils.fromBoolean(fields.cbKEEP_DVM_DIRECTIVES.isSelected());
|
||||
Result.KEEP_SPF_DIRECTIVES = CommonUtils.fromBoolean(fields.cbKEEP_SPF_DIRECTIVES.isSelected());
|
||||
Result.STATIC_SHADOW_ANALYSIS = CommonUtils.fromBoolean(fields.cbSTATIC_SHADOW_ANALYSIS.isSelected());
|
||||
Result.MAX_SHADOW_WIDTH = fields.sMAX_SHADOW_WIDTH.getValue();
|
||||
Result.packFlags();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package TestingSystem.SAPFOR.SapforSettingsCommand;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsCommandFields;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.Trees.DataTree;
|
||||
import Common_old.UI.Trees.TreeRenderers;
|
||||
@@ -59,7 +60,7 @@ public class SapforTasksPackageTree extends DataTree {
|
||||
//---
|
||||
if (o instanceof SapforVersion_json) {
|
||||
SapforVersion_json version = (SapforVersion_json) o;
|
||||
Current.set(current, version);
|
||||
CurrentAnchestor.set(current, version);
|
||||
if (current.equals(Current.SapforEtalonVersion))
|
||||
UI.getMainWindow().getTestingWindow().ShowCurrentSapforPackageVersionEtalon();
|
||||
else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package TestingSystem.SAPFOR.ServerSapfor;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common_old.UI.Tables.TableRenderers;
|
||||
import Common_old.UI.UI;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
@@ -20,8 +21,8 @@ public abstract class AbortTestingPackage extends TestingSystemPass<TestingPacka
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
packageToKill = null;
|
||||
if (Current.Check(Log, currentName())) {
|
||||
target = (TestingPackage) Current.get(currentName());
|
||||
if (CurrentAnchestor.Check(Log, currentName())) {
|
||||
target = (TestingPackage) CurrentAnchestor.get(currentName());
|
||||
switch (target.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -30,7 +31,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.BugReport)) {
|
||||
if (CurrentAnchestor.Check(Log, Current.BugReport)) {
|
||||
target = Current.getBugReport();
|
||||
if (!BugReportInterface.CheckNotDraft(target,Log))
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Repository.BugReport.BugReport;
|
||||
@@ -21,7 +22,7 @@ public class ApplyBugReportSettings extends Pass_2021<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
if (Current.Check(Log, Current.BugReport)) {
|
||||
if (CurrentAnchestor.Check(Log, Current.BugReport)) {
|
||||
target = Current.getBugReport();
|
||||
long vv = target.visualiser_version;
|
||||
if (vv < 500) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -28,7 +29,7 @@ public class ApplyCurrentFunction extends Pass_2021 {
|
||||
String func_name = ff.Result;
|
||||
if (Current.getProject().allFunctions.containsKey(func_name)) {
|
||||
FuncInfo fi = Current.getProject().allFunctions.get(func_name);
|
||||
Current.set(Current.Function, fi);
|
||||
CurrentAnchestor.set(Current.Function, fi);
|
||||
return true;
|
||||
} else {
|
||||
Log.Writeln_("Проект не содержит процедуры с именем " + CommonUtils.Brackets(func_name));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import GlobalData.SapforProfile.SapforProfile;
|
||||
@@ -22,8 +23,8 @@ public class ApplyProfile extends Pass_2021<SapforProfile> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.SapforProfile)) {
|
||||
target = (SapforProfile) Current.get(Current.SapforProfile);
|
||||
if (CurrentAnchestor.Check(Log, Current.SapforProfile)) {
|
||||
target = (SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CommonConstants;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Database;
|
||||
@@ -139,7 +140,7 @@ public class CloneDVMPackage extends AddObjectPass<DVMPackage> {
|
||||
return false;
|
||||
}
|
||||
//-
|
||||
if (!Current.Check(Log, Current.Machine, Current.User, Current.Compiler))
|
||||
if (!CurrentAnchestor.Check(Log, Current.Machine, Current.User, Current.Compiler))
|
||||
return false;
|
||||
//---
|
||||
if (!Current.getMachine().type.equals(MachineType.Server)) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CommonConstants;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Database;
|
||||
@@ -81,7 +82,7 @@ public class CloneSapforPackage extends AddObjectPass<SapforPackage> {
|
||||
if (!Current.getAccount().CheckRegistered(Log))
|
||||
return false;
|
||||
//--
|
||||
if (!Current.Check(Log, Current.ServerSapfor))
|
||||
if (!CurrentAnchestor.Check(Log, Current.ServerSapfor))
|
||||
return false;
|
||||
if (!Current.getServerSapfor().state.equals(ServerSapforState.Done)) {
|
||||
Log.Writeln_("Выбранная версия SAPFOR не собрана!");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -35,12 +36,12 @@ public class CloseCurrentFile extends Pass_2021<DBProjectFile> {
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.set(Current.File, null);
|
||||
Current.set(Current.FileGraphElement, null);
|
||||
CurrentAnchestor.set(Current.File, null);
|
||||
CurrentAnchestor.set(Current.FileGraphElement, null);
|
||||
//-
|
||||
Current.set(Current.Notes, null);
|
||||
Current.set(Current.Warnings, null);
|
||||
Current.set(Current.Errors, null);
|
||||
CurrentAnchestor.set(Current.Notes, null);
|
||||
CurrentAnchestor.set(Current.Warnings, null);
|
||||
CurrentAnchestor.set(Current.Errors, null);
|
||||
//-
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
@@ -41,18 +42,18 @@ public class CloseCurrentProject extends Pass_2021<db_project_info> {
|
||||
//--
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getSapfor().cd(new File(CommonUtils.Home));
|
||||
Current.set(Current.Project, null);
|
||||
Current.set(Current.File, null);
|
||||
Current.set(Current.Function, null);
|
||||
Current.set(Current.SelectedFunction,null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
Current.set(Current.SelectedFile, null);
|
||||
Current.set(Current.SelectedDirectory, null);
|
||||
CurrentAnchestor.set(Current.Project, null);
|
||||
CurrentAnchestor.set(Current.File, null);
|
||||
CurrentAnchestor.set(Current.Function, null);
|
||||
CurrentAnchestor.set(Current.SelectedFunction,null);
|
||||
CurrentAnchestor.set(Current.ProjectNode, null);
|
||||
CurrentAnchestor.set(Current.SelectedFile, null);
|
||||
CurrentAnchestor.set(Current.SelectedDirectory, null);
|
||||
//-мб перестраховка. мб и нет.
|
||||
Current.set(Current.ParallelVariant, null);
|
||||
Current.set(Current.Dimensions, null);
|
||||
Current.set(Current.Array, null);
|
||||
Current.set(Current.DBArray, null);
|
||||
CurrentAnchestor.set(Current.ParallelVariant, null);
|
||||
CurrentAnchestor.set(Current.Dimensions, null);
|
||||
CurrentAnchestor.set(Current.Array, null);
|
||||
CurrentAnchestor.set(Current.DBArray, null);
|
||||
//-
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import ProjectData.Project.db_project_info;
|
||||
@@ -18,7 +19,7 @@ public class CloseProject extends Pass_2021<db_project_info> {
|
||||
protected void performDone() throws Exception {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getSapfor().cd(new File(CommonUtils.Home));
|
||||
Current.set(Current.Project, null);
|
||||
CurrentAnchestor.set(Current.Project, null);
|
||||
//-
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
@@ -29,7 +30,7 @@ public class Compile extends Pass_2021<db_project_info> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
if (Current.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
|
||||
if (CurrentAnchestor.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
|
||||
target = Current.getProject();
|
||||
subpass = null;
|
||||
compilationTask = null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
import Repository.Server.ServerCode;
|
||||
@@ -26,7 +27,7 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
|
||||
Log.Writeln_("Вы не являетесь администратором");
|
||||
return false;
|
||||
}
|
||||
if (!Current.Check(Log, Current.ServerSapfor)){
|
||||
if (!CurrentAnchestor.Check(Log, Current.ServerSapfor)){
|
||||
return false;
|
||||
}
|
||||
return UI.Warning("Загрузить полный пакет DVM тестов на корректность и производительность.");
|
||||
@@ -38,8 +39,8 @@ public class ConvertCorrectnessTests extends TestingSystemPass<File> {
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
passes.get(PassCode_2021.CloseCurrentProject);
|
||||
Current.set(Current.Root, null);
|
||||
Current.set(Current.Version, null);
|
||||
CurrentAnchestor.set(Current.Root, null);
|
||||
CurrentAnchestor.set(Current.Version, null);
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Current;
|
||||
@@ -70,7 +71,7 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
|
||||
if (args.length == 0) {
|
||||
//--
|
||||
from_files_chooser = true;
|
||||
if (!Current.Check(Log, Current.Group))
|
||||
if (!CurrentAnchestor.Check(Log, Current.Group))
|
||||
return false;
|
||||
group = Current.getGroup();
|
||||
if (!selectFiles())
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import ProjectData.Files.FileState;
|
||||
import ProjectData.Files.ProjectFile;
|
||||
@@ -14,7 +15,7 @@ public class CreateTestFromProject extends CreateTestFromDirectory {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (args.length == 0) {
|
||||
if (Current.Check(Log, Current.Group, Current.Project)) {
|
||||
if (CurrentAnchestor.Check(Log, Current.Group, Current.Project)) {
|
||||
project = Current.getProject();
|
||||
if (super.canStart(Current.getProject().Home, Current.getGroup())){
|
||||
from_files_chooser = true; //чтобы опубликовал.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.Utils.Files.VFileChooser;
|
||||
import Common_old.Utils.Utils;
|
||||
@@ -20,7 +21,7 @@ public class CreateTestsFromFiles extends PublishTests {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.Group)){
|
||||
if (CurrentAnchestor.Check(Log, Current.Group)){
|
||||
Utils.RestoreSelectedDirectory(fileChooser);
|
||||
Vector<File> files = fileChooser.ShowMultiDialog();
|
||||
if (files.isEmpty()){
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -21,7 +22,7 @@ public class CreateTestsGroupFromSelectedVersions extends PublishTests {
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
//---
|
||||
if (Current.Check(Log, Current.Group)) {
|
||||
if (CurrentAnchestor.Check(Log, Current.Group)) {
|
||||
group = Current.getGroup();
|
||||
} else
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
@@ -39,7 +40,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
|
||||
version = null;
|
||||
badFiles = "";
|
||||
//--
|
||||
if (Current.Check(Log, Current.Project)) {
|
||||
if (CurrentAnchestor.Check(Log, Current.Project)) {
|
||||
target = Current.getProject();
|
||||
programsToConvert = target.getPrograms().get(target.languageName);
|
||||
programsNames = new Vector<>();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -54,7 +55,7 @@ public class DeleteDirectory extends ChangeFilePass {
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.set(Current.SelectedDirectory, null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
CurrentAnchestor.set(Current.SelectedDirectory, null);
|
||||
CurrentAnchestor.set(Current.ProjectNode, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -14,7 +15,7 @@ public class DeleteFile extends ChangeFilePass<DBProjectFile> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
resetArgs();
|
||||
return (Current.Check(Log, Current.SelectedFile)) &&
|
||||
return (CurrentAnchestor.Check(Log, Current.SelectedFile)) &&
|
||||
UI.Warning("Удалить файл "
|
||||
+ CommonUtils.Brackets((target = Current.getSelectedFile()).name));
|
||||
}
|
||||
@@ -31,7 +32,7 @@ public class DeleteFile extends ChangeFilePass<DBProjectFile> {
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.set(Current.SelectedFile, null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
CurrentAnchestor.set(Current.SelectedFile, null);
|
||||
CurrentAnchestor.set(Current.ProjectNode, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
@@ -8,7 +9,7 @@ import java.util.Vector;
|
||||
public class DeleteLonelyM extends Pass_2021<db_project_info> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.Root)) {
|
||||
if (CurrentAnchestor.Check(Log, Current.Root)) {
|
||||
target = Current.getRoot();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.Utils.Utils;
|
||||
@@ -33,8 +34,8 @@ public class DeleteSelectedFiles extends Pass_2021 {
|
||||
if (hasCurrent)
|
||||
passes.get(PassCode_2021.CloseCurrentFile).Do();
|
||||
if (hasSelected) {
|
||||
Current.set(Current.SelectedFile, null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
CurrentAnchestor.set(Current.SelectedFile, null);
|
||||
CurrentAnchestor.set(Current.ProjectNode, null);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.UI;
|
||||
@@ -26,7 +27,7 @@ public class DeleteSelectedVersions extends Pass_2021<Vector<db_project_info>> {
|
||||
Log.Writeln_("Нажмите правую клавишу мыши, и перейдите в режим выбора версий.");
|
||||
return false;
|
||||
}
|
||||
if (!Current.Check(Log, Current.Root)) {
|
||||
if (!CurrentAnchestor.Check(Log, Current.Root)) {
|
||||
return false;
|
||||
}
|
||||
Vector<db_project_info> allVersions = new Vector<>();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
@@ -50,11 +51,11 @@ public class DeleteVersion extends Pass_2021<db_project_info> {
|
||||
protected void performDone() throws Exception {
|
||||
parent = target.parent;
|
||||
if (current)
|
||||
Current.set(Current.Version, null);
|
||||
CurrentAnchestor.set(Current.Version, null);
|
||||
if (parent != null) {
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(target.node);
|
||||
parent.versions.remove(target.name);
|
||||
} else
|
||||
Current.set(Current.Root, null);
|
||||
CurrentAnchestor.set(Current.Root, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
@@ -22,7 +23,7 @@ public class DownloadAllBugReportsArchives extends ComponentsRepositoryPass<File
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
passes.get(PassCode_2021.CloseCurrentProject).Do();
|
||||
Current.set(Current.Root, null); //чтобы гарантированно не существовало корня.
|
||||
CurrentAnchestor.set(Current.Root, null); //чтобы гарантированно не существовало корня.
|
||||
Utils.CleanDirectory(Global.BugReportsDirectory);
|
||||
}
|
||||
@Override
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user