本文整理汇总了Java中org.eclipse.ui.IEditorRegistry.findEditor方法的典型用法代码示例。如果您正苦于以下问题:Java IEditorRegistry.findEditor方法的具体用法?Java IEditorRegistry.findEditor怎么用?Java IEditorRegistry.findEditor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IEditorRegistry
的用法示例。
在下文中一共展示了IEditorRegistry.findEditor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEditorId
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
private String getEditorId(IFileStore file) {
// IWorkbench workbench= fWindow.getWorkbench();
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorRegistry editorRegistry= workbench.getEditorRegistry();
IEditorDescriptor descriptor= editorRegistry.getDefaultEditor(file.getName(), getContentType(file));
// check the OS for in-place editor (OLE on Win32)
if (descriptor == null && editorRegistry.isSystemInPlaceEditorAvailable(file.getName()))
descriptor= editorRegistry.findEditor(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID);
// check the OS for external editor
if (descriptor == null && editorRegistry.isSystemExternalEditorAvailable(file.getName()))
descriptor= editorRegistry.findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);
if (descriptor != null)
return descriptor.getId();
return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
}
示例2: getEditorId
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
private String getEditorId(IFileStore file) {
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorRegistry editorRegistry= workbench.getEditorRegistry();
IEditorDescriptor descriptor= editorRegistry.getDefaultEditor(file.getName(), getContentType(file));
// check the OS for in-place editor (OLE on Win32)
if (descriptor == null && editorRegistry.isSystemInPlaceEditorAvailable(file.getName()))
descriptor= editorRegistry.findEditor(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID);
// check the OS for external editor
if (descriptor == null && editorRegistry.isSystemExternalEditorAvailable(file.getName()))
descriptor= editorRegistry.findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);
if (descriptor != null)
return descriptor.getId();
return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
}
示例3: initializeTitle
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
private void initializeTitle(final IEditorInput input) {
final Image oldImage = fTitleImage;
fTitleImage = null;
String title = ""; //$NON-NLS-1$
if (input != null) {
final IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
final IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
final ImageDescriptor imageDesc = editorDesc != null ? editorDesc.getImageDescriptor() : null;
fTitleImage = imageDesc != null ? imageDesc.createImage() : null;
title = input.getName();
}
setTitleImage(fTitleImage);
setPartName(title);
firePropertyChange(PROP_DIRTY);
if (oldImage != null && !oldImage.isDisposed())
oldImage.dispose();
}
示例4: initializeTitle
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
private void initializeTitle(IEditorInput input) {
Image oldImage = fTitleImage;
fTitleImage = null;
String title = ""; //$NON-NLS-1$
if (input != null) {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench()
.getEditorRegistry();
IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite()
.getId());
ImageDescriptor imageDesc = editorDesc != null ? editorDesc
.getImageDescriptor() : null;
fTitleImage = imageDesc != null ? imageDesc.createImage() : null;
title = input.getName();
}
setTitleImage(fTitleImage);
setPartName(title);
firePropertyChange(PROP_DIRTY);
if (oldImage != null && !oldImage.isDisposed())
oldImage.dispose();
}
示例5: init
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
setSite(site);
setInput(input);
setPartName(input.getName());
Image oldTitleImage = titleImage;
if (input != null) {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
ImageDescriptor imageDesc = editorDesc != null ? editorDesc.getImageDescriptor() : null;
titleImage = imageDesc != null ? imageDesc.createImage() : null;
}
setTitleImage(titleImage);
if (oldTitleImage != null && !oldTitleImage.isDisposed()) {
oldTitleImage.dispose();
}
FileEditorInput fileInput = (FileEditorInput) input;
htmlUrl = fileInput.getFile().getLocation().toOSString();
}
示例6: init
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
/**
* 启动编辑器。
*
* @param site
* the site
* @param input
* the input
* @throws PartInitException
* the part init exception
* @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite,
* org.eclipse.ui.IEditorInput)
*/
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("init(IEditorSite site, IEditorInput input)");
}
setSite(site);
setInput(input);
// 设置Editor标题栏的显示名称,否则名称用plugin.xml中的name属性
setPartName(input.getName());
Image oldTitleImage = titleImage;
if (input != null) {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
ImageDescriptor imageDesc = editorDesc != null ? editorDesc.getImageDescriptor() : null;
titleImage = imageDesc != null ? imageDesc.createImage() : null;
}
setTitleImage(titleImage);
if (oldTitleImage != null && !oldTitleImage.isDisposed()) {
oldTitleImage.dispose();
}
getSite().setSelectionProvider(this);
}
示例7: getEditorId
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
private String getEditorId( IFileStore file )
{
IWorkbench workbench = window.getWorkbench( );
IEditorRegistry editorRegistry = workbench.getEditorRegistry( );
IEditorDescriptor descriptor = editorRegistry.getDefaultEditor( file.getName( ),
getContentType( file ) );
// check the OS for in-place editor (OLE on Win32)
if ( descriptor == null
&& editorRegistry.isSystemInPlaceEditorAvailable( file.getName( ) ) )
{
descriptor = editorRegistry.findEditor( IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID );
}
// check the OS for external editor
if ( descriptor == null
&& editorRegistry.isSystemExternalEditorAvailable( file.getName( ) ) )
{
descriptor = editorRegistry.findEditor( IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID );
}
return ( descriptor == null ) ? "" : descriptor.getId( ); //$NON-NLS-1$
}
示例8: getEditorDescriptor
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
/**
* Returns the {@link IEditorDescriptor} associated with this input's editor id.
*
* @return The {@link IEditorDescriptor} for the editor id.
*/
protected IEditorDescriptor getEditorDescriptor() {
String editorId = getEditorId();
if (editorId == null) {
return null;
}
IWorkbench workBench = PlatformUI.getWorkbench();
IEditorRegistry editorRegistry = workBench.getEditorRegistry();
IEditorDescriptor editorDescriptor = editorRegistry.findEditor(editorId);
return editorDescriptor;
}
示例9: getDefaultImage
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
@Override
public Image getDefaultImage() {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
ImageDescriptor imageDesc = editorDesc != null ? editorDesc.getImageDescriptor() : null;
return imageDesc != null ? imageHelper.getImage(imageDesc) : super.getDefaultImage();
}
示例10: dragStart
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
@Override
public void dragStart(DragSourceEvent event) {
fEditorInputDatas= new ArrayList<EditorInputData>();
ISelection selection= fProvider.getSelection();
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection= (IStructuredSelection) selection;
for (Iterator<?> iter= structuredSelection.iterator(); iter.hasNext();) {
Object element= iter.next();
IEditorInput editorInput= EditorUtility.getEditorInput(element);
if (editorInput != null && editorInput.getPersistable() != null) {
try {
String editorId= EditorUtility.getEditorID(editorInput);
// see org.eclipse.ui.internal.ide.EditorAreaDropAdapter.openNonExternalEditor(..):
IEditorRegistry editorReg= PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor editorDesc= editorReg.findEditor(editorId);
if (editorDesc != null && !editorDesc.isOpenExternal()) {
fEditorInputDatas.add(EditorInputTransfer.createEditorInputData(editorId, editorInput));
}
} catch (PartInitException e) {
JavaPlugin.log(e);
}
}
}
}
event.doit= fEditorInputDatas.size() > 0;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:EditorInputTransferDragAdapter.java
示例11: init
import org.eclipse.ui.IEditorRegistry; //导入方法依赖的package包/类
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("init(IEditorSite site, IEditorInput input)");
}
setSite(site);
setInput(input);
// 设置Editor标题栏的显示名称,否则名称用plugin.xml中的name属性
setPartName(input.getName());
Image oldTitleImage = titleImage;
if (input != null) {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
ImageDescriptor imageDesc = editorDesc != null ? editorDesc.getImageDescriptor() : null;
titleImage = imageDesc != null ? imageDesc.createImage() : null;
}
setTitleImage(titleImage);
if (oldTitleImage != null && !oldTitleImage.isDisposed()) {
oldTitleImage.dispose();
}
getSite().setSelectionProvider(this);
cursorIbeam = new Cursor(null, SWT.CURSOR_IBEAM);
cursorArrow = new Cursor(null, SWT.CURSOR_ARROW);
hookListener();
}