當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。