Get Reference of ToolItems from the Main ToolBar [message #661382] |
Thu, 24 March 2011 13:28 |
amir Messages: 16 Registered: September 2010 |
Junior Member |
|
|
Hey There
I Have this code :
Object data = shell.getData();
ApplicationWindow app = (ApplicationWindow) data;
MenuManager menuMng = app.getMenuBarManager();
IContributionItem[] items = menuMng.getItems();
CoolBarManager coolBar = app.getCoolBarManager();
ICoolBarManager icoolBar = app.getCoolBarManager2();
IContributionItem citem = items[1];
MenuManager submenu = (MenuManager) citem;
String subId = submenu.getId();
IContributionItem[] icool = icoolBar.getItems();
IContributionItem icot = icool[1];
ToolBarContributionItem item = (ToolBarContributionItem) icot;
IToolBarManager toolMng = item.getToolBarManager();
ToolBarManager toolBarManager = (ToolBarManager)toolMng;
ToolBar control = toolBarManager.getControl();
ToolItem[] Toolitems = control.getItems();
ToolItem toolitem = Toolitems[0];
toolitem.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
if(e.detail == SWT.ARROW);
{
}
}
I need to get reference of the toolItems like this one "Class":
http://img546.imageshack.us/i/recommend002.jpg
I tried many classes with no luck, all i get is the first tooltem "New" , but couldnot get the dropdown menu of the toolitem. glad to hear your tips how to do that.
Thanks for help
Amir
p.s iam writing a plug-in .
[Updated on: Thu, 24 March 2011 14:15] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04620 seconds