public class IlvMenuCompletion extends CompoundEdit
IlvMenuCompletion
class.
A menu completion is a Swing undoable edit. Its completeMenus(java.lang.Object[])
method brings modifications to a set of menu bars and toolbars, while its CompoundEdit.undo()
method restores their state before they were modified. The redo()
method reapplies the modifications to the menu bar and toolbars.
A menu completion edit is a compound edit that performs a set of elementary menu edits. Each of these edits can perform one of the following tasks:
edits
RedoName, UndoName
Constructor and Description |
---|
IlvMenuCompletion()
Constructs a new
IlvMenuCompletion . |
Modifier and Type | Method and Description |
---|---|
boolean |
canRedo()
Determines whether the menu completion can complete the menu bars and
toolbars again.
|
boolean |
canUndo()
Determines whether the menu completion can remove the changes its has
made on menu bars and toolbars when invoking the method
completeMenus(java.lang.Object[]) . |
boolean |
completeMenus(Object[] components)
Completes the specified menu bars and toolbars.
|
IlvApplication |
getApplication()
Gets the application associated with this menu completion.
|
String |
getSettingsName()
Returns the name of the the settings root node that defines
the menu completion into settings.
|
String |
getSettingsPath()
Returns the settings path that locates the root settings node defining
the menu completion into settings.
|
boolean |
readSettings(IlvSettings settings)
Reads the definition of the menu completion from the specified settings.
|
boolean |
readSettings(IlvSettingsElement element)
Reads the definition of the menu completion into the specified settings
element.
|
void |
redo()
Reapplies the menu completions.
|
void |
setApplication(IlvApplication application)
Sets the application to associate with this menu completion.
|
void |
setSettingsName(String name)
Sets the name of the settings node that defines the menu completion
into settings.
|
void |
setSettingsPath(String settingsPath)
Sets the settings path that locates the root settings node defining
the menu completion into settings.
|
addEdit, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, isSignificant, lastEdit, toString, undo
replaceEdit
public boolean completeMenus(Object[] components)
components
- The set of menu bars and toolbars to apply menu completion
to.true
if all the modifications can be performed;
false
otherwise. For example, the modifications can fail if
component keys specified in the menu completion definition do not
correspond to existing components in the specified menus or toolbars.public boolean readSettings(IlvSettings settings)
getSettingsPath()
is used.settings
- The settings to extract the menu completion definition from.true
if the menu completion could be read successfully;
false
, if the settings path is not correct.readSettings(IlvSettingsElement)
public boolean readSettings(IlvSettingsElement element)
true
if the menu completion could be read successfully;
false
otherwise.readSettings(IlvSettings)
public String getSettingsPath()
setSettingsPath(java.lang.String)
public void setSettingsPath(String settingsPath)
settingsPath
- The new settings path of the menu completion.getSettingsPath()
public String getSettingsName()
setSettingsName(java.lang.String)
,
getSettingsPath()
public void setSettingsName(String name)
"menuCompletion"
and of the same name as the specified name.name
- The new settings name of the menu completion.getSettingsName()
,
getSettingsPath()
public IlvApplication getApplication()
public void setApplication(IlvApplication application)
public void redo()
redo
in interface UndoableEdit
redo
in class CompoundEdit
public boolean canRedo()
canRedo
in interface UndoableEdit
canRedo
in class CompoundEdit
true
if the menu completion was previously undone
with a call to CompoundEdit.undo()
; false
otherwise.public boolean canUndo()
completeMenus(java.lang.Object[])
.canUndo
in interface UndoableEdit
canUndo
in class CompoundEdit
true
if the menu completion was previously applied
with the completeMenus(java.lang.Object[])
method;
false
otherwise.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.