public void actionPerformed(ActionEvent e) { JTabbedPane pane = (JTabbedPane) e.getSource(); if (pane != null && (pane.getUI() instanceof CloseTabPaneUI)) { CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI(); String command = e.getActionCommand(); if (command != null && command.length() > 0) { int mnemonic = (int) e.getActionCommand().charAt(0); if (mnemonic >= 'a' && mnemonic <= 'z') { mnemonic -= ('a' - 'A'); } Integer index = (Integer) ui.mnemonicToIndexMap.get(new Integer(mnemonic)); if (index != null && pane.isEnabledAt(index.intValue())) { pane.setSelectedIndex(index.intValue()); } } } }
public void actionPerformed(ActionEvent e) { JTabbedPane pane = (JTabbedPane) e.getSource(); CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI(); int tabPlacement = pane.getTabPlacement(); if (tabPlacement == TOP || tabPlacement == BOTTOM) { ui.navigateSelectedTab(EAST); } else { ui.navigateSelectedTab(SOUTH); } }
private void maybeShowPopup(MouseEvent e, JPopupMenu popup) { if (e.isPopupTrigger()) { int tab = _tabbedExecutionsPanel .getUI() .tabForCoordinate(_tabbedExecutionsPanel, e.getX(), e.getY()); if (-1 != tab) { popup.show(e.getComponent(), e.getX(), e.getY()); } } }
public void actionPerformed(ActionEvent e) { JTabbedPane pane = null; Object src = e.getSource(); if (src instanceof JTabbedPane) { pane = (JTabbedPane) src; } else if (src instanceof ScrollableTabButton) { pane = (JTabbedPane) ((ScrollableTabButton) src).getParent(); } else { return; // shouldn't happen } CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI(); ui.tabScroller.scrollBackward(pane.getTabPlacement()); }
/** Update the UI of this JTabbedPane to contain a progress bar */ public static void extendUI(JTabbedPane pane) { TabbedPaneUI oldUI = pane.getUI(); TabbedPaneUI newUI = oldUI; if (aquaUI != null && aquaUI.isInstance(oldUI)) newUI = createNewUI("com.limegroup.gnutella.gui.AquaTab", newUI); else if (macUI != null && macUI.isInstance(oldUI)) newUI = createNewUI("com.limegroup.gnutella.gui.MacTab", newUI); else if (windowsUI != null && windowsUI.isInstance(oldUI)) newUI = createNewUI("com.limegroup.gnutella.gui.WinTab", newUI); else if (metalUI != null && metalUI.isInstance(oldUI)) newUI = new MetalTab(); // Note that this last check is an == check. // This is because lots of UIs are going to extend from BasicUI // and we only want to use the BasicTab if we are positive that // the actual tab is using a BasicUI. else if (oldUI.getClass() == basicUI) newUI = new BasicTab(); pane.setUI(newUI); }
public void actionPerformed(ActionEvent e) { JTabbedPane pane = (JTabbedPane) e.getSource(); CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI(); ui.requestMyFocusForVisibleComponent(); }
public void actionPerformed(ActionEvent e) { JTabbedPane pane = (JTabbedPane) e.getSource(); CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI(); ui.navigateSelectedTab(PREVIOUS); }