本文整理汇总了Java中org.eclipse.ui.texteditor.IDocumentProviderExtension.validateState方法的典型用法代码示例。如果您正苦于以下问题:Java IDocumentProviderExtension.validateState方法的具体用法?Java IDocumentProviderExtension.validateState怎么用?Java IDocumentProviderExtension.validateState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.texteditor.IDocumentProviderExtension
的用法示例。
在下文中一共展示了IDocumentProviderExtension.validateState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
示例2: 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());
}