|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| 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
net.java.sip.communicator.util.swing.TransparentPanel
net.java.sip.communicator.plugin.keybindingchooser.chooser.BindingPanel
net.java.sip.communicator.plugin.keybindingchooser.chooser.BindingChooser
public class BindingChooser
Implementation of the BindingPanel that provides configuring functionality
for the keystroke component of key bindings. Methods provide a means of
producing predefined, sweeping changes in the display. This defaults to a
light blue color scheme with an index indent style.
Though display elements are still accessible, manual changes are not
particularly recommended unless automated changes to the appearance (the
indentation style and color scheme) are disabled since they may be
unexpectedly reverted or clash any alterations made.
| Nested Class Summary | |
|---|---|
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). |
| 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 |
|---|
| 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 | |
|---|---|
BindingChooser()
|
|
| Method Summary | |
|---|---|
(package private) void |
doInput(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 String |
getReadableConstant(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(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. |
void |
setSelectedText(String message)
Sets the message of the selected shortcut field when awaiting user input. |
static LinkedHashMap<KeyStroke,String> |
showDialog(Component parent,
BindingChooser display,
String dialogTitle,
boolean showLabels,
BindingAdaptor adaptor)
Displays a dialog allowing the user to redefine the keystroke component of key bindings. |
static LinkedHashMap<KeyStroke,String> |
showDialog(Component parent,
Map<KeyStroke,String> bindings)
Displays a dialog allowing the user to redefine the keystroke component of key bindings. |
void |
validate()
|
| Methods inherited from class net.java.sip.communicator.plugin.keybindingchooser.chooser.BindingPanel |
|---|
clearBindings, contains, getBinding, getBindingCount, getBindingIndex, getBindingInputMap, getBindingMap, getBindings, putAllBindings, putBinding, putBinding, putBinding, putBinding, removeBinding, removeBinding |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BindingChooser()
| Method Detail |
|---|
public static LinkedHashMap<KeyStroke,String> showDialog(Component parent,
Map<KeyStroke,String> bindings)
parent - frame to which to apply modal property and center within
(centers within screen if null)bindings - initial mapping of keystrokes to their actions
public void putAllBindings(KeybindingSet set)
set - mapping between keystrokes and actions to be added
public static LinkedHashMap<KeyStroke,String> showDialog(Component parent,
BindingChooser display,
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 functionality
protected void onUpdate(int index,
BindingEntry entry,
boolean isNew)
onUpdate in class BindingPanelindex - newly assigned index of entryentry - entry that has been added or shiftedisNew - if true the entry is new to the display, false otherwise
protected void onClick(MouseEvent event,
BindingEntry entry,
BindingEntry.Field field)
onClick in class BindingPanelevent - 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 void setSelectedText(String message)
message - prompt for user inputpublic boolean isBindingSelected()
public BindingEntry getSelected()
public void setSelected(BindingEntry entry)
entry - binding entry awaiting input for its shortcut field
IllegalArgumentException - if entry is not contained in chooserpublic BindingAdaptor makeAdaptor()
public BindingEntry makeLabels()
void doInput(KeyStroke input)
input - keystroke input for selected entrypublic void validate()
validate in class Containerpublic static String getReadableConstant(String input)
input - string to be converted
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||