本文整理汇总了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());
}
示例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()));
}
示例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);
}
}
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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();
}
});
}
示例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();
}
});
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}