com.togethersoft.openapi.util.ui
Class ExtendedTabbedPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JTabbedPane
                          |
                          +--com.togethersoft.openapi.util.ui.ExtendedTabbedPane

public class ExtendedTabbedPane
extends JTabbedPane

Presents extended JTabedPane with possibility set shortcut for panels and predefined keyboard
navigation (Alt-Right Alt-Left)

Author:
TogetherSoft
Since: Together 5.0

Inner Class Summary
 (package private) static classExtendedTabbedPane.ExtendedMetalTabbedPaneUI
           
 private classExtendedTabbedPane.MySelectTab
           

Field Summary
 private HashtablemnemonicsTable
           
 private HashtabletitlesTable
           

Fields inherited from class javax.swing.JTabbedPane
tabPlacement, model, changeListener, changeEvent

Fields inherited from class javax.swing.JComponent
ui, listenerList, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, accessibleContext

Fields inherited from class java.awt.Component
TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT

Constructor Summary
ExtendedTabbedPane()
          Creates new ExtendedTabbedPane and registers keyboard actions.
ExtendedTabbedPane(int tabPlacement)
           

Method Summary
 voidaddTab(String title, char accChar, Component component)
          Adds new tab with title and shortcut.
 voidaddTab(String title, int accChar, Component component)
          Adds new tab with title and shortcut.
 private intcalculateAccChar(char accChar)
           
 (package private) intgetAccCharAt(int tabIndex)
           
 private intgetMnemonicByTitle(String title)
           
 voidremoveTabAt(int index)
          Removes the tab at index.
 private voidselectNextComponent()
           
 private voidselectPrevComponent()
           
 voidsetMnenonicAt(int index, char accChar)
          Sets the mnemonic at index to accChar which
can be '\0'.
 voidsetMnenonicAt(int index, int accChar)
          Sets the mnemonic at index to accChar which
can be '\0'.
 voidsetTitleAt(int index, String title)
          Sets the title at index to title which
can be null.
 voidsetUI(TabbedPaneUI ui)
          Sets extended UI for drawing shortcut underlines.

Methods inherited from class javax.swing.JTabbedPane
getUI, updateUI, getUIClassID, createChangeListener, addChangeListener, removeChangeListener, fireStateChanged, getModel, setModel, getTabPlacement, setTabPlacement, getSelectedIndex, setSelectedIndex, getSelectedComponent, setSelectedComponent, insertTab, addTab, addTab, addTab, add, add, add, add, add, remove, remove, removeAll, getTabCount, getTabRunCount, getTitleAt, getIconAt, getDisabledIconAt, getToolTipTextAt, getBackgroundAt, getForegroundAt, isEnabledAt, getComponentAt, getBoundsAt, setIconAt, setDisabledIconAt, setToolTipTextAt, setBackgroundAt, setForegroundAt, setEnabledAt, setComponentAt, indexOfTab, indexOfTab, indexOfComponent, getToolTipText, paramString, getAccessibleContext

Methods inherited from class javax.swing.JComponent
setUI, getComponentGraphics, paintComponent, paintChildren, paintBorder, update, paint, printAll, print, printComponent, printChildren, printBorder, isPaintingTile, isFocusCycleRoot, isManagingFocus, setNextFocusableComponent, getNextFocusableComponent, setRequestFocusEnabled, isRequestFocusEnabled, requestFocus, grabFocus, setVerifyInputWhenFocusTarget, getVerifyInputWhenFocusTarget, setPreferredSize, getPreferredSize, setMaximumSize, getMaximumSize, setMinimumSize, getMinimumSize, isMinimumSizeSet, isPreferredSizeSet, isMaximumSizeSet, contains, setBorder, getBorder, getInsets, getInsets, getAlignmentY, setAlignmentY, getAlignmentX, setAlignmentX, setInputVerifier, getInputVerifier, getGraphics, setDebugGraphicsOptions, getDebugGraphicsOptions, registerKeyboardAction, registerKeyboardAction, unregisterKeyboardAction, getRegisteredKeyStrokes, getConditionForKeyStroke, getActionForKeyStroke, resetKeyboardActions, setInputMap, getInputMap, getInputMap, setActionMap, getActionMap, requestDefaultFocus, setVisible, hide, setEnabled, setForeground, setBackground, setFont, isFocusTraversable, processFocusEvent, processComponentKeyEvent, processKeyEvent, processKeyBinding, setToolTipText, getToolTipText, getToolTipLocation, createToolTip, scrollRectToVisible, setAutoscrolls, getAutoscrolls, processMouseMotionEvent, enable, disable, getClientProperty, putClientProperty, isLightweightComponent, reshape, getBounds, getSize, getLocation, getX, getY, getWidth, getHeight, hasFocus, isOpaque, setOpaque, computeVisibleRect, getVisibleRect, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener, fireVetoableChange, addVetoableChangeListener, removeVetoableChangeListener, getTopLevelAncestor, addAncestorListener, removeAncestorListener, getListeners, addNotify, removeNotify, repaint, repaint, revalidate, isValidateRoot, isOptimizedDrawingEnabled, paintImmediately, paintImmediately, setDoubleBuffered, isDoubleBuffered, getRootPane

