public class MenuItem extends JMenuItem implements FormComponent, IdentifiedElement, SecureElement, StatusComponent, HasPreferenceComponent, IDynamicItem, IParameterItem
JMenuItem.AccessibleJMenuItemAbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListenerJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected String |
attribute
The menu item attribute.
|
protected boolean |
dialog
True when the form is opened in a dialog
|
protected boolean |
dynamic |
protected String |
formManagerName
The name of the FormManager
|
protected String |
formName
The form name to show
|
static String |
MENU_ACCELERATOR
The key of a menu accelerator.
|
protected boolean |
restricted
The condition of restricted.
|
protected String |
shortcut
The reference to shortcut.
|
protected String |
statusText
The status text reference.
|
protected String |
text
The menu text to show.
|
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTYaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDEBUG_LANGUAGEDESACTIVATE_COMPONENT_BY_PERMISSION_TIPBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WESTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
MenuItem(Hashtable parameters)
The class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize() |
void |
free()
Removes all listener menu items.
|
protected String |
getAcceleratorPreferencesKey()
Gets the accelerator preference key.
|
Object |
getAttribute()
Gets the object attribute.
|
Object |
getConstraints(LayoutManager layout)
Description method to return the
constraints component to
place correctly in parent container. |
String |
getFormManagerName() |
String |
getFormName() |
String |
getStatusText()
Gets the
StatusText variable. |
Vector |
getTextsToTranslate()
Adds the attribute parameter to the vector to translate.
|
void |
init(Hashtable parameters)
Initializes parameters.
|
void |
initPermissions()
Initializes the permissions.
|
void |
initPreferences(ApplicationPreferences aPrefs,
String user)
Initializes the application preferences.
|
boolean |
isDialog() |
boolean |
isDynamic() |
boolean |
isRestricted()
Gets the restricted condition.
|
void |
setAccelerator(KeyStroke ks) |
void |
setComponentLocale(Locale l)
Sets the component locale.
|
void |
setDialog(boolean dialog) |
void |
setDynamic(boolean dynamic) |
void |
setEnabled(boolean enabled)
Description method to set enabled or not the component according the
boolean condition in parameter.
|
void |
setFormName(String formName) |
void |
setResourceBundle(ResourceBundle resources)
Sets the language resource bundle.
|
void |
setVisible(boolean vis)
Description method to set visible or not the component according the
boolean condition in parameter.
|
actionPropertyChanged, addMenuDragMouseListener, addMenuKeyListener, configurePropertiesFromAction, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getAccessibleContext, getComponent, getMenuDragMouseListeners, getMenuKeyListeners, getSubElements, getUIClassID, init, isArmed, menuSelectionChanged, paramString, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setArmed, setModel, setUI, updateUIaddActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPositionaddAncestorListener, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTreeaction, 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, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, 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, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitisEnabledpublic static final String MENU_ACCELERATOR
protected String statusText
protected String attribute
protected String text
protected String shortcut
protected String formName
protected boolean dialog
protected String formManagerName
protected boolean dynamic
protected boolean restricted
public MenuItem(Hashtable parameters)
parameters - The hashtable with parameterspublic Object getConstraints(LayoutManager layout)
FormComponentconstraints component to
place correctly in parent container.
getConstraints in interface FormComponentlayout - the parent container referencepublic void init(Hashtable parameters)
init in interface FormComponentparameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| attr | yes | The attribute. | ||
| status | attr | no | The text showed in status bar application. MainApplication translates this text according to the bundle. | |
| icon | no | Specifies the file name of button icon. Complete or relative path from Ontimize class location, for example, if an icon is stored in com/ontimize/gui/images/item.gif, it would be correct to specify the path like: 'item.gif'. If not stored in any baseImage bundle, write the complete route | ||
| shortcut | no | The reference to shortcut (for example: 'ctrl + C') | ||
| mnemonic | no | Mnemonic letter. NOTE: This parameter has not been Internationalized yet | ||
| form | no | The form name to be opened | ||
| showdialog | yes/no | If the 'form' parameter is established the default values is 'yes'.Otherwise the default value is 'no' | no | Established whether the form is opened in a dialog |
| formmanager | no | no | The name of FormManager to show. If this parameter isn't established the value is taking from 'attr' parameter |
public Object getAttribute()
IdentifiedElementgetAttribute in interface IdentifiedElementpublic Vector getTextsToTranslate()
getTextsToTranslate in interface Internationalizationpublic void setResourceBundle(ResourceBundle resources)
InternationalizationsetResourceBundle in interface Internationalizationresources - the new language bundle.public void setComponentLocale(Locale l)
setComponentLocale in interface Internationalizationl - the locale to setpublic void free()
protected void finalize()
throws Throwable
public void setVisible(boolean vis)
FormComponentsetVisible in interface FormComponentsetVisible in class JComponentvis - the visibility conditionpublic void setEnabled(boolean enabled)
FormComponentsetEnabled in interface FormComponentsetEnabled in class JMenuItemenabled - the enabled conditionpublic void initPermissions()
initPermissions in interface SecureElementpublic String getStatusText()
StatusText variable.
getStatusText in interface StatusComponentpublic boolean isRestricted()
isRestricted in interface SecureElementrestricted variable value.public void setAccelerator(KeyStroke ks)
setAccelerator in class JMenuItempublic void initPreferences(ApplicationPreferences aPrefs, String user)
initPreferences in interface HasPreferenceComponentaPrefs - the application preferencesuser - the user referenceprotected String getAcceleratorPreferencesKey()
menu_accelerator key with attribute.public String getFormName()
getFormName in interface IParameterItempublic void setFormName(String formName)
public boolean isDialog()
isDialog in interface IParameterItempublic void setDialog(boolean dialog)
public String getFormManagerName()
getFormManagerName in interface IParameterItempublic boolean isDynamic()
isDynamic in interface IDynamicItempublic void setDynamic(boolean dynamic)
Copyright © 2016 Imatia Innovation S.L.. All rights reserved.