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;
private ResourceManager resourceManager;
+ private String libUri;
+
private Item selected;
private Set<PositionType> allowed;
private Set<PositionType> filterAllowed;
public ComponentSelectionDialog(Shell parentShell, Set<PositionType> allowed, PipelineComponent component){
- super(parentShell);
- this.allowed = allowed;
- this.component = component;
- filterAllowed = new HashSet<PositionType>();
- insertAdjustable = component instanceof InlineComponent ? ((InlineComponent)component).isVariableLength() : false;
- lenghtAdjustable = false;
+ this(parentShell, allowed, component, Plant3D.URIs.Builtin);
}
+ public ComponentSelectionDialog(Shell parentShell, Set<PositionType> allowed, PipelineComponent component, String libUri){
+ super(parentShell);
+ this.allowed = allowed;
+ this.component = component;
+ filterAllowed = new HashSet<PositionType>();
+ 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);
List<Item> turns = null;
List<Item> 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());