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());
updateInsertPosition(PositionType.NEXT);
}
});
+
+ if (!hasInsertPosition()) {
+ label.setVisible(false);
+ buttonComposite.setVisible(false);
+ }
label = new Label(composite, SWT.NONE);
label.setText("Name");
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);
return composite;
}
+ private boolean hasInsertPosition() {
+ return component.getNext() == null || component.getPrevious() == null;
+ }
+
private void updateInsertPosition(PositionType type) {
if (insertPosition == type)
return;
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);