org.jdesktop.swingx
public abstract class AbstractPatternPanel extends JXPanel
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MATCH_ACTION_COMMAND |
protected javax.swing.JCheckBox |
matchCheck |
protected PatternModel |
patternModel |
static java.lang.String |
SEARCH_FIELD_LABEL |
static java.lang.String |
SEARCH_FIELD_MNEMONIC |
static java.lang.String |
SEARCH_TITLE |
protected javax.swing.JTextField |
searchField |
protected javax.swing.JLabel |
searchLabel |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
AbstractPatternPanel() |
Modifier and Type | Method and Description |
---|---|
protected void |
bind()
configure and bind components to/from PatternModel
|
protected void |
bindSearchLabel(java.util.Locale locale)
Configures the searchLabel.
|
protected AbstractActionExt |
createBoundAction(java.lang.String actionCommand,
java.lang.String methodName)
creates, configures and returns a bound action to the given method of
this.
|
protected AbstractActionExt |
createModelStateAction(java.lang.String command,
java.lang.String methodName,
boolean initial)
creates, configures and returns a bound state action on a boolean property
of the PatternModel.
|
protected PatternModel |
createPatternModel()
factory method to create the PatternModel.
|
protected AbstractActionExt |
getAction(java.lang.String key)
convenience method for type-cast to AbstractActionExt.
|
protected ActionContainerFactory |
getActionContainerFactory() |
protected PatternModel |
getPatternModel()
returns the patternModel.
|
protected java.beans.PropertyChangeListener |
getPatternModelListener()
creates and returns a PropertyChangeListener to the PatternModel.
|
protected javax.swing.event.DocumentListener |
getSearchFieldListener()
Create
DocumentListener for the search field that calls
corresponding callback method whenever the search field contents is being changed |
protected int |
getSearchFieldWidth() |
protected java.lang.String |
getUIString(java.lang.String key)
Returns a potentially localized value from the UIManager.
|
protected java.lang.String |
getUIString(java.lang.String key,
java.util.Locale locale)
Returns a potentially localized value from the UIManager for the
given locale.
|
protected void |
initActions()
creates and registers all actions for the default the actionMap.
|
protected void |
initComponents()
Initialize all the incorporated components and models
|
protected void |
initExecutables()
creates and registers all "executable" actions.
|
protected void |
initPatternActions()
creates actions bound to PatternModel's state.
|
abstract void |
match()
Callback action bound to MATCH_ACTION_COMMAND.
|
protected void |
refreshDocumentFromModel()
callback method that updates document from the search field
|
protected void |
refreshEmptyFromModel()
called from listening to empty property of PatternModel.
|
protected void |
refreshModelFromDocument()
callback method from listening to searchField.
|
protected void |
refreshPatternFromModel()
called from listening to pattern property of PatternModel.
|
void |
setLocale(java.util.Locale l) |
protected void |
updateLocaleState(java.util.Locale locale)
Updates locale-dependent state.
|
getAlpha, getBackgroundPainter, getEffectiveAlpha, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, isInheritAlpha, isPaintBorderInsets, paint, paintComponent, setAlpha, setBackground, setBackgroundPainter, setInheritAlpha, setPaintBorderInsets, setScrollableTracksViewportHeight, setScrollableTracksViewportWidth
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, 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, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String SEARCH_FIELD_LABEL
public static final java.lang.String SEARCH_FIELD_MNEMONIC
public static final java.lang.String SEARCH_TITLE
public static final java.lang.String MATCH_ACTION_COMMAND
protected javax.swing.JLabel searchLabel
protected javax.swing.JTextField searchField
protected javax.swing.JCheckBox matchCheck
protected PatternModel patternModel
public abstract void match()
protected AbstractActionExt getAction(java.lang.String key)
key
- Key to retrieve actionAbstractActionExt
protected void initActions()
protected void initExecutables()
protected void initPatternActions()
protected java.lang.String getUIString(java.lang.String key)
UIPREFIX
before doing the
lookup. The lookup respects this table's current locale
property. Returns the key, if no value is found.key
- the bare key to look up in the UIManager.protected java.lang.String getUIString(java.lang.String key, java.util.Locale locale)
UIPREFIX
before doing the
lookup. Returns the key, if no value is found.key
- the bare key to look up in the UIManager.locale
- the locale use for lookupprotected AbstractActionExt createModelStateAction(java.lang.String command, java.lang.String methodName, boolean initial)
command
- the actionCommand - same as key to find localizable resourcesmethodName
- the method on the PatternModel to call on item state changedinitial
- the initial value of the propertyprotected AbstractActionExt createBoundAction(java.lang.String actionCommand, java.lang.String methodName)
actionCommand
- the actionCommand, same as key to find localizable resourcesmethodName
- the method to call an actionPerformed.public void setLocale(java.util.Locale l)
Overridden to update locale-dependent properties.
setLocale
in class java.awt.Component
updateLocaleState(Locale)
protected void updateLocaleState(java.util.Locale locale)
PENDING: Try better to find all column actions including custom additions? Or move to columnControl?
setLocale(Locale)
protected void refreshPatternFromModel()
protected PatternModel getPatternModel()
PatternModel
if it exists or newly created
one if it was not initialized before this callprotected PatternModel createPatternModel()
PatternModel
protected java.beans.PropertyChangeListener getPatternModelListener()
PropertyChangeListener
protected void refreshEmptyFromModel()
protected void refreshModelFromDocument()
protected void refreshDocumentFromModel()
protected javax.swing.event.DocumentListener getSearchFieldListener()
DocumentListener
for the search field that calls
corresponding callback method whenever the search field contents is being changedDocumentListener
protected void bind()
protected void bindSearchLabel(java.util.Locale locale)
protected ActionContainerFactory getActionContainerFactory()
ActionContainerFactory
.
Will lazily create new factory if it does not existprotected void initComponents()
protected int getSearchFieldWidth()