dialogSettings = settings.getSection(DIALOG);
if (dialogSettings == null)
dialogSettings = settings.addNewSection(DIALOG);
+
+ if (component.getNext() != null && component.getPrevious() != null)
+ insertPosition = PositionType.PREVIOUS;
}
public void setLengthFactor(double lengthFactor) {
horizFillData.applyTo(buttonComposite);
GridLayoutFactory.fillDefaults().numColumns(3).applyTo(buttonComposite);
+ startButton.setSelection(insertPosition == PositionType.PREVIOUS);
+ middleButton.setSelection(insertPosition == PositionType.SPLIT);
+ endButton.setSelection(insertPosition == PositionType.NEXT);
+
startButton.setEnabled(false);
middleButton.setEnabled(false);
endButton.setEnabled(false);
updateInsertPosition(PositionType.NEXT);
}
});
- endButton.setSelection(true);
label = new Label(composite, SWT.NONE);
label.setText("Name");
private void updateInsertPosition(PositionType type) {
if (insertPosition == type)
return;
- endButton.setSelection(type == PositionType.NEXT);
- middleButton.setSelection(type == PositionType.SPLIT);
startButton.setSelection(type == PositionType.PREVIOUS);
+ middleButton.setSelection(type == PositionType.SPLIT);
+ endButton.setSelection(type == PositionType.NEXT);
insertPosition = type;
}
} else {
lenghtAdjustable = ((selected.getType() == Type.INLINE)
&& (selected.isVariable() || selected.isModifiable()));
- if (insertAdjustable) {
+
+ if (component.getNext() != null && component.getPrevious() != null) {
+ // We are inserting to a fully connected variable length component
+ // only allow insertion within the component
+ startButton.setEnabled(false);
+ middleButton.setEnabled(false);
+ endButton.setEnabled(false);
+ updateInsertPosition(PositionType.PREVIOUS);
+ } else if (insertAdjustable) {
switch (selected.getType()) {
case END:
startButton.setEnabled(false);