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

The following examples show how to use org.eclipse.jface.action.ToolBarManager#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: FindingsUiUtil.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Returns all actions from the sub toolbar
 * 
 * @param c
 * @param iObservation
 * @param horizontalGrap
 * @return
 */
public static List<Action> createToolbarSubComponents(Composite c, IObservation iObservation,
	int horizontalGrap){
	
	List<Action> actions = new ArrayList<>();
	String comment = iObservation.getComment().orElse("");
	
	ToolBarManager menuManager = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL | SWT.NO_FOCUS);
	Action commentableAction = new CommentAction(c.getShell(), comment);
	menuManager.add(commentableAction);
	menuManager.createControl(c)
		.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, horizontalGrap, 1));
	actions.add(commentableAction);
	
	return actions;
}
 
Example 2
Source File: ProblemHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void fillToolBar(ToolBarManager manager, IInformationControl infoControl) {
	super.fillToolBar(manager, infoControl);
	if (!(annotation instanceof IJavaAnnotation))
		return;

	IJavaAnnotation javaAnnotation= (IJavaAnnotation) annotation;

	String optionId= JavaCore.getOptionForConfigurableSeverity(javaAnnotation.getId());
	if (optionId != null) {
		IJavaProject javaProject= javaAnnotation.getCompilationUnit().getJavaProject();
		boolean isJavadocProblem= (javaAnnotation.getId() & IProblem.Javadoc) != 0;
		ConfigureProblemSeverityAction problemSeverityAction= new ConfigureProblemSeverityAction(javaProject, optionId, isJavadocProblem, infoControl);
		manager.add(problemSeverityAction);
	}
}
 
Example 3
Source File: SvnWizardLockPage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private void addResourcesArea(Composite composite) {  
	ResourceSelectionTree.IToolbarControlCreator toolbarControlCreator = new ResourceSelectionTree.IToolbarControlCreator() {
  public void createToolbarControls(ToolBarManager toolbarManager) {
    toolbarManager.add(new ControlContribution("stealLock") {
      protected Control createControl(Composite parent) {
        stealButton = new Button(parent, SWT.CHECK);
        stealButton.setText(Policy.bind("LockDialog.stealLock")); //$NON-NLS-1$		
        return stealButton;
      }
    });
  }
  public int getControlCount() {
    return 1;
  }
};
	resourceSelectionTree = new ResourceSelectionTree(composite, SWT.NONE, "These files will be locked:", files, new HashMap(), null, false, toolbarControlCreator, null); //$NON-NLS-1$    	
	resourceSelectionTree.setShowRemoveFromViewAction(false);
}
 
Example 4
Source File: DialogPackageExplorerActionGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a toolbar manager for a given
 * <code>ViewerPane</code>
 *
 * @param pane the pane to create the <code>
 * ToolBarManager</code> for.
 * @return the created <code>ToolBarManager</code>
 */
public ToolBarManager createLeftToolBarManager(ViewerPane pane) {
    ToolBarManager tbm= pane.getToolBarManager();

    tbm.add(fAddFolderToBuildpathAction);
    tbm.add(fRemoveFromBuildpathAction);
    tbm.add(new Separator());
    tbm.add(fExcludeFromBuildpathAction);
    tbm.add(fIncludeToBuildpathAction);
    tbm.add(new Separator());
    tbm.add(fDropDownAction);

    tbm.update(true);
    return tbm;
}
 
