X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fdialog%2FComponentSelectionDialog.java;h=cce00075faf8b1940ab2da5988f4dbbad5d92df3;hb=ba7b58ca0c80bb539ac40c11af3adc0616e492a6;hp=df00bc39f468804efcde3b91afa6d133087c1000;hpb=f3f581189d66c01f258dcbecd6e3beb180a15fc6;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 df00bc39..cce00075 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/dialog/ComponentSelectionDialog.java @@ -222,7 +222,7 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange inlineViewer.setContentProvider(new ComponentContentProvider()); ExpandItem turnItem = new ExpandItem(expandBar, SWT.NONE); - turnItem.setText("Turn"); + turnItem.setText("Elbow"); turnViewer = new ListViewer(expandBar); turnViewer.setLabelProvider(new ComponentLabelProvider()); turnViewer.setContentProvider(new ComponentContentProvider()); @@ -297,6 +297,11 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange updateInsertPosition(PositionType.NEXT); } }); + + if (!hasInsertPosition()) { + label.setVisible(false); + buttonComposite.setVisible(false); + } label = new Label(composite, SWT.NONE); label.setText("Name"); @@ -319,7 +324,7 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange label.setText("Wall thickness"); thicknessText = new Text(composite, SWT.SINGLE | SWT.BORDER); label = new Label(composite, SWT.NONE); - label.setText("Turn radius"); + label.setText("Elbow radius"); turnRadiusText = new Text(composite, SWT.SINGLE | SWT.BORDER); validationLabel = new Label(composite, SWT.NONE); @@ -431,6 +436,10 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange return composite; } + private boolean hasInsertPosition() { + return component.getNext() == null || component.getPrevious() == null; + } + private void updateInsertPosition(PositionType type) { if (insertPosition == type) return; @@ -488,7 +497,7 @@ public class ComponentSelectionDialog extends Dialog implements ISelectionChange lenghtAdjustable = ((selected.getType() == Type.INLINE) && (selected.isVariable() || selected.isModifiable())); - if (component.getNext() != null && component.getPrevious() != null) { + if (!hasInsertPosition()) { // We are inserting to a fully connected variable length component // only allow insertion within the component startButton.setEnabled(false);