X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fdialog%2FComponentSelectionDialog.java;h=93a305bb9d74ea67fddb1ed35c088c09044d12e4;hb=31fd8b586a816e12d85f361b3fe2f6ebd52e427b;hp=30f2540d5ccee1be1953ff0db181d2247c24a2ae;hpb=53d55c24c779745f188bdb18d32f71d20acb61b2;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java b/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java index 30f2540d..93a305bb 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java @@ -33,6 +33,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.simantics.db.exception.DatabaseException; import org.simantics.plant3d.Activator; +import org.simantics.plant3d.ontology.Plant3D; import org.simantics.plant3d.scenegraph.EndComponent; import org.simantics.plant3d.scenegraph.InlineComponent; import org.simantics.plant3d.scenegraph.Nozzle; @@ -48,6 +49,8 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange private ResourceManager resourceManager; + private String libUri; + private Item selected; private Set allowed; private Set filterAllowed; @@ -81,14 +84,19 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange public ComponentSelectionDialog(Shell parentShell, Set allowed, PipelineComponent component){ - super(parentShell); - this.allowed = allowed; - this.component = component; - filterAllowed = new HashSet(); - insertAdjustable = component instanceof InlineComponent ? ((InlineComponent)component).isVariableLength() : false; - lenghtAdjustable = false; + this(parentShell, allowed, component, Plant3D.URIs.Builtin); } + public ComponentSelectionDialog(Shell parentShell, Set allowed, PipelineComponent component, String libUri){ + super(parentShell); + this.allowed = allowed; + this.component = component; + filterAllowed = new HashSet(); + insertAdjustable = component instanceof InlineComponent ? ((InlineComponent)component).isVariableLength() : false; + lenghtAdjustable = false; + this.libUri = libUri; + } + @Override protected Control createDialogArea(Composite parent) { resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent); @@ -115,9 +123,9 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange List turns = null; List inlines = null; try { - ends = P3DUtil.getEnds(); - turns= P3DUtil.getTurns(); - inlines = P3DUtil.getInlines(); + ends = P3DUtil.getEnds(libUri); + turns= P3DUtil.getTurns(libUri); + inlines = P3DUtil.getInlines(libUri); } catch (DatabaseException e) { Label label = new Label(composite, SWT.NONE); label.setText("Cannot load pipeline components: " + e.getMessage());