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


Java SessionUIManager类代码示例

本文整理汇总了Java中org.eclipse.sirius.ui.business.api.session.SessionUIManager的典型用法代码示例。如果您正苦于以下问题:Java SessionUIManager类的具体用法?Java SessionUIManager怎么用?Java SessionUIManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SessionUIManager类属于org.eclipse.sirius.ui.business.api.session包,在下文中一共展示了SessionUIManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notifySirius

import org.eclipse.sirius.ui.business.api.session.SessionUIManager; //导入依赖的package包/类
/**
 * Notifies Sirius about a change in the given {@link DSLBreakpoint}.
 * 
 * @param instructionUris
 *            the {@link URI}s of the instructions to refresh.
 * @param debugModelID
 *            the debug model identifier
 */
public void notifySirius(Set<URI> instructionUris, String debugModelID) {
	Map<String, Set<String>> toRefresh = representationToRefresh.get(debugModelID);
	if (toRefresh != null) {
		for (IEditingSession session : SessionUIManager.INSTANCE.getUISessions()) {
			final TransactionalEditingDomain transactionalEditingDomain = session.getSession()
					.getTransactionalEditingDomain();
			final boolean instructionPresent = isOneInstructionPresent(instructionUris,
					transactionalEditingDomain.getResourceSet());
			if (instructionPresent) {
				final List<DRepresentation> representations = getRepresentationsToRefresh(toRefresh,
						session);
				refreshRepresentations(transactionalEditingDomain, representations);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:25,代码来源:AbstractDSLDebuggerServices.java

示例2: notifySirius

import org.eclipse.sirius.ui.business.api.session.SessionUIManager; //导入依赖的package包/类
/**
 * Notifies Sirius about a change in the given {@link DSLBreakpoint}.
 * 
 * @param instructionUri
 *            the {@link URI} of the instruction to refresh.
 */
public void notifySirius(Set<URI> instructionUris) {
	final Map<String, Set<String>> toRefresh = representationToRefresh;
	for (IEditingSession session : SessionUIManager.INSTANCE
			.getUISessions()) {
		final TransactionalEditingDomain transactionalEditingDomain = session
				.getSession().getTransactionalEditingDomain();
		final ResourceSet resourceSet = transactionalEditingDomain
				.getResourceSet();
		final boolean instructionPresent = isOneInstructionPresent(
				instructionUris, resourceSet);
		if (instructionPresent) {
			final List<DRepresentation> representations = getRepresentationsToRefresh(
					toRefresh, session);
			refreshRepresentations(transactionalEditingDomain,
					representations);
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:25,代码来源:AbstractGemocAnimatorServices.java

示例3: killPreviousSiriusSession

import org.eclipse.sirius.ui.business.api.session.SessionUIManager; //导入依赖的package包/类
private static void killPreviousSiriusSession(URI sessionResourceURI) {
	final Session session = SessionManager.INSTANCE.getExistingSession(sessionResourceURI);
	if (session != null) {
		final IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session);
		DebugPermissionProvider permProvider = new DebugPermissionProvider();
		if (!permProvider.provides(session.getTransactionalEditingDomain().getResourceSet())) {
			// this is a not debugSession (ie. a normal editing session)
			if (uiSession != null) {
				for (final DialectEditor editor : uiSession.getEditors()) {
					final IEditorSite editorSite = editor.getEditorSite();
					if (editor.getSite() == null) {
						editorSite.getShell().getDisplay().syncExec(new Runnable() {
							@Override
							public void run() {
								editorSite.getPage().closeEditor(editor, true);
							}
						});
					}
				}
				PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
					@Override
					public void run() {
						uiSession.close();
					}
				});
			}
		}
		PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
			@Override
			public void run() {
				session.close(new NullProgressMonitor());
				SessionManager.INSTANCE.remove(session);
			}
		});
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:37,代码来源:DefaultModelLoader.java

示例4: getEditor

import org.eclipse.sirius.ui.business.api.session.SessionUIManager; //导入依赖的package包/类
/**
 * Return opened representation.
 * 
 * @param session
 *            Session
 * @param representation
 *            DRepresentation
 * @return opened representation.
 */
public static DialectEditor getEditor(final Session session, final DRepresentation representation) {
    IEditingSession ui = SessionUIManager.INSTANCE.getUISession(session);
    if (ui != null) {
        return ui.getEditor(representation);
    }
    return null;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:17,代码来源:SiriusRepresentationUtils.java


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