当前位置: 首页>>代码示例>>Java>>正文


Java IEditorRegistry.findEditor方法代码示例

本文整理汇总了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;
	}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:SVNConflictResolver.java

示例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;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:SVNConflictResolver.java

示例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();
    }
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:24,代码来源:TestEditor.java

示例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();
	}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:27,代码来源:TestEditor.java

示例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();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:23,代码来源:HtmlBrowserEditor.java

示例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);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:37,代码来源:XLIFFEditor.java

示例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$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:OpenJavaSourceAction.java

示例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;
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:17,代码来源:BaseEditorInput.java

示例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();
}
 
开发者ID:cplutte,项目名称:bts,代码行数:8,代码来源:XtextEditor.java

示例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();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:32,代码来源:XLFEditor.java


注:本文中的org.eclipse.ui.IEditorRegistry.findEditor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。