use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class OutputTablesZoneView method initLayout.
@Override
public Layout initLayout() {
FormLayout formLayout = new FormLayout();
formLayout.marginLeft = 40;
formLayout.marginRight = 10;
formLayout.marginTop = MARGIN_TOP_ZONE_WITHOUT_ACTION_BAR;
formLayout.marginBottom = 10;
formLayout.marginWidth = 0;
formLayout.marginHeight = 0;
formLayout.spacing = 10;
setLayout(formLayout);
return formLayout;
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class DebugProcessTosComposite method createLineLimitedControl.
private void createLineLimitedControl(Composite container) {
Composite composite = new Composite(container, SWT.NONE);
FormData layouData = new FormData();
layouData.left = new FormAttachment(0, 10);
layouData.right = new FormAttachment(100, 0);
layouData.top = new FormAttachment(100, -30);
layouData.bottom = new FormAttachment(100, -3);
composite.setLayoutData(layouData);
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = 7;
formLayout.marginHeight = 4;
formLayout.spacing = 7;
composite.setLayout(formLayout);
enableLineLimitButton = new Button(composite, SWT.CHECK);
//$NON-NLS-1$
enableLineLimitButton.setText(Messages.getString("ProcessComposite.lineLimited"));
FormData formData = new FormData();
enableLineLimitButton.setLayoutData(formData);
enableLineLimitButton.setEnabled(false);
enableLineLimitButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
lineLimitText.setEditable(enableLineLimitButton.getSelection());
RunProcessPlugin.getDefault().getPluginPreferences().setValue(RunprocessConstants.ENABLE_CONSOLE_LINE_LIMIT, enableLineLimitButton.getSelection());
}
});
lineLimitText = new Text(composite, SWT.BORDER);
formData = new FormData();
formData.width = 120;
formData.left = new FormAttachment(enableLineLimitButton, 0, SWT.RIGHT);
lineLimitText.setLayoutData(formData);
lineLimitText.setEnabled(false);
lineLimitText.addListener(SWT.Verify, new Listener() {
// this text only receive number here.
@Override
public void handleEvent(Event e) {
String s = e.text;
if (!s.equals("")) {
//$NON-NLS-1$
try {
Integer.parseInt(s);
RunProcessPlugin.getDefault().getPluginPreferences().setValue(RunprocessConstants.CONSOLE_LINE_LIMIT_COUNT, lineLimitText.getText() + s);
} catch (Exception ex) {
e.doit = false;
}
}
}
});
lineLimitText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
RunProcessPlugin.getDefault().getPluginPreferences().setValue(RunprocessConstants.CONSOLE_LINE_LIMIT_COUNT, lineLimitText.getText());
}
});
boolean enable = RunProcessPlugin.getDefault().getPluginPreferences().getBoolean(RunprocessConstants.ENABLE_CONSOLE_LINE_LIMIT);
enableLineLimitButton.setSelection(enable);
lineLimitText.setEditable(enable);
String count = RunProcessPlugin.getDefault().getPluginPreferences().getString(RunprocessConstants.CONSOLE_LINE_LIMIT_COUNT);
if (count.equals("")) {
//$NON-NLS-1$
//$NON-NLS-1$
count = "100";
}
lineLimitText.setText(count);
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class BasicNotePropertyComposite method createControl.
/*
* (non-Javadoc)
*
* @see
* org.talend.designer.core.ui.editor.properties.notes.AbstractNotePropertyComposite#createControl(org.eclipse.swt
* .widgets.Composite)
*/
@Override
public void createControl(Composite parent) {
composite = getWidgetFactory().createFlatFormComposite(parent);
if (composite.getLayout() instanceof FormLayout) {
FormLayout formLayout = (FormLayout) composite.getLayout();
formLayout.spacing = 0;
}
FormData data;
//$NON-NLS-1$
check = getWidgetFactory().createButton(composite, "", SWT.CHECK);
data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
check.setLayoutData(data);
//$NON-NLS-1$
CLabel labelLabel = getWidgetFactory().createCLabel(composite, Messages.getString("OpaqueNoteSection.Label"));
data = new FormData();
data.left = new FormAttachment(check);
data.top = new FormAttachment(check, 0, SWT.TOP);
labelLabel.setLayoutData(data);
check.setSelection(note.isOpaque());
check.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (check.getSelection() != (note.isOpaque())) {
ChangeNoteOpacityCommand command = new ChangeNoteOpacityCommand(note, check.getSelection());
getCommandStack().execute(command);
}
}
});
createFontsAndColorsGroups(composite);
createAlignGroups(composite);
createTextControl(composite);
refresh();
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class OpaqueNotePropertySection method createControls.
@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
Composite composite = getWidgetFactory().createFlatFormComposite(parent);
if (composite.getLayout() instanceof FormLayout) {
FormLayout formLayout = (FormLayout) composite.getLayout();
formLayout.spacing = 0;
}
FormData data;
//$NON-NLS-1$
check = getWidgetFactory().createButton(composite, "", SWT.CHECK);
data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
check.setLayoutData(data);
//$NON-NLS-1$
CLabel labelLabel = getWidgetFactory().createCLabel(composite, Messages.getString("OpaqueNoteSection.Label"));
data = new FormData();
data.left = new FormAttachment(check);
data.top = new FormAttachment(check, 0, SWT.TOP);
labelLabel.setLayoutData(data);
check.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (check.getSelection() != (note.isOpaque())) {
ChangeNoteOpacityCommand command = new ChangeNoteOpacityCommand(note, check.getSelection());
getCommandStack().execute(command);
}
}
});
}
use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.
the class FooterComposite method createComponents.
private void createComponents() {
GridData footerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
this.setLayoutData(footerCompositeGridData);
FormLayout formLayout = new FormLayout();
this.setLayout(formLayout);
Button okButton = new Button(this, SWT.NONE);
//$NON-NLS-1$
okButton.setText(Messages.getString("FooterComposite.0"));
FormData okFormData = new FormData();
Point minSize = okButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
okFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
okButton.setLayoutData(okFormData);
okButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
// if (hl7Manager.getUiManager().validateRootElement()) {
hl7Manager.getUiManager().closeHL7(SWT.OK);
// } else {
// MessageDialog warningMessageDialog = new MessageDialog(composite.getShell(), Messages
// .getString("FooterComposite.RootElementError.Title"), null, //$NON-NLS-1$
// Messages.getString("FooterComposite.RootElementError.Message"), MessageDialog.ERROR, //$NON-NLS-1$
// new String[] { Messages.getString("FooterComposite.0") }, 0); //$NON-NLS-1$
// warningMessageDialog.open();
// }
}
});
Button cancelButton = new Button(this, SWT.NONE);
//$NON-NLS-1$
cancelButton.setText(Messages.getString("FooterComposite.1"));
cancelButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
hl7Manager.getUiManager().closeHL7(SWT.CANCEL);
}
});
FormData cancelFormData = new FormData();
minSize = cancelButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
cancelFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
cancelButton.setLayoutData(cancelFormData);
Button autoMapButton = new Button(this, SWT.NONE);
if (hl7Manager != null) {
boolean canModify = hl7Manager.getHl7Component().getProcess().isReadOnly();
if (hl7Manager.getHl7Component().getOriginalNode().getJobletNode() != null) {
canModify = hl7Manager.getHl7Component().getOriginalNode().isReadOnly();
}
if (canModify) {
autoMapButton.setEnabled(false);
}
}
//$NON-NLS-1$
autoMapButton.setToolTipText(Messages.getString("FooterComposite.AutoMapTip"));
//$NON-NLS-1$
autoMapButton.setText(Messages.getString("FooterComposite.AutoMap"));
autoMapButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
hl7Manager.getUiManager().autoMap(hl7Manager.getCurrentSchema(false));
}
});
FormData autoMapFormData = new FormData();
minSize = autoMapButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
autoMapFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
autoMapButton.setLayoutData(autoMapFormData);
cancelFormData.right = new FormAttachment(100, -5);
okFormData.right = new FormAttachment(cancelButton, -5);
// autoMapFormData.left = new FormAttachment(0, 5);
}
Aggregations