X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.issues.ui%2Fsrc%2Forg%2Fsimantics%2Fissues%2Fui%2Fhandler%2FNewUserIssue.java;h=1890228f40193324d7538433beadc81dae684f3a;hp=8eb30cc24ee84112cfe55d82bb3cc6fd8a06229d;hb=47269fe0acb894f346810417d950a1ab59cdc0ea;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/NewUserIssue.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/NewUserIssue.java index 8eb30cc24..1890228f4 100644 --- a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/NewUserIssue.java +++ b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/NewUserIssue.java @@ -1,53 +1,53 @@ -/******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.issues.ui.handler; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.simantics.Simantics; -import org.simantics.browsing.ui.common.ErrorLogger; -import org.simantics.db.Resource; -import org.simantics.db.Session; -import org.simantics.db.VirtualGraph; -import org.simantics.db.WriteGraph; -import org.simantics.db.common.request.WriteRequest; -import org.simantics.db.common.utils.NameUtils; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.util.Layer0Utils; -import org.simantics.issues.common.IssueUtils; - -/** - * @author Tuukka Lehtonen - */ -public class NewUserIssue extends AbstractHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - try { - Session session = Simantics.getSession(); - VirtualGraph vg = null; - session.syncRequest(new WriteRequest(vg) { - @Override - public void perform(WriteGraph graph) throws DatabaseException { - graph.markUndoPoint(); - Resource issue = IssueUtils.newUserIssueForModel(graph); - Layer0Utils.addCommentMetadata(graph, "Created new User Issue " + NameUtils.getSafeLabel(graph, issue) + " " + issue.toString()); - } - }); - } catch (DatabaseException e) { - ErrorLogger.defaultLogError(e); - } - return null; - } - +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.issues.ui.handler; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.simantics.Simantics; +import org.simantics.browsing.ui.common.ErrorLogger; +import org.simantics.db.Resource; +import org.simantics.db.Session; +import org.simantics.db.VirtualGraph; +import org.simantics.db.WriteGraph; +import org.simantics.db.common.request.WriteRequest; +import org.simantics.db.common.utils.NameUtils; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.util.Layer0Utils; +import org.simantics.issues.common.IssueUtils; + +/** + * @author Tuukka Lehtonen + */ +public class NewUserIssue extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + try { + Session session = Simantics.getSession(); + VirtualGraph vg = null; + session.syncRequest(new WriteRequest(vg) { + @Override + public void perform(WriteGraph graph) throws DatabaseException { + graph.markUndoPoint(); + Resource issue = IssueUtils.newUserIssueForModel(graph); + Layer0Utils.addCommentMetadata(graph, "Created new User Issue " + NameUtils.getSafeLabel(graph, issue) + " " + issue.toString()); //$NON-NLS-1$ //$NON-NLS-2$ + } + }); + } catch (DatabaseException e) { + ErrorLogger.defaultLogError(e); + } + return null; + } + } \ No newline at end of file