org.jext
Class JextTabbedPane

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTabbedPane
org.jext.JextTabbedPane
- All Implemented Interfaces:
- javax.accessibility.Accessible, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants
- public class JextTabbedPane
- extends javax.swing.JTabbedPane
- implements javax.swing.event.ChangeListener
A tabbed pane which can display indexed titles. As a matter of fact,
if a tab is added with a name which already exists, JextTabbedPane
will add an index under the form '(x)' at the end of the name. When all tabs
of the same name are closed, indexes are counted over from 0.
| Nested classes inherited from class javax.swing.JTabbedPane |
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener |
| 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 |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
|
Constructor Summary |
JextTabbedPane(JextFrame parent)
Creates a new tabbed pane and register a change listener
which will be used to update Jext infos concerning text
areas. |
| Methods inherited from class javax.swing.JTabbedPane |
add, add, add, add, add, addChangeListener, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, insertTab, isEnabledAt, paramString, remove, remove, removeChangeListener, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabLayoutPolicy, setTabPlacement, setToolTipTextAt, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, 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, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, 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 |
addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, 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, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
popupMenu
private static javax.swing.JPopupMenu popupMenu
parent
private JextFrame parent
fileNames
private java.util.HashMap fileNames
_mouseListener
private JextTabbedPane.PopupMenu _mouseListener
CLEAN_ICON
private static final javax.swing.Icon CLEAN_ICON
DIRTY_ICON
private static final javax.swing.Icon DIRTY_ICON
JextTabbedPane
public JextTabbedPane(JextFrame parent)
- Creates a new tabbed pane and register a change listener
which will be used to update Jext infos concerning text
areas.
getPopupMenu
public static javax.swing.JPopupMenu getPopupMenu()
- Returns JextTabbedPane popup menu. This is needed to update look and feel when
user changed it.
setCleanIcon
public void setCleanIcon(JextTextArea textArea)
- When a text area is saved (or simply cleaned in case
of open or new), this method is used to display the 'clean'
icon in the tab which holds the text area.
setDirtyIcon
public void setDirtyIcon(JextTextArea textArea)
- When a text area is modified this method is used to display
the 'dirty' icon in the tab which holds the text area.
addTab
public void addTab(java.lang.String title,
java.awt.Component component)
- Overrides default
addTab(String, Component) method.
This method register the title if it hasn't been
displayed yet to be able to index next titles of same name. Then,
super.addTab(String, Component) is called.
removeTabAt
public void removeTabAt(int index)
- Overrides default
removeTabAt(int) method.
This method checks if no other tab among the remaining ones
has got the same name. In this case, the title is unregistered
from the indexed titles list.
setTitleAt
public void setTitleAt(int index,
java.lang.String title)
- Overrides default
setTitleAt(int, String) method.
Before setting the new title, the new title is registered in
the indexed titles list. Then, we call super.setTitleAt(int, String)
method but specifying an indexed title.
removeTitle
private void removeTitle(int index,
java.lang.String title)
setIndexedTitle
private void setIndexedTitle(java.lang.String title)
getIndexedTitle
private java.lang.String getIndexedTitle(java.lang.String title)
nextTab
public void nextTab()
- Selects the next tab in the list. If current selected tab
is the last one, then the first one is selected.
previousTab
public void previousTab()
- Selects the previous tab in the list. If current selected tab
is the first one, then the last one is selected.
removeAll
public void removeAll()
- Removes any installed component from this tabbed pane.
Also resets the titles list.
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent evt)
- When a tab is selected, and if content of the tab is a
JextTextArea, we update infos displayed by
Jext and notify Jext listeners.
- Specified by:
stateChanged in interface javax.swing.event.ChangeListener
finalize
protected void finalize()
throws java.lang.Throwable
- Patch
-> Memory management improvements : it may help the garbage collector.
-> Author : Julien Ponge (julien@izforge.com)
-> Date : 23, May 2001