org.eclipse.jface.action.ToolBarManager Java Examples

The following examples show how to use org.eclipse.jface.action.ToolBarManager. 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: AbstractDocumentationHover.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IInformationControl doCreateInformationControl(Shell parent)
{
	if (BrowserInformationControl.isAvailable(parent))
	{
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, tbm);
		iControl.setBackgroundColor(documentationHover.getBackgroundColor());
		iControl.setForegroundColor(documentationHover.getForegroundColor());
		documentationHover.populateToolbarActions(tbm, iControl);
		tbm.update(true);
		documentationHover.installLinkListener(iControl);
		return iControl;
	}
	else
	{
		return new DefaultInformationControl(parent, true);
	}
}
 
Example #2
Source File: ProblemHover.java    From goclipse 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: ICEMeshPage.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * The constructor
 * 
 * @param editor
 *            The FormEditor for which the page should be constructed.
 * @param id
 *            The id of the page.
 * @param title
 *            The title of the page.
 */
public ICEMeshPage(FormEditor editor, String id, String title) {

	// Just call ICEFormPage's constructor
	super(editor, id, title);

	// Create the list of actions (these go in the ToolBar and the
	// rightClickMenu).
	actions = new ArrayList<ActionTree>();

	// Initialize the Menu- and ToolBarManagers.
	actionToolBarManager = new ToolBarManager();
	actionMenuManager = new MenuManager();

	// Initialize the collection of selection listeners
	listeners = new ListenerList();

	return;
}
 
Example #4
Source File: HistoryToolBar.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 
 * @param parent
 *            parent composite
 * @param viewer
 *            the dataset editor's tree viewer
 * @param style
 */
public HistoryToolBar( Composite parent, TreeViewer viewer, int style )
{
	super( parent, SWT.NONE );
	
	GridLayout toolbarLayout = new GridLayout( );
	toolbarLayout.marginHeight = 0;
	toolbarLayout.verticalSpacing = 0;
	setLayout( toolbarLayout );
	setLayoutData( new GridData( SWT.END, SWT.FILL, false, true ) );
	
	ToolBar toolBar = new ToolBar( this, style);
	toolBar.setLayoutData( new GridData( SWT.END, SWT.FILL, false, true ) );
	toolbarManager = new ToolBarManager( toolBar );

	this.viewer = viewer;
	createHistoryControls( toolBar );
	toolbarManager.update( false );
	
	initAccessible();
}
 
Example #5
Source File: XFilteredTree.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Create the button that clears the text.
 *
 * @param parent parent <code>Composite</code> of toolbar button
 */
private void createClearTextOld(Composite parent) {
   // only create the button if the text widget doesn't support one
   // natively
   if ((filterText.getStyle() & SWT.ICON_CANCEL) == 0) {
      filterToolBar = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL);
      filterToolBar.createControl(parent);

      IAction clearTextAction = new Action("", IAction.AS_PUSH_BUTTON) {//$NON-NLS-1$
            /**
             * @see org.eclipse.jface.action.Action#run()
             */
            @Override
            public void run() {
               clearText();
            }
         };

      clearTextAction.setToolTipText(XViewerText.get("button.clear")); //$NON-NLS-1$
      clearTextAction.setImageDescriptor(JFaceResources.getImageRegistry().getDescriptor(CLEAR_ICON));
      clearTextAction.setDisabledImageDescriptor(JFaceResources.getImageRegistry().getDescriptor(DISABLED_CLEAR_ICON));

      filterToolBar.add(clearTextAction);
   }
}
 
Example #6
Source File: AnalysisView.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * The default constructor.
 * 
 * @param dataSource
 *            The data source associated with this view (input, reference,
 *            comparison).
 */
public AnalysisView(DataSource dataSource) {

	// Create the logger
	logger = LoggerFactory.getLogger(getClass());

	// Set the data source associated with this analysis view.
	this.dataSource = dataSource;

	// Create the list of actions (these go in the ToolBar and the
	// rightClickMenu).
	actions = new ArrayList<ActionTree>();

	// Initialize the Menu- and ToolBarManagers.
	actionToolBarManager = new ToolBarManager();
	actionMenuManager = new MenuManager();

	return;
}
 
Example #7
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 #8
Source File: HoverInformationControl.java    From xds-ide with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void setVisible(boolean visible) {
    if (fInput != null) {
        fInput.setVisible(visible);
    }

    if (!visible) {
        Control[] children= fParent.getChildren();
        for (Control element : children) {
            element.dispose();
        }
        ToolBarManager toolBarManager= getToolBarManager();
        if (toolBarManager != null) {
            toolBarManager.removeAll();
        }
    }

    super.setVisible(visible);
}
 
Example #9
Source File: HTMLTextHover.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
	// @formatter:off
	/*
	final OpenDOMReferenceAction openReferenceAction = new OpenDOMReferenceAction(iControl);
	tbm.add(openReferenceAction);
	IInputChangedListener inputChangeListener = new IInputChangedListener()
	{

		public void inputChanged(Object newInput)
		{
			if (newInput instanceof BrowserInformationControlInput)
			{
				openReferenceAction.update();
			}
		}
	};
	iControl.addInputChangeListener(inputChangeListener);
	*/
	// @formatter:on
}
 
