no message

This commit is contained in:
2024-10-09 20:35:18 +03:00
parent e5f4ee40aa
commit 63b7f7dfd2
183 changed files with 443 additions and 266 deletions

View File

@@ -0,0 +1,32 @@
package Common.Visual.Menus;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Visual.Menus.StyledPopupMenu;
import Common.Visual.Menus.VisualiserMenuItem;
import javax.swing.*;
public class TableMenu extends StyledPopupMenu {
int row = CommonConstants.Nan;
int column = CommonConstants.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 -> CommonUtils.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();
}
}