|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.swing.DesktopFrameSelector
General keyboard-based sector for internal frames of a desktop pane.
This class emulates the keyboard-based frame selection dialogs of the usual desktop environments.
It is attached to a JDesktopPane
and will, as soon as its activation key stroke is pressed,
show a small popup menu with all internal frames' names shown. If one of the frames' names is clicked,
that frame is made active.
Almost always you will only have one instance of DesktopFrameSelector in your program. If you do not plan to make the key stroke configurable, you can instanciate the selector once and then forget about it.
Nested Class Summary | |
private static class |
DesktopFrameSelector.FrameAction
Action for the menu items of the popup menu. |
Field Summary | |
private javax.swing.JDesktopPane |
desktoppane
|
private javax.swing.KeyStroke |
keystroke
|
private java.lang.Object |
oldaction
|
private SelectableJPopupMenu |
pm
|
Constructor Summary | |
DesktopFrameSelector(javax.swing.JDesktopPane desktoppanex)
Initialize a frame selector for a desktop pane. |
|
DesktopFrameSelector(javax.swing.JDesktopPane desktoppanex,
javax.swing.KeyStroke keystrokex)
Initialize a frame selector for a desktop pane and with an activation key stroke. |
Method Summary | |
private java.util.List |
getFrameActions()
Return the list of frame actions needed for the frames in the desktop pane. |
void |
populateJMenu(javax.swing.JMenu jm)
Populates the given JMenu with the frame action entries. |
void |
setKeyStroke(javax.swing.KeyStroke keystrokex)
Set or change the activation key stroke for the selector. |
private void |
showPopupMenu()
Show the popup menu with the selection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private javax.swing.JDesktopPane desktoppane
private SelectableJPopupMenu pm
private javax.swing.KeyStroke keystroke
private java.lang.Object oldaction
Constructor Detail |
public DesktopFrameSelector(javax.swing.JDesktopPane desktoppanex, javax.swing.KeyStroke keystrokex)
desktoppanex
- Desktop pane to prepare the selection forkeystrokex
- Key stroke to activate the selector withpublic DesktopFrameSelector(javax.swing.JDesktopPane desktoppanex)
setKeyStroke(KeyStroke)
has been called and the activation key stroke has been set. Use this constructor if you want to
define the key stroke independently from the instance creation.
desktoppanex
- Desktop pane to prepare the selection forMethod Detail |
public void setKeyStroke(javax.swing.KeyStroke keystrokex)
keystrokex
- Activation key stroke or null if the selector should be not activateableprivate java.util.List getFrameActions()
private void showPopupMenu()
SelectableJPopupMenu
:
public void populateJMenu(javax.swing.JMenu jm)
jm
- Menu to put actions in. All current entries are removed.
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |