public class JOptionsEditionByMousePopupMenu
extends javax.swing.JPopupMenu
implements java.io.Serializable
This class is a JPopupMenu that can be used with another component.
The items showed in this menu are for editing: UNDO, REDO, CUT, COPY, PASTE, DELETE and SELECT ALL.
When the user clicks on a item, this Component fires a property change event that its value allows identify the item clicked.
(The icons used are from the open-source 'Tango Icon Library' project: (http://tango.freedesktop.org/Tango_Icon_Library)).
javax.swing.JPopupMenu.AccessibleJPopupMenu, javax.swing.JPopupMenu.Separator
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
COPY |
static int |
CUT |
static int |
DEFAULT |
static int |
DELETE |
static int |
PASTE |
static int |
REDO |
static int |
SELECT_ALL |
static java.lang.String |
SELECTEDOPTION |
static int |
UNDO |
static int |
VISIBILITY |
static java.lang.String |
VISIBILITYCHANGED |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
JOptionsEditionByMousePopupMenu()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
isEnabledCopyOption()
Returns if the copy option item is enabled or not
|
boolean |
isEnabledCutOption()
Returns if the cut option item is enabled or not
|
boolean |
isEnabledDeleteOption()
Returns if the delete option item is enabled or not
|
boolean |
isEnabledelectAllOption()
Returns if the select all option item is enabled or not
|
boolean |
isEnabledPasteOption()
Returns if the paste option item is enabled or not
|
boolean |
isEnabledRedoOption()
Returns if the redo option item is enabled or not
|
boolean |
isEnabledUndoOption()
Returns if the undo option item is enabled or not
|
void |
setEnabledAllOptions(boolean b)
Enables or disables all option items
|
void |
setEnabledCopyOption(boolean b)
Enables or disables the copy option item
|
void |
setEnabledCutOption(boolean b)
Enables or disables the cut option item
|
void |
setEnabledDeleteOption(boolean b)
Enables or disables the delete option item
|
void |
setEnabledPasteOption(boolean b)
Enables or disables the paste option item
|
void |
setEnabledRedoOption(boolean b)
Enables or disables the redo option item
|
void |
setEnabledSelectAllOption(boolean b)
Enables or disables the select all option item
|
void |
setEnabledUndoOption(boolean b)
Enables or disables the undo option item
|
void |
setVisible(boolean b) |
add, add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, show, 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, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, 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, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, 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, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int DEFAULT
public static final int UNDO
public static final int REDO
public static final int CUT
public static final int COPY
public static final int PASTE
public static final int DELETE
public static final int SELECT_ALL
public static final int VISIBILITY
public static final java.lang.String SELECTEDOPTION
public static final java.lang.String VISIBILITYCHANGED
public JOptionsEditionByMousePopupMenu()
public void setEnabledUndoOption(boolean b)
b
- Value true or falsepublic boolean isEnabledUndoOption()
public void setEnabledRedoOption(boolean b)
b
- Value true or falsepublic boolean isEnabledRedoOption()
public void setEnabledCutOption(boolean b)
b
- Value true or falsepublic boolean isEnabledCutOption()
public void setEnabledCopyOption(boolean b)
b
- Value true or falsepublic boolean isEnabledCopyOption()
public void setEnabledPasteOption(boolean b)
b
- Value true or falsepublic boolean isEnabledPasteOption()
public void setEnabledDeleteOption(boolean b)
b
- Value true or falsepublic boolean isEnabledDeleteOption()
public void setEnabledSelectAllOption(boolean b)
b
- Value true or falsepublic boolean isEnabledelectAllOption()
public void setEnabledAllOptions(boolean b)
b
- Value true or falsepublic void setVisible(boolean b)
setVisible
in class javax.swing.JPopupMenu