本文整理汇总了Java中org.eclipse.emf.edit.domain.IEditingDomainProvider.getEditingDomain方法的典型用法代码示例。如果您正苦于以下问题:Java IEditingDomainProvider.getEditingDomain方法的具体用法?Java IEditingDomainProvider.getEditingDomain怎么用?Java IEditingDomainProvider.getEditingDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.edit.domain.IEditingDomainProvider
的用法示例。
在下文中一共展示了IEditingDomainProvider.getEditingDomain方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
/**
* Opens the resource in <code>linkTarget</code> with the generated editor, if it
* supports the file extension of this resource, and tries to jump to the
* definition. Otherwise it tries to open the target with the default editor.
*/
public void open() {
if (linkTarget == null) {
return;
}
IFile file = getIFileFromResource();
if (file != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(file.getName());
if (desc == null) {
desc = workbench.getEditorRegistry().findEditor("org.eclipse.emf.ecore.presentation.ReflectiveEditorID");
}
IEditorPart editorPart = page.openEditor(new FileEditorInput(file), desc.getId());
if (editorPart instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) editorPart;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
URI uri = EcoreUtil.getURI(linkTarget);
EObject originalObject = editingDomain.getResourceSet().getEObject(uri, true);
if (editingDomainProvider instanceof IViewerProvider) {
IViewerProvider viewerProvider = (IViewerProvider) editingDomainProvider;
Viewer viewer = viewerProvider.getViewer();
viewer.setSelection(new StructuredSelection(originalObject), true);
}
}
} catch (PartInitException e) {
de.darwinspl.preferences.resource.dwprofile.mopp.DwprofilePlugin.logError("Exception while opening hyperlink target.", e);
}
}
}
示例2: open
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
/**
* Opens the resource in <code>linkTarget</code> with the generated editor, if it
* supports the file extension of this resource, and tries to jump to the
* definition. Otherwise it tries to open the target with the default editor.
*/
public void open() {
if (linkTarget == null) {
return;
}
IFile file = getIFileFromResource();
if (file != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(file.getName());
if (desc == null) {
desc = workbench.getEditorRegistry().findEditor("org.eclipse.emf.ecore.presentation.ReflectiveEditorID");
}
IEditorPart editorPart = page.openEditor(new FileEditorInput(file), desc.getId());
if (editorPart instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) editorPart;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
URI uri = EcoreUtil.getURI(linkTarget);
EObject originalObject = editingDomain.getResourceSet().getEObject(uri, true);
if (editingDomainProvider instanceof IViewerProvider) {
IViewerProvider viewerProvider = (IViewerProvider) editingDomainProvider;
Viewer viewer = viewerProvider.getViewer();
viewer.setSelection(new StructuredSelection(originalObject), true);
}
}
} catch (PartInitException e) {
eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionPlugin.logError("Exception while opening hyperlink target.", e);
}
}
}
示例3: open
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
/**
* Opens the resource in <code>linkTarget</code> with the generated editor, if it
* supports the file extension of this resource, and tries to jump to the
* definition. Otherwise it tries to open the target with the default editor.
*/
public void open() {
if (linkTarget == null) {
return;
}
IFile file = getIFileFromResource();
if (file != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(file.getName());
if (desc == null) {
desc = workbench.getEditorRegistry().findEditor("org.eclipse.emf.ecore.presentation.ReflectiveEditorID");
}
IEditorPart editorPart = page.openEditor(new FileEditorInput(file), desc.getId());
if (editorPart instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) editorPart;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
URI uri = EcoreUtil.getURI(linkTarget);
EObject originalObject = editingDomain.getResourceSet().getEObject(uri, true);
if (editingDomainProvider instanceof IViewerProvider) {
IViewerProvider viewerProvider = (IViewerProvider) editingDomainProvider;
Viewer viewer = viewerProvider.getViewer();
viewer.setSelection(new StructuredSelection(originalObject), true);
}
}
} catch (PartInitException e) {
eu.hyvar.context.contextValidity.resource.hyvalidityformula.mopp.HyvalidityformulaPlugin.logError("Exception while opening hyperlink target.", e);
}
}
}
示例4: open
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
/**
* Opens the resource in <code>linkTarget</code> with the generated editor, if it
* supports the file extension of this resource, and tries to jump to the
* definition. Otherwise it tries to open the target with the default editor.
*/
public void open() {
if (linkTarget == null) {
return;
}
IFile file = getIFileFromResource();
if (file != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(file.getName());
if (desc == null) {
desc = workbench.getEditorRegistry().findEditor("org.eclipse.emf.ecore.presentation.ReflectiveEditorID");
}
IEditorPart editorPart = page.openEditor(new FileEditorInput(file), desc.getId());
if (editorPart instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) editorPart;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
URI uri = EcoreUtil.getURI(linkTarget);
EObject originalObject = editingDomain.getResourceSet().getEObject(uri, true);
if (editingDomainProvider instanceof IViewerProvider) {
IViewerProvider viewerProvider = (IViewerProvider) editingDomainProvider;
Viewer viewer = viewerProvider.getViewer();
viewer.setSelection(new StructuredSelection(originalObject), true);
}
}
} catch (PartInitException e) {
eu.hyvar.dataValues.resource.hydatavalue.mopp.HydatavaluePlugin.logError("Exception while opening hyperlink target.", e);
}
}
}
示例5: open
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
/**
* Opens the resource in <code>linkTarget</code> with the generated editor, if it
* supports the file extension of this resource, and tries to jump to the
* definition. Otherwise it tries to open the target with the default editor.
*/
public void open() {
if (linkTarget == null) {
return;
}
IFile file = getIFileFromResource();
if (file != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(file.getName());
if (desc == null) {
desc = workbench.getEditorRegistry().findEditor("org.eclipse.emf.ecore.presentation.ReflectiveEditorID");
}
IEditorPart editorPart = page.openEditor(new FileEditorInput(file), desc.getId());
if (editorPart instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) editorPart;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
URI uri = EcoreUtil.getURI(linkTarget);
EObject originalObject = editingDomain.getResourceSet().getEObject(uri, true);
if (editingDomainProvider instanceof IViewerProvider) {
IViewerProvider viewerProvider = (IViewerProvider) editingDomainProvider;
Viewer viewer = viewerProvider.getViewer();
viewer.setSelection(new StructuredSelection(originalObject), true);
}
}
} catch (PartInitException e) {
eu.hyvar.feature.mapping.resource.hymapping.mopp.HymappingPlugin.logError("Exception while opening hyperlink target.", e);
}
}
}
示例6: open
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
/**
* Opens the resource in <code>linkTarget</code> with the generated editor, if it
* supports the file extension of this resource, and tries to jump to the
* definition. Otherwise it tries to open the target with the default editor.
*/
public void open() {
if (linkTarget == null) {
return;
}
IFile file = getIFileFromResource();
if (file != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(file.getName());
if (desc == null) {
desc = workbench.getEditorRegistry().findEditor("org.eclipse.emf.ecore.presentation.ReflectiveEditorID");
}
IEditorPart editorPart = page.openEditor(new FileEditorInput(file), desc.getId());
if (editorPart instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) editorPart;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
URI uri = EcoreUtil.getURI(linkTarget);
EObject originalObject = editingDomain.getResourceSet().getEObject(uri, true);
if (editingDomainProvider instanceof IViewerProvider) {
IViewerProvider viewerProvider = (IViewerProvider) editingDomainProvider;
Viewer viewer = viewerProvider.getViewer();
viewer.setSelection(new StructuredSelection(originalObject), true);
}
}
} catch (PartInitException e) {
eu.hyvar.feature.constraint.resource.hyconstraints.mopp.HyconstraintsPlugin.logError("Exception while opening hyperlink target.", e);
}
}
}
示例7: open
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
/**
* Opens the resource in <code>linkTarget</code> with the generated editor, if it
* supports the file extension of this resource, and tries to jump to the
* definition. Otherwise it tries to open the target with the default editor.
*/
public void open() {
if (linkTarget == null) {
return;
}
IFile file = getIFileFromResource();
if (file != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(file.getName());
if (desc == null) {
desc = workbench.getEditorRegistry().findEditor("org.eclipse.emf.ecore.presentation.ReflectiveEditorID");
}
IEditorPart editorPart = page.openEditor(new FileEditorInput(file), desc.getId());
if (editorPart instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) editorPart;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
URI uri = EcoreUtil.getURI(linkTarget);
EObject originalObject = editingDomain.getResourceSet().getEObject(uri, true);
if (editingDomainProvider instanceof IViewerProvider) {
IViewerProvider viewerProvider = (IViewerProvider) editingDomainProvider;
Viewer viewer = viewerProvider.getViewer();
viewer.setSelection(new StructuredSelection(originalObject), true);
}
}
} catch (PartInitException e) {
eu.hyvar.mspl.manifest.resource.hymanifest.mopp.HymanifestPlugin.logError("Exception while opening hyperlink target.", e);
}
}
}
示例8: execute
import org.eclipse.emf.edit.domain.IEditingDomainProvider; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
@SuppressWarnings("deprecation")
IEditorPart[] editors = activePage.getEditors();
for (IEditorPart part : editors) {
if (part instanceof IEditingDomainProvider) {
IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider) part;
EditingDomain editingDomain = editingDomainProvider.getEditingDomain();
addAdapterHandler(editingDomain);
}
}
return null;
}