no message

This commit is contained in:
2024-10-17 20:31:06 +03:00
parent 3b5bffe998
commit 7b56eae371
13 changed files with 24 additions and 38 deletions

View File

@@ -1,13 +0,0 @@
package Common.Visual;
import Common.Current_;
public interface DataControl_OLD {
//todo скорее всего устареет.
default Current_ getCurrent() {
return null;
}
//-?
default void ShowCurrentObject() throws Exception {
}
default void ShowNoCurrentObject() throws Exception {
}
}

View File

@@ -1,22 +1,23 @@
package Common.Visual.Trees;
import Common.Current_;
import Common.MainModule_;
import Common.Utils.Utils_;
import Common.Visual.DataControl_OLD;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
public class DataTree extends StyledTree implements DataControl_OLD {
public class DataTree extends StyledTree{
public DataTree(DefaultMutableTreeNode root_in) {
super(root_in);
}
public void ChangeCurrentObject(DefaultMutableTreeNode node) {
if (getCurrent() != null)
MainModule_.instance.set(getCurrent(), node.getUserObject());
if (currentName() != null)
MainModule_.instance.set(currentName(), node.getUserObject());
}
public Current_ currentName() {
return null;
}
@Override
public void ShowCurrentObject() throws Exception {
}
@Override
public void ShowNoCurrentObject() throws Exception {
}
@Override

View File

@@ -9,7 +9,7 @@ public class SelectableTree extends DataTree {
}
@Override
public void LeftMouseAction1() {
Object element = MainModule_.instance.get(getCurrent());
Object element = MainModule_.instance.get(currentName());
if ((element instanceof Selectable)) {
((Selectable) element).SwitchSelection();
updateUI();

View File

@@ -11,7 +11,7 @@ public class RemoteFilesTree extends DataTree {
return RendererTreeRemoteFile.class;
}
@Override
public Current getCurrent() {
public Current currentName() {
return Current.RemoteFile;
}
@Override

View File

@@ -72,7 +72,7 @@ public class ResurrectComponentFromServer extends CurrentComponentPass {
});
}
@Override
public Current getCurrent() {
public Current currentName() {
return Current.ComponentServerBackup;
}
};

View File

@@ -17,13 +17,13 @@ public class FileGraphTree extends DataTree {
return GraphTreeCellRenderer.class;
}
@Override
public Current getCurrent() {
public Current currentName() {
return Current.FileGraphElement;
}
@Override
public void ShowCurrentObject() throws Exception {
Global.mainModule.getFile().form.EventsOff();
Object o = Global.mainModule.get(getCurrent());
Object o = Global.mainModule.get(currentName());
Global.mainModule.getFile().form.getEditor().gotoLine((o instanceof FileObjectWithMessages) ? (((FileObjectWithMessages) o).line) : 1);
Global.mainModule.getFile().form.ShowMessages();
Global.mainModule.getFile().form.EventsOn();

View File

@@ -34,7 +34,7 @@ public class VersionsTree extends DataTree {
return RendererProjectVersion.class;
}
@Override
public Current getCurrent() {
public Current currentName() {
return Current.Version;
}
public void SelectCurrentProject() {
@@ -48,7 +48,7 @@ public class VersionsTree extends DataTree {
public void LeftMouseAction1() {
if (Global.versions_multiselection) {
// только если есть режим выбора версий.
Object element = Global.mainModule.get(getCurrent());
Object element = Global.mainModule.get(currentName());
if ((element instanceof Selectable)) {
((Selectable) element).SwitchSelection();
updateUI();

View File

@@ -14,12 +14,12 @@ public class InlineTree extends SelectableTree {
return SelectionTreeCellRenderer.class;
}
@Override
public Current getCurrent() {
public Current currentName() {
return Current.InlineGraphElement;
}
@Override
public void ShowCurrentObject() {
Object o = Global.mainModule.get(getCurrent());
Object o = Global.mainModule.get(currentName());
if (o instanceof FileObject) {
((FileObject) o).Show(false);
}

View File

@@ -14,7 +14,7 @@ public class InlineTree2 extends SelectableTree {
return SelectionTreeCellRenderer.class;
}
@Override
public Current getCurrent() {
public Current currentName() {
return Current.InlineGraphElement2;
}
@Override
@@ -23,7 +23,7 @@ public class InlineTree2 extends SelectableTree {
}
@Override
public void ShowCurrentObject() {
Object o = Global.mainModule.get(getCurrent());
Object o = Global.mainModule.get(currentName());
if (o instanceof FileObject) {
((FileObject) o).Show(false);
}

View File

@@ -9,7 +9,7 @@ public class IncludesTree extends SelectableTree {
super(Global.mainModule.getProject().includes_root);
}
@Override
public Current getCurrent() {
public Current currentName() {
return Current.IncludeGraphElement;
}
@Override

View File

@@ -26,7 +26,7 @@ public class SapforTasksPackageTree extends DataTree {
return RendererTreeSapforVersions.class;
}
@Override
public Current getCurrent() {
public Current currentName() {
return current;
}
public void selectSamePath_r(TreePath example, int index, DefaultMutableTreeNode node, Vector<DefaultMutableTreeNode> res) {

View File

@@ -43,7 +43,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
m_select_for_current.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
Object o = Global.mainModule.get(tree.getCurrent());
Object o = Global.mainModule.get(tree.currentName());
if (o instanceof Selectable) {
((Selectable) o).SelectAllChildren(true);
}
@@ -56,7 +56,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
m_unselect_for_current.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
Object o = Global.mainModule.get(tree.getCurrent());
Object o = Global.mainModule.get(tree.currentName());
if (o instanceof Selectable) {
((Selectable) o).SelectAllChildren(false);
}
@@ -70,7 +70,7 @@ public abstract class SelectionTreeMenu extends GraphMenu<DataTree> {
public abstract void SelectAll(boolean select);
@Override
public void CheckElementsVisibility() {
Object current = Global.mainModule.get(tree.getCurrent());
Object current = Global.mainModule.get(tree.currentName());
if ((current != null) && (current.getClass().equals(getTargetClass()))) {
String name = ((Selectable) current).getSelectionText();
m_select_for_current.setText("Выбрать всё для " +