|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--de.hunsicker.swing.util.PopupSupport
Helper class which adds popup menu support for text components.
| Constructor Summary | |
PopupSupport()
Creates a new PopupSuppport object. |
|
PopupSupport(boolean enable)
Creates a new PopupSuppport object. |
|
PopupSupport(boolean enable,
java.util.List supported)
Creates a new PopupSuppport object. |
|
PopupSupport(java.util.List supported)
Creates a new PopupSuppport object. |
|
| Method Summary | |
void |
addSupport(javax.swing.text.JTextComponent component)
Adds a default popup menu for the given component. |
protected javax.swing.JPopupMenu |
getPopup(javax.swing.text.JTextComponent component)
Returns the popup menu for the given component. |
protected boolean |
isClipboardEmpty()
Indicates whether the system clipboard contains text content. |
protected boolean |
isTextSelected(int start,
int end)
Indicates whether a text selection exists. |
void |
setEnabled(boolean enable)
Sets the status of the popup menu support. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PopupSupport()
javax.swing hierachy.
public PopupSupport(java.util.List supported)
supported - supported package hierarchies or classes.
public PopupSupport(boolean enable,
java.util.List supported)
enable - if true the popup menu support will be initially
enabled.supported - supported package hierarchies or classes.public PopupSupport(boolean enable)
enable - if true the popup menu support will be initially
enabled.| Method Detail |
public void setEnabled(boolean enable)
enable - if true the popup menu support will be enabled.public void addSupport(javax.swing.text.JTextComponent component)
component - component to add the popup menu to.protected boolean isClipboardEmpty()
true if the system clipboard contains no text content.protected javax.swing.JPopupMenu getPopup(javax.swing.text.JTextComponent component)
This popup menu consists of five actions:
+------------+ | Copy | | Cut | | Paste | | Delete | +------------+ | Select all | +------------+
component - component to return the popup menu for.
protected boolean isTextSelected(int start,
int end)
start - start offset of the text's selection start.end - end offset of the text's selection end.
true if start > end.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||