本文整理汇总了Java中org.eclipse.ui.part.IPageSite.getPage方法的典型用法代码示例。如果您正苦于以下问题:Java IPageSite.getPage方法的具体用法?Java IPageSite.getPage怎么用?Java IPageSite.getPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.part.IPageSite
的用法示例。
在下文中一共展示了IPageSite.getPage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
示例2: 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();
}
示例3: 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);
}
}
}
}
示例4: createControl
import org.eclipse.ui.part.IPageSite; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
EditingDomain editingDomain = planEditorModel.getEditingDomain();
composite = new Composite(parent, SWT.NONE);
composite.setLayout(new FillLayout());
tabFolder = new TabFolder(composite, SWT.BORDER);
equalityTableViewer = createEMFTreeTableViewer(editingDomain, tabFolder, 0, "Equality Requirements");
envelopeTableViewer = createEMFTreeTableViewer(editingDomain, tabFolder, 1, "Min/Max Requirements");
effectTableViewer = createEMFTreeTableViewer(editingDomain, tabFolder, 2, "Effects");
effectTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if (!selection.equals(selectionProvider.getSelection())) {
selectionProvider.setSelection(selection);
}
}
});
IPageSite site = getSite();
site.setSelectionProvider(selectionProvider);
IWorkbenchPage page = site.getPage();
page.addPostSelectionListener(listener);
listener.selectionChanged(null, selectionProvider.getSelection());
UndoRedoUtils.setupUndoRedo(site.getActionBars(), viewSite, planEditorModel.getUndoContext());
}
示例5: dispose
import org.eclipse.ui.part.IPageSite; //导入方法依赖的package包/类
@Override
public void dispose() {
removePostSelectionChangedListeners(cutAction);
removePostSelectionChangedListeners(copyAction);
removePostSelectionChangedListeners(pasteAction);
removePostSelectionChangedListeners(deleteAction);
composite = null;
planEditorModel = null;
IPageSite site = getSite();
site.setSelectionProvider(null);
IWorkbenchPage page = site.getPage();
page.removePostSelectionListener(listener);
}
示例6: dispose
import org.eclipse.ui.part.IPageSite; //导入方法依赖的package包/类
@Override
public void dispose() {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(workspaceListener);
IPageSite site = getSite();
if (site != null) {
IWorkbenchPage page = site.getPage();
page.removePostSelectionListener(selectionListener);
}
super.dispose();
}
示例7: createControl
import org.eclipse.ui.part.IPageSite; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
toolkit = new FormToolkit(parent.getDisplay());
toolkit.setBorderStyle(SWT.NONE);
form = toolkit.createScrolledForm(parent);
form.setExpandHorizontal(true);
form.setExpandVertical(true);
originalLayout = new TableWrapLayout();
form.getBody().setLayout(originalLayout);
IPageSite site = getSite();
if (site != null) {
IWorkbenchPage page = site.getPage();
page.addPostSelectionListener(selectionListener);
ISelectionProvider partSelectionProvider = associatedPart.getSite().getSelectionProvider();
site.setSelectionProvider(partSelectionProvider);
if (associatedPart instanceof IEditorPart) {
IEditorPart editorPart = (IEditorPart) associatedPart;
IUndoContext undoContext = (IUndoContext)editorPart.getAdapter(IUndoContext.class);
if (undoContext != null) {
UndoRedoUtils.setupUndoRedo(site.getActionBars(), viewSite, undoContext);
}
}
ISelection selection = partSelectionProvider.getSelection();
if ((selection != null) && (selection instanceof IStructuredSelection)) {
try {
updateSelection((IStructuredSelection)selection, false);
} catch (Exception e) {
printException(e);
trace.error("DetailPage.updateSelection", e);
}
}
createActions();
// page.addPartListener(new IPartListener2() {
// @Override
// public void partVisible(IWorkbenchPartReference partRef) {
// System.out.println("visible");
// }
// @Override
// public void partOpened(IWorkbenchPartReference partRef) {
// System.out.println("opened");
// }
// @Override
// public void partInputChanged(IWorkbenchPartReference partRef) {
// System.out.println("inputChanged");
// }
// @Override
// public void partHidden(IWorkbenchPartReference partRef) {
// System.out.println("hidden");
// }
// @Override
// public void partDeactivated(IWorkbenchPartReference partRef) {
// System.out.println("deactivated");
// }
// @Override
// public void partClosed(IWorkbenchPartReference partRef) {
// System.out.println("closed");
// }
// @Override
// public void partBroughtToTop(IWorkbenchPartReference partRef) {
// System.out.println("top");
// }
// @Override
// public void partActivated(IWorkbenchPartReference partRef) {
// System.out.println("activated");
// }
// });
}
}