Community
Participate
Working Groups
In the platform (File Explorer, Internet Explorer, Outlook Express, etc.) the status bar gives details for the highlighted menuitem. In Eclipse, nothing happens, despite IAction defining getDescription(). This also works generally for those applications' popup menus, but it's slightly less expected IMHO.
The following snippet shows a technique for tracking the highlighed menuitem: public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display); final Text status = new Text(shell, SWT.READ_ONLY | SWT.BORDER); status.setText("status"); shell.addControlListener(new ControlAdapter() { public void controlResized(ControlEvent e) { Rectangle client = shell.getClientArea(); client.y += client.height; client.height = status.computeSize(-1,-1).y; client.y -= client.height; status.setBounds(client); } }); Listener StatusListener = new Listener() { public void handleEvent(Event event) { if (event.type == SWT.Arm){ MenuItem item = (MenuItem)event.widget; status.setText("Long Descriptiong For: " + item.getText()); } else if (event.type == SWT.Hide) status.setText(""); } }; Menu bar = new Menu(shell, SWT.BAR); shell.setMenuBar(bar); MenuItem fileItem = new MenuItem(bar, SWT.CASCADE); fileItem.setText("File"); Menu submenu = new Menu(shell, SWT.DROP_DOWN); submenu.addListener(SWT.Hide, StatusListener); fileItem.setMenu(submenu); MenuItem item; item= new MenuItem(submenu, SWT.PUSH); item.setText("Open"); item.addListener(SWT.Arm, StatusListener); item= new MenuItem(submenu, SWT.PUSH); item.setText("Exit"); item.addListener(SWT.Arm, StatusListener); shell.setSize(200, 200); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } }
Moving Dougs bugs
Assigning to component owner PW
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.