[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform.swt] Re: Mnemonic keys are not working for ToolItem(s)
|
FYI, I've submitted the defect #36722.
"Barys Dubauski" <dubauski@xxxxxxxxxxxx> wrote in message
news:b81ao8$kl1$1@xxxxxxxxxxxxxxxx
> Here is the code
>
> public static void main(String[] args) {
> final Display display = new Display();
> final Shell shell = new Shell(display);
>
> GridLayout layout = new GridLayout();
> layout.numColumns = 1;
> layout.marginWidth = 0;
> shell.setLayout(layout);
>
> Button b = new Button(shell, SWT.PUSH);
> b.setText("&Push");
> b.addSelectionListener(new SelectionListener() {
> public void widgetSelected(SelectionEvent e) {
> System.out.println("Normal Button is pressed");
> }
> public void widgetDefaultSelected(SelectionEvent e) {
> }
>
> });
>
> // Toolbar
> ToolBar tb = new ToolBar(shell, SWT.VERTICAL | SWT.WRAP | SWT.CENTER);
>
> ToolItem ti = new ToolItem(tb, SWT.PUSH);
> ti.setText("&Reference");
> ti.setToolTipText("bla"); //$NON-NLS-1$
>
> ti.addSelectionListener(new SelectionListener() {
> public void widgetSelected(SelectionEvent e) {
> System.out.println("ToolItem button is pressed");
> }
> public void widgetDefaultSelected(SelectionEvent e) {
> }
>
> });
>
> WidgetFactory.setGridData(shell, GridData.FILL, true, GridData.FILL,
> true);
>
> shell.setSize(400, 300);
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> }
>
>
> "Barys Dubauski" <dubauski@xxxxxxxxxxxx> wrote in message
> news:b81a3f$k2k$1@xxxxxxxxxxxxxxxx
> > Is this a known bug?
> >
> > Mnemonic keys (shortcut keys) work just fine for PUSH style Buttons but
> > nothing happens when I use them in ToolItems. Also I noticed that
> ToolItems
> > are never focused. Is there a way to include them in a tab order?
> >
> > Thanks,
> > -Boris
> >
> >
>
>