-
- 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;
- }
-
- protected List<Item> getItems(Class c, String libUri) throws DatabaseException{
- if (InlineComponent.class.equals(c)) {
- return P3DUtil.getInlines(libUri);
- } else if (TurnComponent.class.equals(c)) {
- return P3DUtil.getTurns(libUri);
- } else if (EndComponent.class.equals(c)) {
- return P3DUtil.getEnds(libUri);
- } else {
- return null;
- }
- }
-
+
+ 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;
+
+ usedNames = new HashSet<>();
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+
+ IDialogSettings settings = Activator.getDefault().getDialogSettings();
+ dialogSettings = settings.getSection(DIALOG);
+ if (dialogSettings == null)
+ dialogSettings = settings.addNewSection(DIALOG);
+ }
+
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
+ return dialogSettings;
+ }
+
+ @Override
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText("Create pipeline component");
+ }
+
+ public void addUsedNames(Collection<String> names) {
+ usedNames.addAll(names);
+ }
+
+ protected List<Item> getItems(Class<?> c, String libUri) throws DatabaseException {
+ if (InlineComponent.class.equals(c)) {
+ return P3DUtil.getInlines(libUri);
+ } else if (TurnComponent.class.equals(c)) {
+ return P3DUtil.getTurns(libUri);
+ } else if (EndComponent.class.equals(c)) {
+ return P3DUtil.getEnds(libUri);
+ } else {
+ return null;
+ }
+ }
+