промежуточный. частичный рефакторинг с прицелом на библиотечную часть

This commit is contained in:
2024-10-07 00:58:29 +03:00
parent c211ffb82b
commit 6b1576461d
798 changed files with 3007 additions and 2344 deletions

View File

@@ -0,0 +1,30 @@
package Common_old.UI.Menus;
import Common_old.Constants;
import Common_old.Utils.Utils;
import javax.swing.*;
public class TableMenu extends StyledPopupMenu {
int row = Constants.Nan;
int column = Constants.Nan;
Object target = null;
//-
JTable owner = null;
VisualiserMenuItem mcopy;
public TableMenu(JTable owner_in) {
owner = owner_in;
mcopy = new VisualiserMenuItem("Копировать текст текущей ячейки", "/icons/Editor/Copy.png");
//если удалось нажать значит все условия выполнены
mcopy.addActionListener(e -> Utils.CopyToClipboard(target.toString()));
add(mcopy);
}
@Override
public void CheckElementsVisibility() {
row = owner.getSelectedRow();
column = owner.getSelectedColumn();
if ((row >= 0) && (column >= 0)) {
target = owner.getValueAt(row, column);
mcopy.setVisible(true);
} else mcopy.setVisible(false);
super.CheckElementsVisibility();
}
}