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