本文整理汇总了Java中org.eclipse.ui.part.PageBookView类的典型用法代码示例。如果您正苦于以下问题:Java PageBookView类的具体用法?Java PageBookView怎么用?Java PageBookView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PageBookView类属于org.eclipse.ui.part包,在下文中一共展示了PageBookView类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConsole
import org.eclipse.ui.part.PageBookView; //导入依赖的package包/类
public static IConsole getConsole(IWorkbenchPart part) {
if(!(part instanceof IViewPart)){
return null;
}
IViewPart vp =(IViewPart) part;
if (vp instanceof PageBookView) {
IPage page = ((PageBookView) vp).getCurrentPage();
ITextViewer viewer = getViewer(page);
if (viewer == null || viewer.getDocument() == null)
return null;
}
IConsole con = null;
try {
con = ((IConsoleView)part).getConsole();
} catch (Exception e) {
}
return con;
}
示例2: getSelection
import org.eclipse.ui.part.PageBookView; //导入依赖的package包/类
private ISelection getSelection(IWorkbenchPart part, ISelection selection) {
// for some reason, selection is empty when we select a revision from the P4 history view
if (!(part instanceof PageBookView)) {
return selection;
}
IPage page = ((PageBookView)part).getCurrentPage();
if (!(page instanceof P4HistoryPage)) {
return selection;
}
return getSelection((P4HistoryPage)page);
}
示例3: refreshPaletteView
import org.eclipse.ui.part.PageBookView; //导入依赖的package包/类
private void refreshPaletteView(final IWorkbenchPart part) {
final PageBookView paletteView = findPaletteView(part);
if (paletteView == null) {
return;
}
part.getSite().getWorkbenchWindow().getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
paletteView.partClosed(part);
paletteView.partActivated(part);
}
});
}
示例4: findPaletteView
import org.eclipse.ui.part.PageBookView; //导入依赖的package包/类
private PageBookView findPaletteView(final IWorkbenchPart part) {
final IViewReference[] views = part.getSite().getPage().getViewReferences();
for (final IViewReference view : views) {
if (PaletteView.ID.equals(view.getId())) {
return (PageBookView) view.getPart(true);
}
}
return null;
}
示例5: log
import org.eclipse.ui.part.PageBookView; //导入依赖的package包/类
public static void log(Class<? extends PageBookView> class1, String string,
PartInitException e) {
// TODO Auto-generated method stub
}
示例6: execute
import org.eclipse.ui.part.PageBookView; //导入依赖的package包/类
/**
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@SuppressWarnings("unchecked")
public Object execute(ExecutionEvent event) throws ExecutionException {
ITextEditor editor = getTextEditor(event);
if (editor == null) {
if (isWindowCommand()) {
Object result = checkExecute(event);
if (result == Check.Fail) {
beep();
result = null;
}
return result;
} else if (isConsoleCommand()) {
// intercept and dispatch execution if console supported and used in a console view
IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
if (activePart != null && (activePart instanceof IConsoleView) && (activePart instanceof PageBookView)) {
IPage textPage = ((PageBookView)activePart).getCurrentPage();
if (textPage instanceof TextConsolePage) {
return ((IConsoleDispatch)this).consoleDispatch(((TextConsolePage)textPage).getViewer(),(IConsoleView)activePart,event);
}
}
}
}
try {
setThisEditor(editor);
isEditable = getEditable();
if (editor == null || isBlocked()) {
beep();
asyncShowMessage(editor, INEDITABLE_BUFFER, true);
return null;
}
// Retrieve the universal-argument parameter value if passed
if (extractUniversalCount(event) != 1) {
// check if we should dispatch a related command based on the universal argument
String dispatchId = checkDispatchId(event.getCommand().getId());
if (dispatchId != null) {
// recurse on new id (inverse or arg value driven)
return dispatchId(editor, dispatchId, getParams(event.getCommand(), event.getParameters()));
}
}
setThisDocument(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
// Get the current selection
ISelectionProvider selectionProvider = editor.getSelectionProvider();
ITextSelection selection = (ITextSelection) selectionProvider.getSelection();
preTransform(editor, selection);
return transformWithCount(editor, getThisDocument(), selection, event);
} finally {
// normal commands clean up here
if (isTransform()) {
postExecute();
}
}
}