updateInsertPosition(PositionType.NEXT);
}
});
+
+ if (!hasInsertPosition()) {
+ label.setVisible(false);
+ buttonComposite.setVisible(false);
+ }
label = new Label(composite, SWT.NONE);
label.setText("Name");
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);