List of usage examples for javax.swing JPopupMenu getComponentCount
public int getComponentCount()
From source file:org.orbisgis.view.geocatalog.Catalog.java
/** * The user click on the source list control * * @param e The mouse event fired by the LI */// w w w . j a v a 2 s .c om public void onMouseActionOnSourceList(MouseEvent e) { //Manage selection of items before popping up the menu if (e.isPopupTrigger()) { //Right mouse button under linux and windows int itemUnderMouse = -1; //Item under the position of the mouse event //Find the Item under the position of the mouse cursor for (int i = 0; i < sourceListContent.getSize(); i++) { //If the coordinate of the cursor cover the cell bouding box if (sourceList.getCellBounds(i, i).contains(e.getPoint())) { itemUnderMouse = i; break; } } //Retrieve all selected items index int[] selectedItems = sourceList.getSelectedIndices(); //If there are a list item under the mouse if ((selectedItems != null) && (itemUnderMouse != -1)) { //If the item under the mouse was not previously selected if (!CollectionUtils.contains(selectedItems, itemUnderMouse)) { //Control must be pushed to add the list item to the selection if (e.isControlDown()) { sourceList.addSelectionInterval(itemUnderMouse, itemUnderMouse); } else { //Unselect the other items and select only the item under the mouse sourceList.setSelectionInterval(itemUnderMouse, itemUnderMouse); } } } else if (itemUnderMouse == -1) { //Unselect all items sourceList.clearSelection(); } //Selection are ready, now create the popup menu JPopupMenu popup = new JPopupMenu(); popupActions.copyEnabledActions(popup); if (popup.getComponentCount() > 0) { popup.show(e.getComponent(), e.getX(), e.getY()); } } }
From source file:org.rdv.ui.ChannelListPanel.java
private void handlePopup(MouseEvent e) { TreePath treePath = tree.getPathForLocation(e.getX(), e.getY()); if (treePath == null) { return;// w w w . j a va 2 s . co m } // select only the node under the mouse if it is not already selected if (!tree.isPathSelected(treePath)) { tree.setSelectionPath(treePath); } JPopupMenu popup = null; Object o = treePath.getLastPathComponent(); if (o == treeModel.getRoot()) { popup = getRootPopup(); } else { popup = getChannelPopup(); } if (popup != null && popup.getComponentCount() > 0) { popup.show(tree, e.getX(), e.getY()); } }
From source file:org.rdv.ui.ChannelListPanel.java
private JPopupMenu getChannelPopup() { JPopupMenu popup = new JPopupMenu(); JMenuItem menuItem;//from w ww.j ava2s.c om final List<String> channels = getSelectedChannels(); if (channels.isEmpty()) { return null; } String plural = (channels.size() == 1) ? "" : "s"; List<Extension> extensions = dataPanelManager.getExtensions(channels); if (extensions.size() > 0) { for (final Extension extension : extensions) { menuItem = new JMenuItem("View channel" + plural + " with " + extension.getName()); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { viewChannels(channels, extension); } }); popup.add(menuItem); } popup.addSeparator(); } if (dataPanelManager.isAnyChannelSubscribed(channels)) { menuItem = new JMenuItem("Unsubscribe from channel" + plural); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { dataPanelManager.unsubscribeChannels(channels); } }); popup.add(menuItem); popup.addSeparator(); } // menu item to remove local channels if (areLocal(channels)) { menuItem = new JMenuItem("Remove channel" + plural); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { LocalChannelManager lcm = LocalChannelManager.getInstance(); lcm.removeChannels(channels); } }); popup.add(menuItem); popup.addSeparator(); } String mime = getMime(channels); if (mime != null) { if (mime.equals("application/octet-stream")) { menuItem = new JMenuItem("Export data channel" + plural + "...", DataViewer.getIcon("icons/export.gif")); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { ActionFactory.getInstance().getDataExportAction().exportData(channels); } }); popup.add(menuItem); } else if (mime.equals("image/jpeg")) { menuItem = new JMenuItem("Export video channel" + plural + "...", DataViewer.getIcon("icons/export.gif")); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JFrame frame = RDV.getInstance(RDV.class).getMainFrame(); new ExportVideoDialog(frame, rbnb, channels); } }); popup.add(menuItem); } else { popup.remove(popup.getComponentCount() - 1); } } return popup; }
From source file:org.ut.biolab.medsavant.client.view.genetics.variantinfo.VariantFrequencyAggregatePane.java
public void setVariantRecords(Set<VariantRecord> records) { innerPanel.removeAll();//from w ww .j a v a2s.com //This function executes quickly, no need for waitPanel. //innerPanel.add(new WaitPanel("Loading DNA Ids...")); tableModel.setValues(records); aggregateTable = new AggregateTable(tableModel) { @Override //Necessary to enable buttons within the table. public boolean isCellEditable(int rowIndex, int colIndex) { return colIndex == buttonIndex; } //"Disables" selection within the aggregateTable. @Override public TableCellRenderer getCellRenderer(final int rowIndex, final int columnIndex) { final TableCellRenderer renderer = super.getCellRenderer(rowIndex, columnIndex); return new TableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable jtable, final Object o, boolean bln, boolean bln1, int i, int i1) { return renderer.getTableCellRendererComponent(jtable, o, false, false, i, i1); } }; } //This overridden method, together with the custom mouse listener on the //AggregateTable header, disallows moving the first column, and columns //>= dnaIDIndex @Override protected AggregateTable.DraggingHandler createDraggingColumnPropertyChangeListener() { return new AggregateTable.DraggingHandler() { @Override public void columnMoved(TableColumnModelEvent e) { if (fromColumnIndex == -1) { fromColumnIndex = e.getFromIndex(); } toColumnIndex = e.getToIndex(); } }; } }; header = new AggregateTableHeader(aggregateTable); header.addMouseListener(new MouseAdapter() { //Disable moving the first column, or columns with index //>=dnaIDIndex @Override public void mouseReleased(MouseEvent e) { if (toColumnIndex != -1 && ((toColumnIndex == 0 || fromColumnIndex == 0) || (toColumnIndex >= dnaIDIndex || fromColumnIndex >= dnaIDIndex))) { aggregateTable.moveColumn(toColumnIndex, fromColumnIndex); String msg = "This column cannot be moved."; DialogUtils.displayMessage(msg); } else { for (int columnHeaderIndex = 0; columnHeaderIndex < header.getColumnModel().getColumnCount() - 2; columnHeaderIndex++) { String columnTitle = (String) header.getColumnModel().getColumn(columnHeaderIndex) .getHeaderValue(); aggregateColumns[columnHeaderIndex] = columnTitle; } reaggregate(); } //aggregateTable.aggregate(this.aggregateColumns); fromColumnIndex = -1; toColumnIndex = -1; //expandAllButLast(); } }); header.setAutoFilterEnabled(false); header.setReorderingAllowed(true); header.setFont(TABLE_FONT_LARGE); aggregateTable.setTableHeader(header); aggregateTable.setAutoResizeMode(AggregateTable.AUTO_RESIZE_ALL_COLUMNS); aggregateTable.setFont(TABLE_FONT_LARGE); //Setup a custom "summary". This is what calculates frequencies when cells are //collapsed PivotField f = aggregateTable.getAggregateTableModel().getField(BasicVariantColumns.DNA_ID.getAlias()); f.setSummaryType(PivotConstants.SUMMARY_RESERVED_MAX + 1); aggregateTable.getAggregateTableModel().setSummaryCalculator(new SummaryCalculator() { private Set<String> collapsedDNAIDs = new HashSet<String>(); private Values lastRowValues; private int valueCount = 0; private final int SUMMARY_FREQ = PivotConstants.SUMMARY_RESERVED_MAX + 1; @Override public void addValue(PivotValueProvider dataModel, PivotField field, Values rowValues, Values columnValues, Object object) { //this gets called multiple times for all the cells that disappear when //something is collapsed. // row[0] is the value of the corresponding first column: e.g. a Cohort or Family. // columnValues can be ignored (blank) // Object is the value of the item in the cell that disappeared. (i.e. those cells which are being summarized) // field.getName() is the column name corresponding to Object // Useful Debugging code: //if(field.getName().equals(BasicVariantColumns.DNA_ID.getAlias())){ /* System.out.println("=========="); System.out.println("Field : " + field.getName()); System.out.println("Row values: "); for (int i = 0; i < rowValues.getCount(); ++i) { System.out.println("\trow[" + i + "] = " + rowValues.getValueAt(i).getValue()); } System.out.println("Column values: "); for (int i = 0; i < columnValues.getCount(); ++i) { System.out.println("\tcol[" + i + "] = " + columnValues.getValueAt(i).getValue()); } System.out.println("Object: "); System.out.println("\t" + object); System.out.println("=========="); */ // } if (field.getName().equals(BasicVariantColumns.DNA_ID.getAlias())) { collapsedDNAIDs.add((String) object); lastRowValues = rowValues; } else { lastRowValues = null; } valueCount++; } //Should never be called @Override public void addValue(Object o) { LOG.error("Unexpected method invocation in OtherIndividualsSubInspector (1)"); } //Should never be called @Override public void addValue(IPivotDataModel ipdm, PivotField pf, int i, int i1, Object o) { LOG.error("Unexpected method invocation in OtherIndividualsSubInspector (2)"); } //Should never be called @Override public void addValue(PivotValueProvider pvp, PivotField pf, Object o) { LOG.error("Unexpected method invocation in OtherIndividualsSubInspector (3)"); } @Override public void clear() { collapsedDNAIDs.clear(); valueCount = 0; lastRowValues = null; } @Override public Object getSummaryResult(int type) { //if null, then we're not in the DNAId column. Return null //to show a blank in this cell if (lastRowValues == null) { return null; } int numIndividuals = getNumberOfIndividualsInGroup(lastRowValues.getValueAt(0)); return new Frequency(collapsedDNAIDs.size(), numIndividuals); } private int getNumberOfIndividualsInGroup(Value v) { if (aggregateColumns[0].equals("Cohort")) { //LOG.debug("Getting number of individuals in group " + v.getValue()); Set<String> dnaIds = cohortDNAIDMap.get((Cohort) v.getValue()); //for (String id : dnaIds) { //LOG.debug("\tGot id " + id); //} return cohortDNAIDMap.get((Cohort) v.getValue()).size(); } else if (aggregateColumns[0].equals(BasicPatientColumns.FAMILY_ID.getAlias())) { return familyIDdnaIDMap.get((String) v.getValue()).size(); } else { LOG.error("Invalid first column"); return -1; } } @Override public long getCount() { return valueCount; } @Override public int getNumberOfSummaries() { return 1; } @Override public String getSummaryName(Locale locale, int i) { return "Frequency"; } @Override public int[] getAllowedSummaries(Class<?> type) { return new int[] { SUMMARY_FREQ }; } @Override public int[] getAllowedSummaries(Class<?> type, ConverterContext cc) { return new int[] { SUMMARY_FREQ }; } }); //Sets up the context menu for clicking column headers. This will probably not be used //frequently. Limit the available operations to collapsing, expanding, and grouping. TableHeaderPopupMenuInstaller installer = new TableHeaderPopupMenuInstaller(aggregateTable); installer.addTableHeaderPopupMenuCustomizer(new AggregateTablePopupMenuCustomizer() { @Override public void customizePopupMenu(JTableHeader header, JPopupMenu popup, int clickingColumn) { super.customizePopupMenu(header, popup, clickingColumn); for (int i = 0; i < popup.getComponentCount(); i++) { String menuItemName = popup.getComponent(i).getName(); if (!(CONTEXT_MENU_COLLAPSE.equals(menuItemName) || CONTEXT_MENU_COLLAPSE_ALL.equals(menuItemName) || CONTEXT_MENU_EXPAND.equals(menuItemName) || CONTEXT_MENU_EXPAND_ALL.equals(menuItemName) || CONTEXT_MENU_GROUP.equals(menuItemName) || CONTEXT_MENU_UNGROUP.equals(menuItemName))) { popup.remove(popup.getComponent(i)); } } } }); aggregateTable.getAggregateTableModel().setSummaryMode(true); aggregateTable.aggregate(aggregateColumns); aggregateTable.setShowContextMenu(false); expandAllButLast(); setupButtonColumn(); JScrollPane jsp = new JScrollPane(aggregateTable); jsp.setPreferredSize(PREFERRED_SIZE); JPanel bp = new JPanel(); bp.setLayout(new BoxLayout(bp, BoxLayout.X_AXIS)); JButton closeButton = new JButton(IconFactory.getInstance().getIcon(IconFactory.StandardIcon.CLOSE)); closeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { unsplitScreen(); } }); bp.add(Box.createHorizontalGlue()); bp.add(title); bp.add(Box.createHorizontalGlue()); bp.add(closeButton); innerPanel.add(bp); innerPanel.add(jsp); reaggregate(); innerPanel.revalidate(); innerPanel.repaint(); }
From source file:org.yccheok.jstock.gui.AjaxAutoCompleteJComboBox.java
private void adjustScrollBar() { final int max_search = 8; // i < max_search is just a safe guard when getAccessibleChildrenCount // returns an arbitary large number. 8 is magic number JPopupMenu popup = null; for (int i = 0, count = this.getUI().getAccessibleChildrenCount(this); i < count && i < max_search; i++) { Object o = this.getUI().getAccessibleChild(this, i); if (o instanceof JPopupMenu) { popup = (JPopupMenu) o; break; }// w w w. java2s . co m } if (popup == null) { return; } JScrollPane scrollPane = null; for (int i = 0, count = popup.getComponentCount(); i < count && i < max_search; i++) { Component c = popup.getComponent(i); if (c instanceof JScrollPane) { scrollPane = (JScrollPane) c; break; } } if (scrollPane == null) { return; } scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL)); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); }
From source file:statechum.analysis.learning.Visualiser.java
private void maybeShowPopup(MouseEvent e) { if (e.isPopupTrigger()) { if ((e.getModifiers() & InputEvent.SHIFT_MASK) == 0) popupMenu.show(e.getComponent(), e.getX(), e.getY()); else// ww w.ja v a2s. c o m // attempt the popup for the diff if (currentGraph >= 0) {// if there are any graphs in this frame JPopupMenu diffMenu = new JPopupMenu(); final LearnerGraphND ourGraph = graphsOrig.get(currentGraph); if (ourGraph != null) {// if this is a real graph for (Visualiser viz : framesVisible) { final Visualiser fViz = viz; if (fViz.currentGraph >= 0) { final LearnerGraphND otherGr = fViz.graphsOrig.get(fViz.currentGraph); if (ourGraph != otherGr && otherGr != null) {// only if this is a real graph JMenuItem menuitem = new JMenuItem(new AbstractAction() { /** * ID for serialization */ private static final long serialVersionUID = 6840129509410881970L; {// Constructor putValue(Action.NAME, otherGr.getNameNotNull()); putValue(SHORT_DESCRIPTION, otherGr.getNameNotNull()); } @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent ev) { GD<List<CmpVertex>, List<CmpVertex>, LearnerGraphNDCachedData, LearnerGraphNDCachedData> gd = new GD<List<CmpVertex>, List<CmpVertex>, LearnerGraphNDCachedData, LearnerGraphNDCachedData>(); DirectedSparseGraph gr = //gd.showGD(ourGraph,otherGr,ExperimentRunner.getCpuNumber()); ChangesToGraph.computeVisualisationParameters( Synapse.StatechumProcess.constructFSM(ourGraph), ChangesToGraph.computeGD(ourGraph, otherGr, ourGraph.config)); Visualiser.updateFrame(gr, null); } }); diffMenu.add(menuitem); } } // if otherGr != null } // if fViz.graphs.size() > 0 if (diffMenu.getComponentCount() > 0) diffMenu.show(e.getComponent(), e.getX(), e.getY()); } // if ourGraph != null } // if graphs.size() > 0 } // e.isPopupTrigger() }
From source file:studio.ui.Studio.java
private void rebuildMenus(TabIndexChanged event) { AppMenuBar appMenubar = getJMenuBar() instanceof AppMenuBar ? (AppMenuBar) getJMenuBar() : null; ToolBarActions toolBar = null;//from w ww. j a va2s. c o m ActionMenu menuBar = null; if (appToolbar == null && appMenubar == null) { appToolbar = new ToolBarActions(); getContentPane().add(appToolbar, BorderLayout.NORTH); appMenubar = new AppMenuBar(); setJMenuBar(appMenubar); toolBar = new ToolBarActions("File"); menuBar = new ActionMenu("File", 'f', "File operations", (MouseAdapter) null); Action action = new NewFileAction(tabEditors, tabConsoles); JPopupMenu popupMenu = new JPopupMenu(); JMenuItem item = new JMenuItem("Script"); item.setToolTipText("New script"); item.addMouseListener(new ActionHintsListener(tabEditors, "Create new script")); item.addActionListener(action); popupMenu.add(item); item = new JMenuItem("Project"); item.setToolTipText("New project"); item.addMouseListener(new ActionHintsListener(tabEditors, "Create new project")); try { item.addActionListener(new AddProjectAction(treeProjects)); popupMenu.add(item); } catch (StudioException ex) { } JButton button = new DropDownButton(action, popupMenu); if (button instanceof DataListener) { tabEditors.addFireDataListener((DataListener) button); } button.addMouseListener(new ActionHintsListener(tabEditors, action)); toolBar.add(button); menuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); action = new OpenFileAction(tabEditors, tabConsoles); menuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); popupMenu = null; if (studioConfig.getOpenedFiles() != null && !studioConfig.getOpenedFiles().isEmpty()) { popupMenu = new JPopupMenu(); int pos = 0; for (EditorFile file : studioConfig.getOpenedFiles()) { item = new JMenuItem((char) (pos + 48) + " " + file.getPath(), pos + 48); item.addMouseListener(new ActionHintsListener(tabEditors, "Open file " + file)); popupMenu.add(item); if (++pos > 9) { break; } } } button = new DropDownButton(action, popupMenu); if (button instanceof DataListener) { tabEditors.addFireDataListener((DataListener) button); } button.addMouseListener(new ActionHintsListener(tabEditors, action)); toolBar.add(button); appToolbar.add(toolBar); appMenubar.add(menuBar); appToolbar.add(new ToolBarActions("KDB+")); appMenubar.add(new ActionMenu("KDB+", 'k', "KDB+ databse operations", (MouseAdapter) null)); appToolbar.add(new ToolBarActions("Edit")); appMenubar.add(new ActionMenu("Edit", 'E', "Editor operations", (MouseAdapter) null)); toolBar = new ToolBarActions("Options"); appToolbar.add(toolBar); menuBar = new ActionMenu("Tools", 'T', "Tools", (MouseAdapter) null); ActionMenu opMenuBar = new ActionMenu("Options", 'O', "Studio settings", (MouseAdapter) null); ActionMenu lfMenuBar = new ActionMenu("Look and feel", 'L', "L&F", (MouseAdapter) null); LookAndFeelAction.getActionLookAndFeel(this, lfMenuBar, studioConfig); opMenuBar.add(lfMenuBar); opMenuBar.addSeparator(); action = new EditorSettingsAction(this); opMenuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); action = new TokensSettingsAction(this); opMenuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); opMenuBar.addSeparator(); action = new ConsoleSettingsAction(this); opMenuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); opMenuBar.addSeparator(); action = new ConnectionsSettingsAction(treeConnections); opMenuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); menuBar.add(opMenuBar); opMenuBar.addSeparator(); action = new GlobalSettingsAction(this); opMenuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); appMenubar.add(menuBar); opMenuBar.addSeparator(); action = new ProjectSettingsAction(this); opMenuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); appMenubar.add(menuBar); menuBar = new ActionMenu("Help", 'H', "Help...", (MouseAdapter) null); action = new VisitKxAction(); menuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); menuBar.addSeparator(); action = new VisitWroclawAction(); menuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); menuBar.addSeparator(); action = new KeyListAction(tabEditors); menuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); menuBar.addSeparator(); action = new AboutAction(tabEditors); menuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); appMenubar.add(menuBar); menuBar.addSeparator(); action = new CheckUpdate(this); menuBar.add(new ActionMenuItem(action, new ActionHintsListener(tabEditors, action))); appMenubar.add(menuBar); toolBar = null; this.setJMenuBar(appMenubar); } appToolbar.getToolBar("Edit").setVisible(event != null && event.getData() != -1); appToolbar.getToolBar("Options").setVisible(event != null && event.getData() != -1); appToolbar.getToolBar("KDB+").setVisible(event != null && event.getData() != -1); appToolbar.getToolBar("File").setVisible(event != null && event.getData() != -1); appMenubar.getMenu("Edit").setVisible(event != null && event.getData() != -1); appMenubar.getMenu("Tools").setVisible(event != null && event.getData() != -1); appMenubar.getMenu("KDB+").setVisible(event != null && event.getData() != -1); appMenubar.getMenu("File").setVisible(event != null && event.getData() != -1); if (event != null && event.getSource() instanceof EditorsTabbedPane && event.getData() != -1) { Editor editor = ((EditorsTabbedPane) event.getSource()).getEditor(event.getData()); if (editor != null) { JPopupMenu menu = editor.getComponentPopupMenu(); if (menu != null) { for (int count = 0; count < menu.getComponentCount(); count++) { if (menu.getComponent(count) instanceof JMenuItem) { JMenuItem menuItem = (JMenuItem) menu.getComponent(count); if (menuItem.getAction().getClass() == SaveAction.class) { appToolbar.getToolBar("File").update(tabEditors, menuItem.getAction(), true); appMenubar.getMenu("File").update(tabEditors, menuItem.getAction(), true); } else { if (menuItem.getAction().getClass() == SaveAsAction.class || menuItem.getAction().getClass() == SaveAllAction.class) { appToolbar.getToolBar("File").update(tabEditors, menuItem.getAction()); appMenubar.getMenu("File").update(tabEditors, menuItem.getAction()); } else { if (menuItem.getAction().getClass() == CloseAction.class) { appToolbar.getToolBar("File").update(tabEditors, menuItem.getAction(), true); appMenubar.getMenu("File").update(tabEditors, menuItem.getAction(), true); } else { if (menuItem.getAction().getClass() == CloseAllAction.class) { appToolbar.getToolBar("File").update(tabEditors, menuItem.getAction()); appMenubar.getMenu("File").update(tabEditors, menuItem.getAction()); } else { if (menuItem.getAction().getClass() == RunAction.class || menuItem.getAction().getClass() == RunLineAction.class || menuItem.getAction().getClass() == CancelRunAction.class) { appToolbar.getToolBar("KDB+").update(tabEditors, menuItem.getAction()); appMenubar.getMenu("KDB+").update(tabEditors, menuItem.getAction()); } else { if (menuItem.getAction().getClass() == ExtKit.ReplaceAction.class || menuItem.getAction() .getClass() == ActionFactory.RedoAction.class || menuItem.getAction() .getClass() == ActionFactory.UndoAction.class || menuItem.getAction() .getClass() == BaseKit.CopyAction.class || menuItem.getAction() .getClass() == BaseKit.PasteAction.class || menuItem.getAction() .getClass() == ExtKit.GotoAction.class || menuItem.getAction() .getClass() == BaseKit.SelectAllAction.class || menuItem.getAction() .getClass() == BaseKit.SelectLineAction.class || menuItem.getAction() .getClass() == BaseKit.CutAction.class) { appToolbar.getToolBar("Edit").update(tabEditors, menuItem.getAction()); if (menuItem.getAction().getClass() == ExtKit.GotoAction.class || menuItem.getAction() .getClass() == BaseKit.CopyAction.class || menuItem.getAction() .getClass() == BaseKit.SelectAllAction.class) { appMenubar.getMenu("Edit").update(tabEditors, menuItem.getAction(), true); } else { appMenubar.getMenu("Edit").update(tabEditors, menuItem.getAction()); } } } } } } } } } } } } if (event != null && event.getData() != -1 && event.getSource() instanceof EditorsTabbedPane && ((EditorsTabbedPane) event.getSource()).getEditor(event.getData()) != null) { ((EditorsTabbedPane) event.getSource()).getEditor(event.getData()).requestFocus(); } }