Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.MenuItem.addListener()


      proxyItem.setImage(realItem.getImage());
      proxyItem.setSelection(realItem.getSelection());
      proxyItem.setText(realItem.getText());

      // pass through any events
      proxyItem.addListener(SWT.Selection, passThrough);
      proxyItem.addListener(SWT.Arm, passThrough);
      proxyItem.addListener(SWT.Help, passThrough);

      final Menu itemMenu = realItem.getMenu();
      if (itemMenu != null) {
View Full Code Here


      proxyItem.setSelection(realItem.getSelection());
      proxyItem.setText(realItem.getText());

      // pass through any events
      proxyItem.addListener(SWT.Selection, passThrough);
      proxyItem.addListener(SWT.Arm, passThrough);
      proxyItem.addListener(SWT.Help, passThrough);

      final Menu itemMenu = realItem.getMenu();
      if (itemMenu != null) {
        // create a proxy for any sub menu items
View Full Code Here

      proxyItem.setText(realItem.getText());

      // pass through any events
      proxyItem.addListener(SWT.Selection, passThrough);
      proxyItem.addListener(SWT.Arm, passThrough);
      proxyItem.addListener(SWT.Help, passThrough);

      final Menu itemMenu = realItem.getMenu();
      if (itemMenu != null) {
        // create a proxy for any sub menu items
        final Menu subMenu = new Menu(proxy);
View Full Code Here

    @Override
    protected void insertAction(final Type type, Menu parentMenu) {
      MenuItem actionItem = new MenuItem(parentMenu, SWT.PUSH);
      actionItem.setText(type.getShortName());

      actionItem.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {

          IAction actionToExecute = new ChangeModeAction(type, type.getShortName(),
                  AnnotationEditor.this);
View Full Code Here

        actionItem.setSelection(true);
      }

      // TODO: move this to an action
      // do not access mTypesToDisplay directly !!!
      actionItem.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
          if (actionItem.getSelection()) {
            mTypesToDisplay.add(type);

          } else {
View Full Code Here

        menuItem.setMenu(subMenu);
      }
    }

    menuItem.addDisposeListener(disposeListener);
    menuItem.addListener(SWT.Selection, selectionListener);

    // TODO Needs a way to be linked to a command.
    // if (action.getHelpListener() != null)
    // menuItem.addHelpListener(action.getHelpListener());
View Full Code Here

    } else {
      item = new MenuItem(parent, tmpStyle);
    }
    item.setData(this);

    item.addListener(SWT.Dispose, getItemListener());
    item.addListener(SWT.Selection, getItemListener());
    widget = item;
   
    String helpContextId = null;
    try {
View Full Code Here

      item = new MenuItem(parent, tmpStyle);
    }
    item.setData(this);

    item.addListener(SWT.Dispose, getItemListener());
    item.addListener(SWT.Selection, getItemListener());
    widget = item;
   
    String helpContextId = null;
    try {
      helpContextId = commandService.getHelpContextId(command
View Full Code Here

      //
      MenuItem menuItem = new MenuItem(menu, SWT.NONE);
      menuItem.setText(deviceAction.getText());
      menuItem.setData(deviceAction.m_device);
      // add listeners
      menuItem.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          deviceAction.run();
        }
      });
    }
View Full Code Here

                    Menu menu = new Menu(shell, SWT.POP_UP);
                    MenuItem item = new MenuItem(menu, SWT.PUSH);
                    // Add the action item, which will remove the node from the tree if selected
                    item.setText(ACTION_REMOVE_MBEANNODE);
                    item.addListener(SWT.Selection, new Listener()
                        {
                            public void handleEvent(Event e)
                            {
                                removeManagedObject(parentNode, (ManagedBean) selectedNode.getManagedObject(), true);
                                _treeViewer.refresh();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.