本文整理匯總了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;
}