Example 5
Source File: XbaseHoverProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureControl(final IXtextBrowserInformationControl control, ToolBarManager tbm, String font) {
	final BackAction backAction = new BackAction(control);
	backAction.setEnabled(false);
	tbm.add(backAction);
	final ForwardAction forwardAction = new ForwardAction(control);
	tbm.add(forwardAction);
	forwardAction.setEnabled(false);
	final ShowInJavadocViewAction showInJavadocViewAction = new ShowInJavadocViewAction(control);
	tbm.add(showInJavadocViewAction);
	showInJavadocViewAction.setEnabled(false);
	final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(control);
	tbm.add(openDeclarationAction);
	IInputChangedListener inputChangeListener = new IInputChangedListener() {
		@Override
		public void inputChanged(Object newInput) {
			backAction.update();
			forwardAction.update();
			if (newInput != null && newInput instanceof XbaseInformationControlInput) {
				openDeclarationAction.setEnabled(true);
				if (((XtextBrowserInformationControlInput) newInput).getInputElement() != null) {
					showInJavadocViewAction.setEnabled(true);
				}
			}
		}
	};
	control.addInputChangeListener(inputChangeListener);
	tbm.update(true);
	addLinkListener(control);
}
 
Example 6
Source File: NLSStringHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	ToolBarManager tbm= new ToolBarManager(SWT.FLAT);
	NLSHoverControl iControl= new NLSHoverControl(parent, tbm);
	OpenPropertiesFileAction openPropertiesFileAction= new OpenPropertiesFileAction(iControl);
	tbm.add(openPropertiesFileAction);
	tbm.update(true);
	return iControl;
}
 
Example 7
Source File: MethodsViewer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Fills up the tool bar with items for the method viewer
 * Should be called by the creator of the tool bar
 * @param tbm the tool bar manager
 */
public void contributeToToolBar(ToolBarManager tbm) {
	tbm.add(fShowInheritedMembersAction);
	tbm.add(fSortByDefiningTypeAction);
	tbm.add(new Separator());
	fMemberFilterActionGroup.contributeToToolBar(tbm);
}
 
Example 8
Source File: AggregateEditorComposite.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void placeComponents( )
{
	GridLayout layout = new GridLayout( 2, false );
	layout.horizontalSpacing = 2;
	layout.verticalSpacing = 0;
	layout.marginWidth = 0;
	layout.marginHeight = 0;
	setLayout( layout );

	fBtnDropDown = new ToolBar( this, SWT.FLAT );
	ChartUIUtil.addScreenReaderAccessbility( fBtnDropDown, "Aggregation");
	if( fEnabled && this.isEnabled( ) )
	{
		fBtnDropDown.setToolTipText( Messages.getString("AggregateEditorComposite.Tooltip.SetAggregateFunction") ); //$NON-NLS-1$
	}
	ToolBarManager toolManager = new ToolBarManager( fBtnDropDown );
	toolManager.add( new AggregationAction( fEnabled ) );
	toolManager.update( true );
	fBtnDropDown.addMouseListener( this );

	fBtnDropDown.addKeyListener( new KeyAdapter( ) {

		public void keyReleased( KeyEvent e )
		{
			if ( e.keyCode == SWT.ARROW_DOWN )
			{
				toggleDropDown( );
			}
		}
	} );
}
 
Example 9
Source File: MedicationTableViewerContentProvider.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void createContent(){
	currentState = new Label(this, SWT.NONE);
	
	toolbarmgr = new ToolBarManager();
	toolbarmgr.add(new PreviousPage());
	toolbarmgr.add(new NextPage());
	toolbarmgr.createControl(this);
}
 
Example 10
Source File: AbstractSliceSystem.java    From dawnsci with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates the slice tools by reading extension points
 * for the slice tools.
 * 
 * @return
 */
protected IToolBarManager createSliceTools() {
			
	final ToolBarManager man = new ToolBarManager(SWT.FLAT|SWT.RIGHT|SWT.WRAP);
	man.add(new Separator("sliceTools"));
	return createSliceTools(man);
}
 
Example 11
Source File: EigenartikelDetailDisplay.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @wbp.parser.entryPoint
 */
