public class BindingChooser extends BindingPanel
Modifier and Type | Class and Description |
---|---|
static class |
BindingChooser.IndentStyle
Supported appearances of the indent field, which includes:
NONE- No actions are taken to change the indent field's appearance. EMPTY- Indent field is set to be invisible (effectively removing it from the display). SPACER- Blank field that occupies its currently set dimensions. TYPE- Displays Unicode arrows according to the shortcut's event type (down for KEY_PRESSED, up for KEY_RELEASED, bidirectional for KEY_TYPED, and an 'X' if disabled). INDEX- Displays the field's index from the top (starting with one). |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
BindingChooser() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
doInput(javax.swing.KeyStroke input)
Emulates keyboard input, setting the selected entry's shortcut if an
entry's currently awaiting input.
|
BindingChooser.IndentStyle |
getIndentStyle()
Provides the indent style used by the chooser.
|
static java.lang.String |
getReadableConstant(java.lang.String input)
Provides a more readable version of constant names.
|
BindingEntry |
getSelected()
Provides the currently selected entry if awaiting input.
|
boolean |
isBindingSelected()
Returns if a binding is currently awaiting input or not.
|
BindingAdaptor |
makeAdaptor()
Provides a key adaptor that can provide editing functionality for the
selected entry.
|
BindingEntry |
makeLabels()
Provides the labels naming the fields.
|
protected void |
onClick(java.awt.event.MouseEvent event,
BindingEntry entry,
BindingEntry.Field field)
Invoked on click.
|
protected void |
onUpdate(int index,
BindingEntry entry,
boolean isNew)
This is called upon:
Component reordering (inherited functionality from BindingPanel)
Visual changes to the entry
Component validation
|
void |
putAllBindings(KeybindingSet set)
Adds a collection of new key binding mappings to the end of the listing.
|
void |
setEditable(boolean editable)
Sets if the shortcut fields of entries can be selected to provide editing
functionality or not.
|
void |
setIndentStyle(BindingChooser.IndentStyle style)
Sets content display in the indent field of entries.
|
void |
setSelected(BindingEntry entry)
Sets the shortcut field of an entry to prompt user input.
|
static java.util.LinkedHashMap<javax.swing.KeyStroke,java.lang.String> |
showDialog(java.awt.Component parent,
BindingChooser display,
java.lang.String dialogTitle,
boolean showLabels,
BindingAdaptor adaptor)
Displays a dialog allowing the user to redefine the keystroke component
of key bindings.
|
void |
validate() |
clearBindings, contains, getBinding, getBindingCount, getBindingIndex, getBindingInputMap, getBindingMap, getBindings, putAllBindings, putBinding, putBinding, putBinding, putBinding, removeBinding, removeBinding
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, 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, 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, transferFocusBackward, transferFocusUpCycle
public void putAllBindings(KeybindingSet set)
set
- mapping between keystrokes and actions to be addedpublic static java.util.LinkedHashMap<javax.swing.KeyStroke,java.lang.String> showDialog(java.awt.Component parent, BindingChooser display, java.lang.String dialogTitle, boolean showLabels, BindingAdaptor adaptor)
parent
- frame to which to apply modal property and center within
(centers within screen if null)display
- body of the display, containing current bindings and
appearance propertiesdialogTitle
- title of the displayed dialogshowLabels
- if true the top has labels describing the fields,
otherwise they are omittedadaptor
- adaptor used to provide configuring functionalityprotected void onUpdate(int index, BindingEntry entry, boolean isNew)
onUpdate
in class BindingPanel
index
- newly assigned index of entryentry
- entry that has been added or shiftedisNew
- if true the entry is new to the display, false otherwiseprotected void onClick(java.awt.event.MouseEvent event, BindingEntry entry, BindingEntry.Field field)
onClick
in class BindingPanel
event
- fired mouse event that triggered method callentry
- entry on which the click landedfield
- field of entry on which the click landed, null if not a
recognized fieldpublic void setEditable(boolean editable)
editable
- if true shortcut fields may be selected to have their
values changed, otherwise user input and calls to the
setSelected method are ignoredpublic BindingChooser.IndentStyle getIndentStyle()
public void setIndentStyle(BindingChooser.IndentStyle style)
style
- type of content displayed in entry's indent fieldpublic boolean isBindingSelected()
public BindingEntry getSelected()
public void setSelected(BindingEntry entry)
entry
- binding entry awaiting input for its shortcut fieldjava.lang.IllegalArgumentException
- if entry is not contained in chooserpublic BindingAdaptor makeAdaptor()
public BindingEntry makeLabels()
void doInput(javax.swing.KeyStroke input)
input
- keystroke input for selected entrypublic void validate()
validate
in class java.awt.Container
public static java.lang.String getReadableConstant(java.lang.String input)
input
- string to be converted
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.