JIDE 3.5.15

com.jidesoft.shortcut
Class ShortcutEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jidesoft.shortcut.ShortcutEditor
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ShortcutEditor
extends JPanel

ShortcutEditor is an editor for ShortcutSchemaManager.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JButton _assignButton
           
protected  JList _commandsList
           
protected  JComboBox _contextComboBox
           
protected  JButton _copyButton
           
protected  JButton _deleteButton
           
protected  QuickFilterField _filterField
           
protected  JCheckBox _overriddenOnlyCheckBox
           
protected  JLabel _parentSchemaLabel
           
protected  JButton _removeButton
           
protected  JList _schemaList
           
protected  DefaultListModel _schemaListModel
           
protected  JButton _setActiveButton
           
protected  ShortcutField _shortcutField
           
protected  com.jidesoft.shortcut.ShortcutLabel _shortcutLabel
           
protected  JComboBox _shortcutsComboBox
           
 
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
ShortcutEditor(ShortcutSchemaManager manager)
           
ShortcutEditor(ShortcutSchemaManager manager, boolean allowMultipleShortcuts)
           
ShortcutEditor(ShortcutSchemaManager manager, String[] contexts)
          Creates ShortcutEditor.
ShortcutEditor(ShortcutSchemaManager manager, String[] contexts, boolean multipleShortcutsAllowed)
          Creates ShortcutEditor.
 
Method Summary
protected  JPanel createConflictingShortcutPanel()
          Creates the panel for the conflicting shortcuts.
protected  JPanel createEditingShortcutPanel()
          Creates the editing panel for the shortcut.
protected  JPanel createExistingShortcutPanel()
          Creates the panel for the existing shortcut.
protected  QuickFilterField createFilterField()
          Creates a QuickListFilterField for the command JList.
protected  ListCellRenderer createListCellRenderer()
          Creates the list cell renderer for the list.
protected  JPanel createSchemaPanel()
          Creates the panel that contains the schema JList as well as the buttons for it.
protected  ShortcutField createShortcutField()
          Creates the shortcut field.
protected  JPanel createShortcutFilterPanel()
          Creates the panel that contains the shortcut filter field.
protected  JPanel createShortcutListPanel()
          Create the panel that contains the shortcut JList.
 QuickFilterField getFilterField()
           
protected  ResourceBundle getResourceBundle()
          Gets the resource bundle for the ShortcutEditor.
 String getSelectedCommand()
           
 ShortcutSchema getSelectedShortcutSchema()
           
 ShortcutField getShortcutField()
          Gets the ShortcutField.
 ShortcutSchemaManager getShortcutSchemaManager()
           
protected  void initComponents()
           
protected  void initData(boolean keepSelection)
           
 boolean isConflictedShortcutsAllowed()
           
 boolean isMultipleShortcutsAllowed()
           
 boolean isNewShortcutOnTop()
          Get the flag indicating if the new shortcut should be inserted in the first place of the list.
protected  void selectedCommandChanged(boolean selectLast)
          This method is called when the selected command is changed.
protected  void selectedSchemaChanged()
          This method is called when the selected schema is changed in the schema JList.
 void setConflictedShortcutsAllowed(boolean conflictedShortcutsAllowed)
           
 void setNewShortcutOnTop(boolean newShortcutOnTop)
          Set the flag indicating if the new shortcut should be inserted in the first place of the list.
 void setSelectedCommand(String selectedCommand)
           
 void setSelectedShortcutSchema(ShortcutSchema selectedShortcutSchema)
           
protected  void updateCommandList()
          Updates the command list after the filtering in the filter field.
protected  void updateCommandListModel(QuickFilterField field)
          Updates the command JList's list mode based on the filter field's filtered result.
protected  void updateEditable()
           
protected  void updateFilterField(QuickFilterField field, ListModel model)
          Updates the filter field's list model from the command list.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
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, paint, paintBorder, paintChildren, paintComponent, 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, setBackground, 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
 
Methods inherited from class java.awt.Container
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, 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, 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, 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
 

Field Detail

_schemaList

protected JList _schemaList

_setActiveButton

protected JButton _setActiveButton

_copyButton

protected JButton _copyButton

_deleteButton

protected JButton _deleteButton

_parentSchemaLabel

protected JLabel _parentSchemaLabel

_filterField

protected QuickFilterField _filterField

_commandsList

protected JList _commandsList

_overriddenOnlyCheckBox

protected JCheckBox _overriddenOnlyCheckBox

_shortcutsComboBox

protected JComboBox _shortcutsComboBox

_shortcutLabel

protected com.jidesoft.shortcut.ShortcutLabel _shortcutLabel

_removeButton

protected JButton _removeButton

_shortcutField

protected ShortcutField _shortcutField

_assignButton

protected JButton _assignButton

_contextComboBox

protected JComboBox _contextComboBox

_schemaListModel

protected DefaultListModel _schemaListModel
Constructor Detail

ShortcutEditor

public ShortcutEditor(ShortcutSchemaManager manager)

ShortcutEditor

public ShortcutEditor(ShortcutSchemaManager manager,
                      boolean allowMultipleShortcuts)

