Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IContributionItem


            // Find reference group.
            if (tgroup == null) {
        tgroup = IWorkbenchActionConstants.MB_ADDITIONS;
      }
            IContributionItem sep = null;
            sep = toolbar.find(tgroup);
            if (sep == null) {
                if (appendIfMissing) {
                    addGroup(toolbar, tgroup);
                } else {
View Full Code Here


        /**
         * This implementation inserts the group into the action set additions group. 
         */
        protected void addGroup(IContributionManager mgr, String name) {
            IContributionItem refItem = findInsertionPoint(
                    IWorkbenchActionConstants.MB_ADDITIONS, actionSetId, mgr,
                    true);
            // Insert the new group marker.
            ActionSetSeparator group = new ActionSetSeparator(name, actionSetId);
            if (refItem == null) {
                mgr.add(group);
            } else {
                mgr.insertAfter(refItem.getId(), group);
            }
        }
View Full Code Here

            // create a coolitem for the toolbar id if it does not yet exist       
            IToolBarManager toolBarManager = bars.getToolBarManager(toolBarId);

            // Check to see if the group already exists
            IContributionItem groupMarker = toolBarManager.find(toolGroupId);
            // Add a group marker if one does not exist
            if (groupMarker == null) {
                toolBarManager.add(new Separator(toolGroupId));
            }
            IContributionItem refItem = findAlphabeticalOrder(toolGroupId,
                    contributingId, toolBarManager);
            if (refItem != null && refItem.getId() != null) {
                toolBarManager.insertAfter(refItem.getId(), actionContribution);
            } else {
                toolBarManager.add(actionContribution);
            }
            toolBarManager.update(false);
View Full Code Here

            // retreive the toolbar from the action bars.
            IToolBarManager toolBar = bars.getToolBarManager(toolBarId);

            // Check to see if the group already exists
            IContributionItem groupMarker = toolBar.find(toolGroupId);
            // Add a group marker if one does not exist
            if (groupMarker == null) {
                // @issue should this be a GroupMarker?
                toolBar.add(new Separator(toolGroupId));
            }
View Full Code Here

                IContributionItem[] items = menu.getItems();
                // Loop thru all the current groups looking for the first
                // group whose id > than the current action set id. Insert
                // current marker just before this item then.
                for (int i = 0; i < items.length; i++) {
                    IContributionItem item = items[i];
                    if (item.isSeparator() || item.isGroupMarker()) {
                        if (item instanceof IActionSetContributionItem) {
                            String testId = ((IActionSetContributionItem) item)
                                    .getActionSetId();
                            if (actionSetId.compareTo(testId) < 0) {
                                menu.insertBefore(items[i].getId(), marker);
View Full Code Here

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

            // look for starting point
            while (insertIndex < items.length) {
                IContributionItem item = items[insertIndex];
                if (startId != null && startId.equals(item.getId())) {
          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];
                if (item.isGroupMarker()) {
          break;
        }

                String testId = null;
                if (item instanceof PluginActionCoolBarContributionItem) {
View Full Code Here

        /* (non-Javadoc)
         * Method declared on Basic Contribution.
         */
        protected void insertAfter(IContributionManager mgr, String refId,
                IContributionItem item) {
            IContributionItem refItem = findInsertionPoint(refId, actionSetId,
                    mgr, true);
            if (refItem != null) {
                mgr.insertAfter(refItem.getId(), item);
            } else {
                WorkbenchPlugin
                        .log("Reference item " + refId + " not found for action " + item.getId()); //$NON-NLS-1$ //$NON-NLS-2$
            }
        }
View Full Code Here

                    action);

            bars.removeAdjunctContribution(actionContribution);

            // remove a coolitem for the toolbar id if it exists      
            IContributionItem cbItem = coolBarMgr.find(toolBarId);
            if (cbItem != null) {
        coolBarMgr.remove(cbItem);
      }

            //      activeManager = cbItem.getToolBarManager(); 
View Full Code Here

          }
                }
      }
            Iterator iter = itemsToRemove.iterator();
            while (iter.hasNext()) {
                IContributionItem item = (IContributionItem) iter.next();
                menuMgr.remove(item);
            }
            menuMgr.update(true);
        }
View Full Code Here

        // Find the insertion point for the new item.
        // We do this by iterating through all of the previous
        // action set contributions define within the current group.
        for (int nX = insertIndex + 1; nX < items.length; nX++) {
            IContributionItem item = items[nX];
            if (item.isSeparator() || item.isGroupMarker()) {
                // Fix for bug report 18357
                break;
            }
            if (item instanceof IActionSetContributionItem) {
                if (sortId != null) {
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.IContributionItem

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.