Example #10
Source File: WebBrowserViewer4Mac.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private void createNavigationBar(Composite parent) {
	toolBarManager = new ToolBarManager(SWT.FLAT);
	// toolBarManager.add(consoleAction);
	toolBarManager.add(backAction);
	toolBarManager.add(forwardAction);
	toolBarManager.add(stopAction);
	toolBarManager.add(refreshAction);
	ToolBar toolbar = toolBarManager.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());

	urlCombo = new Combo(parent, SWT.DROP_DOWN);
	urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
			.create());

	urlCombo.addListener(SWT.DefaultSelection, new Listener() {
		public void handleEvent(Event e) {
			setURL(urlCombo.getText());
		}
	});

	ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
	toolBarManager2.add(goAction);
	toolbar = toolBarManager2.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
 
Example #11
Source File: JSTextHover.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
	final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
	final OpenHelpAction openHelpAction = new OpenHelpAction(iControl);
	tbm.add(openDeclarationAction);
	tbm.add(openHelpAction);
	IInputChangedListener inputChangeListener = new IInputChangedListener()
	{
		public void inputChanged(Object newInput)
		{
			if (newInput instanceof BrowserInformationControlInput)
			{
				openDeclarationAction.update();
				openHelpAction.update();
			}
		}
	};
	iControl.addInputChangeListener(inputChangeListener);
}
 
Example #12
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 #13
Source File: WebBrowserViewer.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private void createNavigationBar(Composite parent)
{
	toolBarManager = new ToolBarManager(SWT.FLAT);
	toolBarManager.add(consoleAction);
	toolBarManager.add(backAction);
	toolBarManager.add(forwardAction);
	toolBarManager.add(stopAction);
	toolBarManager.add(refreshAction);
	ToolBar toolbar = toolBarManager.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());

	urlCombo = new Combo(parent, SWT.DROP_DOWN);
	urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
	urlCombo.addListener(SWT.DefaultSelection, new Listener() {
		
		@Override
		public void handleEvent(Event e) {
			setURL(urlCombo.getText());
		}
	});

	ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
	toolBarManager2.add(goAction);
	toolbar = toolBarManager2.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
 
Example #14
Source File: SelectFallDialog.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent){
	Composite ret = new Composite(parent, SWT.None);
	ret.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	GridLayout gl_ret = new GridLayout(1, false);
	gl_ret.marginWidth = 0;
	gl_ret.marginHeight = 0;
	ret.setLayout(gl_ret);
	
	list = new List(ret, SWT.BORDER);
	list.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	
	reloadFaelleList();
	
	ToolBarManager tbManager = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL | SWT.WRAP);
	tbManager.add(GlobalActions.neuerFallAction);
	tbManager.createControl(ret);
	
	ElexisEventDispatcher.getInstance().addListeners(updateFallListener);
	
	return ret;
}
 
Example #15
Source File: AnalysisView.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Populates the specified ToolBar with ToolItems used to manipulate this
 * IAnalysisView.
 * 
 * @param toolBar
 *            The ToolBar to fill with ToolItems.
 */
@Override
public void getToolBarContributions(ToolBar toolBar) {
	logger.info("AnalysisView message: " + "Populating provided ToolBar.");

	// To populate a pre-existing ToolBar, we *have* to re-initialize the
	// ToolBarManager and pass the ToolBar as a parameter to the
	// constructor.
	actionToolBarManager = new ToolBarManager(toolBar);

	// Because we just re-initialized the ToolBarManager, we need to update
	// it here.
	updateActionManagers();

	return;
}
 
Example #16
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 main toolbar
 * 
 * @param c
 * @param iObservation
 * @param horizontalGrap
 * @return
 */
public static List<Action> createToolbarMainComponent(Composite c, IObservation iObservation,
	int horizontalGrap){
	
	Composite toolbarComposite = new Composite(c, SWT.NONE);
	toolbarComposite.setLayout(SWTHelper.createGridLayout(true, 2));
	toolbarComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, false));
	
	List<Action> actions = new ArrayList<>();
	LocalDateTime currentDate = iObservation.getEffectiveTime().orElse(LocalDateTime.now());
	
	ToolBarManager menuManager = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL);
	
	Action action = new DateAction(c.getShell(), currentDate, toolbarComposite);
	menuManager.add(action);
	menuManager.createControl(toolbarComposite)
		.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, horizontalGrap, 1));
	actions.add(action);
	
	return actions;
}
 