@Override
public Composite createDisplay(Composite parent, IViewSite site){
	this.site = site;
	
	container = new Composite(parent, SWT.NONE);
	// 		parent.setLayoutData(new GridData(GridData.FILL_BOTH));
		layout = new StackLayout();
		container.setLayout(layout);
	
	compProduct = new Composite(container, SWT.None);		
	compProduct.setLayout(new GridLayout(1, false));
	
	ToolBar toolBar = new ToolBar(compProduct, SWT.BORDER | SWT.FLAT | SWT.RIGHT);
	toolBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	final ToolBarManager manager = new ToolBarManager(toolBar);
	manager.add(createAction);
	if (LocalLockServiceHolder.get().getStatus() != Status.STANDALONE) {
		manager.add(toggleLockAction);
	}
	manager.add(deleteAction);
	manager.update(true);
	toolBar.pack();
	
	epc = new EigenartikelProductComposite(compProduct, SWT.None);
	epc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	epc.setUnlocked(LocalLockServiceHolder.get().getStatus() == Status.STANDALONE);
	
	compArticle = new Composite(container, SWT.None);		
	compArticle.setLayout(new GridLayout(1, false));
	
	ec = new EigenartikelComposite(compArticle, SWT.None, false, null);
	ec.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	ec.setUnlocked(LocalLockServiceHolder.get().getStatus() == Status.STANDALONE);
	
	layout.topControl = compProduct;
	container.layout();
	
	return container;
}
 
Example 12
Source File: HL7LabImportRulesPreferencePage.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Create contents of the preference page.
 * 
 * @param parent
 */
@Override
public Control createContents(Composite parent){
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));
	
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	composite.setLayout(new GridLayout(2, false));
	
	Label lblLabNoPathFlagMeansNonPath = new Label(composite, SWT.WRAP);
	lblLabNoPathFlagMeansNonPath
		.setText(Messages.HL7LabImportRulesPreferencePage_lblLabImportRulesHeader_text);
	
	ToolBarManager toolbarmgr = new ToolBarManager();
	toolbarmgr.add(new AddMissingPathFlagMeansNonPathLaboratoryAction());
	toolbarmgr.add(new RemoveMissingPathFlagMeansNonPathLaboratoryAction());
	ToolBar toolbar = toolbarmgr.createControl(composite);
	toolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
	new Label(composite, SWT.NONE);
	
	labMPathMNonPathListViewer = new ListViewer(composite, SWT.BORDER | SWT.V_SCROLL);
	labMPathMNonPathListViewer.setContentProvider(ArrayContentProvider.getInstance());
	labMPathMNonPathListViewer.setLabelProvider(new LabelProvider() {
		@Override
		public String getText(Object element){
			if (element instanceof Kontakt) {
				return ((Kontakt) element).getLabel();
			}
			return super.getText(element);
		}
	});
	GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
	gridData.heightHint = 80;
	labMPathMNonPathListViewer.getList()
		.setLayoutData(gridData);

	labMPathMNonPathListViewer.setInput(findAllLabsWithPathFlagMissingMeansNonPathologic());
	
	return container;
}
 
Example 13
Source File: JavadocHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	if (BrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm= new ToolBarManager(SWT.FLAT);
		String font= PreferenceConstants.APPEARANCE_JAVADOC_FONT;
		BrowserInformationControl iControl= new BrowserInformationControl(parent, font, tbm);

		final BackAction backAction= new BackAction(iControl);
		backAction.setEnabled(false);
		tbm.add(backAction);
		final ForwardAction forwardAction= new ForwardAction(iControl);
		tbm.add(forwardAction);
		forwardAction.setEnabled(false);

		final ShowInJavadocViewAction showInJavadocViewAction= new ShowInJavadocViewAction(iControl);
		tbm.add(showInJavadocViewAction);
		final OpenDeclarationAction openDeclarationAction= new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);

		final SimpleSelectionProvider selectionProvider= new SimpleSelectionProvider();
		if (fSite != null) {
			OpenAttachedJavadocAction openAttachedJavadocAction= new OpenAttachedJavadocAction(fSite);
			openAttachedJavadocAction.setSpecialSelectionProvider(selectionProvider);
			openAttachedJavadocAction.setImageDescriptor(JavaPluginImages.DESC_ELCL_OPEN_BROWSER);
			openAttachedJavadocAction.setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_OPEN_BROWSER);
			selectionProvider.addSelectionChangedListener(openAttachedJavadocAction);
			selectionProvider.setSelection(new StructuredSelection());
			tbm.add(openAttachedJavadocAction);
		}

		IInputChangedListener inputChangeListener= new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				backAction.update();
				forwardAction.update();
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof BrowserInformationControlInput) {
					BrowserInformationControlInput input= (BrowserInformationControlInput) newInput;
					Object inputElement= input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					boolean isJavaElementInput= inputElement instanceof IJavaElement;
					showInJavadocViewAction.setEnabled(isJavaElementInput);
					openDeclarationAction.setEnabled(isJavaElementInput);
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);

		tbm.update(true);

		addLinkListener(iControl);
		return iControl;

	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
