|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.retek.commons.gui.widget.RPanel
com.retek.commons.gui.widget.RTabPane
This class subclass JPanel and reproduces most of the functionality of the JTabbedPane, but using buttons and a card layout. It is used in conjunction with RTab and calls stop() and start() methods on the tab to initialize and clean up state management.
FUTURE: Both start() and stop() should not throw exception (already implemented), but should rather return true of false and not allow the switching of tabs on failures. This produces a successful stop(), but falty start() weird situation.
Nested Class Summary |
---|
Nested classes inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
RTabPane()
Constructor |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Implements the action listener method to handle the attempted selection of buttons. |
java.awt.Component |
add(java.lang.String title,
java.awt.Component component)
Adds a new RTab to the tab pane. |
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener. |
void |
addTab(java.lang.String title,
javax.swing.Icon icon,
RTab tab)
Adds a new RTab to the tab pane with the given title. |
void |
addTab(java.lang.String title,
javax.swing.Icon icon,
RTab tab,
java.lang.String tip)
Adds a new RTab to the tab pane with the given title. |
void |
addTab(java.lang.String title,
RTab tab)
Adds a new RTab to the tab pane with the given title. |
java.awt.Color |
getActiveBackground()
Returns the active background color of the tabbed pane. |
java.awt.Color |
getActiveBackgroundAt(int index)
Returns the background color of the tab portion of a tab pane for the given index. |
java.awt.Color |
getActiveForeground()
Returns the active foreground color of the tabbed pane. |
java.awt.Color |
getActiveForegroundAt(int index)
Returns the foreground color of the tab portion of a tab pane for the given index. |
javax.swing.Icon |
getDisabledIconAt(int index)
Returns the disabled icon at the given index. |
java.awt.Color |
getFocusBackground()
Returns the focus background color of the tabbed pane. |
javax.swing.Icon |
getIconAt(int index)
Returns the enabled icon at the given index. |
java.awt.Color |
getInactiveBackground()
Returns the inactive background color of the tabbed pane. |
java.awt.Color |
getInactiveBackgroundAt(int index)
Returns the background color of the tab portion of a tab pane for the given index. |
java.awt.Color |
getInactiveForeground()
Returns the inactive foreground color of the tabbed pane. |
java.awt.Color |
getInactiveForegroundAt(int index)
Returns the foreground color of the tab portion of a tab pane for the given index. |
int |
getIndex(javax.swing.Icon icon)
Returns the tab index of the specified icon or -1 if the icon is not found |
int |
getIndex(RTab tab)
Returns the tab index of the specified tab or -1 if no tab exists. |
int |
getIndex(java.lang.String title)
Returns the tab index of the specified title or -1 if no title exists. |
int |
getSelectedIndex()
Returns the currently selected index for the tab pane. |
RTab |
getSelectedTab()
Returns the currently selected RTab for this tab pane. |
java.lang.String |
getSelectedTitle()
Returns the currently selected title for the tab pane. |
RTab |
getTabAt(int index)
Returns the tab at the given index. |
int |
getTabCount()
Returns the number of tabs in the tab pane. |
java.lang.String |
getTitleAt(int index)
Returns the title at the given index. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
Returns the tool tip text of the tab by mouse event. |
java.lang.String |
getToolTipTextAt(int index)
Returns the tool tip text of the tab by index. |
void |
insertTab(java.lang.String title,
javax.swing.Icon icon,
RTab tab,
java.lang.String tip,
int index)
Inserts a RTab with the given title at the given index. |
void |
insertTab(java.lang.String title,
RTab tab,
int index)
Inserts a RTab with the given title at the given index. |
boolean |
isEnabledAt(int index)
Returns whether or not the tab is enabled at the given index. |
boolean |
isEnabledAt(java.lang.String title)
Returns whether or not the tab is enabled for the given tab (by title). |
boolean |
isUniformTitleSize()
Returns whether or not the tab should display uniform title sizes. |
void |
keyPressed(java.awt.event.KeyEvent event)
Implements the key listener method. |
void |
keyReleased(java.awt.event.KeyEvent event)
|
void |
keyTyped(java.awt.event.KeyEvent event)
|
void |
refreshSelectedTab()
Refreshes selected tab. |
void |
removeAll()
Removes all the tabs from the tabbed pane. |
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a change listener.. |
void |
removeTab(RTab tab)
Removes the tab from the tab panel. |
void |
removeTabAt(int index)
Removes the tab from the tab panel. |
void |
requestFocus()
Override request focus to transfer focus to the currently selected button. |
void |
setActiveBackground(java.awt.Color color)
Assigns the active background color for the tabbed pane. |
void |
setActiveBackgroundAt(int index,
java.awt.Color color)
Assigns the active background color for the tab at the specific index. |
void |
setActiveForeground(java.awt.Color color)
Assigns the active foreground color for the tabbed pane. |
void |
setActiveForegroundAt(int index,
java.awt.Color color)
Assigns the active foreground color for the tab at the specific index. |
void |
setDisabledIconAt(int index,
javax.swing.Icon disabledIcon)
Sets the disabled icon at the specified index. |
void |
setEnabledAt(int index,
boolean enabled)
Sets the enabled state of a tab. |
void |
setEnabledAt(java.lang.String title,
boolean enabled)
Sets the enabled state of a tab. |
void |
setFocusBackground(java.awt.Color color)
Assigns the focus background color for the tabbed pane. |
void |
setIconAt(int index,
javax.swing.Icon icon)
Sets the enabled icon at the specified index. |
void |
setInactiveBackground(java.awt.Color color)
Assigns the inactive background color for the tabbed pane. |
void |
setInactiveBackgroundAt(int index,
java.awt.Color color)
Assigns the inactive background color for the tab at the specific index. |
void |
setInactiveForeground(java.awt.Color color)
Assigns the inactive foreground color for the tabbed pane. |
void |
setInactiveForegroundAt(int index,
java.awt.Color color)
Assigns the inactive foreground color for the tab at the specific index. |
void |
setSelectedIndex(int index)
Assigns the selected tab for the component based on index. |
void |
setSelectedTab(RTab tab)
Assigns the selected tab for the component. |
void |
setSelectedTab(java.lang.String title)
Assigns the selected tab for the component based on the title. |
void |
setTitleAt(int index,
java.lang.String title)
Assigns the title to a tab at a particular index. |
void |
setToolTipTextAt(int index,
java.lang.String toolTipText)
Sets the tool tip text at the specified index. |
void |
setUniformTitleSize(boolean isUniform)
Assigns whether or not the tab should display uniform title sizes. |
protected void |
switchTab(int index)
Attempts to the switch the tab to a new tab. |
Methods inherited from class com.retek.commons.gui.widget.RPanel |
---|
addREventListener, getFocusCycleComponents, notifyREventListeners, notifyREventListeners, performActionEvent, performErrorEvent, removeAllREventListeners, removeREventListener, repaintPanel, setEmptyBorder, setEmptyBorder, setFocusCycleComponents, setLineBorder, setLineBorder, setLoweredBevelBorder, setMinimumHeight, setRaisedBevelBorder, setTitleBorder, setTitleBorder, setTitleBorder, setTitleBorder |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RTabPane()
Method Detail |
public void addChangeListener(javax.swing.event.ChangeListener listener)
listener
- The ChangeListener to add to the component.public void removeChangeListener(javax.swing.event.ChangeListener listener)
listener
- The ChangeListener to remove from the component.public boolean isUniformTitleSize()
public void setUniformTitleSize(boolean isUniform)
isUniform
- True if the tab should display uniform title size, false otherwise.public int getTabCount()
public RTab getTabAt(int index)
index
- The index of the tab.
public java.lang.String getTitleAt(int index)
index
- The index of the tab.
public void setTitleAt(int index, java.lang.String title)
index
- The index of the tab.public java.awt.Color getActiveBackground()
public void setActiveBackground(java.awt.Color color)
color
- The color to assign.public java.awt.Color getActiveForeground()
public void setActiveForeground(java.awt.Color color)
color
- The color to assign.public java.awt.Color getInactiveBackground()
public void setInactiveBackground(java.awt.Color color)
color
- The color to assign.public java.awt.Color getInactiveForeground()
public void setInactiveForeground(java.awt.Color color)
color
- The color to assign.public java.awt.Color getFocusBackground()
public void setFocusBackground(java.awt.Color color)
color
- The color to assign.public java.awt.Color getActiveBackgroundAt(int index)
index
- The index of the tab to retrieve the background color from.
public void setActiveBackgroundAt(int index, java.awt.Color color)
index
- The tab index.color
- The color to assign.public java.awt.Color getActiveForegroundAt(int index)
index
- The index of the tab to retrieve the foreground color from.
public void setActiveForegroundAt(int index, java.awt.Color color)
index
- The tab index.color
- The color to assign.public java.awt.Color getInactiveBackgroundAt(int index)
index
- The index of the tab to retrieve the background color from.
public void setInactiveBackgroundAt(int index, java.awt.Color color)
index
- The tab index.color
- The color to assign.public java.awt.Color getInactiveForegroundAt(int index)
index
- The index of the tab to retrieve the foreground color from.
public void setInactiveForegroundAt(int index, java.awt.Color color)
index
- The tab index.color
- The color to assign.public javax.swing.Icon getDisabledIconAt(int index)
index
- The index of the tab.
public void setDisabledIconAt(int index, javax.swing.Icon disabledIcon)
index
- The tab index.public javax.swing.Icon getIconAt(int index)
index
- The index of the tab.
public void setIconAt(int index, javax.swing.Icon icon)
index
- The tab index.icon
- The icon to display in enabled mode.public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
event
- The MouseEvent to return a tool tip for.
public java.lang.String getToolTipTextAt(int index)
index
- The tab index.
public void setToolTipTextAt(int index, java.lang.String toolTipText)
index
- The tab index.public boolean isEnabledAt(java.lang.String title)
title
- The title of the tab.
public boolean isEnabledAt(int index)
index
- The tab index.
public void setEnabledAt(java.lang.String title, boolean enabled)
title
- The title of the tab.enabled
- True if the tab should be enabled, false if not.public void setEnabledAt(int index, boolean enabled)
index
- The tab index.enabled
- True if the tab should be enabled, false if not.public int getSelectedIndex()
public void setSelectedIndex(int index)
index
- The index of the tab to select.public java.lang.String getSelectedTitle()
public RTab getSelectedTab()
public void setSelectedTab(java.lang.String title)
public void setSelectedTab(RTab tab)
tab
- The tab to select.public void refreshSelectedTab()
public int getIndex(RTab tab)
tab
- The tab to search for.
public int getIndex(java.lang.String title)
title
- The title to search for.
public int getIndex(javax.swing.Icon icon)
icon
- The icon to search for.
public java.awt.Component add(java.lang.String title, java.awt.Component component)
title
- The title to assign to the RTab component.component
- The RTab component to add to the tabbed pane.public void addTab(java.lang.String title, RTab tab)
title
- The title to assign to the RTab component.tab
- The RTab component to add to the tabbed pane.public void addTab(java.lang.String title, javax.swing.Icon icon, RTab tab)
title
- The title to assign to the RTab component.icon
- The icon to assign to the RTab component.tab
- The RTab component to add to the tabbed pane.public void addTab(java.lang.String title, javax.swing.Icon icon, RTab tab, java.lang.String tip)
title
- The title to assign to the RTab component.icon
- The icon to assign to the RTab component.tab
- The RTab component to add to the tabbed pane.tip
- The tool tip to display with the tab.public void insertTab(java.lang.String title, RTab tab, int index)
title
- The title to assign to the tab.tab
- The tab to insert.index
- The index to insert the tab at.public void insertTab(java.lang.String title, javax.swing.Icon icon, RTab tab, java.lang.String tip, int index)
title
- The title to assign to the tab.tab
- The tab to insert.index
- The index to insert the tab at.public void removeAll()
public void removeTab(RTab tab)
tab
- The tab to remove from the tab panel.public void removeTabAt(int index)
index
- The index of the tab to remove from the panel.protected void switchTab(int index)
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
public void keyPressed(java.awt.event.KeyEvent event)
keyPressed
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent event)
keyTyped
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent event)
keyReleased
in interface java.awt.event.KeyListener
public void requestFocus()
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |