当前位置: 首页>>代码示例>>Java>>正文


Java IPageSite类代码示例

本文整理汇总了Java中org.eclipse.ui.part.IPageSite的典型用法代码示例。如果您正苦于以下问题:Java IPageSite类的具体用法?Java IPageSite怎么用?Java IPageSite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IPageSite类属于org.eclipse.ui.part包,在下文中一共展示了IPageSite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
public void init(IPageSite pageSite) {
	super.init(pageSite);

	IActionBars bars = pageSite.getActionBars();

	bars.getToolBarManager().add(getActionRegistry().getAction(ClearEdgeBendpointLayoutAction.ID));
	bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.DELETE.getId()));
	bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.UNDO.getId()));
	bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.REDO.getId()));

	bars.setGlobalActionHandler(ClearEdgeBendpointLayoutAction.ID,
			getActionRegistry().getAction(ClearEdgeBendpointLayoutAction.ID));
	bars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
			getActionRegistry().getAction(ActionFactory.UNDO.getId()));
	bars.setGlobalActionHandler(ActionFactory.REDO.getId(),
			getActionRegistry().getAction(ActionFactory.REDO.getId()));
	bars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
			getActionRegistry().getAction(ActionFactory.DELETE.getId()));
	bars.updateActionBars();

	getViewer().setKeyHandler(keyHandler);

	pageSite.setSelectionProvider(getViewer());
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:25,代码来源:GW4EEditor.java

示例2: init

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
public void init(IPageSite pageSite) {
	super.init(pageSite);
	ActionRegistry registry = editor.getEditorActionRegistry();
	IActionBars bars = pageSite.getActionBars();
	String id = ActionFactory.UNDO.getId();
	bars.setGlobalActionHandler(id, registry.getAction(id));
	id = ActionFactory.REDO.getId();
	bars.setGlobalActionHandler(id, registry.getAction(id));
	id = ActionFactory.DELETE.getId();
	bars.setGlobalActionHandler(id, registry.getAction(id));
	bars.setGlobalActionHandler(ActionFactory.COPY.getId(),
			registry.getAction(ActionFactory.COPY.getId()));
	bars.setGlobalActionHandler(ActionFactory.PASTE.getId(),
			registry.getAction(ActionFactory.PASTE.getId()));

}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:17,代码来源:DiagramOutlinePage2.java

示例3: init

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
@Override
public void init(IPageBookViewPage page, IConsole console) {
	IPageSite pageSite = page.getSite();
	IWorkbenchPage workbenchPage = pageSite.getPage();
	IViewPart viewPart = workbenchPage.findView(IConsoleConstants.ID_CONSOLE_VIEW);
	IViewSite viewSite = viewPart.getViewSite();
	IActionBars actionBars = viewSite.getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	IContributionItem[] items = toolBarManager.getItems();
	for(int i = 0; i < items.length; ++i) {
		IContributionItem item = items[i];
		if(item instanceof ActionContributionItem) {
			IAction action = ((ActionContributionItem) item).getAction();
			String text = action.getText();
			if(text.equals("Pi&n Console") || text.equals("Open Console"))
				toolBarManager.remove(item);
		}
	}
}
 
开发者ID:AlexWengh,项目名称:HMM,代码行数:20,代码来源:ConsolePageParticipant.java

示例4: dispose

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
@Override
public void dispose() {
    IPageSite site = getSite();
    if (site != null) {
	    IWorkbenchPage page = site.getPage();
	    page.removePostSelectionListener(selectionListener);
	    UndoRedoUtils.disposeUndoRedo(site.getActionBars());
    }
    clearChildren();
    if ((form != null) && (!form.isDisposed())) {
    	form.dispose();
    }
    DetailUtils.PREFERENCES.removePropertyChangeListener(preferenceListener);
    currentSelection.clear();
    super.dispose();
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:DetailPage.java

示例5: selectionChanged

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
      	if (!isRelevantChange(part)) 
      		return;
      	IPageSite site = getSite(); 
      	if ((site != null) && (site.getSelectionProvider() == null)) {
      		ISelectionProvider partSelectionProvider = associatedPart.getSite().getSelectionProvider();
      		site.setSelectionProvider(partSelectionProvider);
      	}
      	if ((selection != null) && (selection instanceof IStructuredSelection)) {
       	try {
       		updateSelection((IStructuredSelection)selection);
       	} catch (Exception e) {
       		printException(e);
       		trace.error("DetailPage.updateSelection", e);
       	}
      	}
      }
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:DetailPage.java

示例6: createControl

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
	super.createControl(parent);
	ResourcesPlugin.getWorkspace().addResourceChangeListener(workspaceListener, IResourceChangeEvent.POST_CHANGE);
	IPageSite site = getSite();
    if (site != null) {
	    IWorkbenchPage page = site.getPage();
	    page.addPostSelectionListener(selectionListener);
    	ISelectionProvider partSelectionProvider = editorPart.getSite().getSelectionProvider();
	    ISelection selection = partSelectionProvider.getSelection();
	    if ((selection != null) && (selection instanceof IStructuredSelection)) {
        	try {
        		updateSelection((IStructuredSelection)selection);
        	} catch (Exception e) {
        		LogUtil.error("Error updating selection from editor", e);
        	}
       	}
    }
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:SPIFeTemplatePlanPage.java

