JClass DesktopViews 6.3.0 API
Documentation

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

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPopupMenu
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.Separator
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  String[] commands
           
static int DEFAULT_LONG_POPUPMENU_LIST
          default long popup menu list
static int DEFAULT_SHORT_POPUPMENU_LIST
          default short popup menu list
protected  com.klg.jclass.higrid.HiGrid grid
           
protected  Vector insertList
           
protected static int NO_RECORDS_END_INDEX
           
protected static int NO_RECORDS_START_INDEX
           
static int POPUP_APPEND
           
static int POPUP_CANCEL
           
static int POPUP_CANCEL_ALL
           
static int POPUP_CANCEL_CURRENT
           
static int POPUP_CANCEL_SELECTED
           
static int POPUP_COLLAPSE_PARENT
           
static int POPUP_DELETE
           
static int POPUP_DELETE_CURRENT
           
static int POPUP_DELETE_SELECTED
           
static int POPUP_INSERT
          List of enums for the default edit popup menu.
static int POPUP_MOVE_TO_PARENT
           
static int POPUP_MOVE_TO_RECORD
           
static int POPUP_MOVE_TO_RECORD_FIRST
           
static int POPUP_MOVE_TO_RECORD_LAST
           
static int POPUP_MOVE_TO_RECORD_NEXT
           
static int POPUP_MOVE_TO_RECORD_PREVIOUS
           
static int POPUP_MOVE_TO_TABLE_RECORD
           
static int POPUP_MOVE_TO_TABLE_RECORD_FIRST
           
static int POPUP_MOVE_TO_TABLE_RECORD_LAST
           
static int POPUP_MOVE_TO_TABLE_RECORD_NEXT
           
static int POPUP_MOVE_TO_TABLE_RECORD_PREVIOUS
           
static int POPUP_PRINT
           
static int POPUP_PRINT_AS_DISPLAYED
           
static int POPUP_PRINT_AS_EXPANDED
           
static int POPUP_PRINT_EXPAND_ALL
           
static int POPUP_PRINT_PREVIEW
           
static int POPUP_PRINT_PREVIEW_AS_DISPLAYED
           
static int POPUP_PRINT_PREVIEW_AS_EXPANDED
           
static int POPUP_PRINT_PREVIEW_EXPAND_ALL
           
static int POPUP_REQUERY
           
static int POPUP_REQUERY_ALL
           
static int POPUP_REQUERY_RECORD
           
static int POPUP_REQUERY_RECORD_AND_DETAILS
           
static int POPUP_REQUERY_SELECTED
           
static int POPUP_REQUERY_SELECTED_AND_DETAILS
           
static int POPUP_REQUERY_TABLE
           
static int POPUP_SELECT
           
static int POPUP_SELECT_ALL
           
static int POPUP_SELECT_ALL_IN_SAME_LEVEL
           
static int POPUP_SELECT_ALL_IN_SAME_TABLE
           
static int POPUP_SELECT_CURRENT
           
static int POPUP_TIPS
           
static int POPUP_TIPS_KEYBOARD
           
static int POPUP_TIPS_MENU
           
static int POPUP_TIPS_MOUSE
           
static int POPUP_UPDATE
           
static int POPUP_UPDATE_ALL
           
static int POPUP_UPDATE_CURRENT
           
static int POPUP_UPDATE_SELECTED
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
EditPopupMenu(com.klg.jclass.higrid.HiGrid grid)
          Default Constructor
 
Method Summary
 void actionPerformed(ActionEvent event)
           
protected  void buildDynamicSubMenu(JMenuItem insertMenu, String command)
          Creates a submenu based on the passed command (currently insert/append)
protected  Rectangle computePopupBounds(int x, int y, int width, int height)
           
 JMenuItem createMenu(int index)
          Create a menu component from the default popup menu list.
 JMenuItem createMenuItem(int index)
          Create a menu item component from the default popup menu list.
 void dispose()
           
 boolean enableMenuItem(Object menu, String command, boolean enable)
          Enable or disable a menu item in the popup menu.
protected  int findMenuIndex(MenuElement[] subElements, int command)
          Retrieves the position of the specified command from the subElements.
 String getCommand(int index)
          Retrieves the specified command string.
 void performAction(ActionEvent event)
          Handles a popup menu action event.
 void performCommand(int command)
          Execute one of the popup menu's commands.
 void performCommand(String command)
          Execute one of the popup menu's commands.
 void setDefaultMenuList(int list)
          Sets the popup menu to the indicated default list.
 void show(int x, int y)
          Show the popup menu.
protected  void showTips(String title, String text)
          Display the HiGrid tips window.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

EditPopupMenu

public EditPopupMenu(com.klg.jclass.higrid.HiGrid grid)
Default Constructor

Method Detail

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.

Copyright © 2004 Quest Software Inc..
All rights reserved.