Java Code Examples for org.eclipse.jface.action.IToolBarManager#add()

The following examples show how to use org.eclipse.jface.action.IToolBarManager#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ICEResourceView.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Create and add the play, previous, and next buttons to the tool bar for
 * this view.
 */
private void createActions() {

	// Get the IToolBarManager
	IActionBars actionBars = getViewSite().getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();

	// Create a previous button and add it to the tool bar
	prevAction = new PreviousAction(this);
	toolBarManager.add(prevAction);

	// Create a play button and add it to the tool bar
	playAction = new PlayAction(this);
	toolBarManager.add(playAction);

	// Create a next button and add it to the tool bar
	nextAction = new NextAction(this);
	toolBarManager.add(nextAction);

	return;
}
 
Example 2
Source File: JavadocView.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void fillToolBar(IToolBarManager tbm) {
	tbm.add(fBackAction);
	tbm.add(fForthAction);
	tbm.add(new Separator());

	super.fillToolBar(tbm);
	tbm.add(fOpenBrowserAction);
}
 
Example 3
Source File: VisualInterfaceActionBarContributor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This adds Separators for editor additions to the tool bar.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void contributeToToolBar ( IToolBarManager toolBarManager )
{
    toolBarManager.add ( new Separator ( "visualinterface-settings" ) ); //$NON-NLS-1$
    toolBarManager.add ( new Separator ( "visualinterface-additions" ) ); //$NON-NLS-1$
}
 
Example 4
Source File: ApplicationActionBarAdvisor.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
  IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle());
  toolbar.add(saveAction);
  toolbar.add(ContributionItemFactory.NEW_WIZARD_SHORTLIST
      .create(getActionBarConfigurer().getWindowConfigurer().getWindow()));

  coolBar.add(toolbar);
  // allow contributions here with id "additions" (MB_ADDITIONS)
  coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
 
Example 5
Source File: TypeHierarchyViewPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void fillMainToolBar(IToolBarManager tbmanager) {
	tbmanager.removeAll();
	for (int i= 0; i < fViewActions.length; i++) {
		tbmanager.add(fViewActions[i]);
	}
	tbmanager.add(fHistoryDropDownAction);
	tbmanager.update(false);
}
 
Example 6
Source File: RecipeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This adds Separators for editor additions to the tool bar.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void contributeToToolBar ( IToolBarManager toolBarManager )
{
    toolBarManager.add ( new Separator ( "recipe-settings" ) ); //$NON-NLS-1$
    toolBarManager.add ( new Separator ( "recipe-additions" ) ); //$NON-NLS-1$
}
 
Example 7
Source File: CrossflowActionBarContributor.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * This adds Separators for editor additions to the tool bar.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
	super.contributeToToolBar(toolBarManager);
	toolBarManager.add(new Separator("crossflow-settings"));
	toolBarManager.add(new Separator("crossflow-additions"));
}
 
Example 8
Source File: LibraryExplorerContextMenuProvider.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Handles all global actions
 */
private void handleGlobalAction( )
{
	IPageSite pageSite = page == null ? null : page.getSite( );
	IActionBars actionBars = pageSite == null ? null
			: pageSite.getActionBars( );

	if ( actionBars != null )
	{
		String copyID = ActionFactory.COPY.getId( );
		String pasteID = ActionFactory.PASTE.getId( );
		String deleteID = ActionFactory.DELETE.getId( );
		String moveID = ActionFactory.MOVE.getId( );
		String renameID = ActionFactory.RENAME.getId( );
		String refreshID = ActionFactory.REFRESH.getId( );

		actionBars.setGlobalActionHandler( copyID, copyResourceAction );
		actionBars.setGlobalActionHandler( pasteID, pasteResourceAction );
		actionBars.setGlobalActionHandler( deleteID, deleteResourceAction );
		actionBars.setGlobalActionHandler( moveID, moveResourceAction );
		actionBars.setGlobalActionHandler( renameID, renameResourceAction );
		actionBars.setGlobalActionHandler( refreshID, refreshExplorerAction );

		IMenuManager menuManager = actionBars.getMenuManager( );
		IToolBarManager toolBarManager = actionBars.getToolBarManager( );

		if ( menuManager != null )
		{
			menuManager.add( filterAction );
		}
		if ( toolBarManager != null )
		{
			toolBarManager.add( refreshExplorerAction );
		}
	}
}
 
