com.klg.jclass.higrid
Class EditPopupMenu
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPopupMenu
|
+--com.klg.jclass.higrid.EditPopupMenu
- All Implemented Interfaces:
- Accessible, ActionListener, EventListener, ImageObserver, MenuContainer, MenuElement, Serializable
- public class EditPopupMenu
- extends JPopupMenu
- implements ActionListener
The EditPopupMenu class is the default popup menu for runtime editing
of HiGrid.
- See Also:
- Serialized Form
Constructor Summary |
EditPopupMenu(com.klg.jclass.higrid.HiGrid grid)
Default Constructor |
Methods inherited from class javax.swing.JPopupMenu |
add, add, add, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
DEFAULT_SHORT_POPUPMENU_LIST
public static final int DEFAULT_SHORT_POPUPMENU_LIST
- default short popup menu list
- See Also:
- Constant Field Values
DEFAULT_LONG_POPUPMENU_LIST
public static final int DEFAULT_LONG_POPUPMENU_LIST
- default long popup menu list
- See Also:
- Constant Field Values
POPUP_INSERT
public static final int POPUP_INSERT
- List of enums for the default edit popup menu.
- See Also:
- Constant Field Values
POPUP_APPEND
public static final int POPUP_APPEND
- See Also:
- Constant Field Values
POPUP_DELETE
public static final int POPUP_DELETE
- See Also:
- Constant Field Values
POPUP_DELETE_CURRENT
public static final int POPUP_DELETE_CURRENT
- See Also:
- Constant Field Values
POPUP_DELETE_SELECTED
public static final int POPUP_DELETE_SELECTED
- See Also:
- Constant Field Values
POPUP_CANCEL
public static final int POPUP_CANCEL
- See Also:
- Constant Field Values
POPUP_CANCEL_CURRENT
public static final int POPUP_CANCEL_CURRENT
- See Also:
- Constant Field Values
POPUP_CANCEL_SELECTED
public static final int POPUP_CANCEL_SELECTED
- See Also:
- Constant Field Values
POPUP_CANCEL_ALL
public static final int POPUP_CANCEL_ALL
- See Also:
- Constant Field Values
POPUP_REQUERY
public static final int POPUP_REQUERY
- See Also:
- Constant Field Values
POPUP_REQUERY_RECORD
public static final int POPUP_REQUERY_RECORD
- See Also:
- Constant Field Values
POPUP_REQUERY_RECORD_AND_DETAILS
public static final int POPUP_REQUERY_RECORD_AND_DETAILS
- See Also:
- Constant Field Values
POPUP_REQUERY_SELECTED
public static final int POPUP_REQUERY_SELECTED
- See Also:
- Constant Field Values
POPUP_REQUERY_SELECTED_AND_DETAILS
public static final int POPUP_REQUERY_SELECTED_AND_DETAILS
- See Also:
- Constant Field Values
POPUP_REQUERY_TABLE
public static final int POPUP_REQUERY_TABLE
- See Also:
- Constant Field Values
POPUP_REQUERY_ALL
public static final int POPUP_REQUERY_ALL
- See Also:
- Constant Field Values
POPUP_UPDATE
public static final int POPUP_UPDATE
- See Also:
- Constant Field Values
POPUP_UPDATE_CURRENT
public static final int POPUP_UPDATE_CURRENT
- See Also:
- Constant Field Values
POPUP_UPDATE_SELECTED
public static final int POPUP_UPDATE_SELECTED
- See Also:
- Constant Field Values
POPUP_UPDATE_ALL
public static final int POPUP_UPDATE_ALL
- See Also:
- Constant Field Values
POPUP_SELECT
public static final int POPUP_SELECT
- See Also:
- Constant Field Values
POPUP_SELECT_CURRENT
public static final int POPUP_SELECT_CURRENT
- See Also:
- Constant Field Values
POPUP_SELECT_ALL_IN_SAME_LEVEL
public static final int POPUP_SELECT_ALL_IN_SAME_LEVEL
- See Also:
- Constant Field Values
POPUP_SELECT_ALL_IN_SAME_TABLE
public static final int POPUP_SELECT_ALL_IN_SAME_TABLE
- See Also:
- Constant Field Values
POPUP_SELECT_ALL
public static final int POPUP_SELECT_ALL
- See Also:
- Constant Field Values
POPUP_MOVE_TO_RECORD
public static final int POPUP_MOVE_TO_RECORD
- See Also:
- Constant Field Values
POPUP_MOVE_TO_RECORD_FIRST
public static final int POPUP_MOVE_TO_RECORD_FIRST
- See Also:
- Constant Field Values
POPUP_MOVE_TO_RECORD_PREVIOUS
public static final int POPUP_MOVE_TO_RECORD_PREVIOUS
- See Also:
- Constant Field Values
POPUP_MOVE_TO_RECORD_NEXT
public static final int POPUP_MOVE_TO_RECORD_NEXT
- See Also:
- Constant Field Values
POPUP_MOVE_TO_RECORD_LAST
public static final int POPUP_MOVE_TO_RECORD_LAST
- See Also:
- Constant Field Values
POPUP_MOVE_TO_TABLE_RECORD
public static final int POPUP_MOVE_TO_TABLE_RECORD
- See Also:
- Constant Field Values
POPUP_MOVE_TO_TABLE_RECORD_FIRST
public static final int POPUP_MOVE_TO_TABLE_RECORD_FIRST
- See Also:
- Constant Field Values
POPUP_MOVE_TO_TABLE_RECORD_PREVIOUS
public static final int POPUP_MOVE_TO_TABLE_RECORD_PREVIOUS
- See Also:
- Constant Field Values
POPUP_MOVE_TO_TABLE_RECORD_NEXT
public static final int POPUP_MOVE_TO_TABLE_RECORD_NEXT
- See Also:
- Constant Field Values
POPUP_MOVE_TO_TABLE_RECORD_LAST
public static final int POPUP_MOVE_TO_TABLE_RECORD_LAST
- See Also:
- Constant Field Values
POPUP_MOVE_TO_PARENT
public static final int POPUP_MOVE_TO_PARENT
- See Also:
- Constant Field Values
POPUP_COLLAPSE_PARENT
public static final int POPUP_COLLAPSE_PARENT
- See Also:
- Constant Field Values
POPUP_PRINT
public static final int POPUP_PRINT
- See Also:
- Constant Field Values
POPUP_PRINT_AS_DISPLAYED
public static final int POPUP_PRINT_AS_DISPLAYED
- See Also:
- Constant Field Values
POPUP_PRINT_AS_EXPANDED
public static final int POPUP_PRINT_AS_EXPANDED
- See Also:
- Constant Field Values
POPUP_PRINT_EXPAND_ALL
public static final int POPUP_PRINT_EXPAND_ALL
- See Also:
- Constant Field Values
POPUP_PRINT_PREVIEW
public static final int POPUP_PRINT_PREVIEW
- See Also:
- Constant Field Values
POPUP_PRINT_PREVIEW_AS_DISPLAYED
public static final int POPUP_PRINT_PREVIEW_AS_DISPLAYED
- See Also:
- Constant Field Values
POPUP_PRINT_PREVIEW_AS_EXPANDED
public static final int POPUP_PRINT_PREVIEW_AS_EXPANDED
- See Also:
- Constant Field Values
POPUP_PRINT_PREVIEW_EXPAND_ALL
public static final int POPUP_PRINT_PREVIEW_EXPAND_ALL
- See Also:
- Constant Field Values
POPUP_TIPS
public static final int POPUP_TIPS
- See Also:
- Constant Field Values
POPUP_TIPS_KEYBOARD
public static final int POPUP_TIPS_KEYBOARD
- See Also:
- Constant Field Values
POPUP_TIPS_MOUSE
public static final int POPUP_TIPS_MOUSE
- See Also:
- Constant Field Values
POPUP_TIPS_MENU
public static final int POPUP_TIPS_MENU
- See Also:
- Constant Field Values
NO_RECORDS_START_INDEX
protected static final int NO_RECORDS_START_INDEX
- See Also:
- Constant Field Values
NO_RECORDS_END_INDEX
protected static final int NO_RECORDS_END_INDEX
- See Also:
- Constant Field Values
commands
protected String[] commands
insertList
protected Vector insertList
grid
protected com.klg.jclass.higrid.HiGrid grid
EditPopupMenu
public EditPopupMenu(com.klg.jclass.higrid.HiGrid grid)
- Default Constructor
dispose
public void dispose()
actionPerformed
public void actionPerformed(ActionEvent event)
- Specified by:
actionPerformed
in interface ActionListener
setDefaultMenuList
public void setDefaultMenuList(int list)
- Sets the popup menu to the indicated default list.
- Parameters:
list
- The default list indication.
createMenu
public JMenuItem createMenu(int index)
- Create a menu component from the default popup menu list.
The default label and command text are used.
- Parameters:
index
- The popup menu enum value.
- Returns:
- The created menu.
createMenuItem
public JMenuItem createMenuItem(int index)
- Create a menu item component from the default popup menu list.
The default label and command text are used and HiGrid
will be the action listener to this menu item.
- Parameters:
index
- The popup menu item enum value.
- Returns:
- The created menu item.
getCommand
public String getCommand(int index)
- Retrieves the specified command string.
- Parameters:
index
- The index for the command string.
- Returns:
- The command string.
findMenuIndex
protected int findMenuIndex(MenuElement[] subElements,
int command)
- Retrieves the position of the specified command from the subElements.
- Parameters:
subElements
- The submenu to search.command
- The command id.
- Returns:
- The index of the command id.
buildDynamicSubMenu
protected void buildDynamicSubMenu(JMenuItem insertMenu,
String command)
- Creates a submenu based on the passed command (currently insert/append)
- Parameters:
insertMenu
- The submenu to modify.command
- The command string.
show
public void show(int x,
int y)
- Show the popup menu.
- Parameters:
x
- The x position of the cursor.y
- The y position of the cursor.
computePopupBounds
protected Rectangle computePopupBounds(int x,
int y,
int width,
int height)
enableMenuItem
public boolean enableMenuItem(Object menu,
String command,
boolean enable)
- Enable or disable a menu item in the popup menu.
- Parameters:
menu
- The menu level.command
- The command string.enable
- True if enable else false.
- Returns:
- True if menu item is found and is enabled or is disabled.
performAction
public void performAction(ActionEvent event)
- Handles a popup menu action event.
- Parameters:
event
- The action event.
performCommand
public void performCommand(int command)
- Execute one of the popup menu's commands.
- Parameters:
command
- The POPUP_ command to execute.
showTips
protected void showTips(String title,
String text)
- Display the HiGrid tips window.
- Parameters:
title
- The frame window's title.text
- The HTML text to display in the window.
performCommand
public void performCommand(String command)
- Execute one of the popup menu's commands.
- Parameters:
command
- The command to execute.