Example #17
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 #18
Source File: TypeHierarchyViewPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void updateMainToolbar(boolean horizontal) {
	IActionBars actionBars= getViewSite().getActionBars();
	IToolBarManager tbmanager= actionBars.getToolBarManager();

	if (horizontal) {
		clearMainToolBar(tbmanager);
		ToolBar typeViewerToolBar= new ToolBar(fTypeViewerViewForm, SWT.FLAT | SWT.WRAP);
		fillMainToolBar(new ToolBarManager(typeViewerToolBar));
		fTypeViewerViewForm.setTopLeft(typeViewerToolBar);
	} else {
		fTypeViewerViewForm.setTopLeft(null);
		fillMainToolBar(tbmanager);
	}
}
 
Example #19
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 #20
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 #21
Source File: AbstractFormPage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private Control createHeader(Form form) {
    final Composite head = form.getHead();
    final ToolBar toolBar = new ToolBar(head, SWT.HORIZONTAL | SWT.RIGHT | SWT.NO_FOCUS);
    toolBarManager = new ToolBarManager(toolBar);
    createHeaderContent(toolBar);

    Label toolbarSeparator = new Label(form.getBody(), SWT.HORIZONTAL | SWT.SEPARATOR);
    toolbarSeparator.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
    return toolBar;
}
 
Example #22
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 #23
Source File: TreeCompoundTask.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates the compound task's title area.
 * 
 * @param parent
 *            the SWT parent for the title area composite.
 * @return the created title area composite.
 */
protected Composite createTitleArea( Composite parent )
{
	Composite cmpTitle = new Composite( parent, SWT.NONE );
	GridLayout layout = new GridLayout( 2, false );
	layout.marginWidth = 0;
	layout.marginHeight = 0;
	cmpTitle.setLayout( layout );

	GridData gridData = new GridData( GridData.FILL_BOTH );
	cmpTitle.setLayoutData( gridData );

	Label label = new Label( cmpTitle, SWT.NONE );
	{
		label.setFont( JFaceResources.getBannerFont( ) );
		label.setText( getTitleAreaString( ) );
	}

	if ( needHistory )
	{
		ToolBar historyBar = new ToolBar( cmpTitle, SWT.HORIZONTAL
				| SWT.FLAT );
		{
			GridData gd = new GridData( );
			gd.horizontalAlignment = SWT.END;
			historyBar.setLayoutData( gd );
			ToolBarManager historyManager = new ToolBarManager( historyBar );
			history.createHistoryControls( historyBar, historyManager );
			historyManager.update( false );
		}
	}
	else
	{
		new Label( cmpTitle, SWT.NONE );
	}
	return cmpTitle;
}
 
Example #24
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 help toolbar for
 * @return the created <code>ToolBarManager</code>
 */
public ToolBarManager createLeftToolBar(ViewerPane pane) {
    ToolBar tb= new ToolBar(pane, SWT.FLAT);
    pane.setTopRight(tb);
    ToolBarManager tbm= new ToolBarManager(tb);

    tbm.add(fCreateLinkedSourceFolderAction);
    tbm.add(fCreateSourceFolderAction);
    tbm.add(fResetAllAction);
    tbm.add(new HelpAction());

    tbm.update(true);
    return tbm;
}
 
Example #25
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 #26
Source File: RcpActionBarAdvisor.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
	IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.LEFT);
	coolBar.add(new ToolBarContributionItem(toolbar, "main"));
	toolbar.add(Actions.create(
			M.Home, Icon.HOME.descriptor(), StartPage::open));
	toolbar.add(saveAction);
	toolbar.add(saveAsAction);
	toolbar.add(saveAllAction);
	coolBar.add(toolbar);
}
 
Example #27
Source File: DocumentsFilterBarComposite.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void createContent(){
	setBackground(UiDesk.getColor(UiDesk.COL_WHITE));
	setLayout(new FillLayout());
	
	manager = new ToolBarManager(SWT.WRAP);
	manager.createControl(this);
	refresh();
}
 
Example #28
Source File: CustomAbstractInformationControl.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private void createStatusComposite(final String statusFieldText, final ToolBarManager toolBarManager,
		Color foreground, Color background)
{
	if (toolBarManager == null && statusFieldText == null)
		return;

	fStatusComposite = new Composite(fShell, SWT.NONE);
	GridData gridData = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
	fStatusComposite.setLayoutData(gridData);
	GridLayout statusLayout = new GridLayout(1, false);
	statusLayout.marginHeight = 0;
	statusLayout.marginWidth = 0;
	statusLayout.verticalSpacing = 1;
	fStatusComposite.setLayout(statusLayout);

	fSeparator = new Label(fStatusComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
	fSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	if (statusFieldText != null)
	{
		createStatusLabel(statusFieldText, foreground, background);
	}
	else
	{
		createToolBar(toolBarManager);
	}
}
 
Example #29
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 #30
Source File: ViewerPane.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public ViewerPane(Composite parent, int style) {
	super(parent, style);

	marginWidth= 0;
	marginHeight= 0;

	CLabel label= new CLabel(this, SWT.NONE);
	setTopLeft(label);

	ToolBar tb= new ToolBar(this, SWT.FLAT);
	setTopCenter(tb);
	fToolBarManager= new ToolBarManager(tb);
}