Examples of IContributionItem


Examples of org.eclipse.jface.action.IContributionItem

        Iterator iter = sortedWorkingSets.iterator();
        mruMenuCount = 0;
        while (iter.hasNext()) {
            IWorkingSet workingSet = (IWorkingSet) iter.next();
            if (workingSet != null) {
                IContributionItem item = new WorkingSetMenuContributionItem(
                        ++mruMenuCount, this, workingSet);
                menuManager.insertBefore(SEPARATOR_ID, item);
            }
        }
    }
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

     * Returns the item passed to us, not the wrapper.
     * In the case of menu's not added by this manager,
     * ensure that we return a wrapper for the menu.
     */
    public IContributionItem find(String id) {
        IContributionItem item = getParentMenuManager().find(id);
        if (item instanceof SubContributionItem) {
      // Return the item passed to us, not the wrapper.
            item = unwrap(item);
    }

View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

     * Method declared on IContributionManager.
     * Inserts the new item after any action set contributions which may
     * exist within the toolbar to ensure a consistent order for actions.
     */
    public void insertAfter(String id, IContributionItem item) {
        IContributionItem refItem = PluginActionSetBuilder.findInsertionPoint(
                id, null, getParentMenuManager(), false);
        if (refItem != null) {
            super.insertAfter(refItem.getId(), item);
        } else {
            WorkbenchPlugin
                    .log("Reference item " + id + " not found for action " + item.getId()); //$NON-NLS-1$ //$NON-NLS-2$
        }
    }
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

        }
    }

    protected void getAllContributedActions(HashSet set, IContributionItem item) {
        if (item instanceof MenuManager) {
            IContributionItem subItems[] = ((MenuManager) item).getItems();
            for (int j = 0; j < subItems.length; j++) {
        getAllContributedActions(set, subItems[j]);
      }
        } else if (item instanceof ActionContributionItem) {
            set.add(((ActionContributionItem) item).getAction());
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

         */
        public void updateEnabledAllowed() {
            // update the items in the map
            IContributionItem[] items = EditorMenuManager.super.getItems();
            for (int i = 0; i < items.length; i++) {
                IContributionItem item = items[i];
                item.update(IContributionManagerOverrides.P_ENABLED);
            }
            // update the wrapped menus
            if (wrappers != null) {
                for (int i = 0; i < wrappers.size(); i++) {
                    EditorMenuManager manager = (EditorMenuManager) wrappers
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

            return;
        }
       
        IContributionItem[] items = getContributionItemsToFill();
        for (int i = 0; i < items.length; i++) {
            IContributionItem item = items[i];
            int oldItemCount = menu.getItemCount();
            if (item.isVisible()) {
                item.fill(menu, index);
            }
            int newItemCount = menu.getItemCount();
            int numAdded = newItemCount - oldItemCount;
            index += numAdded;
        }
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

    protected abstract IContributionItem[] getContributionItems();
   
    private IContributionItem[] getContributionItemsToFill() {
        if (oldItems != null) {
            for (int i = 0; i < oldItems.length; i++) {
                IContributionItem oldItem = oldItems[i];
                oldItem.dispose();
            }
            oldItems = null;
        }
        oldItems = getContributionItems();
        return oldItems;
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

    IContributionItem[] items = coolItemToolBarMgr.getItems();
    // remove the action set's items from its action bar, don't use
    // removeAll since other items from other actions sets may be in
    // the action bar's cool item
    for (int i = 0; i < items.length; i++) {
      IContributionItem item = items[i];
      if (item instanceof PluginActionCoolBarContributionItem) {
        PluginActionCoolBarContributionItem actionSetItem = (PluginActionCoolBarContributionItem) item;
        if (actionSetItem.getActionSetId().equals(actionSetId)) {
          coolItemToolBarMgr.remove(item);
          item.dispose();
        }
      } else {
        // leave separators and group markers intact, doing
        // so allows ordering to be maintained when action sets
        // are removed then added back
      }
    }

    // remove items from this action set that are in other action bars
    for (int i = 0; i < adjunctContributions.size(); i++) {
      ContributionItem item = (ContributionItem) adjunctContributions
          .get(i);
      IContributionManager parent = item.getParent();
      if (parent != null) {
        parent.remove(item);
        item.dispose();
      }
    }
    toolBarContributionItem = null;
    coolItemToolBarMgr = null;
    adjunctContributions = new ArrayList();
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

    IContributionItem[] items = mgr.getItems();
    int insertIndex = 0;

    // look for starting point
    while (insertIndex < items.length) {
      IContributionItem item = items[insertIndex];
      if (item.getId() != null && item.getId().equals(startId)) {
        break;
      }
      ++insertIndex;
    }

    // Find the index that this item should be inserted in
    for (int i = insertIndex + 1; i < items.length; i++) {
      IContributionItem item = items[i];
      String testId = item.getId();

      if (item.isGroupMarker()) {
        break;
      }

      if (itemId != null && testId != null) {
        if (itemId.compareTo(testId) < 1) {
View Full Code Here

Examples of org.eclipse.jface.action.IContributionItem

    if ((coolItemToolBarMgr != null) && (!isAdjunctType)) {
      return coolItemToolBarMgr;
    }

    // Search for toolBarId in the cool Bar manager
    IContributionItem cbItem = coolBarManager.find(toolBarId);
    // If there hasn't been a tool bar contribution item created for this
    // tool bar
    // id then create one. Otherwise retrieve the tool bar contribution
    // item
    if (cbItem instanceof IToolBarContributionItem) {

      IToolBarContributionItem tbcbItem = (IToolBarContributionItem) cbItem;
      coolItemToolBarMgr = tbcbItem.getToolBarManager();
      // If this not an adjuct type then we can cashe the tool bar
      // contribution type
      if (!isAdjunctType) {
        toolBarContributionItem = tbcbItem;
      }
    } else {
     
      coolItemToolBarMgr = actionBarConfigurer.createToolBarManager();
          
      // If this is not an adjunct type then create a tool bar
      // contribution item
      // we don't create one for an adjunct type because another action
      // set action bars contains one
           
            IContributionItem toolBarContributionItem = actionBarConfigurer
          .createToolBarContributionItem(coolItemToolBarMgr,
              toolBarId);

      toolBarContributionItem.setParent(coolItemToolBarMgr);
      toolBarContributionItem.setVisible(getActive());
      coolItemToolBarMgr.markDirty();

      // Now add the tool bar contribution Item to the cool bar manager
      IContributionItem refItem = findAlphabeticalOrder(
          IWorkbenchActionConstants.MB_ADDITIONS, toolBarId,
          coolBarManager);
      if (refItem != null) {
        coolBarManager.insertAfter(refItem.getId(),
            toolBarContributionItem);
      } else {
        coolBarManager.add(toolBarContributionItem);
      }
    }
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.