• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IDocumentProviderExtension类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.ui.texteditor.IDocumentProviderExtension的典型用法代码示例。如果您正苦于以下问题:Java IDocumentProviderExtension类的具体用法?Java IDocumentProviderExtension怎么用?Java IDocumentProviderExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDocumentProviderExtension类属于org.eclipse.ui.texteditor包,在下文中一共展示了IDocumentProviderExtension类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initializeSourceViewer

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
private void initializeSourceViewer(final IEditorInput input) {

        final IDocumentProvider documentProvider = getDocumentProvider();
        final IAnnotationModel model = documentProvider.getAnnotationModel(input);
        final IDocument document = documentProvider.getDocument(input);

        if (document != null) {
            fSourceViewer.setDocument(document, model);
            fSourceViewer.setEditable(isEditable());
            fSourceViewer.showAnnotations(model != null);
        }

        if (fElementStateListener instanceof IElementStateListenerExtension) {
            boolean isStateValidated = false;
            if (documentProvider instanceof IDocumentProviderExtension)
                isStateValidated = ((IDocumentProviderExtension) documentProvider).isStateValidated(input);

            final IElementStateListenerExtension extension = (IElementStateListenerExtension) fElementStateListener;
            extension.elementStateValidationChanged(input, isStateValidated);
        }

    }
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:23,代码来源:TestEditor.java


示例2: updateState

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
protected void updateState(final IEditorInput input) {
    final IDocumentProvider provider = getDocumentProvider();
    if (provider instanceof IDocumentProviderExtension) {
        final IDocumentProviderExtension extension = (IDocumentProviderExtension) provider;
        try {

            extension.updateStateCache(input);

            if (fSourceViewer != null)
                fSourceViewer.setEditable(isEditable());

        } catch (final CoreException e) {
            ERDiagramActivator.log(e);
        }
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:17,代码来源:TestEditor.java


示例3: initializeSourceViewer

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
private void initializeSourceViewer(IEditorInput input) {

		IDocumentProvider documentProvider = getDocumentProvider();
		IAnnotationModel model = documentProvider.getAnnotationModel(input);
		IDocument document = documentProvider.getDocument(input);

		if (document != null) {
			fSourceViewer.setDocument(document, model);
			fSourceViewer.setEditable(isEditable());
			fSourceViewer.showAnnotations(model != null);
		}

		if (fElementStateListener instanceof IElementStateListenerExtension) {
			boolean isStateValidated = false;
			if (documentProvider instanceof IDocumentProviderExtension)
				isStateValidated = ((IDocumentProviderExtension) documentProvider)
						.isStateValidated(input);

			IElementStateListenerExtension extension = (IElementStateListenerExtension) fElementStateListener;
			extension.elementStateValidationChanged(input, isStateValidated);
		}

	}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:24,代码来源:TestEditor.java


示例4: updateState

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
protected void updateState(IEditorInput input) {
	IDocumentProvider provider = getDocumentProvider();
	if (provider instanceof IDocumentProviderExtension) {
		IDocumentProviderExtension extension = (IDocumentProviderExtension) provider;
		try {

			extension.updateStateCache(input);

			if (fSourceViewer != null)
				fSourceViewer.setEditable(isEditable());

		} catch (CoreException e) {
			ERDiagramActivator.log(e);
		}
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:17,代码来源:TestEditor.java


示例5: isEditable

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
public boolean isEditable() {
    final IDocumentProvider provider = getDocumentProvider();
    if (provider instanceof IDocumentProviderExtension) {
        final IDocumentProviderExtension extension = (IDocumentProviderExtension) provider;
        return extension.isModifiable(getEditorInput());
    }
    return false;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:9,代码来源:TestEditor.java


示例6: validateState

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
protected void validateState(final IEditorInput input) {

        final IDocumentProvider provider = getDocumentProvider();
        if (!(provider instanceof IDocumentProviderExtension))
            return;

        final IDocumentProviderExtension extension = (IDocumentProviderExtension) provider;

        try {

            extension.validateState(input, getSite().getShell());

        } catch (final CoreException x) {
            final IStatus status = x.getStatus();
            if (status == null || status.getSeverity() != IStatus.CANCEL) {
                final Bundle bundle = Platform.getBundle(PlatformUI.PLUGIN_ID);
                final ILog log = Platform.getLog(bundle);
                log.log(x.getStatus());

                final Shell shell = getSite().getShell();
                final String title = "EditorMessages.Editor_error_validateEdit_title";
                final String msg = "EditorMessages.Editor_error_validateEdit_message";
                ErrorDialog.openError(shell, title, msg, x.getStatus());
            }
            return;
        }

        if (fSourceViewer != null)
            fSourceViewer.setEditable(isEditable());

    }
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:32,代码来源:TestEditor.java


示例7: isEditable

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
public boolean isEditable() {
	IDocumentProvider provider = getDocumentProvider();
	if (provider instanceof IDocumentProviderExtension) {
		IDocumentProviderExtension extension = (IDocumentProviderExtension) provider;
		return extension.isModifiable(getEditorInput());
	}
	return false;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:9,代码来源:TestEditor.java


示例8: validateState

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
protected void validateState(IEditorInput input) {

		IDocumentProvider provider = getDocumentProvider();
		if (!(provider instanceof IDocumentProviderExtension))
			return;

		IDocumentProviderExtension extension = (IDocumentProviderExtension) provider;

		try {

			extension.validateState(input, getSite().getShell());

		} catch (CoreException x) {
			IStatus status = x.getStatus();
			if (status == null || status.getSeverity() != IStatus.CANCEL) {
				Bundle bundle = Platform.getBundle(PlatformUI.PLUGIN_ID);
				ILog log = Platform.getLog(bundle);
				log.log(x.getStatus());

				Shell shell = getSite().getShell();
				String title = "EditorMessages.Editor_error_validateEdit_title";
				String msg = "EditorMessages.Editor_error_validateEdit_message";
				ErrorDialog.openError(shell, title, msg, x.getStatus());
			}
			return;
		}

		if (fSourceViewer != null)
			fSourceViewer.setEditable(isEditable());

	}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:32,代码来源:TestEditor.java


示例9: handleEditorInputChanged

import org.eclipse.ui.texteditor.IDocumentProviderExtension; //导入依赖的package包/类
/**
 * This code auto-refreshes files that are out of synch when we first open them. This is a bit of a hack that looks
 * to see if it seems we're out of sync and the file isn't open yet. If it is already open, we call super so it pops
 * a dialog asking if you want to update the file contents.
 */
@Override
protected void handleEditorInputChanged()
{
	final IDocumentProvider provider = getDocumentProvider();
	if (provider == null)
	{
		// fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=15066
		close(false);
		return;
	}

	final IEditorInput input = getEditorInput();
	boolean wasActivated = true;
	try
	{
		Field f = AbstractTextEditor.class.getDeclaredField("fHasBeenActivated"); //$NON-NLS-1$
		f.setAccessible(true);
		wasActivated = (Boolean) f.get(this);
	}
	catch (Exception e1)
	{
		// ignore
	}
	if (!wasActivated && !provider.isDeleted(input))
	{
		try
		{
			if (provider instanceof IDocumentProviderExtension)
			{
				IDocumentProviderExtension extension = (IDocumentProviderExtension) provider;
				extension.synchronize(input);
			}
			else
			{
				doSetInput(input);
			}
			return;
		}
		catch (Exception e)
		{
			// ignore
		}
	}
	super.handleEditorInputChanged();
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:51,代码来源:AbstractFoldingEditor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RichInputFormat类代码示例发布时间:2022-05-22
下一篇:
Java VectorIterable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap