X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fruntime%2FRuntimeVariableForInput.java;h=ca3c73d3295e793a6e9d2529d1d96d03856c0e7e;hb=006602e856bbc3e222789cfe00a923b863e3e91b;hp=56d6c4e21c855bfc61f62fcdc66326449b7314e0;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/runtime/RuntimeVariableForInput.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/runtime/RuntimeVariableForInput.java index 56d6c4e21..ca3c73d32 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/runtime/RuntimeVariableForInput.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/runtime/RuntimeVariableForInput.java @@ -1,52 +1,52 @@ -/******************************************************************************* - * Copyright (c) 2013 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: - * Semantum Oy - initial API and implementation for issue #4384 - *******************************************************************************/ -package org.simantics.diagram.runtime; - -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.common.request.UnaryRead; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.variable.RVI; -import org.simantics.ui.workbench.IResourceEditorInput2; - -/** - * Extract a triple from the input argument. This - * request is needed in addition to {@link RuntimeVariable} to support possible - * changes in the data contained by {@link IResourceEditorInput2}. - * - * Returns null if it cannot find: - *
    - *
  1. model resource by its URI
  2. - *
  3. active realization of the model or base realization as a fallback
  4. - *
- * - * @author Tuukka Lehtonen - * @see RuntimeVariable - */ -class RuntimeVariableForInput extends UnaryRead { - - public RuntimeVariableForInput(IResourceEditorInput2 input) { - super(input); - } - - @Override - public RuntimeDiagramDesc perform(ReadGraph graph) throws DatabaseException { - Resource model = parameter.getModel(graph); - String rvis = parameter.getRVI(); - RVI rvi = rvis == null ? null : RVI.fromResourceFormat(graph, rvis); - return graph.syncRequest(new RuntimeVariable( - model, - rvi, - parameter.getResource())); - } - +/******************************************************************************* + * Copyright (c) 2013 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: + * Semantum Oy - initial API and implementation for issue #4384 + *******************************************************************************/ +package org.simantics.diagram.runtime; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.request.UnaryRead; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.RVI; +import org.simantics.ui.workbench.IResourceEditorInput2; + +/** + * Extract a triple from the input argument. This + * request is needed in addition to {@link RuntimeVariable} to support possible + * changes in the data contained by {@link IResourceEditorInput2}. + * + * Returns null if it cannot find: + *
    + *
  1. model resource by its URI
  2. + *
  3. active realization of the model or base realization as a fallback
  4. + *
+ * + * @author Tuukka Lehtonen + * @see RuntimeVariable + */ +class RuntimeVariableForInput extends UnaryRead { + + public RuntimeVariableForInput(IResourceEditorInput2 input) { + super(input); + } + + @Override + public RuntimeDiagramDesc perform(ReadGraph graph) throws DatabaseException { + Resource model = parameter.getModel(graph); + String rvis = parameter.getRVI(); + RVI rvi = rvis == null ? null : RVI.fromResourceFormat(graph, rvis); + return graph.syncRequest(new RuntimeVariable( + model, + rvi, + parameter.getResource())); + } + } \ No newline at end of file