ShortcutEditor

public ShortcutEditor(ShortcutSchemaManager manager,
                      String[] contexts)
Creates ShortcutEditor.

Parameters:
manager - the ShortcutSchemaManager
contexts - a list of contexts. Please note, the first context must be "Global". You can give it a different name if you want such as "Default". But it means if the short cut doesn't explicitly specified a context, it defaults to this context. Null context in shortcut means this one too.

ShortcutEditor

public ShortcutEditor(ShortcutSchemaManager manager,
                      String[] contexts,
                      boolean multipleShortcutsAllowed)
Creates ShortcutEditor.

Parameters:
manager - the ShortcutSchemaManager
contexts - a list of contexts. Please note, the first context must be "Global". You can give it a different name if you want such as "Default". But it means if the short cut doesn't explicitly specified a context, it defaults to this context. Null context in shortcut means this one too.
multipleShortcutsAllowed - whether multiple shortcuts is allowed for each command.
Method Detail

initComponents

protected void initComponents()

createSchemaPanel

protected JPanel createSchemaPanel()
Creates the panel that contains the schema JList as well as the buttons for it.

Returns:
the schema panel.

selectedSchemaChanged

protected void selectedSchemaChanged()
This method is called when the selected schema is changed in the schema JList.


createShortcutFilterPanel

protected JPanel createShortcutFilterPanel()
Creates the panel that contains the shortcut filter field.

Returns:
the shortcut filter panel.

createFilterField

protected QuickFilterField createFilterField()
Creates a QuickListFilterField for the command JList.

Returns:
a QuickListFilterField.

initData

protected void initData(boolean keepSelection)

updateCommandList

protected void updateCommandList()
Updates the command list after the filtering in the filter field.


updateCommandListModel

protected void updateCommandListModel(QuickFilterField field)
Updates the command JList's list mode based on the filter field's filtered result.

Parameters:
field - the filter field.

updateFilterField

protected void updateFilterField(QuickFilterField field,
                                 ListModel model)
Updates the filter field's list model from the command list.

Parameters:
field - the filter field.
model - the list model.

createShortcutListPanel

protected JPanel createShortcutListPanel()
Create the panel that contains the shortcut JList.

Returns:
the shortcut list panel.

createListCellRenderer

protected ListCellRenderer createListCellRenderer()
Creates the list cell renderer for the list.

By default, it creates a CommandListCellRenderer instance.

Returns:
the ListCellRenderer.
Since:
3.3.7

selectedCommandChanged

protected void selectedCommandChanged(boolean selectLast)
This method is called when the selected command is changed.

Parameters:
selectLast - true to select the last command in the shortcutsCombobox.

createExistingShortcutPanel

protected JPanel createExistingShortcutPanel()
Creates the panel for the existing shortcut.

Returns:
the existing shortcut panel.

createEditingShortcutPanel

protected JPanel createEditingShortcutPanel()
Creates the editing panel for the shortcut.

Returns:
the editing panel for the shortcut.

createShortcutField

protected ShortcutField createShortcutField()
Creates the shortcut field.

Returns:
the shortcut field.

createConflictingShortcutPanel

protected JPanel createConflictingShortcutPanel()
Creates the panel for the conflicting shortcuts.

Returns:
the panel for the conflicting shortcuts.

updateEditable

protected void updateEditable()

getSelectedShortcutSchema

public ShortcutSchema getSelectedShortcutSchema()

setSelectedShortcutSchema

public void setSelectedShortcutSchema(ShortcutSchema selectedShortcutSchema)

getSelectedCommand

public String getSelectedCommand()

setSelectedCommand

public void setSelectedCommand(String selectedCommand)

getFilterField

public QuickFilterField getFilterField()

isMultipleShortcutsAllowed

public boolean isMultipleShortcutsAllowed()

isConflictedShortcutsAllowed

public boolean isConflictedShortcutsAllowed()

setConflictedShortcutsAllowed

public void setConflictedShortcutsAllowed(boolean conflictedShortcutsAllowed)

getShortcutField

public ShortcutField getShortcutField()
Gets the ShortcutField. It is the field user defines the keystroke shortcut or mouse shortcut.

Returns:
the ShortcutField.

getShortcutSchemaManager

public ShortcutSchemaManager getShortcutSchemaManager()

getResourceBundle

protected ResourceBundle getResourceBundle()
Gets the resource bundle for the ShortcutEditor.

Returns:
the resource bundle for the ShortcutEditor.

isNewShortcutOnTop

public boolean isNewShortcutOnTop()
Get the flag indicating if the new shortcut should be inserted in the first place of the list.

Returns:
true if new shortcut for the same action should be inserted to the first place. Otherwise false.
See Also:
setNewShortcutOnTop(boolean)

setNewShortcutOnTop

public void setNewShortcutOnTop(boolean newShortcutOnTop)
Set the flag indicating if the new shortcut should be inserted in the first place of the list.

By default, the flag is false to keep the original behavior.

Parameters:
newShortcutOnTop - the flag

JIDE 3.5.15