use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class TOSLoginComposite method createTosRepositoryArea.
private void createTosRepositoryArea(Composite parent) {
repositoryComposite = toolkit.createComposite(parent);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 40;
repositoryComposite.setLayoutData(gd);
repositoryComposite.setLayout(new FormLayout());
repositoryComposite.setBackgroundMode(SWT.INHERIT_DEFAULT);
String productName = brandingService.getProductName();
Label welcomeLabel = toolkit.createLabel(repositoryComposite, //$NON-NLS-1$
Messages.getString("TOSLoginComposite.welcomeTitle", productName));
welcomeLabel.setBackground(repositoryComposite.getBackground());
welcomeLabel.setFont(font);
FormData welcomeLabelFormData = new FormData();
welcomeLabelFormData.top = new FormAttachment(0, 7);
welcomeLabelFormData.left = new FormAttachment(0, 10);
if (Platform.getOS().equals(Platform.OS_WIN32)) {
welcomeLabelFormData.right = new FormAttachment(0, 380);
welcomeLabelFormData.right = new FormAttachment(0, 420);
} else if (Platform.getOS().equals(Platform.OS_LINUX)) {
welcomeLabelFormData.right = new FormAttachment(0, 420);
} else {
welcomeLabelFormData.right = new FormAttachment(0, 420);
}
welcomeLabelFormData.bottom = new FormAttachment(100, 0);
welcomeLabel.setLayoutData(welcomeLabelFormData);
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class WidgetFactory method createFlatFormComposite.
/**
* Creates a flat form composite as a part of the form.
*
* @param parent the composite parent.
* @return the composite.
*/
public Composite createFlatFormComposite(Composite parent) {
Composite composite = createComposite(parent);
FormLayout layout = new FormLayout();
layout.marginWidth = ITabbedPropertyConstants.HSPACE + 2;
layout.marginHeight = ITabbedPropertyConstants.VSPACE;
layout.spacing = ITabbedPropertyConstants.VMARGIN + 1;
composite.setLayout(layout);
return composite;
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class HeaderComposite method createComponents.
private void createComponents() {
GridData headerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
this.setLayoutData(headerCompositeGridData);
FormLayout formLayout = new FormLayout();
this.setLayout(formLayout);
this.statusLabel = new Label(this, SWT.NONE);
this.iconLabel = new Label(this, SWT.NONE);
FormData iconFormData = new FormData();
Point minSize = statusLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
iconFormData.width = Math.max(15, minSize.x);
iconFormData.left = new FormAttachment(0, 5);
iconLabel.setLayoutData(iconFormData);
iconLabel.setImage(null);
FormData labelFormData = new FormData();
Point iconminSize = statusLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
labelFormData.width = Math.max(1000, iconminSize.x);
labelFormData.left = new FormAttachment(iconLabel, 5);
statusLabel.setLayoutData(labelFormData);
//$NON-NLS-1$
statusLabel.setText("");
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class InsertionIndicator method updatePosition.
/**
* Update position of the indicator at top of <code>itemIndexTarget</code> position of the
* <code>draggableTable</code>.
*
* @param currentTable
* @param itemIndexTarget
*/
public void updatePosition(Table currentTable, int itemIndexTarget) {
// System.out.println(itemIndexTarget);
this.draggableTable = currentTable;
removeTablePaintListener();
if (tablePaintListener == null) {
tablePaintListener = new Listener() {
public void handleEvent(Event event) {
drawIndicatorLineInTable(event);
}
};
}
FormLayout formLayout = tablesZoneViewParent.getLayout();
UIManager uiManager = mapperManager.getUiManager();
TablesZoneView tablesZoneViewOutputs = uiManager.getTablesZoneViewOutputs();
Display display = tablesZoneViewOutputs.getDisplay();
Point tablePositionRefZone = display.map(currentTable, tablesZoneViewParent, new Point(0, 0));
FormData formDataLeftArrow = (FormData) leftArrowDraggingIndicator.getLayoutData();
FormData formDataRightArrow = (FormData) rightArrowDraggingIndicator.getLayoutData();
ScrollBar verticalBar = currentTable.getVerticalBar();
// System.out.println("verticalBar.getSelection()="+verticalBar.getSelection() + "
// currentTable.getItemHeight()="+currentTable.getItemHeight());
DataMapTableView dataMapTableView = mapperManager.retrieveDataMapTableView(currentTable);
int indicYPositionRefZone = 0;
if (WindowSystem.isGTK()) {
int offsetVerticalBar = -verticalBar.getSelection();
if (itemIndexTarget == 0) {
indicYPositionRefTable = 0 + offsetVerticalBar;
} else {
indicYPositionRefTable = itemIndexTarget * (currentTable.getItemHeight() + 2) + offsetVerticalBar;
}
// System.out.println("indicYPositionRefTable="+indicYPositionRefTable);
indicYPositionRefZone = indicYPositionRefTable + tablePositionRefZone.y + formLayout.marginTop - HEIGHT_INDICATOR / 2;
indicYPositionRefZone -= currentTable.getItemHeight() + 1;
// System.out.println("indicYPositionRefZone="+indicYPositionRefZone);
} else {
int offsetVerticalBar = -verticalBar.getSelection() * currentTable.getItemHeight();
if (itemIndexTarget == 0) {
indicYPositionRefTable = 0 + offsetVerticalBar;
} else {
indicYPositionRefTable = itemIndexTarget * currentTable.getItemHeight() - 1 + offsetVerticalBar;
}
Point point = currentTable.getDisplay().map(currentTable, tablesZoneViewParent, new Point(0, indicYPositionRefTable));
indicYPositionRefZone = point.y + 5;
}
Rectangle boundsTableView = dataMapTableView.getBounds();
int testValue = boundsTableView.y + boundsTableView.height - formLayout.marginTop - HEIGHT_INDICATOR / 2 - 5;
if (indicYPositionRefZone > testValue) {
indicYPositionRefZone = testValue;
}
currentTable.addListener(SWT.Paint, tablePaintListener);
if (lastIndicYPositionRefZone != indicYPositionRefZone) {
formDataLeftArrow.top.offset = indicYPositionRefZone;
formDataRightArrow.top.offset = indicYPositionRefZone;
formDataRightArrow.left.offset = currentTable.getSize().x + 2;
currentTable.redraw();
tablesZoneViewParent.layout();
}
lastIndicYPositionRefZone = indicYPositionRefZone;
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class MemoryRuntimeComposite method createTopGroup.
private Group createTopGroup(Composite parent) {
Composite topComposite = new Composite(parent, SWT.NULL);
FormLayout topLayout = new FormLayout();
FormData topData = new FormData();
topData.left = new FormAttachment(0, 10);
topData.right = new FormAttachment(100, 0);
topData.top = new FormAttachment(0, 0);
topComposite.setLayout(topLayout);
topComposite.setLayoutData(topData);
Group topGroup = new Group(topComposite, SWT.NULL);
//$NON-NLS-1$
topGroup.setText("Monitor Control");
GridLayout groupLayout = new GridLayout(5, false);
FormData groupData = new FormData();
groupData.left = new FormAttachment(0, 0);
groupData.right = new FormAttachment(100, 0);
groupData.top = new FormAttachment(0, 0);
groupData.bottom = new FormAttachment(100, 0);
topGroup.setLayout(groupLayout);
topGroup.setLayoutData(groupData);
return topGroup;
}
Aggregations