Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IContributionManager


    // 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;
View Full Code Here


    if (adjunctContributions.size() > 0) {
      for (Iterator i = adjunctContributions.iterator(); i.hasNext();) {
        IContributionItem item = (IContributionItem) i.next();
        if (item instanceof ContributionItem) {
          item.setVisible(set);
          IContributionManager manager = ((ContributionItem) item)
              .getParent();
          manager.markDirty();
          manager.update(false);
          if (!coolBarManager.isDirty()) {
            coolBarManager.markDirty();
          }
          item.update(ICoolBarManager.SIZE);
        }
View Full Code Here

   
    /* (non-Javadoc)
     * @see org.eclipse.jface.action.IContributionItem#setParent(org.eclipse.jface.action.IContributionManager)
     */
    public void setParent(IContributionManager parent) {
        IContributionManager oldParent = getParent();
        super.setParent(parent);
        if (oldParent == parent) {
      return;
    }
       
View Full Code Here

     * Mark the parent dirty if we have a parent.
     *
     * @since 3.1
     */
    private void invalidateParent() {
        IContributionManager parent = getParent();
        if (parent != null) {
      parent.markDirty();
    }
    }
View Full Code Here

    private void updateVisibility() {
      boolean visible = identifier != null ? (identifier.isEnabled() && lastExpressionResult)
          : lastExpressionResult;
      item.setVisible(visible);

      IContributionManager parent = null;
      if (item instanceof ContributionItem) {
        parent = ((ContributionItem) item).getParent();

      } else if (item instanceof MenuManager) {
        parent = ((MenuManager) item).getParent();
      }
      if (parent != null) {
        parent.markDirty();
        managersAwaitingUpdates.add(parent);
      }
    }
View Full Code Here

  private void updateManagers() {
    Object[] managers = managersAwaitingUpdates.toArray();
    managersAwaitingUpdates.clear();
    for (int i = 0; i < managers.length; i++) {
      IContributionManager mgr = (IContributionManager) managers[i];
      mgr.update(true);
      if (mgr instanceof ToolBarManager) {
        if (!updateCoolBar((ToolBarManager) mgr)) {
          updateTrim((ToolBarManager) mgr);
        }
      } else if (mgr instanceof MenuManager) {
        IContributionManager parent = ((MenuManager) mgr).getParent();
        if (parent != null) {
          parent.update(true);
        }
      }
    }
  }
View Full Code Here

            display = Display.getDefault();

        display.asyncExec(new Runnable(){
            public void run() {

                IContributionManager bar = mapEditorSite.getActionBars().getStatusLineManager();
                if (bar == null)
                    return;
                StatusBarButton label = (StatusBarButton) bar.find(StatusBarButton.CRS_ITEM_ID);
                if (label == null) {
                    label = new StatusBarButton(StatusBarButton.CRS_ITEM_ID, full);
                    bar.appendToGroup(StatusLineManager.MIDDLE_GROUP, label);
                    label.setVisible(true);
                    bar.update(true);
                    return;
                }
                label.setText(full);
            }
        });
View Full Code Here

        });

    }
    void doUpdateScaleLabel() {
        IContributionManager bar = mapEditorSite.getActionBars().getStatusLineManager();
        if (bar == null)
            return;
        ScaleRatioLabel label = (ScaleRatioLabel) bar.find(ScaleRatioLabel.SCALE_ITEM_ID);
        if (label == null) {
            label = new ScaleRatioLabel(this);
            bar.appendToGroup(StatusLineManager.MIDDLE_GROUP, label);
            label.setVisible(true);
            bar.update(true);
        }
        label.setViewportModel(getMap().getViewportModel());
    }
View Full Code Here

        }
        label.setViewportModel(getMap().getViewportModel());
    }

    private boolean isSame( String crs ) {
        IContributionManager bar = getActionbar().getStatusLineManager();

        if (bar != null) {
            StatusBarButton label = (StatusBarButton) bar.find(StatusBarButton.CRS_ITEM_ID);
            if (label != null && crs.equals(label.getText()))
                return true;
        }
        return false;
    }
View Full Code Here

            display = Display.getDefault();

        display.asyncExec(new Runnable(){
            public void run() {

                IContributionManager bar = mapEditorSite.getActionBars().getStatusLineManager();
                if (bar == null)
                    return;
                StatusBarButton label = (StatusBarButton) bar.find(StatusBarButton.CRS_ITEM_ID);
                if (label == null) {
                    label = new StatusBarButton(StatusBarButton.CRS_ITEM_ID, full);
                    bar.appendToGroup(StatusLineManager.MIDDLE_GROUP, label);
                    label.setVisible(true);
                   
//                    StatusBarToolOptionsPage label2 = new StatusBarToolOptionsPage("An Id",editor);
//                    bar.appendToGroup(StatusLineManager.BEGIN_GROUP, label2);
//                    label2.setVisible(true);
                   
                    bar.update(true);
                    return;
                }
                label.setText(full);
            }
        });
View Full Code Here

TOP

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

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.