示例7: selectionChanged

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
      	if (part != editorPart) 
      		return;
      	IPageSite site = getSite(); 
      	if ((site != null) && (site.getSelectionProvider() == null)) {
      		ISelectionProvider partSelectionProvider = editorPart.getSite().getSelectionProvider();
      		site.setSelectionProvider(partSelectionProvider);
      	}
      	if ((selection != null) && (selection instanceof IStructuredSelection)) {
       	try {
       		updateSelection((IStructuredSelection)selection);
       	} catch (Exception e) {
       		LogUtil.error("Error updating selection from editor", e);
       	}
      	}
      }
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:SPIFeTemplatePlanPage.java

示例8: init

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
@Override
public void init(IPageSite site) {
	super.init(site);
	IMenuManager menuManager = site.getActionBars().getMenuManager();
	menuManager.insertBefore(IContextMenuConstants.GROUP_PROPERTIES, new Separator(GROUP_FILTERING));
	fActionGroup.fillActionBars(site.getActionBars());
	menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new Action(SearchMessages.JavaSearchResultPage_preferences_label) {
		@Override
		public void run() {
			String pageId= "org.eclipse.search.preferences.SearchPreferencePage"; //$NON-NLS-1$
			String[] displayedPages= { pageId,
					"org.eclipse.ui.editors.preferencePages.Annotations", //$NON-NLS-1$
					"org.eclipse.ui.preferencePages.ColorsAndFonts" //$NON-NLS-1$
			};
			PreferencesUtil.createPreferenceDialogOn(JavaPlugin.getActiveWorkbenchShell(), pageId, displayedPages, null).open();
		}
	});
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:JavaSearchResultPage.java

示例9: init

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
@Override
public void init(final IPageSite pageSite)
{
  super.init(pageSite);
  final IMenuManager menuManager = pageSite.getActionBars().getMenuManager();
  menuManager.insertBefore(IContextMenuConstants.GROUP_PROPERTIES, new Separator(
      JiveSearchResultPage.LAYOUT_GROUP));
  menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new Action("Preferences...")
    {
      @Override
      public void run()
      {
        final String pageId = "org.eclipse.search.preferences.SearchPreferencePage"; //$NON-NLS-1$
        final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
        PreferencesUtil.createPreferenceDialogOn(shell, pageId, null, null).open();
      }
    });
}
 
开发者ID:UBPL,项目名称:jive,代码行数:19,代码来源:JiveSearchResultPage.java

示例10: init

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
/**
 * Initializes the outline; addes undo/redo/delete keyhandlers.
 */
public void init(IPageSite pageSite) {
    super.init(pageSite);

    ActionRegistry registry = multieditor.getActionRegistry();
    IActionBars bars = pageSite.getActionBars();
    String id = ActionFactory.UNDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = ActionFactory.REDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = ActionFactory.DELETE.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = ActionFactory.PASTE.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = ActionFactory.COPY.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = ActionFactory.CUT.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:23,代码来源:UrnOutlinePage.java

示例11: createActions

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
private void createActions() {
	IPageSite site = getSite();
	IActionBars actionBars = site.getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	List<IAction> actions = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileOutlinePageActionProvider().getActions(treeViewer);
	for (IAction action : actions) {
		toolBarManager.add(action);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:10,代码来源:DwprofileOutlinePage.java

示例12: createActions

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
private void createActions() {
	IPageSite site = getSite();
	IActionBars actionBars = site.getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	List<IAction> actions = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionOutlinePageActionProvider().getActions(treeViewer);
	for (IAction action : actions) {
		toolBarManager.add(action);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:10,代码来源:HyexpressionOutlinePage.java

示例13: createActions

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
private void createActions() {
	IPageSite site = getSite();
	IActionBars actionBars = site.getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	List<IAction> actions = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaOutlinePageActionProvider().getActions(treeViewer);
	for (IAction action : actions) {
		toolBarManager.add(action);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:10,代码来源:HyvalidityformulaOutlinePage.java

示例14: createActions

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
private void createActions() {
	IPageSite site = getSite();
	IActionBars actionBars = site.getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	List<IAction> actions = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueOutlinePageActionProvider().getActions(treeViewer);
	for (IAction action : actions) {
		toolBarManager.add(action);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:10,代码来源:HydatavalueOutlinePage.java

示例15: createActions

import org.eclipse.ui.part.IPageSite; //导入依赖的package包/类
private void createActions() {
	IPageSite site = getSite();
	IActionBars actionBars = site.getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	List<IAction> actions = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingOutlinePageActionProvider().getActions(treeViewer);
	for (IAction action : actions) {
		toolBarManager.add(action);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:10,代码来源:HymappingOutlinePage.java


注:本文中的org.eclipse.ui.part.IPageSite类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。