X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2Factions%2FNewComponentTypeAction.java;h=a07fe933a4976d3631e95b36919f6a7f432d888f;hb=HEAD;hp=1acbf5391455a714cdf996771b7a0d8b0136d8c3;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewComponentTypeAction.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewComponentTypeAction.java index 1acbf5391..a07fe933a 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewComponentTypeAction.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewComponentTypeAction.java @@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.simantics.DatabaseJob; +import org.simantics.Simantics; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; @@ -23,7 +24,6 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.adapter.ActionFactory; import org.simantics.modeling.NewComponentType; import org.simantics.modeling.ui.Activator; -import org.simantics.ui.SimanticsUI; public class NewComponentTypeAction implements ActionFactory { @@ -35,11 +35,11 @@ public class NewComponentTypeAction implements ActionFactory { return new Runnable() { @Override public void run() { - Job job = new DatabaseJob("New User Component") { + Job job = new DatabaseJob(Messages.NewComponentTypeAction_NewUserComponent) { @Override protected IStatus run(IProgressMonitor monitor) { try { - SimanticsUI.getSession().syncRequest(new WriteRequest() { + Simantics.getSession().syncRequest(new WriteRequest() { @Override public void perform(WriteGraph graph) throws DatabaseException { graph.markUndoPoint(); @@ -48,7 +48,7 @@ public class NewComponentTypeAction implements ActionFactory { }); return Status.OK_STATUS; } catch (DatabaseException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to create new user component.", e); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NewComponentTypeAction_ActivatorFailedToCreateNewUserComponent, e); } } };