Examples of MenuItem


Examples of org.eclipse.swt.widgets.MenuItem

        /* Restore */
        trayMenu.add(new ContributionItem() {
          @Override
          public void fill(Menu menu, int index) {
            MenuItem restoreItem = new MenuItem(menu, SWT.PUSH);
            restoreItem.setText("Restore");
            restoreItem.addSelectionListener(new SelectionAdapter() {
              @Override
              public void widgetSelected(SelectionEvent e) {
                restoreFromTray(shell);
              }
            });
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

      public Menu getMenu(Control parent) {
        Menu menu = new Menu(parent);

        /* Group: None */
        final MenuItem noGrouping = new MenuItem(menu, SWT.RADIO);
        noGrouping.setText(NewsGrouping.Type.NO_GROUPING.getName());
        noGrouping.setSelection(grouping.getType() == NewsGrouping.Type.NO_GROUPING);
        noGrouping.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (noGrouping.getSelection() && grouping.getType() != NewsGrouping.Type.NO_GROUPING)
              doGrouping(NewsGrouping.Type.NO_GROUPING, true, true);
          }
        });
        menu.setDefaultItem(noGrouping);

        /* Separator */
        new MenuItem(menu, SWT.SEPARATOR);

        /* Group: By Date */
        final MenuItem groupByDate = new MenuItem(menu, SWT.RADIO);
        groupByDate.setText(NewsGrouping.Type.GROUP_BY_DATE.getName());
        groupByDate.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_DATE);
        groupByDate.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByDate.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_DATE)
              doGrouping(NewsGrouping.Type.GROUP_BY_DATE, true, true);
          }
        });

        /* Group: By Author */
        final MenuItem groupByAuthor = new MenuItem(menu, SWT.RADIO);
        groupByAuthor.setText(NewsGrouping.Type.GROUP_BY_AUTHOR.getName());
        groupByAuthor.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_AUTHOR);
        groupByAuthor.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByAuthor.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_AUTHOR)
              doGrouping(NewsGrouping.Type.GROUP_BY_AUTHOR, true, true);
          }
        });

        /* Group: By Category */
        final MenuItem groupByCategory = new MenuItem(menu, SWT.RADIO);
        groupByCategory.setText(NewsGrouping.Type.GROUP_BY_CATEGORY.getName());
        groupByCategory.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_CATEGORY);
        groupByCategory.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByCategory.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_CATEGORY)
              doGrouping(NewsGrouping.Type.GROUP_BY_CATEGORY, true, true);
          }
        });

        /* Group: By Topic */
        final MenuItem groupByTopic = new MenuItem(menu, SWT.RADIO);
        groupByTopic.setText(NewsGrouping.Type.GROUP_BY_TOPIC.getName());
        groupByTopic.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_TOPIC);
        groupByTopic.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByTopic.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_TOPIC)
              doGrouping(NewsGrouping.Type.GROUP_BY_TOPIC, true, true);
          }
        });

        /* Separator */
        new MenuItem(menu, SWT.SEPARATOR);

        /* Group: By Other */
        final MenuItem groupByOther = new MenuItem(menu, SWT.CASCADE);
        groupByOther.setText("Other");
        Menu otherMenu = new Menu(groupByOther);
        groupByOther.setMenu(otherMenu);

        /* Group: By State */
        final MenuItem groupByState = new MenuItem(otherMenu, SWT.RADIO);
        groupByState.setText(NewsGrouping.Type.GROUP_BY_STATE.getName());
        groupByState.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_STATE);
        groupByState.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByState.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_STATE)
              doGrouping(NewsGrouping.Type.GROUP_BY_STATE, true, true);
          }
        });

        /* Group: By Stickyness */
        final MenuItem groupByStickyness = new MenuItem(otherMenu, SWT.RADIO);
        groupByStickyness.setText(NewsGrouping.Type.GROUP_BY_STICKY.getName());
        groupByStickyness.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_STICKY);
        groupByStickyness.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByStickyness.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_STICKY)
              doGrouping(NewsGrouping.Type.GROUP_BY_STICKY, true, true);
          }
        });

        /* Separator */
        new MenuItem(otherMenu, SWT.SEPARATOR);

        /* Group: By Label */
        final MenuItem groupByLabel = new MenuItem(otherMenu, SWT.RADIO);
        groupByLabel.setText(NewsGrouping.Type.GROUP_BY_LABEL.getName());
        groupByLabel.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_LABEL);
        groupByLabel.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByLabel.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_LABEL)
              doGrouping(NewsGrouping.Type.GROUP_BY_LABEL, true, true);
          }
        });

        /* Group: By Rating */
        final MenuItem groupByRating = new MenuItem(otherMenu, SWT.RADIO);
        groupByRating.setText(NewsGrouping.Type.GROUP_BY_RATING.getName());
        groupByRating.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_RATING);
        groupByRating.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByRating.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_RATING)
              doGrouping(NewsGrouping.Type.GROUP_BY_RATING, true, true);
          }
        });

        /* Separator */
        new MenuItem(otherMenu, SWT.SEPARATOR);

        /* Group: By Feed */
        final MenuItem groupByFeed = new MenuItem(otherMenu, SWT.RADIO);
        groupByFeed.setText(NewsGrouping.Type.GROUP_BY_FEED.getName());
        groupByFeed.setSelection(grouping.getType() == NewsGrouping.Type.GROUP_BY_FEED);
        groupByFeed.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByFeed.getSelection() && grouping.getType() != NewsGrouping.Type.GROUP_BY_FEED)
              doGrouping(NewsGrouping.Type.GROUP_BY_FEED, true, true);
          }
        });

        return menu;
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

      @Override
      public Menu createMenu(Control parent) {
        Menu menu = new Menu(parent);

        /* Filter: None */
        final MenuItem showAll = new MenuItem(menu, SWT.RADIO);
        showAll.setText(Messages.BookMarkExplorer_SHOW_ALL);
        showAll.setSelection(BookMarkFilter.Type.SHOW_ALL == fBookMarkFilter.getType());
        menu.setDefaultItem(showAll);
        showAll.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (showAll.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_ALL)
              doFilter(BookMarkFilter.Type.SHOW_ALL);
          }
        });

        /* Separator */
        new MenuItem(menu, SWT.SEPARATOR);

        /* Filter: New */
        final MenuItem showNew = new MenuItem(menu, SWT.RADIO);
        showNew.setText(Messages.BookMarkExplorer_SHOW_NEW);
        showNew.setSelection(BookMarkFilter.Type.SHOW_NEW == fBookMarkFilter.getType());
        showNew.addSelectionListener(new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            if (showNew.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_NEW)
              doFilter(BookMarkFilter.Type.SHOW_NEW);
          }
        });

        /* Filter: Unread */
        final MenuItem showUnread = new MenuItem(menu, SWT.RADIO);
        showUnread.setText(Messages.BookMarkExplorer_SHOW_UNREAD);
        showUnread.setSelection(BookMarkFilter.Type.SHOW_UNREAD == fBookMarkFilter.getType());
        showUnread.addSelectionListener(new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            if (showUnread.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_UNREAD)
              doFilter(BookMarkFilter.Type.SHOW_UNREAD);
          }
        });

        /* Filter: Sticky */
        final MenuItem showSticky = new MenuItem(menu, SWT.RADIO);
        showSticky.setText(Messages.BookMarkExplorer_SHOW_STICKY);
        showSticky.setSelection(BookMarkFilter.Type.SHOW_STICKY == fBookMarkFilter.getType());
        showSticky.addSelectionListener(new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            if (showSticky.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_STICKY)
              doFilter(BookMarkFilter.Type.SHOW_STICKY);
          }
        });

        /* Separator */
        new MenuItem(menu, SWT.SEPARATOR);

        /* Filter: Erroneous */
        final MenuItem showErroneous = new MenuItem(menu, SWT.RADIO);
        showErroneous.setText(Messages.BookMarkExplorer_SHOW_ERROR);
        showErroneous.setSelection(BookMarkFilter.Type.SHOW_ERRONEOUS == fBookMarkFilter.getType());
        showErroneous.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (showErroneous.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_ERRONEOUS)
              doFilter(BookMarkFilter.Type.SHOW_ERRONEOUS);
          }
        });

        /* Filter: Never Visited */
        final MenuItem showNeverVisited = new MenuItem(menu, SWT.RADIO);
        showNeverVisited.setText(Messages.BookMarkExplorer_SHOW_NEVER_VISITED);
        showNeverVisited.setSelection(BookMarkFilter.Type.SHOW_NEVER_VISITED == fBookMarkFilter.getType());
        showNeverVisited.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (showNeverVisited.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_NEVER_VISITED)
              doFilter(BookMarkFilter.Type.SHOW_NEVER_VISITED);
          }
        });

        return menu;
      }
    });

    fToolBarManager.add(bookmarkFilter);

    /* Bookmark Group */
    fToolBarManager.add(new Separator());
    final IAction bookmarkGroup = new Action(Messages.BookMarkExplorer_GROUP_ELEMENTS, IAction.AS_DROP_DOWN_MENU) {
      @Override
      public void run() {

        /* Restore Default */
        if (fBookMarkGrouping.getType() != BookMarkGrouping.Type.NO_GROUPING)
          doGrouping(BookMarkGrouping.Type.NO_GROUPING);

        /* Toggle to previous */
        else if (fLastGroupType != null)
          doGrouping(fLastGroupType);

        /* Show Menu */
        else if (fToolBarManager instanceof ToolBarManager)
          OwlUI.positionDropDownMenu(this, (ToolBarManager) fToolBarManager);
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        if (fBookMarkGrouping.getType() == BookMarkGrouping.Type.NO_GROUPING)
          return OwlUI.getImageDescriptor("icons/etool16/group.gif"); //$NON-NLS-1$

        return OwlUI.getImageDescriptor("icons/etool16/group_active.gif"); //$NON-NLS-1$
      }
    };
    bookmarkGroup.setId(GROUP_ACTION);

    bookmarkGroup.setMenuCreator(new ContextMenuCreator() {

      @Override
      public Menu createMenu(Control parent) {
        Menu menu = new Menu(parent);

        /* Group: None */
        final MenuItem noGrouping = new MenuItem(menu, SWT.RADIO);
        noGrouping.setText(Messages.BookMarkExplorer_NO_GROUPING);
        noGrouping.setSelection(BookMarkGrouping.Type.NO_GROUPING == fBookMarkGrouping.getType());
        menu.setDefaultItem(noGrouping);
        noGrouping.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (noGrouping.getSelection() && fBookMarkGrouping.getType() != BookMarkGrouping.Type.NO_GROUPING)
              doGrouping(BookMarkGrouping.Type.NO_GROUPING);
          }
        });

        /* Separator */
        new MenuItem(menu, SWT.SEPARATOR);

        /* Group: By Type */
        final MenuItem groupByType = new MenuItem(menu, SWT.RADIO);
        groupByType.setText(Messages.BookMarkExplorer_GROUP_BY_TYPE);
        groupByType.setSelection(BookMarkGrouping.Type.GROUP_BY_TYPE == fBookMarkGrouping.getType());
        groupByType.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByType.getSelection() && fBookMarkGrouping.getType() != BookMarkGrouping.Type.GROUP_BY_TYPE)
              doGrouping(BookMarkGrouping.Type.GROUP_BY_TYPE);
          }
        });

        /* Group: By State */
        final MenuItem groupByState = new MenuItem(menu, SWT.RADIO);
        groupByState.setText(Messages.BookMarkExplorer_GROUP_BY_STATE);
        groupByState.setSelection(BookMarkGrouping.Type.GROUP_BY_STATE == fBookMarkGrouping.getType());
        groupByState.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByState.getSelection() && fBookMarkGrouping.getType() != BookMarkGrouping.Type.GROUP_BY_STATE)
              doGrouping(BookMarkGrouping.Type.GROUP_BY_STATE);
          }
        });

        /* Separator */
        new MenuItem(menu, SWT.SEPARATOR);

        /* Group: By Last Visit */
        final MenuItem groupByLastVisit = new MenuItem(menu, SWT.RADIO);
        groupByLastVisit.setText(Messages.BookMarkExplorer_GROUP_BY_LAST_VISIT);
        groupByLastVisit.setSelection(BookMarkGrouping.Type.GROUP_BY_LAST_VISIT == fBookMarkGrouping.getType());
        groupByLastVisit.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByLastVisit.getSelection() && fBookMarkGrouping.getType() != BookMarkGrouping.Type.GROUP_BY_LAST_VISIT)
              doGrouping(BookMarkGrouping.Type.GROUP_BY_LAST_VISIT);
          }
        });

        /* Group: By Popularity */
        final MenuItem groupByPopularity = new MenuItem(menu, SWT.RADIO);
        groupByPopularity.setText(Messages.BookMarkExplorer_GROUP_BY_POPULARITY);
        groupByPopularity.setSelection(BookMarkGrouping.Type.GROUP_BY_POPULARITY == fBookMarkGrouping.getType());
        groupByPopularity.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (groupByPopularity.getSelection() && fBookMarkGrouping.getType() != BookMarkGrouping.Type.GROUP_BY_POPULARITY)
              doGrouping(BookMarkGrouping.Type.GROUP_BY_POPULARITY);
          }
        });

        return menu;
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

          @Override
          public Menu createMenu(Control parent) {
            Menu menu = new Menu(parent);
            NavigationActionType defaultAction = NavigationActionType.values()[fPreferences.getInteger(DefaultPreferences.DEFAULT_NEXT_ACTION)];

            MenuItem item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.NEXT_NEWS.getCommandId(), NavigationActionType.NEXT_NEWS.getName()));
            item.setData(NavigationActionType.NEXT_NEWS);
            item.addSelectionListener(new NavigationSelectionListener(true));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.NEXT_UNREAD_NEWS.getCommandId(), NavigationActionType.NEXT_UNREAD_NEWS.getName()));
            item.setData(NavigationActionType.NEXT_UNREAD_NEWS);
            item.addSelectionListener(new NavigationSelectionListener(true));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            new MenuItem(menu, SWT.SEPARATOR);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.NEXT_FEED.getCommandId(), NavigationActionType.NEXT_FEED.getName()));
            item.setData(NavigationActionType.NEXT_FEED);
            item.addSelectionListener(new NavigationSelectionListener(true));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.NEXT_UNREAD_FEED.getCommandId(), NavigationActionType.NEXT_UNREAD_FEED.getName()));
            item.setData(NavigationActionType.NEXT_UNREAD_FEED);
            item.addSelectionListener(new NavigationSelectionListener(true));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            new MenuItem(menu, SWT.SEPARATOR);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.NEXT_TAB.getCommandId(), NavigationActionType.NEXT_TAB.getName()));
            item.setData(NavigationActionType.NEXT_TAB);
            item.addSelectionListener(new NavigationSelectionListener(true));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            return menu;
          }
        };
      }

        /* Previous News | Previous Unread News || Previous Feed | Previous Unread Feed || Previous Tab */
      case PREVIOUS: {
        return new ContextMenuCreator() {

          @Override
          public Menu createMenu(Control parent) {
            Menu menu = new Menu(parent);
            NavigationActionType defaultAction = NavigationActionType.values()[fPreferences.getInteger(DefaultPreferences.DEFAULT_PREVIOUS_ACTION)];

            MenuItem item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.PREVIOUS_NEWS.getCommandId(), NavigationActionType.PREVIOUS_NEWS.getName()));
            item.setData(NavigationActionType.PREVIOUS_NEWS);
            item.addSelectionListener(new NavigationSelectionListener(false));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.PREVIOUS_UNREAD_NEWS.getCommandId(), NavigationActionType.PREVIOUS_UNREAD_NEWS.getName()));
            item.setData(NavigationActionType.PREVIOUS_UNREAD_NEWS);
            item.addSelectionListener(new NavigationSelectionListener(false));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            new MenuItem(menu, SWT.SEPARATOR);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.PREVIOUS_FEED.getCommandId(), NavigationActionType.PREVIOUS_FEED.getName()));
            item.setData(NavigationActionType.PREVIOUS_FEED);
            item.addSelectionListener(new NavigationSelectionListener(false));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.PREVIOUS_UNREAD_FEED.getCommandId(), NavigationActionType.PREVIOUS_UNREAD_FEED.getName()));
            item.setData(NavigationActionType.PREVIOUS_UNREAD_FEED);
            item.addSelectionListener(new NavigationSelectionListener(false));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            new MenuItem(menu, SWT.SEPARATOR);

            item = new MenuItem(menu, SWT.RADIO);
            item.setText(getLabelWithBinding(NavigationActionType.PREVIOUS_TAB.getCommandId(), NavigationActionType.PREVIOUS_TAB.getName()));
            item.setData(NavigationActionType.PREVIOUS_TAB);
            item.addSelectionListener(new NavigationSelectionListener(false));
            if (item.getData().equals(defaultAction))
              item.setSelection(true);

            return menu;
          }
        };
      }
