本文整理汇总了Java中org.eclipse.ui.part.MultiPageEditorSite类的典型用法代码示例。如果您正苦于以下问题:Java MultiPageEditorSite类的具体用法?Java MultiPageEditorSite怎么用?Java MultiPageEditorSite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultiPageEditorSite类属于org.eclipse.ui.part包,在下文中一共展示了MultiPageEditorSite类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: finishNotCompiledReport
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
private void finishNotCompiledReport() {
UIUtils.getDisplay().asyncExec(new Runnable() {
public void run() {
pcontainer.setNotRunning(true);
if (pcontainer.getSite() instanceof MultiPageEditorSite) {
MultiPageEditorPart mpe = ((MultiPageEditorSite) pcontainer.getSite()).getMultiPageEditor();
IEditorPart[] editors = mpe.findEditors(mpe.getEditorInput());
if (editors != null && editors.length > 0) {
// Dialog, if not ..., it's not clear for the user that error happened
UIUtils.showInformation(Messages.ReportControler_compilationerrors);
mpe.setActiveEditor(editors[0]);
}
}
}
});
}
示例2: activate
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
/**
* This function takes a workbench part site, which might be from a top-level view,
* or from a top-level editor, or from a page-level editor in a multipage editor
* site. The function finds the corresponding part for this site and activates it.
* @param site
*/
public static void activate(IWorkbenchPartSite site) {
try {
IWorkbenchPart part;
if (site instanceof MultiPageEditorSite) {
part = ((MultiPageEditorSite)site).getMultiPageEditor();
} else {
part = site.getPart();
}
if (part == null) {
return;
}
IWorkbenchPage page = site.getPage();
if (page == null) {
return;
}
page.activate(part);
} catch (ThreadDeath td) {
throw td;
} catch (Throwable t) {
Logger.getLogger(WorkbenchUtils.class).error("throwable in activate", t);
}
}
示例3: dispose
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
/**
* disposes all color objects
*/
public void dispose( )
{
// colorManager.dispose( );
// remove the mediator listener
// SessionHandleAdapter.getInstance( )
// .getMediator( root )
// .removeColleague( this );
selectionMap.clear( );
editingDomainEditor = null;
if ( scriptEditor != null )
{
scriptEditor.dispose( );
scriptEditor = null;
}
super.dispose( );
// ( (ReportMultiPageEditorSite) getSite( ) ).dispose( );
( (MultiPageEditorSite) getSite( ) ).dispose( );
}
示例4: openEditor
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
public static void openEditor(final Object val, IEditorPart editor, ANode node) {
if (editor.getEditorSite() instanceof MultiPageEditorSite) {
final MultiPageEditorPart mpep = ((MultiPageEditorSite) editor.getEditorSite()).getMultiPageEditor();
if (mpep instanceof IJROBjectEditor)
doOpenEditor(val, (IJROBjectEditor) mpep, node);
} else {
editor = Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor instanceof IJROBjectEditor)
doOpenEditor(val, (IJROBjectEditor) editor, node);
}
}
示例5: createSite
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
@Override
protected IEditorSite createSite(IEditorPart editor) {
// Due to an eclipse bug/misfeature, the Id of a multipart editor is always "", so you can't contribute
// to the editor without doing this in code. This workaround allows the debugger plugin to add a RulerDoubleClick
// event to make breakpoints work again.
return new MultiPageEditorSite(this, editor) {
@Override
public String getId() {
return EditorConstants.APEX_EDITOR_ID;
}
};
}
示例6: dispose
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
public void dispose( )
{
super.dispose( );
( (MultiPageEditorSite) getSite( ) ).dispose( );
reportXMLEditor.dispose( );
reportXMLEditor = null;
unhookModelEventManager( getModel( ) );
SessionHandleAdapter.getInstance( )
.getMediator( getModel( ) )
.removeColleague( this );
}
示例7: init
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
public void init( IEditorSite site, IEditorInput input )
throws PartInitException
{
super.init( site, input );
initialize( (FormEditor) ( (MultiPageEditorSite) site ).getMultiPageEditor( ) );
// Initializes command stack
// WrapperCommandStack stack = (WrapperCommandStack) getCommandStack( );
// if ( stack != null )
// {
// stack.addCommandStackListener( getCommandStackListener( ) );
// }
}
示例8: dispose
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
public void dispose( )
{
if (fSourceViewerDecorationSupport != null) {
fSourceViewerDecorationSupport.dispose();
fSourceViewerDecorationSupport= null;
}
fAnnotationAccess= null;
colorManager.dispose( );
super.dispose( );
( (MultiPageEditorSite) getSite( ) ).dispose( );
}
示例9: doTransform
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
/**
* Get the next position off the global mark ring and move to that file and location
*
* @param editor
* @param document
* @param currentSelection
* @param norotate - if true, pop else rotate and pop
* @return NO_OFFSET
* @throws BadLocationException
*/
protected int doTransform(ITextEditor editor, IDocument document, ITextSelection currentSelection, boolean norotate, boolean isTags)
throws BadLocationException {
// get editor and offset
IBufferLocation location = (isTags ? MarkUtils.popTagMark() : MarkUtils.popGlobalMark(norotate));
if (location != null) {
if (currentSelection != null &&
location.getEditor() == editor && location.getOffset() == currentSelection.getOffset()) {
// if we're already at the global mark location, move to next location
// recurse with no selection to avoid infinite loop if only one global location
return doTransform(editor,document,null,norotate, isTags);
}
ITextEditor jumpTo = location.getEditor();
int offset = location.getOffset();
IWorkbenchPage page = getWorkbenchPage();
IEditorPart part = jumpTo;
if (part != null) {
// move to the correct page
IEditorPart apart = part;
IEditorSite esite = part.getEditorSite();
if (esite instanceof MultiPageEditorSite) {
apart = ((MultiPageEditorSite)esite).getMultiPageEditor();
// handle multi page by activating the correct part within the parent
if (apart instanceof MultiPageEditorPart) {
((MultiPageEditorPart)apart).setActiveEditor(part);
}
}
// check to make sure the editor is still valid
if (page.findEditor(apart.getEditorInput()) != null) {
// then activate
page.activate(apart);
page.bringToTop(apart);
if (part instanceof ITextEditor) {
selectAndReveal((ITextEditor) part,offset,offset);
EmacsPlusUtils.clearMessage(part);
}
} else {
EmacsPlusUtils.showMessage(editor, String.format(BAD_MARK, apart.getTitle()), true);
}
}
} else {
beep();
}
return NO_OFFSET;
}
示例10: doExecuteResult
import org.eclipse.ui.part.MultiPageEditorSite; //导入依赖的package包/类
/**
* @see com.mulgasoft.emacsplus.minibuffer.IMinibufferExecutable#executeResult(org.eclipse.ui.texteditor.ITextEditor, java.lang.Object)
*/
public boolean doExecuteResult(ITextEditor editor, Object minibufferResult) {
if (minibufferResult != null) {
String key = (String)minibufferResult;
IRegisterLocation location = TecoRegister.getInstance().getLocation(key);
if (location != null) {
IWorkbenchPage page = getWorkbenchPage();
IEditorPart part = location.getEditor();
int offset = location.getOffset();
if (part != null) {
// move to the correct page
IEditorPart apart = part;
IEditorSite esite = part.getEditorSite();
if (esite instanceof MultiPageEditorSite) {
apart = ((MultiPageEditorSite)esite).getMultiPageEditor();
// handle multi page by activating the correct part within the parent
if (apart instanceof MultiPageEditorPart) {
((MultiPageEditorPart)apart).setActiveEditor(part);
}
}
// now activate
page.activate(apart);
page.bringToTop(apart);
} else {
// restore the resource from the file system
if (location.getPath() != null) {
try {
// loads and activates
part = IDE.openEditor(page, location.getPath(), true);
if (part instanceof IEditorPart) {
if (part instanceof MultiPageEditorPart) {
IEditorPart[] parts = ((MultiPageEditorPart)part).findEditors(part.getEditorInput());
// TODO this will only work on the first load of a multi page
// There is no supported way to determine the correct sub part in this case
// Investigate org.eclipse.ui.PageSwitcher (used in org.eclipse.ui.part.MultiPageEditorPart)
// as a means for locating the correct sub page at this level
for (int i = 0; i < parts.length; i++) {
if (parts[i] instanceof ITextEditor) {
((MultiPageEditorPart)part).setActiveEditor(parts[i]);
part = parts[i];
break;
}
}
}
location.setEditor((ITextEditor)part);
}
} catch (PartInitException e) {
showResultMessage(editor, String.format(BAD_LOCATION,key + ' ' + e.getLocalizedMessage()), true);
}
} else {
showResultMessage(editor, String.format(NO_LOCATION,key), true);
}
}
if (part instanceof ITextEditor) {
((ITextEditor) part).selectAndReveal(offset, 0);
showResultMessage(editor, String.format(LOCATED, key), false);
} else {
}
} else {
showResultMessage(editor, NO_REGISTER, true);
}
}
return true;
}