use of org.eclipse.swt.layout.FormData in project cogtool by cogtool.
the class DictionaryEditorView method layOutWidgets.
protected void layOutWidgets(Composite parent) {
nameLabel = new Label(parent, SWT.NONE);
dictTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
dictTable.setLinesVisible(true);
dictTable.setHeaderVisible(true);
dictTable.setEnabled(true);
dictTable.addListener(SWT.MeasureItem, new Listener() {
public void handleEvent(Event event) {
event.height = OSUtils.MACOSX ? 28 : 25;
}
});
TableColumn goalColumn = new TableColumn(dictTable, SWT.NONE);
goalColumn.setText(GOAL_HEADER);
goalColumn.setResizable(true);
goalColumn.setWidth(DictionaryEditorView.COL_WIDTH);
TableColumn searchColumn = new TableColumn(dictTable, SWT.NONE);
searchColumn.setText(SEARCH_HEADER);
searchColumn.setResizable(true);
searchColumn.setWidth(DictionaryEditorView.COL_WIDTH);
TableColumn similarityColumn = new TableColumn(dictTable, SWT.RIGHT);
similarityColumn.setText(SIMIL_HEADER);
similarityColumn.setResizable(true);
similarityColumn.setWidth(DictionaryEditorView.COL_WIDTH);
TableColumn algColumn = new TableColumn(dictTable, SWT.NONE);
algColumn.setText(ALG_HEADER);
algColumn.setResizable(false);
algColumn.setWidth(DictionaryEditorView.COL_WIDTH);
TableColumn dateColumn = new TableColumn(dictTable, SWT.NONE);
dateColumn.setText(DATE_HEADER);
dateColumn.setResizable(true);
dateColumn.setWidth(DictionaryEditorView.COL_WIDTH);
urlLabel = new Label(parent, SWT.NONE);
urlLabel.setText(SITE_LABEL);
urlText = new View.PerformActionText(parent, SWT.SINGLE | SWT.BORDER) {
@Override
protected boolean doChangeAction() {
return performChangeURL();
}
};
urlText.setEnabled(false);
spaceLabel = new Label(parent, SWT.NONE);
spaceLabel.setText(SPACE_LABEL);
spaceCombo = new View.PerformActionCombo(parent, SWT.DROP_DOWN | SWT.BORDER) {
@Override
protected boolean doChangeAction() {
return performChangeSpace();
}
};
spaceCombo.setItems(LSASimilarity.KNOWN_SPACES);
spaceCombo.setEnabled(false);
FormData formData = new FormData();
formData.left = new FormAttachment(0, 5);
formData.top = new FormAttachment(0, 5);
nameLabel.setLayoutData(formData);
formData = new FormData();
formData.left = new FormAttachment(0, 20);
formData.top = new FormAttachment(nameLabel, 5);
formData.right = new FormAttachment(100, -20);
formData.height = 350;
dictTable.setLayoutData(formData);
formData = new FormData();
formData.left = new FormAttachment(0, 5);
formData.top = new FormAttachment(dictTable, 5);
spaceLabel.setLayoutData(formData);
formData = new FormData();
formData.left = new FormAttachment(spaceLabel, 5);
formData.top = new FormAttachment(dictTable, 5);
spaceCombo.setLayoutData(formData);
formData = new FormData();
formData.left = new FormAttachment(urlLabel, 5);
formData.top = new FormAttachment(spaceCombo, 5, SWT.BOTTOM);
formData.right = new FormAttachment(100, -15);
urlText.setLayoutData(formData);
formData = new FormData();
formData.left = new FormAttachment(0, 5);
formData.top = new FormAttachment(urlText.getOuter(), 0, SWT.CENTER);
formData.right = new FormAttachment(spaceLabel, 0, SWT.RIGHT);
urlLabel.setLayoutData(formData);
}
use of org.eclipse.swt.layout.FormData 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.FormData 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.FormData 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.FormData 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);
}
Aggregations