Methods inherited from class java.awt.Container
getComponentCount, countComponents, getComponent, getComponents, insets, addImpl, getLayout, setLayout, doLayout, layout, invalidate, validate, validateTree, preferredSize, minimumSize, paintComponents, printComponents, addContainerListener, removeContainerListener, processEvent, processContainerEvent, deliverEvent, getComponentAt, locate, getComponentAt, findComponentAt, findComponentAt, isAncestorOf, list, list

Methods inherited from class java.awt.Component
getName, setName, getParent, getPeer, setDropTarget, getDropTarget, getGraphicsConfiguration, getTreeLock, getToolkit, isValid, isDisplayable, isVisible, isShowing, isEnabled, enable, enableInputMethods, show, show, getForeground, getBackground, getFont, getLocale, setLocale, getColorModel, getLocation, getLocationOnScreen, location, setLocation, move, setLocation, getSize, size, setSize, resize, setSize, resize, getBounds, bounds, setBounds, setBounds, isLightweight, getFontMetrics, setCursor, getCursor, paintAll, repaint, repaint, repaint, imageUpdate, createImage, createImage, prepareImage, prepareImage, checkImage, checkImage, inside, contains, dispatchEvent, postEvent, addComponentListener, removeComponentListener, addFocusListener, removeFocusListener, addHierarchyListener, removeHierarchyListener, addHierarchyBoundsListener, removeHierarchyBoundsListener, addKeyListener, removeKeyListener, addMouseListener, removeMouseListener, addMouseMotionListener, removeMouseMotionListener, addInputMethodListener, removeInputMethodListener, getInputMethodRequests, getInputContext, enableEvents, disableEvents, coalesceEvents, processComponentEvent, processMouseEvent, processInputMethodEvent, processHierarchyEvent, processHierarchyBoundsEvent, handleEvent, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, action, gotFocus, lostFocus, transferFocus, nextFocus, add, remove, toString, list, list, list, setComponentOrientation, getComponentOrientation

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize

Field Detail

mnemonicsTable

private Hashtable mnemonicsTable

titlesTable

private Hashtable titlesTable
Constructor Detail

ExtendedTabbedPane

public ExtendedTabbedPane()
Creates new ExtendedTabbedPane and registers keyboard actions.

ExtendedTabbedPane

public ExtendedTabbedPane(int tabPlacement)
Method Detail

addTab

public void addTab(String title, char accChar, Component component)
Adds new tab with title and shortcut.
Shortcut can be indicated by '&' in title (accChar should be '\0').
Parameters:
title - title for tab;
accChar - shortcut letter;
component - inserted component.

addTab

public void addTab(String title, int accChar, Component component)
Adds new tab with title and shortcut.
Parameters:
title - title for tab;
accChar - shortcut letter's code;
component - inserted component.

calculateAccChar

private int calculateAccChar(char accChar)

getAccCharAt

int getAccCharAt(int tabIndex)

getMnemonicByTitle

private int getMnemonicByTitle(String title)

removeTabAt

public void removeTabAt(int index)
Removes the tab at index. After the component associated with index is removed, its visibility is reset to true to ensure it will be visible if added to other containers.
param index - the index of the tab to be removed

selectNextComponent

private void selectNextComponent()

selectPrevComponent

private void selectPrevComponent()

setMnenonicAt

public void setMnenonicAt(int index, char accChar)
Sets the mnemonic at index to accChar which
can be '\0'.
An internal exception is raised if there is no tab at that index.
Parameters:
index the tab index where the title should be set
accChar the mnemonic to be displayed in the tab

setMnenonicAt

public void setMnenonicAt(int index, int accChar)
Sets the mnemonic at index to accChar which
can be '\0'.
An internal exception is raised if there is no tab at that index.
Parameters:
index the tab index where the title should be set
accChar the virtual key's mnemonic to be displayed in the tab

setTitleAt

public void setTitleAt(int index, String title)
Sets the title at index to title which
can be null.
An internal exception is raised if there is no tab at that index.
Parameters:
index the tab index where the title should be set
title the title to be displayed in the tab

setUI

public void setUI(TabbedPaneUI ui)
Sets extended UI for drawing shortcut underlines.

Association Links

to Class java.util.Hashtable

to Class java.util.Hashtable