Example 9
Source File: LapseView.java    From lapse-plus with GNU General Public License v3.0 5 votes vote down vote up
private void fillLocalToolBar(IToolBarManager manager) {
	manager.add(updateAction);
	//manager.add(expandAction);
	manager.add(expandAllAction);
	
	//manager.add(collapseAction);
	manager.add(collapseAllAction);
	
	manager.add(prefAction);
	manager.add(historyAction);
	manager.add(copyAction);
}
 
Example 10
Source File: AbapGitView.java    From ADT_Frontend with MIT License 4 votes vote down vote up
private void contributeToActionBars() {
	IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
	toolBarManager.add(this.actionRefresh);
	toolBarManager.add(this.actionShowMyRepos);
	toolBarManager.add(this.actionWizard);
}
 
Example 11
Source File: ApplicationActionBarAdvisor.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
private IToolBarManager createToolItem(ICoolBarManager coolBar) {
	IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle());
	coolBar.add(new ToolBarContributionItem(toolBar, "findreplace"));
	toolBar.add(findAction);
	return toolBar;
}
 
Example 12
Source File: AnnotationOutline.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/**
 * Adds the these actions to the global action handler: {@link DeleteFeatureStructureAction}
 * SelectAllAction.
 *
 * @param actionBars the new action bars
 */
@Override
public void setActionBars(IActionBars actionBars) {
  DeleteFeatureStructureAction deleteAction = new DeleteFeatureStructureAction(editor);

  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);

  getSite().getSelectionProvider().addSelectionChangedListener(deleteAction);

  actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), new SelectAllAction());
  
  Action action = new SwitchStyleAction(this);
  
  IMenuManager dropDownMenu = actionBars.getMenuManager();
  dropDownMenu.add(action);
  
  IToolBarManager toolBarManager = actionBars.getToolBarManager();
  
  // wide left annotation side action
  WideLeftAnnotationSideAction wideLeftAnnotationSideAction = new WideLeftAnnotationSideAction(
          editor);
  wideLeftAnnotationSideAction.setActionDefinitionId(WideLeftAnnotationSideAction.ID);
  wideLeftAnnotationSideAction.setText("Wides the left annotation side");
  wideLeftAnnotationSideAction.setImageDescriptor(CasEditorPlugin
          .getTaeImageDescriptor(Images.WIDE_LEFT_SIDE));

  getSite().getSelectionProvider().addSelectionChangedListener(wideLeftAnnotationSideAction);
  actionBars.setGlobalActionHandler(WideLeftAnnotationSideAction.ID, wideLeftAnnotationSideAction);
  toolBarManager.add(wideLeftAnnotationSideAction);

  // lower left annotation side action
  LowerLeftAnnotationSideAction lowerLeftAnnotationSideAction = new LowerLeftAnnotationSideAction(
          editor);
  lowerLeftAnnotationSideAction.setActionDefinitionId(LowerLeftAnnotationSideAction.ID);
  lowerLeftAnnotationSideAction.setText("Lowers the left annotation side");
  lowerLeftAnnotationSideAction.setImageDescriptor(CasEditorPlugin
          .getTaeImageDescriptor(Images.LOWER_LEFT_SIDE));

  getSite().getSelectionProvider().addSelectionChangedListener(lowerLeftAnnotationSideAction);
  actionBars.setGlobalActionHandler(LowerLeftAnnotationSideAction.ID, lowerLeftAnnotationSideAction);
  toolBarManager.add(lowerLeftAnnotationSideAction);

  // lower right annotation side action
  LowerRightAnnotationSideAction lowerRightAnnotationSideAction =
    new LowerRightAnnotationSideAction(editor);
  lowerRightAnnotationSideAction.setActionDefinitionId(LowerRightAnnotationSideAction.ID);
  lowerRightAnnotationSideAction.setText("Lowers the right annotation side");
  lowerRightAnnotationSideAction.setImageDescriptor(CasEditorPlugin
          .getTaeImageDescriptor(Images.LOWER_RIGHT_SIDE));

  getSite().getSelectionProvider().addSelectionChangedListener(lowerRightAnnotationSideAction);
  actionBars.setGlobalActionHandler(LowerRightAnnotationSideAction.ID, lowerRightAnnotationSideAction);
  toolBarManager.add(lowerRightAnnotationSideAction);

  // wide right annotation side action
  WideRightAnnotationSideAction wideRightAnnotationSideAction = new WideRightAnnotationSideAction(
          editor);
  wideRightAnnotationSideAction.setActionDefinitionId(WideRightAnnotationSideAction.ID);
  wideRightAnnotationSideAction.setText("Wides the right annotation side");
  wideRightAnnotationSideAction.setImageDescriptor(CasEditorPlugin
          .getTaeImageDescriptor(Images.WIDE_RIGHT_SIDE));

  getSite().getSelectionProvider().addSelectionChangedListener(wideRightAnnotationSideAction);
  actionBars.setGlobalActionHandler(WideRightAnnotationSideAction.ID, wideRightAnnotationSideAction);
  toolBarManager.add(wideRightAnnotationSideAction);

  // merge action
  MergeAnnotationAction mergeAction = new MergeAnnotationAction(editor);
  getSite().getSelectionProvider().addSelectionChangedListener(mergeAction);
  mergeAction.setImageDescriptor(CasEditorPlugin.getTaeImageDescriptor(Images.MERGE));

  toolBarManager.add(mergeAction);

  // delete action
  toolBarManager.add(ActionFactory.DELETE.create(getSite().getWorkbenchWindow()));
  
  super.setActionBars(actionBars);
}
 