Example 14
Source File: MakrosComposite.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Create the composite.
 * 
 * @param parent
 * @param style
 */
public MakrosComposite(Composite parent, int style){
	super(parent, style);
	setLayout(new GridLayout(1, false));
	
	CLabel lblHeader = new CLabel(this, SWT.NONE);
	lblHeader.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	lblHeader.setText("Makros des Anwender " + CoreHub.getLoggedInContact().getLabel());

	
	SashForm sash = new SashForm(this, SWT.HORIZONTAL);
	sash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	Composite selectionComposite = new Composite(sash, SWT.NONE);
	selectionComposite.setLayout(new GridLayout(1, true));
	ToolBarManager toolbar = new ToolBarManager();
	ToolBar toolbarControl = toolbar.createControl(selectionComposite);
	toolbarControl.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
	
	viewer = new TableViewer(selectionComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
	viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setLabelProvider(new DefaultLabelProvider());
	viewer.setInput(getUserMakros(CoreHub.getLoggedInContact()));
	viewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event){
			StructuredSelection selection = (StructuredSelection) viewer.getSelection();
			if (selection != null && !selection.isEmpty()) {
				detailComposite.setMakro((MakroDTO) selection.getFirstElement());
			} else {
				detailComposite.setMakro(null);
			}
		}
	});
	viewer.setComparator(new ViewerComparator());
	
	MenuManager menuManager = new MenuManager();
	menuManager.add(new RemoveMakroAction(viewer));
	MenuManager subMenu = new MenuManager("Marko zu Anwender kopieren");
	subMenu.setRemoveAllWhenShown(true);
	subMenu.addMenuListener(new IMenuListener() {
		@Override
		public void menuAboutToShow(IMenuManager manager){
			addCopyToUserActions(manager);
		}
	});
	menuManager.add(subMenu);
	
	Menu menu = menuManager.createContextMenu(viewer.getTable());
	viewer.getTable().setMenu(menu);
	
	toolbar.add(new AddMakroAction(viewer));
	toolbar.add(new RemoveMakroAction(viewer));
	toolbar.add(new RefreshMakrosAction(viewer));
	toolbar.update(true);
	
	detailComposite = new MakroDetailComposite(sash, SWT.NONE);
	
	// can only be set after child components are available
	sash.setWeights(new int[] {
		1, 4
	});
}
 
Example 15
Source File: BreadcrumbItemDropDown.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
public BreadcrumbItemDropDown(BreadcrumbItem parent, Composite composite) {
  fParent = parent;
  fParentComposite = composite;
  fMenuIsShown = false;
  fEnabled = true;

  fToolBar = new ToolBar(composite, SWT.FLAT);
  fToolBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
  // SWTUtil.setAccessibilityText(
  // fToolBar,
  // BreadcrumbMessages.BreadcrumbItemDropDown_showDropDownMenu_action_toolTip);
  ToolBarManager manager = new ToolBarManager(fToolBar);

  final Action showDropDownMenuAction = new Action(null, SWT.NONE) {
    public void run() {
      Shell shell = fParent.getDropDownShell();
      if (shell != null)
        return;

      shell = fParent.getViewer().getDropDownShell();
      if (shell != null)
        shell.close();

      showMenu();

      fShell.setFocus();
    }
  };

  showDropDownMenuAction.setImageDescriptor(new AccessibelArrowImage(isLTR()));
  // showDropDownMenuAction.setToolTipText(BreadcrumbMessages.BreadcrumbItemDropDown_showDropDownMenu_action_toolTip);
  manager.add(showDropDownMenuAction);

  manager.update(true);
  if (IS_MAC_WORKAROUND) {
    manager.getControl().addMouseListener(new MouseAdapter() {
      // see also BreadcrumbItemDetails#addElementListener(Control)
      public void mouseDown(MouseEvent e) {
        showDropDownMenuAction.run();
      }
    });
  }
}
 
