下面列出了怎么用org.eclipse.ui.part.Page的API类实例代码及写法,或者点击链接到github查看源代码。
protected void registerOutlineSwitchAction( )
{
if ( registered == true )
return;
// Register the switch action onto outline page
Page reportMultiBookPage = (Page) ( (MultiPageReportEditor) getEditor( ) ).getOutlinePage( );
if ( reportMultiBookPage.getSite( ) != null )
{
if ( reportMultiBookPage.getSite( )
.getActionBars( )
.getMenuManager( )
.find( getOutlineSwitchAction( ).getId( ) ) == null )
reportMultiBookPage.getSite( )
.getActionBars( )
.getMenuManager( )
.add( getOutlineSwitchAction( ) );
registered = true;
}
}
private void removeOutlineSwitchAction( )
{
Page reportMultiBookPage = (Page) ( (MultiPageReportEditor) getEditor( ) ).getOutlinePage( );
if ( reportMultiBookPage.getSite( ) != null )
{
reportMultiBookPage.getSite( )
.getActionBars( )
.getMenuManager( )
.remove( switchAction_ID );
registered = false;
}
}
public Page createPage(Object object) {
SVNHistoryPage page = new SVNHistoryPage(object);
return page;
}
/**
* Creates a new <code>JavaSearchActionGroup</code>. The group
* requires that the selection provided by the page's selection provider
* is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page that owns this action group
*/
public TypeScriptSearchActionGroup(Page page) {
this(page.getSite());
}
/**
* Creates a new <code>JavaSearchActionGroup</code>. The group
* requires that the selection provided by the page's selection provider
* is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page that owns this action group
*/
public JavaSearchActionGroup(Page page) {
this(page.getSite());
}
/**
* Creates a new <code>CCPActionGroup</code>. The group requires that
* the selection provided by the page's selection provider is of type
* <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page that owns this action group
*/
public CCPActionGroup(Page page) {
this(page.getSite(), null, false);
}
/**
* Creates a new <code>OpenActionGroup</code>. The group requires
* that the selection provided by the page's selection provider is
* of type {@link IStructuredSelection}.
*
* @param page the page that owns this action group
*/
public OpenViewActionGroup(Page page) {
createSiteActions(page.getSite(), null);
}
/**
* Creates a new <code>OpenActionGroup</code>. The group requires
* that the selection provided by the given selection provider is
* of type {@link IStructuredSelection}.
*
* @param page the page that owns this action group
* @param selectionProvider the selection provider used instead of the
* page selection provider.
*
* @since 3.2
*/
public OpenViewActionGroup(Page page, ISelectionProvider selectionProvider) {
createSiteActions(page.getSite(), selectionProvider);
}
/**
* Creates a new <code>FindOccurrencesInFileAction</code>. The action requires
* that the selection provided by the page's selection provider is of type <code>
* org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page providing context information for this action
*/
public FindOccurrencesInFileAction(Page page) {
this(page.getSite());
}
/**
* Creates a new <code>GenerateActionGroup</code>. The group
* requires that the selection provided by the page's selection provider
* is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page that owns this action group
*/
public GenerateActionGroup(Page page) {
this(page.getSite(), null);
installQuickAccessAction();
}
/**
* Creates a new <code>ShowActionGroup</code>. The action requires
* that the selection provided by the page's selection provider is of type
* <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page that owns this action group
*/
public ShowActionGroup(Page page) {
this(page.getSite());
}
/**
* Creates a new <code>RefactorActionGroup</code>. The action requires
* that the selection provided by the page's selection provider is of type <code>
* org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page that owns this action group
*/
public RefactorActionGroup(Page page) {
this(page.getSite(), null);
installQuickAccessAction();
}
/**
* Creates a new <code>GenerateActionGroup</code>. The group
* requires that the selection provided by the page's selection provider
* is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
*
* @param page the page that owns this action group
*/
public GenerateBuildPathActionGroup(Page page) {
this(page.getSite(), page.getSite().getSelectionProvider());
}