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


Java IEditingDomainProvider.getEditingDomain方法代码示例

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

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

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

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

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

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

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

示例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;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:15,代码来源:AddAdapterHandler.java


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