|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.appshell.MenuItem
Logical representation of a menu item. It contains a Task which is called
every time the menu item is selected. It may contain a list of MenuItems representing
its submenu. Internally it maintains references to its parent MenuItem, the AppShell
the visual representation of the menu item.
| Constructor Summary | |
MenuItem(IAppShell appShell)
creates a MenuItem |
|
MenuItem(java.lang.String name)
creates a MenuItem |
|
MenuItem(java.lang.String name,
org.eclipse.swt.graphics.Image image)
|
|
MenuItem(java.lang.String name,
int style)
Note: For a MenuItem used at a MenuAppShell and so representing an org.eclipse.swt.widgets.MenuItem only one of the styles CHECK, CASCADE, PUSH, RADIO and SEPARATOR may be specified. |
|
MenuItem(java.lang.String name,
int style,
org.eclipse.swt.graphics.Image image)
Note: For a MenuItem used at a MenuAppShell and so representing an org.eclipse.swt.widgets.MenuItem only one of the styles CHECK, CASCADE, PUSH, RADIO and SEPARATOR may be specified. |
|
MenuItem(java.lang.String name,
Task task)
creates a MenuItem |
|
MenuItem(java.lang.String name,
Task task,
org.eclipse.swt.graphics.Image image)
|
|
MenuItem(java.lang.String name,
Task task,
int style)
Note: For a MenuItem used at a ShellMenuAppShell (i.e. at an SWT menu) and so representing an org.eclipse.swt.widgets.MenuItem only one of the styles CHECK, CASCADE, PUSH, RADIO and SEPARATOR may be specified. |
|
MenuItem(java.lang.String name,
Task task,
int style,
org.eclipse.swt.graphics.Image image)
Note: For a MenuItem used at a ShellMenuAppShell (i.e. at an SWT menu) and so representing an org.eclipse.swt.widgets.MenuItem only one of the styles CHECK, CASCADE, PUSH, RADIO and SEPARATOR may be specified. |
|
| Method Summary | |
void |
addItem(int index,
MenuItem item)
Add the given MenuItem to the list of subitems at the given index. |
void |
addItem(MenuItem item)
Add the given MenuItem to the list of subitems. |
void |
clearItems()
Remove all MenuItems from the list of subitems. |
boolean |
containsItem(IMenuItem item)
Determine if the given item is contained in the submenu of this menu. |
java.lang.Object |
getAttached()
Get the visual representation of the MenuItem. |
org.eclipse.swt.graphics.Image |
getImage()
|
int |
getIndex()
Get the index of the MenuItem in the list of subitems in its parent. |
int |
getIndexOf(IMenuItem item)
Get the index of the given MenuItem in the submenu of this. |
java.util.List |
getItems()
Get the list of all MenuItems of the submenu of this MenuItem. |
java.lang.String |
getName()
Get the name of the MenuItem. |
IMenuItem |
getParent()
Get the MenuItem containing this MenuItem in its submenu. |
java.lang.Object |
getParentAttached()
Get the visual representation of the parent MenuItem |
int |
getStyle()
If no style was set then SWT.NONE is returned. |
ITask |
getTask()
Get the Task than will be called whenever this MenuItem is selected. |
void |
removeItem(MenuItem item)
Remove the given MenuItem from the list of subitems. |
void |
select()
Select the MenuItem. |
void |
setAttached(java.lang.Object attached)
Set the visual representation of the MenuItem e.g.: a ITreeWMClient or org.eclipse.swt.widget.MenuItem. |
void |
setImage(org.eclipse.swt.graphics.Image image)
Sets the image to show at this item. |
void |
setName(java.lang.String name)
Set the name of the MenuItem |
void |
setTask(ITask task)
Set the task to run when the MenuItem is selected |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MenuItem(IAppShell appShell)
appShell - the AppShell containing the MenuItempublic MenuItem(java.lang.String name)
name - the name of the MenuItem
public MenuItem(java.lang.String name,
Task task)
name - the name of the MenuItemtask - the task to run when the MenuItem is selected
public MenuItem(java.lang.String name,
int style)
name - the name of the MenuItemstyle - the SWT style
public MenuItem(java.lang.String name,
org.eclipse.swt.graphics.Image image)
name - the name of the MenuItemimage - an image shown at the MenuItem
public MenuItem(java.lang.String name,
int style,
org.eclipse.swt.graphics.Image image)
name - the name of the MenuItemstyle - the SWT styleimage - an image shown at the MenuItem
public MenuItem(java.lang.String name,
Task task,
int style)
name - the name of the MenuItemtask - the task to run when the MenuItem is selectedstyle - the SWT style
public MenuItem(java.lang.String name,
Task task,
org.eclipse.swt.graphics.Image image)
name - the name of the MenuItemtask - the task to run when the MenuItem is selectedimage - an image shown at the MenuItem
public MenuItem(java.lang.String name,
Task task,
int style,
org.eclipse.swt.graphics.Image image)
name - the name of the MenuItemtask - the task to run when the MenuItem is selectedstyle - the SWT styleimage - an image shown at the MenuItem| Method Detail |
public java.lang.String getName()
getName in interface IMenuItempublic void setName(java.lang.String name)
name - the unique name of this item.public void setTask(ITask task)
setTask in interface IMenuItemtask - the task of this item.public ITask getTask()
getTask in interface IMenuItempublic java.lang.Object getAttached()
ITreeWMClient or org.eclipse.swt.widget.MenuItem.
getAttached in interface IMenuItempublic void setAttached(java.lang.Object attached)
ITreeWMClient or org.eclipse.swt.widget.MenuItem.
setAttached in interface IMenuItemattached - the GUI-Object corresponding to this MenuItem.public org.eclipse.swt.graphics.Image getImage()
getImage in interface IMenuItempublic void setImage(org.eclipse.swt.graphics.Image image)
IMenuItem
setImage in interface IMenuItemimage - Sets the image to show at this item.public int getStyle()
getStyle in interface IMenuItempublic java.lang.Object getParentAttached()
getParentAttached in interface IMenuItempublic IMenuItem getParent()
public int getIndex()
getIndex in interface IMenuItempublic int getIndexOf(IMenuItem item)
getIndexOf in interface IMenuItemitem - to determine the index of
public void select()
select in interface IMenuItempublic void addItem(MenuItem item)
addItem in interface IMenuItemitem - to add.
public void addItem(int index,
MenuItem item)
addItem in interface IMenuItemindex - where to add the new item.item - to add.public java.util.List getItems()
getItems in interface IMenuItempublic void clearItems()
clearItems in interface IMenuItempublic void removeItem(MenuItem item)
removeItem in interface IMenuItemitem - to removepublic boolean containsItem(IMenuItem item)
containsItem in interface IMenuItemitem - the MenuItem to search for in the submenu.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||