Class JOptionsEditionByMousePopupMenu
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPopupMenu
org.gvsig.gui.beans.editionpopupmenu.JOptionsEditionByMousePopupMenu
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,MenuElement
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)).
- Author:
- Pablo Piqueras Bartolomé (p_queras@hotmail.com)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPopupMenu
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.SeparatorNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final intstatic final intstatic final StringFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns if the copy option item is enabled or notbooleanReturns if the cut option item is enabled or notbooleanReturns if the delete option item is enabled or notbooleanReturns if the select all option item is enabled or notbooleanReturns if the paste option item is enabled or notbooleanReturns if the redo option item is enabled or notbooleanReturns if the undo option item is enabled or notvoidsetEnabledAllOptions(boolean b) Enables or disables all option itemsvoidsetEnabledCopyOption(boolean b) Enables or disables the copy option itemvoidsetEnabledCutOption(boolean b) Enables or disables the cut option itemvoidsetEnabledDeleteOption(boolean b) Enables or disables the delete option itemvoidsetEnabledPasteOption(boolean b) Enables or disables the paste option itemvoidsetEnabledRedoOption(boolean b) Enables or disables the redo option itemvoidsetEnabledSelectAllOption(boolean b) Enables or disables the select all option itemvoidsetEnabledUndoOption(boolean b) Enables or disables the undo option itemvoidsetVisible(boolean b) Methods inherited from class javax.swing.JPopupMenu
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, updateUIMethods inherited from class javax.swing.JComponent
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, updateMethods inherited from class java.awt.Container
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, validateTreeMethods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
DEFAULT
public static final int DEFAULT- See Also:
-
UNDO
public static final int UNDO- See Also:
-
REDO
public static final int REDO- See Also:
-
CUT
public static final int CUT- See Also:
-
COPY
public static final int COPY- See Also:
-
PASTE
public static final int PASTE- See Also:
-
DELETE
public static final int DELETE- See Also:
-
SELECT_ALL
public static final int SELECT_ALL- See Also:
-
VISIBILITY
public static final int VISIBILITY- See Also:
-
SELECTEDOPTION
- See Also:
-
VISIBILITYCHANGED
- See Also:
-
-
Constructor Details
-
JOptionsEditionByMousePopupMenu
public JOptionsEditionByMousePopupMenu()Default constructor
-
-
Method Details
-
setEnabledUndoOption
public void setEnabledUndoOption(boolean b) Enables or disables the undo option item- Parameters:
b- Value true or false
-
isEnabledUndoOption
public boolean isEnabledUndoOption()Returns if the undo option item is enabled or not- Returns:
- Value true or false
-
setEnabledRedoOption
public void setEnabledRedoOption(boolean b) Enables or disables the redo option item- Parameters:
b- Value true or false
-
isEnabledRedoOption
public boolean isEnabledRedoOption()Returns if the redo option item is enabled or not- Returns:
- Value true or false
-
setEnabledCutOption
public void setEnabledCutOption(boolean b) Enables or disables the cut option item- Parameters:
b- Value true or false
-
isEnabledCutOption
public boolean isEnabledCutOption()Returns if the cut option item is enabled or not- Returns:
- Value true or false
-
setEnabledCopyOption
public void setEnabledCopyOption(boolean b) Enables or disables the copy option item- Parameters:
b- Value true or false
-
isEnabledCopyOption
public boolean isEnabledCopyOption()Returns if the copy option item is enabled or not- Returns:
- Value true or false
-
setEnabledPasteOption
public void setEnabledPasteOption(boolean b) Enables or disables the paste option item- Parameters:
b- Value true or false
-
isEnabledPasteOption
public boolean isEnabledPasteOption()Returns if the paste option item is enabled or not- Returns:
- Value true or false
-
setEnabledDeleteOption
public void setEnabledDeleteOption(boolean b) Enables or disables the delete option item- Parameters:
b- Value true or false
-
isEnabledDeleteOption
public boolean isEnabledDeleteOption()Returns if the delete option item is enabled or not- Returns:
- Value true or false
-
setEnabledSelectAllOption
public void setEnabledSelectAllOption(boolean b) Enables or disables the select all option item- Parameters:
b- Value true or false
-
isEnabledelectAllOption
public boolean isEnabledelectAllOption()Returns if the select all option item is enabled or not- Returns:
- Value true or false
-
setEnabledAllOptions
public void setEnabledAllOptions(boolean b) Enables or disables all option items- Parameters:
b- Value true or false
-
setVisible
public void setVisible(boolean b) - Overrides:
setVisiblein classJPopupMenu
-