Example 16
Source File: SelectorPanel.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
public SelectorPanel(Composite parent, IAction... actions){
	super(parent, SWT.NONE);
	setBackground(parent.getBackground());
	/*
	 * RowLayout layout = new RowLayout(SWT.HORIZONTAL); layout.fill = true; layout.pack = true;
	 */
	FormLayout layout = new FormLayout();
	layout.marginLeft = 0;
	layout.marginRight = 0;
	setLayout(layout);
	tActions = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL | SWT.WRAP);
	
	aClr = new Action(Messages.SelectorPanel_clearFields) {
		{
			setImageDescriptor(Images.IMG_CLEAR.getImageDescriptor());
		}
		
		@Override
		public void run(){
			clearValues();
		}
	};
	tActions.add(aClr);
	
	autoSearchActivatedAction =
		new Action(Messages.SelectorPanel_automaticSearch, Action.AS_CHECK_BOX) {
			{
				setImageDescriptor(Images.IMG_REFRESH.getImageDescriptor());
			}
			
			@Override
			public void run(){
				autoSearchActivated = !autoSearchActivated;
				if (autoSearchActivated)
					contentsChanged(null);
				super.run();
			}
		};
	autoSearchActivatedAction.setToolTipText(Messages.SelectorPanel_activateAutomaticSearch);
	autoSearchActivatedAction.setChecked(autoSearchActivated);
	tActions.add(autoSearchActivatedAction);
	
	performSearchAction = new Action(Messages.SelectorPanel_performSearch) {
		{
			setImageDescriptor(Images.IMG_NEXT.getImageDescriptor());
		}
		
		@Override
		public void run(){
			boolean oldState = autoSearchActivated;
			autoSearchActivated = true;
			contentsChanged(null);
			autoSearchActivated = oldState;
			super.run();
		}
	};
	performSearchAction.setToolTipText(Messages.SelectorPanel_performSearchTooltip);
	tActions.add(performSearchAction);
	
	for (IAction ac : actions) {
		if (ac != null) {
			tActions.add(ac);
		} else {
			tActions.add(new Separator());
		}
	}
	tb = tActions.createControl(this);
	FormData fdActions = new FormData();
	fdActions.top = new FormAttachment(0, 0);
	fdActions.right = new FormAttachment(100, 0);
	tb.setLayoutData(fdActions);
	cFields = new Composite(this, SWT.NONE);
	FormData fd = new FormData();
	fd.left = new FormAttachment(0, 0);
	fd.top = new FormAttachment(0, 0);
	fd.right = new FormAttachment(100, 0);
	cFields.setLayoutData(fd);
	cFields.setLayout(new FillLayout());
	if (parent.getData("TEST_COMP_NAME") != null) {
		for (int idx = 0; idx < tb.getItemCount(); idx++)
		{
			tb.getItem(idx).setData("TEST_COMP_NAME",
				parent.getData("TEST_COMP_NAME") + "_" + idx + "_tbi");
		}
	}
	pack();
}
 
