|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
ilog.views.appframe.swing.IlvMenuCompletion
public class IlvMenuCompletion
Defines objects that modify menu bars and toolbars by adding or removing menu items
and buttons.
Typically, when a new document becomes active within an Application Framework
application, menu items associated with actions that this document can process are added to
the main menu and toolbar. This is done by the document template of
the document, using an instance of the 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:
| Field Summary |
|---|
| Fields inherited from class javax.swing.undo.CompoundEdit |
|---|
edits |
| Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
|---|
RedoName, UndoName |
| Constructor Summary | |
|---|---|
IlvMenuCompletion()
Constructs a new IlvMenuCompletion. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class javax.swing.undo.CompoundEdit |
|---|
addEdit, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, isSignificant, lastEdit, toString, undo |
| Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
|---|
replaceEdit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvMenuCompletion()
IlvMenuCompletion.
| Method Detail |
|---|
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 UndoableEditredo in class CompoundEditpublic boolean canRedo()
canRedo in interface UndoableEditcanRedo in class CompoundEdittrue 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 UndoableEditcanUndo in class CompoundEdittrue if the menu completion was previously applied
with the completeMenus(java.lang.Object[]) method;
false otherwise.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||