Package devplugin

Examples of devplugin.ContextMenuIf


        mItemPanel.setBackground(label.getBackground());
        mItemPanel.setOpaque(isSelected);

        return mItemPanel;
      } else if (value instanceof ContextMenuIf) {
        ContextMenuIf menuIf = (ContextMenuIf) value;
        Program exampleProgram = Plugin.getPluginManager().getExampleProgram();

        // Get the context menu item text
        StringBuilder text = new StringBuilder();
        Icon icon = null;
        // Action[] actionArr = plugin.getContextMenuActions(exampleProgram);
        ActionMenu actionMenu = menuIf.getContextMenuActions(exampleProgram);
        if (actionMenu != null) {
          Action action = actionMenu.getAction();
          if (action != null) {
            text.append((String) action.getValue(Action.NAME));
            icon = (Icon) action.getValue(Action.SMALL_ICON);
View Full Code Here


      JLabel label = (JLabel) super.getListCellRendererComponent(list, value,
          index, isSelected, cellHasFocus);

      if (value instanceof ContextMenuIf) {
        ContextMenuIf menuIf = (ContextMenuIf) value;
        Program exampleProgram = Plugin.getPluginManager().getExampleProgram();

        // Get the context menu item text
        StringBuilder text = new StringBuilder();
        Icon icon = null;
        ActionMenu actionMenu = menuIf.getContextMenuActions(exampleProgram);
        if (actionMenu != null) {
          Action action = actionMenu.getAction();
          if (action != null) {
            text.append((String) action.getValue(Action.NAME));
            icon = (Icon) action.getValue(Action.SMALL_ICON);
View Full Code Here

      mLabel = label;
      mSettingsProperty = settingsProperty;
    }

    public void saveSetting() {
      ContextMenuIf selectedIf = (ContextMenuIf) mComboBox.getSelectedItem();
      if (selectedIf != null) {
        mSettingsProperty.setString(selectedIf.getId());
      } else {
        mSettingsProperty.setString(null);
      }
      mClickInterface = selectedIf;
    }
View Full Code Here

    if (ProgramInfo.getInstance().getSettings().getShowSearchButton()) {
      mTextSearch = new TaskMenuAction(mFunctionGroup, mProgram, mSearchMenu,
          this, "id_sea", mFindAsYouType);
    }

    ContextMenuIf lastEntry = null;
    for (ContextMenuIf contextMenuIf : ContextMenuManager.getInstance()
        .getAvailableContextMenuIfs(false, true)) {
      if (contextMenuIf.getId().compareTo(SeparatorMenuItem.SEPARATOR) == 0) {
        // avoid duplicate separators
        if (lastEntry == null
            || lastEntry.getId().compareTo(SeparatorMenuItem.SEPARATOR) != 0) {
          mFunctionGroup.add(Box.createRigidArea(new Dimension(0, 2)));
          mFunctionGroup.add(new JSeparator());
          mFunctionGroup.add(Box.createRigidArea(new Dimension(0, 2)));
          lastEntry = contextMenuIf;
        }
View Full Code Here

    setLeftSingleCtrlClickIf(getMenuIf(Settings.propLeftSingleCtrlClickIf));
  }
 
  private ContextMenuIf getMenuIf(final StringProperty prop) {
    String id = prop.getString();
    ContextMenuIf menuIf = getContextMenuIfForId(id);
    if (menuIf == null) {
      menuIf = getContextMenuIfForId(prop.getDefault());
      if (menuIf != null) {
        prop.setString(menuIf.getId());
      }
    }
    return menuIf;
  }
View Full Code Here

TOP

Related Classes of devplugin.ContextMenuIf

Copyright © 2018 www.massapicom. 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.