Example 17
Source File: BasicFormPage.java    From tlaplus with MIT License 4 votes vote down vote up
/**
  * Called during FormPage life cycle and delegates the form creation
  * to three methods {@link BasicFormPage#createBodyContent(IManagedForm)}, 
  * {@link BasicFormPage#loadData()}, {@link BasicFormPage#pageInitializationComplete()}
  */
 protected void createFormContent(IManagedForm managedForm)
 {
     ScrolledForm formWidget = managedForm.getForm();
     formWidget.setText(getTitle());
     if (imagePathTemplate != null)
     {
// Show the given image left of the form page's title and beneath the tab
// bar. E.g. the main model page displays three sliders left of its "Model
// Overview" label.
         formWidget.setImage(createRegisteredImage(24));
     }

     Composite body = formWidget.getBody();

     FormToolkit toolkit = managedForm.getToolkit();
     toolkit.decorateFormHeading(formWidget.getForm());

     /*
      * The head client is the second row of the header section, below the title; if we don't create this
      * with 'NO_FOCUS' then the toolbar will always take focus on a form page that gains focus.
      */
     ToolBar headClientTB = new ToolBar(formWidget.getForm().getHead(), SWT.HORIZONTAL | SWT.NO_FOCUS);
     headClientTBM = new ToolBarManager(headClientTB);
     // run button
     headClientTBM.add(new DynamicContributionItem(new RunAction()));
     // validate button
     headClientTBM.add(new DynamicContributionItem(new GenerateAction()));
     // stop button
     headClientTBM.add(new DynamicContributionItem(new StopAction()));

     // refresh the head client toolbar
     headClientTBM.update(true);

     formWidget.getForm().setHeadClient(headClientTB);

     // setup body layout
     body.setLayout(getBodyLayout());

     // create the body of the page
     createBodyContent(managedForm);

     super.createFormContent(managedForm);
     try
     {
         // load data from the model
     	//TODO decouple from UI thread (causes I/O)
         loadData();
     } catch (CoreException e)
     {
         TLCUIActivator.getDefault().logError("Error loading data from the model into the form fields", e);
     }

     // check the model is-running state
     refresh();

     // finalizes the page construction
     // activates the change listeners
     pageInitializationComplete();
     TLCUIHelper.setHelp(getPartControl(), helpId);

     getManagedForm().getForm().getForm().addMessageHyperlinkListener(errorMessageHyperLinkListener);
 }
 
Example 18
Source File: AbstractSliceSystem.java    From dawnsci with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Creates the slice tools by reading extension points
 * for the slice tools.
 * 
 * @return
 */
protected IToolBarManager createSliceTools(final ToolBarManager man) {
			
	final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.dawnsci.slicing.api.slicingTool");

 		plotTypeActions= new HashMap<Enum<?>, IAction>();
 		this.sliceTools= new LinkedHashMap<String, ISlicingTool>(17);

	for (IConfigurationElement e : eles) {
		
		final ISlicingTool slicingTool = createSliceTool(e);
		
		final String requireSep = e.getAttribute("separator");
		if ("true".equals(requireSep)) man.add(new Separator());
		
		IAction action = slicingTool.createAction();
		if (action==null) action = createSliceToolAction(e, slicingTool);
		man.add(action);
		plotTypeActions.put(slicingTool.getSliceType(), action);

		sliceTools.put(slicingTool.getToolId(), slicingTool);
	}
							
	return man;
}
 
Example 19
Source File: AbstractAnnotationHover.java    From typescript.java with MIT License 2 votes vote down vote up
/**
 * Adds actions to the given toolbar.
 *
 * @param manager
 *            the toolbar manager to add actions to
 * @param infoControl
 *            the information control
 */
public void fillToolBar(ToolBarManager manager, IInformationControl infoControl) {
	ConfigureAnnotationsAction configureAnnotationsAction = new ConfigureAnnotationsAction(annotation,
			infoControl);
	manager.add(configureAnnotationsAction);
}
 
Example 20
Source File: AbstractAnnotationHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Adds actions to the given toolbar.
 *
 * @param manager the toolbar manager to add actions to
 * @param infoControl the information control
 */
public void fillToolBar(ToolBarManager manager, IInformationControl infoControl) {
	ConfigureAnnotationsAction configureAnnotationsAction= new ConfigureAnnotationsAction(annotation, infoControl);
	manager.add(configureAnnotationsAction);
}