Example 13
Source File: LamiReportView.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void createPartControl(@Nullable Composite parent) {
    LamiAnalysisReport report = fReport;
    if (report == null || parent == null) {
        return;
    }

    setPartName(report.getName());

    fTabFolder = new CTabFolder(parent, SWT.NONE);
    fTabFolder.setSimple(false);

    for (LamiResultTable table : report.getTables()) {
        String name = table.getTableClass().getTableTitle();

        CTabItem tabItem = new CTabItem(fTabFolder, SWT.NULL);
        tabItem.setText(name);

        SashForm sf = new SashForm(fTabFolder, SWT.NONE);
        fTabPages.add(new LamiReportViewTabPage(sf, table));
        tabItem.setControl(sf);
    }

    /* Add toolbar buttons */
    Action toggleTableAction = new ToggleTableAction();
    toggleTableAction.setText(Messages.LamiReportView_ActivateTableAction_ButtonName);
    toggleTableAction.setToolTipText(Messages.LamiReportView_ActivateTableAction_ButtonTooltip);
    toggleTableAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath("icons/table.gif")); //$NON-NLS-1$

    IActionBars actionBars = getViewSite().getActionBars();
    IToolBarManager toolbarMgr = actionBars.getToolBarManager();
    toolbarMgr.add(toggleTableAction);

    fNewChartAction.setText(Messages.LamiReportView_NewCustomChart);

    fClearCustomViewsAction.setText(Messages.LamiReportView_ClearAllCustomViews);
    IMenuManager menuMgr = actionBars.getMenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener((@Nullable IMenuManager manager) -> {
        if (manager != null) {
            populateMenu(manager);
        }
    });
    populateMenu(menuMgr);

    /* Select the first tab initially */
    CTabFolder tf = checkNotNull(fTabFolder);
    if (tf.getItemCount() > 0) {
        tf.setSelection(0);
    }

}
 
Example 14
Source File: FilesPage.java    From typescript.java with MIT License 4 votes vote down vote up
@Override
protected boolean contributeToToolbar(IToolBarManager manager) {
	manager.add(new BuildAction((TsconfigEditor) getEditor()));
	return true;
}
 
Example 15
Source File: ReportToolbar.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void contributeToToolBar(IToolBarManager manager) {
	manager.add(new ExportAction());
}
 
Example 16
Source File: SourceView.java    From lapse-plus with GNU General Public License v3.0 4 votes vote down vote up
private void fillLocalToolBar(IToolBarManager manager) {
	manager.add(runAction);
	manager.add(copyToClipboardAction);
}
 
Example 17
Source File: MultiPageEditorContributor.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 2 votes vote down vote up
public void contributeToToolBar(IToolBarManager manager) {
	
	manager.add(new Separator());
}
 
Example 18
Source File: AbstractInfoView.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Fills the tool bar.
 * <p>
 * Default is to do nothing.</p>
 *
 * @param tbm the tool bar manager
 */
protected void fillToolBar(IToolBarManager tbm) {
	tbm.add(fToggleLinkAction);
	tbm.add(fGotoInputAction);
}
 
Example 19
Source File: GenconfActionBarContributor.java    From M2Doc with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * This adds Separators for editor additions to the tool bar.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(new Separator("genconf-settings"));
    toolBarManager.add(new Separator("genconf-additions"));
}
 
Example 20
Source File: EipActionBarContributor.java    From eip-designer with Apache License 2.0 2 votes vote down vote up
/**
   * This adds Separators for editor additions to the tool bar.
   * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
   * @generated
   */
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
     toolBarManager.add(new Separator("eip-settings"));
     toolBarManager.add(new Separator("eip-additions"));
  }