View Full Code Here

Examples of org.fenixedu.bennu.portal.domain.MenuItem

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        final MenuItem initialMenuEntry = findTopLevelContainer();
        if (initialMenuEntry == null) {
            response.sendRedirect(request.getContextPath());
        } else {
            response.sendRedirect(request.getContextPath() + initialMenuEntry.getFullPath());
        }

        return null;
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.menus.MenuItem

  public MenuItem getItem(String key) {
    if (this.style != MenuItem.STYLE_MENU) {
      return null;
    }
    java.util.Iterator itr = this.children.iterator();
    MenuItem result = null;
    while (itr.hasNext()) {
      result = (MenuItem) itr.next();
      if (key.equals(result.getResourceKey())) {
        return result;
      }
    }
    return null;
  }
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.menus.MenuItem

                return true;
              }
            });

            MenuManager menuManager = PluginInitializer.getDefaultInterface().getUIManager().getMenuManager();
            MenuItem menuHide = menuManager.addMenuItem("Sidebar." +
                MultipleDocumentInterface.SIDEBAR_SECTION_BURN_INFO,
                "popup.error.hide");
            menuHide.addListener(new MenuItemListener() {
              public void selected(MenuItem menu, Object target) {
                mdi.closeEntry(MultipleDocumentInterface.SIDEBAR_SECTION_BURN_INFO);
              }
            });
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.menus.MenuItem

        TableContextMenuItem  item = (TableContextMenuItem)data;
        TableContextMenuManager.getInstance().addContextMenuItem(item);
        break;
      }
      case UIManagerEvent.ET_ADD_MENU_ITEM: {
        MenuItem item = (MenuItem)data;
        MenuItemManager.getInstance().addMenuItem(item);
        break;
      }
      case UIManagerEvent.ET_REMOVE_TABLE_CONTEXT_MENU_ITEM:{
        TableContextMenuItem item = (TableContextMenuItem)data;
        TableContextMenuManager.getInstance().removeContextMenuItem(item);
        break;
      }
      case UIManagerEvent.ET_REMOVE_MENU_ITEM: {
        MenuItem item = (MenuItem)data;
        MenuItemManager.getInstance().removeMenuItem(item);
        break;
      }     
      case UIManagerEvent.ET_SHOW_CONFIG_SECTION: {
        event.setResult(new Boolean(false));
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.menus.MenuItem

    MenuManager menuManager = uim.getMenuManager();

    String menuID = "sidebar."
        + ContentNetworkUtils.getTarget(contentNetwork);
   
    MenuItem item = menuManager.addMenuItem(menuID, "Button.reload");
    item.addListener(new MenuItemListener() {
      public void selected(MenuItem menu, Object target) {
        browserSkinObject.refresh();
      }
    });
   
   
    if (org.gudy.azureus2.core3.util.Constants.isCVSVersion()) {
      MenuItem parent = menuManager.addMenuItem(menuID, "CVS Only");
      parent.setStyle(MenuItem.STYLE_MENU);
     
     
      MenuItem menuItem = menuManager.addMenuItem(parent, "Button.reset");
      menuItem.addListener(new MenuItemListener() {
        public void selected(MenuItem menu, Object target) {
          browserSkinObject.getContext().executeInBrowser("sendMessage('display','reset-url', {});");
          //browserSkinObject.restart();
        }
      });

      menuItem = menuManager.addMenuItem(parent, "Tux RPC Test");
      menuItem.addListener(new MenuItemListener() {
        public void selected(MenuItem menu, Object target) {
          browserSkinObject.setURL("c:\\test\\BrowserMessaging.html");
        }
      });

      menuItem = menuManager.addMenuItem(parent, "URL..");
      menuItem.addListener(new MenuItemListener() {
        public void selected(MenuItem menu, Object target) {
          SimpleTextEntryWindow entryWindow = new SimpleTextEntryWindow("", "!URL!");
          entryWindow.prompt(new UIInputReceiverListener() {
            public void UIInputReceiverClosed(UIInputReceiver entryWindow) {
              if (entryWindow.hasSubmittedInput()) {
                browserSkinObject.setURL(entryWindow.getSubmittedInput());
              }
            }
          });
        }
      });

      if (contentNetwork != ConstantsVuze.getDefaultContentNetwork()) {
        menuItem = menuManager.addMenuItem(parent, "Remove HD Network");
        menuItem.addListener(new MenuItemListener() {
          public void selected(MenuItem menu, Object target) {
            if (mdi != null) {
              MdiEntry entry = mdi.getEntryBySkinView(Browse.this);
              if (entry != null) {
                entry.removeListener(Browse.this);
              }
              mdi.closeEntry(ContentNetworkUtils.getTarget(contentNetwork));
            }
            contentNetwork.remove();
          }
        });

        menuItem = menuManager.addMenuItem(parent, "Reset IP Flag && Close");
        menuItem.addListener(new MenuItemListener() {
          public void selected(MenuItem menu, Object target) {
            contentNetwork.setPersistentProperty(
                ContentNetwork.PP_AUTH_PAGE_SHOWN, Boolean.FALSE);
            if (mdi != null) {
              MdiEntry entry = mdi.getEntryBySkinView(Browse.this);
              if (entry != null) {
                entry.removeListener(Browse.this);
              }
              mdi.closeEntry(ContentNetworkUtils.getTarget(contentNetwork));
            }
          }
        });
      }
      menuItem = menuManager.addMenuItem(parent, "Source Ref: "
          + contentNetwork.getPersistentProperty(ContentNetwork.PP_SOURCE_REF));
      menuItem.setEnabled(false);
    }

    return null;
  }
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.menus.MenuItem

    PluginInterface pi = PluginInitializer.getDefaultInterface();
    UIManager uim = pi.getUIManager();
    MenuManager menuManager = uim.getMenuManager();

    MenuItem menuItem = menuManager.addMenuItem("sidebar."
        + MultipleDocumentInterface.SIDEBAR_SECTION_ACTIVITIES,
        "v3.activity.button.readall");
    menuItem.addListener(new MenuItemListener() {
      public void selected(MenuItem menu, Object target) {
        VuzeActivitiesEntry[] allEntries = VuzeActivitiesManager.getAllEntries();
        for (int i = 0; i < allEntries.length; i++) {
          VuzeActivitiesEntry entry = allEntries[i];
          entry.setRead(true);
        }
      }
    });

    if (Constants.isCVSVersion()) {
      menuItem = menuManager.addMenuItem("sidebar."
          + MultipleDocumentInterface.SIDEBAR_SECTION_ACTIVITIES,
          "!test update expiry!");
      menuItem.addListener(new MenuItemListener() {
        public void selected(MenuItem menu, Object target) {
          FeatureManagerUIListener.buildNotifications();
        }
      });
    }
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.