use of javax.swing.JPopupMenu in project ACS by ACS-Community.
the class ErrorTreeCellRenderer method getNewNodePopupMenu.
/**
* This method initializes jPopupMenu
*
* @return javax.swing.JPopupMenu
*/
private JPopupMenu getNewNodePopupMenu() {
if (newNodePopupMenu == null) {
newNodePopupMenu = new JPopupMenu();
newNodePopupMenu.add(getNewErrorMenuItem());
newNodePopupMenu.add(getNewCompletionMenuItem());
}
return newNodePopupMenu;
}
use of javax.swing.JPopupMenu in project ACS by ACS-Community.
the class ErrorTreeCellRenderer method getAddPopupMenu.
/**
* This method initializes jPopupMenu
*
* @return javax.swing.JPopupMenu
*/
private JPopupMenu getAddPopupMenu() {
if (addPopupMenu == null) {
addPopupMenu = new JPopupMenu();
addPopupMenu.add(getAddFileItem());
addPopupMenu.add(getAddDirectoryItem());
addPopupMenu.add(getAddDefaultsItem());
}
return addPopupMenu;
}
use of javax.swing.JPopupMenu in project EnrichmentMapApp by BaderLab.
the class HeatMapMainPanel method showExportMenu.
private void showExportMenu(ActionEvent event) {
JPopupMenu menu = new JPopupMenu();
menu.add(txtActionFactory.create(table));
menu.add(pdfActionFactory.create(table));
Component c = (Component) event.getSource();
menu.show(c, 0, c.getHeight());
}
use of javax.swing.JPopupMenu in project EnrichmentMapApp by BaderLab.
the class ColumnHeaderRankOptionRenderer method menuButtonClicked.
private void menuButtonClicked(JTable table, JButton button) {
JTableHeader header = table.getTableHeader();
List<RankingOption> rankOptions = mainPanel.getAllRankingOptions();
JPopupMenu menu = new JPopupMenu();
for (RankingOption rankOption : rankOptions) {
JMenuItem item = new JCheckBoxMenuItem(rankOption.getName());
item.setSelected(rankOption == mainPanel.getSelectedRankOption());
SwingUtil.makeSmall(item);
menu.add(item);
item.addActionListener(e -> mainPanel.updateSetting_RankOption(rankOption));
}
int y = button.getHeight();
int x = 0;
for (int i = 0; i < colIndex; i++) {
TableColumn tableColumn = table.getColumnModel().getColumn(i);
x += tableColumn.getWidth();
}
menu.show(header, x, y);
}
use of javax.swing.JPopupMenu in project EnrichmentMapApp by BaderLab.
the class SettingsPopupPanel method popup.
public void popup(Component parent) {
JPopupMenu menu = new JPopupMenu();
menu.add(this);
menu.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e)) {
menu.setVisible(false);
}
}
});
menu.show(parent, 0, parent.getHeight());
}
Aggregations