本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
示例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);
}
});
}
}
示例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;
}