use of org.eclipse.swt.layout.FormAttachment in project cogtool by cogtool.
the class ThreadProgressBar method addBelowBar.
@Override
protected void addBelowBar() {
FormData data = new FormData();
// at the top of the dialog box otherwise
if (statusLabel != null) {
data.top = new FormAttachment(statusLabel, 10, SWT.BOTTOM);
data.bottom = new FormAttachment(statusLabel, 25, SWT.BOTTOM);
} else {
data.top = new FormAttachment(0, 10);
data.bottom = new FormAttachment(0, 25);
}
data.left = new FormAttachment(0, 20);
data.right = new FormAttachment(100, -20);
bar.setLayoutData(data);
// box, tying it to the given cancelable "process" object.
if (cancelListener != null) {
cancelButton = new Button(shell, SWT.PUSH);
cancelButton.setText(L10N.get("B.Cancel", "Cancel"));
cancelButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
// Called from the main UI thread
cancelListener.cancel();
cancelButton.setEnabled(false);
}
});
data = new FormData();
data.left = new FormAttachment(bar, 0, SWT.CENTER);
data.top = new FormAttachment(bar, 5, SWT.BOTTOM);
cancelButton.setLayoutData(data);
}
}
use of org.eclipse.swt.layout.FormAttachment in project cogtool by cogtool.
the class ThreadProgressBar method addAboveBar.
@Override
protected void addAboveBar() {
shell.setLayout(new FormLayout());
// Add status display area if requested
if (initialStatus != null) {
statusLabel = new Label(shell, SWT.NONE);
statusLabel.setText(initialStatus);
FormData data = new FormData();
data.left = new FormAttachment(0, 20);
data.top = new FormAttachment(0, 10);
data.right = new FormAttachment(100, -20);
statusLabel.setLayoutData(data);
}
}
use of org.eclipse.swt.layout.FormAttachment in project cogtool by cogtool.
the class ActionChangePropertySet method layOutTouchComposite.
@Override
public void layOutTouchComposite() {
touchActionCombo.addSelectionListener(handleChangeChecks);
// Center button action label to its associated combo vertically
// Attach button action label to 5 pixels from the properties left
FormData data = new FormData();
data.top = new FormAttachment(touchActionCombo, 0, SWT.CENTER);
data.left = new FormAttachment(0, 5);
touchActionLabel.setLayoutData(data);
data = new FormData();
data.top = new FormAttachment(0, 5);
data.left = new FormAttachment(touchActionLabel, 5, SWT.RIGHT);
data.right = new FormAttachment(100, -5);
touchActionCombo.setLayoutData(data);
transitionSourceLabelTouch.setVisible(false);
transitionSourceNameTouch.setVisible(false);
transitionDestinationLabelTouch.setVisible(false);
transitionDestinationNameTouch.setVisible(false);
}
use of org.eclipse.swt.layout.FormAttachment in project cogtool by cogtool.
the class ActionChangePropertySet method layOutMouseComposite.
@Override
public void layOutMouseComposite() {
mouseButtonCombo.addSelectionListener(handleChangeChecks);
mouseActionCombo.addSelectionListener(handleChangeChecks);
if (buttonModifierSet != null) {
buttonModifierSet.addSelectionListener(handleChangeChecks);
}
// Center mouse button label to its associated combo vertically
// Attach mouse button label to 5 from the properties left
FormData data = new FormData();
data.top = new FormAttachment(mouseButtonCombo, 0, SWT.CENTER);
data.left = new FormAttachment(0, 5);
mouseButtonLabel.setLayoutData(data);
// Attach mouse button combo to 5 pixels from the label's right
// Attach mouse button combo to 5 from the properties top
// Attach right of combo to end of the properties space
data = new FormData();
data.top = new FormAttachment(0, 5);
data.left = new FormAttachment(mouseButtonLabel, 5, SWT.RIGHT);
data.right = new FormAttachment(100, -5);
mouseButtonCombo.setLayoutData(data);
// Center button action label to its associated combo vertically
// Attach button action label to 5 pixels from the properties left
data = new FormData();
data.top = new FormAttachment(mouseActionCombo, 0, SWT.CENTER);
data.left = new FormAttachment(0, 5);
mouseActionLabel.setLayoutData(data);
data = new FormData();
data.left = new FormAttachment(mouseButtonCombo, 0, SWT.LEFT);
data.top = new FormAttachment(mouseButtonCombo, 5, SWT.BOTTOM);
data.right = new FormAttachment(100, -5);
mouseActionCombo.setLayoutData(data);
transitionSourceLabelMouse.setVisible(false);
transitionSourceNameMouse.setVisible(false);
transitionDestinationLabelMouse.setVisible(false);
transitionDestinationNameMouse.setVisible(false);
}
use of org.eclipse.swt.layout.FormAttachment in project cogtool by cogtool.
the class ActionChangePropertySet method layOutVoiceComposite.
@Override
public void layOutVoiceComposite() {
// Center isCommand state checkbox to associated text
// Align checkbox 5 pixels from the right edge
FormData data = new FormData();
data.top = new FormAttachment(voiceText.getOuter(), 0, SWT.CENTER);
data.right = new FormAttachment(100, -5);
voiceIsCmd.setLayoutData(data);
// Center voice text label to its associated text vertically
// Attach label to 5 pixels from the properties left
data = new FormData();
data.top = new FormAttachment(voiceText.getOuter(), 0, SWT.CENTER);
data.left = leftAttachment;
voiceTextLabel.setLayoutData(data);
// Attach device command text to 5 pixels from the label's right
// Attach top 5 pixels from the top edge
// Attach right of combo to 5 before the isCommand checkbox
data = new FormData();
data.top = new FormAttachment(0, 5);
data.left = new FormAttachment(voiceTextLabel, 5, SWT.RIGHT);
data.right = new FormAttachment(voiceIsCmd, -5, SWT.LEFT);
voiceText.setLayoutData(data);
transitionDestinationLabelVoice.setVisible(false);
transitionDestinationNameVoice.setVisible(false);
}
Aggregations