org.eclipse.ui.SubActionBars Java Examples

The following examples show how to use org.eclipse.ui.SubActionBars. 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: TexOutlineTreeView.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
   * Creates the viewer. Registers the full outline at the document model.
   */
  public void createPartControl(Composite parent) {
PageSite site = new PageSite(getViewSite());
outline.init(site);
  	outline.createControl(parent);
  	((SubActionBars) site.getActionBars()).activate(true);
  	outline.switchTreeViewerSelectionChangeListener(this);
  	
  	// add a part listener if the editor isn't available when the view is created.
      getSite().getPage().addPartListener(this);
      // register it directly if the view is already created.
      IEditorPart part = getSite().getPage().getActiveEditor();
      if (part != null && part instanceof TexEditor) {
          TexEditor e = (TexEditor) part;
          e.registerFullOutline(this);
      }
  }
 
Example #2
Source File: DesignerActionBarContributor.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void propertyChange( PropertyChangeEvent event )
{
	RegisterAction[] actions = getInsertElementActions( );
	if ( actions != null )
	{
		for ( int i = 0; i < actions.length; i++ )
		{
			if ( event.getProperty( )
					.equals( SubActionBars.P_ACTION_HANDLERS ) )
			{
				if ( getAction( actions[i].id ) instanceof ReportRetargetAction )
				{
					( (ReportRetargetAction) getAction( actions[i].id ) ).propagateChange( event );
				}
			}
		}
	}
}
 
Example #3
Source File: DesignerActionBarContributor.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void init( IActionBars bars )
{
	super.init( bars );
	if ( bars instanceof SubActionBars )
	{
		( (SubActionBars) bars ).addPropertyChangeListener( propertyChangeListener );
	}
}
 
Example #4
Source File: DesignerActionBarContributor.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void dispose( )
{
	if ( toggleBreadcrumbAction != null )
	{
		toggleBreadcrumbAction.dispose( );
	}
	if ( getActionBars( ) instanceof SubActionBars )
	{
		( (SubActionBars) getActionBars( ) ).removePropertyChangeListener( propertyChangeListener );
	}
	super.dispose( );
}
 
Example #5
Source File: CasEditorViewPage.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Creates and shows the page, if page is null
 * the not available message will be shown.
 *
 * @param page the page
 */
protected void initializeAndShowPage(IPageBookViewPage page) {
  if (book != null) {
    if (page != null) {
      page.createControl(book);
      casViewPage = page;
      
      // Note: If page is in background event listening must be disabled!
      ISelectionProvider selectionProvider = page.getSite().getSelectionProvider();
      selectionProvider.addSelectionChangedListener(CasEditorViewPage.this::selectionChanged);
      
      subActionBar = (SubActionBars) casViewPage.getSite().getActionBars();
      
      casViewPage.setActionBars(subActionBar);

      subActionBar.activate();
      subActionBar.updateActionBars();

      refreshActionHandlers();
      
      book.showPage(page.getControl());
    }
    else {
      book.showPage(messageText);
      getSite().getActionBars().updateActionBars();
    }
  }
}
 
Example #6
Source File: FaelleTab.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage){
	super.createControls(parent, aTabbedPropertySheetPage);
	fc = new FaelleComposite(parent, SWT.None, aTabbedPropertySheetPage);
	aTabbedPropertySheetPage.getWidgetFactory().adapt(fc);
	aTabbedPropertySheetPage.getWidgetFactory().paintBordersFor(fc);
	subActionBars = new SubActionBars(aTabbedPropertySheetPage.getSite().getActionBars());
	
	// COMPAT
	subActionBars.getToolBarManager().add(GlobalActions.neuerFallAction);
}
 
Example #7
Source File: MultiPageEditorActionBarContributor.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public SubActionBarDef( IActionBars rootBar,
		IEditorActionBarContributor actionBarContrubutor )
{
	this.subActionBar = new SubActionBars( rootBar );
	this.actionBarContrubutor = actionBarContrubutor;
}
 
Example #8
Source File: MultiPageEditorActionBarContributor.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public SubActionBars getSubActionBar( )
{
	return subActionBar;
}