use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.
the class TextFileInputDialog method addContentTab.
private void addContentTab() {
// ////////////////////////
// START OF CONTENT TAB///
// /
wContentTab = new CTabItem(wTabFolder, SWT.NONE);
wContentTab.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ContentTab.TabTitle"));
FormLayout contentLayout = new FormLayout();
contentLayout.marginWidth = 3;
contentLayout.marginHeight = 3;
wContentSComp = new ScrolledComposite(wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
wContentSComp.setLayout(new FillLayout());
wContentComp = new Composite(wContentSComp, SWT.NONE);
props.setLook(wContentComp);
wContentComp.setLayout(contentLayout);
// Filetype line
wlFiletype = new Label(wContentComp, SWT.RIGHT);
wlFiletype.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Filetype.Label"));
props.setLook(wlFiletype);
fdlFiletype = new FormData();
fdlFiletype.left = new FormAttachment(0, 0);
fdlFiletype.top = new FormAttachment(0, 0);
fdlFiletype.right = new FormAttachment(middle, -margin);
wlFiletype.setLayoutData(fdlFiletype);
wFiletype = new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY);
wFiletype.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Filetype.Label"));
props.setLook(wFiletype);
wFiletype.add("CSV");
wFiletype.add("Fixed");
wFiletype.select(0);
wFiletype.addModifyListener(lsMod);
fdFiletype = new FormData();
fdFiletype.left = new FormAttachment(middle, 0);
fdFiletype.top = new FormAttachment(0, 0);
fdFiletype.right = new FormAttachment(100, 0);
wFiletype.setLayoutData(fdFiletype);
wlSeparator = new Label(wContentComp, SWT.RIGHT);
wlSeparator.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Separator.Label"));
props.setLook(wlSeparator);
fdlSeparator = new FormData();
fdlSeparator.left = new FormAttachment(0, 0);
fdlSeparator.top = new FormAttachment(wFiletype, margin);
fdlSeparator.right = new FormAttachment(middle, -margin);
wlSeparator.setLayoutData(fdlSeparator);
wbSeparator = new Button(wContentComp, SWT.PUSH | SWT.CENTER);
wbSeparator.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Delimiter.Button"));
props.setLook(wbSeparator);
fdbSeparator = new FormData();
fdbSeparator.right = new FormAttachment(100, 0);
fdbSeparator.top = new FormAttachment(wFiletype, 0);
wbSeparator.setLayoutData(fdbSeparator);
wSeparator = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wSeparator);
wSeparator.addModifyListener(lsMod);
fdSeparator = new FormData();
fdSeparator.top = new FormAttachment(wFiletype, margin);
fdSeparator.left = new FormAttachment(middle, 0);
fdSeparator.right = new FormAttachment(wbSeparator, -margin);
wSeparator.setLayoutData(fdSeparator);
// Enclosure
wlEnclosure = new Label(wContentComp, SWT.RIGHT);
wlEnclosure.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Enclosure.Label"));
props.setLook(wlEnclosure);
fdlEnclosure = new FormData();
fdlEnclosure.left = new FormAttachment(0, 0);
fdlEnclosure.top = new FormAttachment(wSeparator, margin);
fdlEnclosure.right = new FormAttachment(middle, -margin);
wlEnclosure.setLayoutData(fdlEnclosure);
wEnclosure = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wEnclosure);
wEnclosure.addModifyListener(lsMod);
fdEnclosure = new FormData();
fdEnclosure.left = new FormAttachment(middle, 0);
fdEnclosure.top = new FormAttachment(wSeparator, margin);
fdEnclosure.right = new FormAttachment(100, 0);
wEnclosure.setLayoutData(fdEnclosure);
// Allow Enclosure breaks checkbox
wlEnclBreaks = new Label(wContentComp, SWT.RIGHT);
wlEnclBreaks.setText(BaseMessages.getString(PKG, "TextFileInputDialog.EnclBreaks.Label"));
props.setLook(wlEnclBreaks);
fdlEnclBreaks = new FormData();
fdlEnclBreaks.left = new FormAttachment(0, 0);
fdlEnclBreaks.top = new FormAttachment(wEnclosure, margin);
fdlEnclBreaks.right = new FormAttachment(middle, -margin);
wlEnclBreaks.setLayoutData(fdlEnclBreaks);
wEnclBreaks = new Button(wContentComp, SWT.CHECK);
props.setLook(wEnclBreaks);
fdEnclBreaks = new FormData();
fdEnclBreaks.left = new FormAttachment(middle, 0);
fdEnclBreaks.top = new FormAttachment(wEnclosure, margin);
wEnclBreaks.setLayoutData(fdEnclBreaks);
// Disable until the logic works...
wlEnclBreaks.setEnabled(false);
wEnclBreaks.setEnabled(false);
// Escape
wlEscape = new Label(wContentComp, SWT.RIGHT);
wlEscape.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Escape.Label"));
props.setLook(wlEscape);
fdlEscape = new FormData();
fdlEscape.left = new FormAttachment(0, 0);
fdlEscape.top = new FormAttachment(wEnclBreaks, margin);
fdlEscape.right = new FormAttachment(middle, -margin);
wlEscape.setLayoutData(fdlEscape);
wEscape = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wEscape);
wEscape.addModifyListener(lsMod);
fdEscape = new FormData();
fdEscape.left = new FormAttachment(middle, 0);
fdEscape.top = new FormAttachment(wEnclBreaks, margin);
fdEscape.right = new FormAttachment(100, 0);
wEscape.setLayoutData(fdEscape);
// Header checkbox
wlHeader = new Label(wContentComp, SWT.RIGHT);
wlHeader.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Header.Label"));
props.setLook(wlHeader);
fdlHeader = new FormData();
fdlHeader.left = new FormAttachment(0, 0);
fdlHeader.top = new FormAttachment(wEscape, margin);
fdlHeader.right = new FormAttachment(middle, -margin);
wlHeader.setLayoutData(fdlHeader);
wHeader = new Button(wContentComp, SWT.CHECK);
props.setLook(wHeader);
fdHeader = new FormData();
fdHeader.left = new FormAttachment(middle, 0);
fdHeader.top = new FormAttachment(wEscape, margin);
wHeader.setLayoutData(fdHeader);
// NrHeader
wlNrHeader = new Label(wContentComp, SWT.RIGHT);
wlNrHeader.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrHeader.Label"));
props.setLook(wlNrHeader);
fdlNrHeader = new FormData();
fdlNrHeader.left = new FormAttachment(wHeader, margin);
fdlNrHeader.top = new FormAttachment(wEscape, margin);
wlNrHeader.setLayoutData(fdlNrHeader);
wNrHeader = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrHeader.setTextLimit(3);
props.setLook(wNrHeader);
wNrHeader.addModifyListener(lsMod);
fdNrHeader = new FormData();
fdNrHeader.left = new FormAttachment(wlNrHeader, margin);
fdNrHeader.top = new FormAttachment(wEscape, margin);
fdNrHeader.right = new FormAttachment(100, 0);
wNrHeader.setLayoutData(fdNrHeader);
wlFooter = new Label(wContentComp, SWT.RIGHT);
wlFooter.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Footer.Label"));
props.setLook(wlFooter);
fdlFooter = new FormData();
fdlFooter.left = new FormAttachment(0, 0);
fdlFooter.top = new FormAttachment(wHeader, margin);
fdlFooter.right = new FormAttachment(middle, -margin);
wlFooter.setLayoutData(fdlFooter);
wFooter = new Button(wContentComp, SWT.CHECK);
props.setLook(wFooter);
fdFooter = new FormData();
fdFooter.left = new FormAttachment(middle, 0);
fdFooter.top = new FormAttachment(wHeader, margin);
wFooter.setLayoutData(fdFooter);
// NrFooter
wlNrFooter = new Label(wContentComp, SWT.RIGHT);
wlNrFooter.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrFooter.Label"));
props.setLook(wlNrFooter);
fdlNrFooter = new FormData();
fdlNrFooter.left = new FormAttachment(wFooter, margin);
fdlNrFooter.top = new FormAttachment(wHeader, margin);
wlNrFooter.setLayoutData(fdlNrFooter);
wNrFooter = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrFooter.setTextLimit(3);
props.setLook(wNrFooter);
wNrFooter.addModifyListener(lsMod);
fdNrFooter = new FormData();
fdNrFooter.left = new FormAttachment(wlNrFooter, margin);
fdNrFooter.top = new FormAttachment(wHeader, margin);
fdNrFooter.right = new FormAttachment(100, 0);
wNrFooter.setLayoutData(fdNrFooter);
// Wraps
wlWraps = new Label(wContentComp, SWT.RIGHT);
wlWraps.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Wraps.Label"));
props.setLook(wlWraps);
fdlWraps = new FormData();
fdlWraps.left = new FormAttachment(0, 0);
fdlWraps.top = new FormAttachment(wFooter, margin);
fdlWraps.right = new FormAttachment(middle, -margin);
wlWraps.setLayoutData(fdlWraps);
wWraps = new Button(wContentComp, SWT.CHECK);
props.setLook(wWraps);
fdWraps = new FormData();
fdWraps.left = new FormAttachment(middle, 0);
fdWraps.top = new FormAttachment(wFooter, margin);
wWraps.setLayoutData(fdWraps);
// NrWraps
wlNrWraps = new Label(wContentComp, SWT.RIGHT);
wlNrWraps.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrWraps.Label"));
props.setLook(wlNrWraps);
fdlNrWraps = new FormData();
fdlNrWraps.left = new FormAttachment(wWraps, margin);
fdlNrWraps.top = new FormAttachment(wFooter, margin);
wlNrWraps.setLayoutData(fdlNrWraps);
wNrWraps = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrWraps.setTextLimit(3);
props.setLook(wNrWraps);
wNrWraps.addModifyListener(lsMod);
fdNrWraps = new FormData();
fdNrWraps.left = new FormAttachment(wlNrWraps, margin);
fdNrWraps.top = new FormAttachment(wFooter, margin);
fdNrWraps.right = new FormAttachment(100, 0);
wNrWraps.setLayoutData(fdNrWraps);
// Pages
wlLayoutPaged = new Label(wContentComp, SWT.RIGHT);
wlLayoutPaged.setText(BaseMessages.getString(PKG, "TextFileInputDialog.LayoutPaged.Label"));
props.setLook(wlLayoutPaged);
fdlLayoutPaged = new FormData();
fdlLayoutPaged.left = new FormAttachment(0, 0);
fdlLayoutPaged.top = new FormAttachment(wWraps, margin);
fdlLayoutPaged.right = new FormAttachment(middle, -margin);
wlLayoutPaged.setLayoutData(fdlLayoutPaged);
wLayoutPaged = new Button(wContentComp, SWT.CHECK);
props.setLook(wLayoutPaged);
fdLayoutPaged = new FormData();
fdLayoutPaged.left = new FormAttachment(middle, 0);
fdLayoutPaged.top = new FormAttachment(wWraps, margin);
wLayoutPaged.setLayoutData(fdLayoutPaged);
// Nr of lines per page
wlNrLinesPerPage = new Label(wContentComp, SWT.RIGHT);
wlNrLinesPerPage.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrLinesPerPage.Label"));
props.setLook(wlNrLinesPerPage);
fdlNrLinesPerPage = new FormData();
fdlNrLinesPerPage.left = new FormAttachment(wLayoutPaged, margin);
fdlNrLinesPerPage.top = new FormAttachment(wWraps, margin);
wlNrLinesPerPage.setLayoutData(fdlNrLinesPerPage);
wNrLinesPerPage = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrLinesPerPage.setTextLimit(3);
props.setLook(wNrLinesPerPage);
wNrLinesPerPage.addModifyListener(lsMod);
fdNrLinesPerPage = new FormData();
fdNrLinesPerPage.left = new FormAttachment(wlNrLinesPerPage, margin);
fdNrLinesPerPage.top = new FormAttachment(wWraps, margin);
fdNrLinesPerPage.right = new FormAttachment(100, 0);
wNrLinesPerPage.setLayoutData(fdNrLinesPerPage);
// NrPages
wlNrLinesDocHeader = new Label(wContentComp, SWT.RIGHT);
wlNrLinesDocHeader.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrLinesDocHeader.Label"));
props.setLook(wlNrLinesDocHeader);
fdlNrLinesDocHeader = new FormData();
fdlNrLinesDocHeader.left = new FormAttachment(wLayoutPaged, margin);
fdlNrLinesDocHeader.top = new FormAttachment(wNrLinesPerPage, margin);
wlNrLinesDocHeader.setLayoutData(fdlNrLinesDocHeader);
wNrLinesDocHeader = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrLinesDocHeader.setTextLimit(3);
props.setLook(wNrLinesDocHeader);
wNrLinesDocHeader.addModifyListener(lsMod);
fdNrLinesDocHeader = new FormData();
fdNrLinesDocHeader.left = new FormAttachment(wlNrLinesPerPage, margin);
fdNrLinesDocHeader.top = new FormAttachment(wNrLinesPerPage, margin);
fdNrLinesDocHeader.right = new FormAttachment(100, 0);
wNrLinesDocHeader.setLayoutData(fdNrLinesDocHeader);
// Compression type (None, Zip or GZip
wlCompression = new Label(wContentComp, SWT.RIGHT);
wlCompression.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Compression.Label"));
props.setLook(wlCompression);
fdlCompression = new FormData();
fdlCompression.left = new FormAttachment(0, 0);
fdlCompression.top = new FormAttachment(wNrLinesDocHeader, margin);
fdlCompression.right = new FormAttachment(middle, -margin);
wlCompression.setLayoutData(fdlCompression);
wCompression = new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY);
wCompression.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Compression.Label"));
wCompression.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.Compression.Tooltip"));
props.setLook(wCompression);
wCompression.setItems(CompressionProviderFactory.getInstance().getCompressionProviderNames());
wCompression.addModifyListener(lsMod);
fdCompression = new FormData();
fdCompression.left = new FormAttachment(middle, 0);
fdCompression.top = new FormAttachment(wNrLinesDocHeader, margin);
fdCompression.right = new FormAttachment(100, 0);
wCompression.setLayoutData(fdCompression);
wlNoempty = new Label(wContentComp, SWT.RIGHT);
wlNoempty.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NoEmpty.Label"));
props.setLook(wlNoempty);
fdlNoempty = new FormData();
fdlNoempty.left = new FormAttachment(0, 0);
fdlNoempty.top = new FormAttachment(wCompression, margin);
fdlNoempty.right = new FormAttachment(middle, -margin);
wlNoempty.setLayoutData(fdlNoempty);
wNoempty = new Button(wContentComp, SWT.CHECK);
props.setLook(wNoempty);
wNoempty.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.NoEmpty.Tooltip"));
fdNoempty = new FormData();
fdNoempty.left = new FormAttachment(middle, 0);
fdNoempty.top = new FormAttachment(wCompression, margin);
fdNoempty.right = new FormAttachment(100, 0);
wNoempty.setLayoutData(fdNoempty);
wlInclFilename = new Label(wContentComp, SWT.RIGHT);
wlInclFilename.setText(BaseMessages.getString(PKG, "TextFileInputDialog.InclFilename.Label"));
props.setLook(wlInclFilename);
fdlInclFilename = new FormData();
fdlInclFilename.left = new FormAttachment(0, 0);
fdlInclFilename.top = new FormAttachment(wNoempty, margin);
fdlInclFilename.right = new FormAttachment(middle, -margin);
wlInclFilename.setLayoutData(fdlInclFilename);
wInclFilename = new Button(wContentComp, SWT.CHECK);
props.setLook(wInclFilename);
wInclFilename.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.InclFilename.Tooltip"));
fdInclFilename = new FormData();
fdInclFilename.left = new FormAttachment(middle, 0);
fdInclFilename.top = new FormAttachment(wNoempty, margin);
wInclFilename.setLayoutData(fdInclFilename);
wlInclFilenameField = new Label(wContentComp, SWT.LEFT);
wlInclFilenameField.setText(BaseMessages.getString(PKG, "TextFileInputDialog.InclFilenameField.Label"));
props.setLook(wlInclFilenameField);
fdlInclFilenameField = new FormData();
fdlInclFilenameField.left = new FormAttachment(wInclFilename, margin);
fdlInclFilenameField.top = new FormAttachment(wNoempty, margin);
wlInclFilenameField.setLayoutData(fdlInclFilenameField);
wInclFilenameField = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wInclFilenameField);
wInclFilenameField.addModifyListener(lsMod);
fdInclFilenameField = new FormData();
fdInclFilenameField.left = new FormAttachment(wlInclFilenameField, margin);
fdInclFilenameField.top = new FormAttachment(wNoempty, margin);
fdInclFilenameField.right = new FormAttachment(100, 0);
wInclFilenameField.setLayoutData(fdInclFilenameField);
wlInclRownum = new Label(wContentComp, SWT.RIGHT);
wlInclRownum.setText(BaseMessages.getString(PKG, "TextFileInputDialog.InclRownum.Label"));
props.setLook(wlInclRownum);
fdlInclRownum = new FormData();
fdlInclRownum.left = new FormAttachment(0, 0);
fdlInclRownum.top = new FormAttachment(wInclFilenameField, margin);
fdlInclRownum.right = new FormAttachment(middle, -margin);
wlInclRownum.setLayoutData(fdlInclRownum);
wInclRownum = new Button(wContentComp, SWT.CHECK);
props.setLook(wInclRownum);
wInclRownum.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.InclRownum.Tooltip"));
fdRownum = new FormData();
fdRownum.left = new FormAttachment(middle, 0);
fdRownum.top = new FormAttachment(wInclFilenameField, margin);
wInclRownum.setLayoutData(fdRownum);
wlInclRownumField = new Label(wContentComp, SWT.RIGHT);
wlInclRownumField.setText(BaseMessages.getString(PKG, "TextFileInputDialog.InclRownumField.Label"));
props.setLook(wlInclRownumField);
fdlInclRownumField = new FormData();
fdlInclRownumField.left = new FormAttachment(wInclRownum, margin);
fdlInclRownumField.top = new FormAttachment(wInclFilenameField, margin);
wlInclRownumField.setLayoutData(fdlInclRownumField);
wInclRownumField = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wInclRownumField);
wInclRownumField.addModifyListener(lsMod);
fdInclRownumField = new FormData();
fdInclRownumField.left = new FormAttachment(wlInclRownumField, margin);
fdInclRownumField.top = new FormAttachment(wInclFilenameField, margin);
fdInclRownumField.right = new FormAttachment(100, 0);
wInclRownumField.setLayoutData(fdInclRownumField);
wlRownumByFileField = new Label(wContentComp, SWT.RIGHT);
wlRownumByFileField.setText(BaseMessages.getString(PKG, "TextFileInputDialog.RownumByFile.Label"));
props.setLook(wlRownumByFileField);
fdlRownumByFile = new FormData();
fdlRownumByFile.left = new FormAttachment(wInclRownum, margin);
fdlRownumByFile.top = new FormAttachment(wInclRownumField, margin);
wlRownumByFileField.setLayoutData(fdlRownumByFile);
wRownumByFile = new Button(wContentComp, SWT.CHECK);
props.setLook(wRownumByFile);
wRownumByFile.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.RownumByFile.Tooltip"));
fdRownumByFile = new FormData();
fdRownumByFile.left = new FormAttachment(wlRownumByFileField, margin);
fdRownumByFile.top = new FormAttachment(wInclRownumField, margin);
wRownumByFile.setLayoutData(fdRownumByFile);
wlFormat = new Label(wContentComp, SWT.RIGHT);
wlFormat.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Format.Label"));
props.setLook(wlFormat);
fdlFormat = new FormData();
fdlFormat.left = new FormAttachment(0, 0);
fdlFormat.top = new FormAttachment(wRownumByFile, margin * 2);
fdlFormat.right = new FormAttachment(middle, -margin);
wlFormat.setLayoutData(fdlFormat);
wFormat = new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY);
wFormat.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Format.Label"));
props.setLook(wFormat);
wFormat.add("DOS");
wFormat.add("Unix");
wFormat.add("mixed");
wFormat.select(0);
wFormat.addModifyListener(lsMod);
fdFormat = new FormData();
fdFormat.left = new FormAttachment(middle, 0);
fdFormat.top = new FormAttachment(wRownumByFile, margin * 2);
fdFormat.right = new FormAttachment(100, 0);
wFormat.setLayoutData(fdFormat);
wlEncoding = new Label(wContentComp, SWT.RIGHT);
wlEncoding.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Encoding.Label"));
props.setLook(wlEncoding);
fdlEncoding = new FormData();
fdlEncoding.left = new FormAttachment(0, 0);
fdlEncoding.top = new FormAttachment(wFormat, margin);
fdlEncoding.right = new FormAttachment(middle, -margin);
wlEncoding.setLayoutData(fdlEncoding);
wEncoding = new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY);
wEncoding.setEditable(true);
props.setLook(wEncoding);
wEncoding.addModifyListener(lsMod);
fdEncoding = new FormData();
fdEncoding.left = new FormAttachment(middle, 0);
fdEncoding.top = new FormAttachment(wFormat, margin);
fdEncoding.right = new FormAttachment(100, 0);
wEncoding.setLayoutData(fdEncoding);
wEncoding.addFocusListener(new FocusListener() {
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
}
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
shell.setCursor(busy);
setEncodings();
shell.setCursor(null);
busy.dispose();
}
});
wlLength = new Label(wContentComp, SWT.RIGHT);
wlLength.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Length.Label"));
props.setLook(wlLength);
fdlLength = new FormData();
fdlLength.left = new FormAttachment(0, 0);
fdlLength.top = new FormAttachment(wEncoding, margin);
fdlLength.right = new FormAttachment(middle, -margin);
wlLength.setLayoutData(fdlLength);
wLength = new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY);
wLength.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Length.Label"));
props.setLook(wLength);
wLength.add("Characters");
wLength.add("Bytes");
wLength.select(0);
wLength.addModifyListener(lsMod);
fdLength = new FormData();
fdLength.left = new FormAttachment(middle, 0);
fdLength.top = new FormAttachment(wEncoding, margin);
fdLength.right = new FormAttachment(100, 0);
wLength.setLayoutData(fdLength);
wlLimit = new Label(wContentComp, SWT.RIGHT);
wlLimit.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Limit.Label"));
props.setLook(wlLimit);
fdlLimit = new FormData();
fdlLimit.left = new FormAttachment(0, 0);
fdlLimit.top = new FormAttachment(wLength, margin);
fdlLimit.right = new FormAttachment(middle, -margin);
wlLimit.setLayoutData(fdlLimit);
wLimit = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wLimit);
wLimit.addModifyListener(lsMod);
fdLimit = new FormData();
fdLimit.left = new FormAttachment(middle, 0);
fdLimit.top = new FormAttachment(wLength, margin);
fdLimit.right = new FormAttachment(100, 0);
wLimit.setLayoutData(fdLimit);
// Date Lenient checkbox
wlDateLenient = new Label(wContentComp, SWT.RIGHT);
wlDateLenient.setText(BaseMessages.getString(PKG, "TextFileInputDialog.DateLenient.Label"));
props.setLook(wlDateLenient);
fdlDateLenient = new FormData();
fdlDateLenient.left = new FormAttachment(0, 0);
fdlDateLenient.top = new FormAttachment(wLimit, margin);
fdlDateLenient.right = new FormAttachment(middle, -margin);
wlDateLenient.setLayoutData(fdlDateLenient);
wDateLenient = new Button(wContentComp, SWT.CHECK);
wDateLenient.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.DateLenient.Tooltip"));
props.setLook(wDateLenient);
fdDateLenient = new FormData();
fdDateLenient.left = new FormAttachment(middle, 0);
fdDateLenient.top = new FormAttachment(wLimit, margin);
wDateLenient.setLayoutData(fdDateLenient);
wlDateLocale = new Label(wContentComp, SWT.RIGHT);
wlDateLocale.setText(BaseMessages.getString(PKG, "TextFileInputDialog.DateLocale.Label"));
props.setLook(wlDateLocale);
fdlDateLocale = new FormData();
fdlDateLocale.left = new FormAttachment(0, 0);
fdlDateLocale.top = new FormAttachment(wDateLenient, margin);
fdlDateLocale.right = new FormAttachment(middle, -margin);
wlDateLocale.setLayoutData(fdlDateLocale);
wDateLocale = new CCombo(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wDateLocale.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.DateLocale.Tooltip"));
props.setLook(wDateLocale);
wDateLocale.addModifyListener(lsMod);
fdDateLocale = new FormData();
fdDateLocale.left = new FormAttachment(middle, 0);
fdDateLocale.top = new FormAttachment(wDateLenient, margin);
fdDateLocale.right = new FormAttachment(100, 0);
wDateLocale.setLayoutData(fdDateLocale);
wDateLocale.addFocusListener(new FocusListener() {
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
}
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
shell.setCursor(busy);
setLocales();
shell.setCursor(null);
busy.dispose();
}
});
// ///////////////////////////////
// START OF AddFileResult GROUP //
// ///////////////////////////////
wAddFileResult = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wAddFileResult);
wAddFileResult.setText(BaseMessages.getString(PKG, "TextFileInputDialog.wAddFileResult.Label"));
FormLayout AddFileResultgroupLayout = new FormLayout();
AddFileResultgroupLayout.marginWidth = 10;
AddFileResultgroupLayout.marginHeight = 10;
wAddFileResult.setLayout(AddFileResultgroupLayout);
wlAddResult = new Label(wAddFileResult, SWT.RIGHT);
wlAddResult.setText(BaseMessages.getString(PKG, "TextFileInputDialog.AddResult.Label"));
props.setLook(wlAddResult);
fdlAddResult = new FormData();
fdlAddResult.left = new FormAttachment(0, 0);
fdlAddResult.top = new FormAttachment(wDateLocale, margin);
fdlAddResult.right = new FormAttachment(middle, -margin);
wlAddResult.setLayoutData(fdlAddResult);
wAddResult = new Button(wAddFileResult, SWT.CHECK);
props.setLook(wAddResult);
wAddResult.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.AddResult.Tooltip"));
fdAddResult = new FormData();
fdAddResult.left = new FormAttachment(middle, 0);
fdAddResult.top = new FormAttachment(wDateLocale, margin);
wAddResult.setLayoutData(fdAddResult);
fdAddFileResult = new FormData();
fdAddFileResult.left = new FormAttachment(0, margin);
fdAddFileResult.top = new FormAttachment(wDateLocale, margin);
fdAddFileResult.right = new FormAttachment(100, -margin);
wAddFileResult.setLayoutData(fdAddFileResult);
// ///////////////////////////////////////////////////////////
// / END OF AddFileResult GROUP
// ///////////////////////////////////////////////////////////
wContentComp.pack();
// What's the size:
Rectangle bounds = wContentComp.getBounds();
wContentSComp.setContent(wContentComp);
wContentSComp.setExpandHorizontal(true);
wContentSComp.setExpandVertical(true);
wContentSComp.setMinWidth(bounds.width);
wContentSComp.setMinHeight(bounds.height);
fdContentComp = new FormData();
fdContentComp.left = new FormAttachment(0, 0);
fdContentComp.top = new FormAttachment(0, 0);
fdContentComp.right = new FormAttachment(100, 0);
fdContentComp.bottom = new FormAttachment(100, 0);
wContentComp.setLayoutData(fdContentComp);
wContentTab.setControl(wContentSComp);
// ///////////////////////////////////////////////////////////
// / END OF CONTENT TAB
// ///////////////////////////////////////////////////////////
}
use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.
the class TextFileInputDialog method addFieldsTabs.
private void addFieldsTabs() {
// Fields tab...
//
wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
wFieldsTab.setText(BaseMessages.getString(PKG, "TextFileInputDialog.FieldsTab.TabTitle"));
FormLayout fieldsLayout = new FormLayout();
fieldsLayout.marginWidth = Const.FORM_MARGIN;
fieldsLayout.marginHeight = Const.FORM_MARGIN;
wFieldsComp = new Composite(wTabFolder, SWT.NONE);
wFieldsComp.setLayout(fieldsLayout);
props.setLook(wFieldsComp);
wGet = new Button(wFieldsComp, SWT.PUSH);
wGet.setText(BaseMessages.getString(PKG, "System.Button.GetFields"));
fdGet = new FormData();
fdGet.left = new FormAttachment(50, 0);
fdGet.bottom = new FormAttachment(100, 0);
wGet.setLayoutData(fdGet);
wMinWidth = new Button(wFieldsComp, SWT.PUSH);
wMinWidth.setText(BaseMessages.getString(PKG, "TextFileInputDialog.MinWidth.Button"));
wMinWidth.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.MinWidth.Tooltip"));
wMinWidth.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
setButtonPositions(new Button[] { wGet, wMinWidth }, margin, null);
final int FieldsRows = input.inputFields.length;
ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.NameColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.TypeColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames(), true), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.FormatColumn.Column"), ColumnInfo.COLUMN_TYPE_FORMAT, 2), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.PositionColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.LengthColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.PrecisionColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.CurrencyColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.DecimalColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.GroupColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.NullIfColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.IfNullColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.TrimTypeColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaString.trimTypeDesc, true), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.RepeatColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { BaseMessages.getString(PKG, "System.Combo.Yes"), BaseMessages.getString(PKG, "System.Combo.No") }, true) };
colinf[12].setToolTip(BaseMessages.getString(PKG, "TextFileInputDialog.RepeatColumn.Tooltip"));
wFields = new TableView(transMeta, wFieldsComp, SWT.FULL_SELECTION | SWT.MULTI, colinf, FieldsRows, lsMod, props);
fdFields = new FormData();
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(0, 0);
fdFields.right = new FormAttachment(100, 0);
fdFields.bottom = new FormAttachment(wGet, -margin);
wFields.setLayoutData(fdFields);
fdFieldsComp = new FormData();
fdFieldsComp.left = new FormAttachment(0, 0);
fdFieldsComp.top = new FormAttachment(0, 0);
fdFieldsComp.right = new FormAttachment(100, 0);
fdFieldsComp.bottom = new FormAttachment(100, 0);
wFieldsComp.setLayoutData(fdFieldsComp);
wFieldsComp.layout();
wFieldsTab.setControl(wFieldsComp);
}
use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.
the class TextFileInputDialog method addErrorTab.
private void addErrorTab() {
// ////////////////////////
// START OF ERROR TAB ///
// /
wErrorTab = new CTabItem(wTabFolder, SWT.NONE);
wErrorTab.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ErrorTab.TabTitle"));
wErrorSComp = new ScrolledComposite(wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
wErrorSComp.setLayout(new FillLayout());
FormLayout errorLayout = new FormLayout();
errorLayout.marginWidth = 3;
errorLayout.marginHeight = 3;
wErrorComp = new Composite(wErrorSComp, SWT.NONE);
props.setLook(wErrorComp);
wErrorComp.setLayout(errorLayout);
// ERROR HANDLING...
// ErrorIgnored?
wlErrorIgnored = new Label(wErrorComp, SWT.RIGHT);
wlErrorIgnored.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ErrorIgnored.Label"));
props.setLook(wlErrorIgnored);
fdlErrorIgnored = new FormData();
fdlErrorIgnored.left = new FormAttachment(0, 0);
fdlErrorIgnored.top = new FormAttachment(0, margin);
fdlErrorIgnored.right = new FormAttachment(middle, -margin);
wlErrorIgnored.setLayoutData(fdlErrorIgnored);
wErrorIgnored = new Button(wErrorComp, SWT.CHECK);
props.setLook(wErrorIgnored);
wErrorIgnored.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.ErrorIgnored.Tooltip"));
fdErrorIgnored = new FormData();
fdErrorIgnored.left = new FormAttachment(middle, 0);
fdErrorIgnored.top = new FormAttachment(0, margin);
wErrorIgnored.setLayoutData(fdErrorIgnored);
// Skip bad files?
wlSkipBadFiles = new Label(wErrorComp, SWT.RIGHT);
wlSkipBadFiles.setText(BaseMessages.getString(PKG, "TextFileInputDialog.SkipBadFiles.Label"));
props.setLook(wlSkipBadFiles);
fdlSkipBadFiles = new FormData();
fdlSkipBadFiles.left = new FormAttachment(0, 0);
fdlSkipBadFiles.top = new FormAttachment(wErrorIgnored, margin);
fdlSkipBadFiles.right = new FormAttachment(middle, -margin);
wlSkipBadFiles.setLayoutData(fdlSkipBadFiles);
wSkipBadFiles = new Button(wErrorComp, SWT.CHECK);
props.setLook(wSkipBadFiles);
wSkipBadFiles.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.SkipBadFiles.Tooltip"));
fdSkipBadFiles = new FormData();
fdSkipBadFiles.left = new FormAttachment(middle, 0);
fdSkipBadFiles.top = new FormAttachment(wErrorIgnored, margin);
wSkipBadFiles.setLayoutData(fdSkipBadFiles);
// field for rejected file
wlBadFileField = new Label(wErrorComp, SWT.RIGHT);
wlBadFileField.setText(BaseMessages.getString(PKG, "TextFileInputDialog.BadFileField.Label"));
props.setLook(wlBadFileField);
fdlBadFileField = new FormData();
fdlBadFileField.left = new FormAttachment(0, 0);
fdlBadFileField.top = new FormAttachment(wSkipBadFiles, margin);
fdlBadFileField.right = new FormAttachment(middle, -margin);
wlBadFileField.setLayoutData(fdlBadFileField);
wBadFileField = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wBadFileField);
wBadFileField.addModifyListener(lsMod);
fdBadFileField = new FormData();
fdBadFileField.left = new FormAttachment(middle, 0);
fdBadFileField.top = new FormAttachment(wSkipBadFiles, margin);
fdBadFileField.right = new FormAttachment(100, 0);
wBadFileField.setLayoutData(fdBadFileField);
// field for file error messsage
wlBadFileMessageField = new Label(wErrorComp, SWT.RIGHT);
wlBadFileMessageField.setText(BaseMessages.getString(PKG, "TextFileInputDialog.BadFileMessageField.Label"));
props.setLook(wlBadFileMessageField);
fdlBadFileMessageField = new FormData();
fdlBadFileMessageField.left = new FormAttachment(0, 0);
fdlBadFileMessageField.top = new FormAttachment(wBadFileField, margin);
fdlBadFileMessageField.right = new FormAttachment(middle, -margin);
wlBadFileMessageField.setLayoutData(fdlBadFileMessageField);
wBadFileMessageField = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wBadFileMessageField);
wBadFileMessageField.addModifyListener(lsMod);
fdBadFileMessageField = new FormData();
fdBadFileMessageField.left = new FormAttachment(middle, 0);
fdBadFileMessageField.top = new FormAttachment(wBadFileField, margin);
fdBadFileMessageField.right = new FormAttachment(100, 0);
wBadFileMessageField.setLayoutData(fdBadFileMessageField);
// Skip error lines?
wlSkipErrorLines = new Label(wErrorComp, SWT.RIGHT);
wlSkipErrorLines.setText(BaseMessages.getString(PKG, "TextFileInputDialog.SkipErrorLines.Label"));
props.setLook(wlSkipErrorLines);
fdlSkipErrorLines = new FormData();
fdlSkipErrorLines.left = new FormAttachment(0, 0);
fdlSkipErrorLines.top = new FormAttachment(wBadFileMessageField, margin);
fdlSkipErrorLines.right = new FormAttachment(middle, -margin);
wlSkipErrorLines.setLayoutData(fdlSkipErrorLines);
wSkipErrorLines = new Button(wErrorComp, SWT.CHECK);
props.setLook(wSkipErrorLines);
wSkipErrorLines.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.SkipErrorLines.Tooltip"));
fdSkipErrorLines = new FormData();
fdSkipErrorLines.left = new FormAttachment(middle, 0);
fdSkipErrorLines.top = new FormAttachment(wBadFileMessageField, margin);
wSkipErrorLines.setLayoutData(fdSkipErrorLines);
wlErrorCount = new Label(wErrorComp, SWT.RIGHT);
wlErrorCount.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ErrorCount.Label"));
props.setLook(wlErrorCount);
fdlErrorCount = new FormData();
fdlErrorCount.left = new FormAttachment(0, 0);
fdlErrorCount.top = new FormAttachment(wSkipErrorLines, margin);
fdlErrorCount.right = new FormAttachment(middle, -margin);
wlErrorCount.setLayoutData(fdlErrorCount);
wErrorCount = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wErrorCount);
wErrorCount.addModifyListener(lsMod);
fdErrorCount = new FormData();
fdErrorCount.left = new FormAttachment(middle, 0);
fdErrorCount.top = new FormAttachment(wSkipErrorLines, margin);
fdErrorCount.right = new FormAttachment(100, 0);
wErrorCount.setLayoutData(fdErrorCount);
wlErrorFields = new Label(wErrorComp, SWT.RIGHT);
wlErrorFields.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ErrorFields.Label"));
props.setLook(wlErrorFields);
fdlErrorFields = new FormData();
fdlErrorFields.left = new FormAttachment(0, 0);
fdlErrorFields.top = new FormAttachment(wErrorCount, margin);
fdlErrorFields.right = new FormAttachment(middle, -margin);
wlErrorFields.setLayoutData(fdlErrorFields);
wErrorFields = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wErrorFields);
wErrorFields.addModifyListener(lsMod);
fdErrorFields = new FormData();
fdErrorFields.left = new FormAttachment(middle, 0);
fdErrorFields.top = new FormAttachment(wErrorCount, margin);
fdErrorFields.right = new FormAttachment(100, 0);
wErrorFields.setLayoutData(fdErrorFields);
wlErrorText = new Label(wErrorComp, SWT.RIGHT);
wlErrorText.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ErrorText.Label"));
props.setLook(wlErrorText);
fdlErrorText = new FormData();
fdlErrorText.left = new FormAttachment(0, 0);
fdlErrorText.top = new FormAttachment(wErrorFields, margin);
fdlErrorText.right = new FormAttachment(middle, -margin);
wlErrorText.setLayoutData(fdlErrorText);
wErrorText = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wErrorText);
wErrorText.addModifyListener(lsMod);
fdErrorText = new FormData();
fdErrorText.left = new FormAttachment(middle, 0);
fdErrorText.top = new FormAttachment(wErrorFields, margin);
fdErrorText.right = new FormAttachment(100, 0);
wErrorText.setLayoutData(fdErrorText);
// Bad lines files directory + extension
Control previous = wErrorText;
// BadDestDir line
wlWarnDestDir = new Label(wErrorComp, SWT.RIGHT);
wlWarnDestDir.setText(BaseMessages.getString(PKG, "TextFileInputDialog.WarnDestDir.Label"));
props.setLook(wlWarnDestDir);
fdlWarnDestDir = new FormData();
fdlWarnDestDir.left = new FormAttachment(0, 0);
fdlWarnDestDir.top = new FormAttachment(previous, margin * 4);
fdlWarnDestDir.right = new FormAttachment(middle, -margin);
wlWarnDestDir.setLayoutData(fdlWarnDestDir);
wbbWarnDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbbWarnDestDir);
wbbWarnDestDir.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
wbbWarnDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForDir"));
fdbBadDestDir = new FormData();
fdbBadDestDir.right = new FormAttachment(100, 0);
fdbBadDestDir.top = new FormAttachment(previous, margin * 4);
wbbWarnDestDir.setLayoutData(fdbBadDestDir);
wWarnExt = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wWarnExt);
wWarnExt.addModifyListener(lsMod);
fdWarnDestExt = new FormData();
fdWarnDestExt.left = new FormAttachment(wbbWarnDestDir, -150);
fdWarnDestExt.right = new FormAttachment(wbbWarnDestDir, -margin);
fdWarnDestExt.top = new FormAttachment(previous, margin * 4);
wWarnExt.setLayoutData(fdWarnDestExt);
wlWarnExt = new Label(wErrorComp, SWT.RIGHT);
wlWarnExt.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
props.setLook(wlWarnExt);
fdlWarnDestExt = new FormData();
fdlWarnDestExt.top = new FormAttachment(previous, margin * 4);
fdlWarnDestExt.right = new FormAttachment(wWarnExt, -margin);
wlWarnExt.setLayoutData(fdlWarnDestExt);
wWarnDestDir = new TextVar(transMeta, wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wWarnDestDir);
wWarnDestDir.addModifyListener(lsMod);
fdBadDestDir = new FormData();
fdBadDestDir.left = new FormAttachment(middle, 0);
fdBadDestDir.right = new FormAttachment(wlWarnExt, -margin);
fdBadDestDir.top = new FormAttachment(previous, margin * 4);
wWarnDestDir.setLayoutData(fdBadDestDir);
// Listen to the Browse... button
wbbWarnDestDir.addSelectionListener(DirectoryDialogButtonListenerFactory.getSelectionAdapter(shell, wWarnDestDir.getTextWidget()));
// Whenever something changes, set the tooltip to the expanded version of the directory:
wWarnDestDir.addModifyListener(getModifyListenerTooltipText(wWarnDestDir.getTextWidget()));
// Error lines files directory + extension
previous = wWarnDestDir;
// ErrorDestDir line
wlErrorDestDir = new Label(wErrorComp, SWT.RIGHT);
wlErrorDestDir.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ErrorDestDir.Label"));
props.setLook(wlErrorDestDir);
fdlErrorDestDir = new FormData();
fdlErrorDestDir.left = new FormAttachment(0, 0);
fdlErrorDestDir.top = new FormAttachment(previous, margin);
fdlErrorDestDir.right = new FormAttachment(middle, -margin);
wlErrorDestDir.setLayoutData(fdlErrorDestDir);
wbbErrorDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbbErrorDestDir);
wbbErrorDestDir.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
wbbErrorDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForDir"));
fdbErrorDestDir = new FormData();
fdbErrorDestDir.right = new FormAttachment(100, 0);
fdbErrorDestDir.top = new FormAttachment(previous, margin);
wbbErrorDestDir.setLayoutData(fdbErrorDestDir);
wErrorExt = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wErrorExt);
wErrorExt.addModifyListener(lsMod);
fdErrorDestExt = new FormData();
fdErrorDestExt.left = new FormAttachment(wWarnExt, 0, SWT.LEFT);
fdErrorDestExt.right = new FormAttachment(wWarnExt, 0, SWT.RIGHT);
fdErrorDestExt.top = new FormAttachment(previous, margin);
wErrorExt.setLayoutData(fdErrorDestExt);
wlErrorExt = new Label(wErrorComp, SWT.RIGHT);
wlErrorExt.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
props.setLook(wlErrorExt);
fdlErrorDestExt = new FormData();
fdlErrorDestExt.top = new FormAttachment(previous, margin);
fdlErrorDestExt.right = new FormAttachment(wErrorExt, -margin);
wlErrorExt.setLayoutData(fdlErrorDestExt);
wErrorDestDir = new TextVar(transMeta, wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wErrorDestDir);
wErrorDestDir.addModifyListener(lsMod);
fdErrorDestDir = new FormData();
fdErrorDestDir.left = new FormAttachment(middle, 0);
fdErrorDestDir.right = new FormAttachment(wlErrorExt, -margin);
fdErrorDestDir.top = new FormAttachment(previous, margin);
wErrorDestDir.setLayoutData(fdErrorDestDir);
// Listen to the Browse... button
wbbErrorDestDir.addSelectionListener(DirectoryDialogButtonListenerFactory.getSelectionAdapter(shell, wErrorDestDir.getTextWidget()));
// Whenever something changes, set the tooltip to the expanded version of the directory:
wErrorDestDir.addModifyListener(getModifyListenerTooltipText(wErrorDestDir.getTextWidget()));
// Data Error lines files directory + extension
previous = wErrorDestDir;
// LineNrDestDir line
wlLineNrDestDir = new Label(wErrorComp, SWT.RIGHT);
wlLineNrDestDir.setText(BaseMessages.getString(PKG, "TextFileInputDialog.LineNrDestDir.Label"));
props.setLook(wlLineNrDestDir);
fdlLineNrDestDir = new FormData();
fdlLineNrDestDir.left = new FormAttachment(0, 0);
fdlLineNrDestDir.top = new FormAttachment(previous, margin);
fdlLineNrDestDir.right = new FormAttachment(middle, -margin);
wlLineNrDestDir.setLayoutData(fdlLineNrDestDir);
wbbLineNrDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbbLineNrDestDir);
wbbLineNrDestDir.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
wbbLineNrDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.Browse"));
fdbLineNrDestDir = new FormData();
fdbLineNrDestDir.right = new FormAttachment(100, 0);
fdbLineNrDestDir.top = new FormAttachment(previous, margin);
wbbLineNrDestDir.setLayoutData(fdbLineNrDestDir);
wLineNrExt = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wLineNrExt);
wLineNrExt.addModifyListener(lsMod);
fdLineNrDestExt = new FormData();
fdLineNrDestExt.left = new FormAttachment(wErrorExt, 0, SWT.LEFT);
fdLineNrDestExt.right = new FormAttachment(wErrorExt, 0, SWT.RIGHT);
fdLineNrDestExt.top = new FormAttachment(previous, margin);
wLineNrExt.setLayoutData(fdLineNrDestExt);
wlLineNrExt = new Label(wErrorComp, SWT.RIGHT);
wlLineNrExt.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
props.setLook(wlLineNrExt);
fdlLineNrDestExt = new FormData();
fdlLineNrDestExt.top = new FormAttachment(previous, margin);
fdlLineNrDestExt.right = new FormAttachment(wLineNrExt, -margin);
wlLineNrExt.setLayoutData(fdlLineNrDestExt);
wLineNrDestDir = new TextVar(transMeta, wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wLineNrDestDir);
wLineNrDestDir.addModifyListener(lsMod);
fdLineNrDestDir = new FormData();
fdLineNrDestDir.left = new FormAttachment(middle, 0);
fdLineNrDestDir.right = new FormAttachment(wlLineNrExt, -margin);
fdLineNrDestDir.top = new FormAttachment(previous, margin);
wLineNrDestDir.setLayoutData(fdLineNrDestDir);
// Listen to the Browse... button
wbbLineNrDestDir.addSelectionListener(DirectoryDialogButtonListenerFactory.getSelectionAdapter(shell, wLineNrDestDir.getTextWidget()));
// Whenever something changes, set the tooltip to the expanded version of the directory:
wLineNrDestDir.addModifyListener(getModifyListenerTooltipText(wLineNrDestDir.getTextWidget()));
fdErrorComp = new FormData();
fdErrorComp.left = new FormAttachment(0, 0);
fdErrorComp.top = new FormAttachment(0, 0);
fdErrorComp.right = new FormAttachment(100, 0);
fdErrorComp.bottom = new FormAttachment(100, 0);
wErrorComp.setLayoutData(fdErrorComp);
wErrorComp.pack();
// What's the size:
Rectangle bounds = wErrorComp.getBounds();
wErrorSComp.setContent(wErrorComp);
wErrorSComp.setExpandHorizontal(true);
wErrorSComp.setExpandVertical(true);
wErrorSComp.setMinWidth(bounds.width);
wErrorSComp.setMinHeight(bounds.height);
wErrorTab.setControl(wErrorSComp);
// ///////////////////////////////////////////////////////////
// / END OF CONTENT TAB
// ///////////////////////////////////////////////////////////
}
use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.
the class JobGraph method addAllTabs.
public void addAllTabs() {
CTabItem tabItemSelection = null;
if (extraViewTabFolder != null && !extraViewTabFolder.isDisposed()) {
tabItemSelection = extraViewTabFolder.getSelection();
}
jobHistoryDelegate.addJobHistory();
jobLogDelegate.addJobLog();
jobGridDelegate.addJobGrid();
jobMetricsDelegate.addJobMetrics();
if (tabItemSelection != null) {
extraViewTabFolder.setSelection(tabItemSelection);
} else {
extraViewTabFolder.setSelection(jobGridDelegate.getJobGridTab());
}
XulToolbarbutton button = (XulToolbarbutton) toolbar.getElementById("job-show-results");
button.setTooltiptext(BaseMessages.getString(PKG, "Spoon.Tooltip.HideExecutionResults"));
ToolItem swtToolItem = (ToolItem) button.getManagedObject();
swtToolItem.setImage(GUIResource.getInstance().getImageHideResults());
}
use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.
the class JobGridDelegate method addJobGrid.
/**
* Add a grid with the execution metrics per step in a table view
*/
public void addJobGrid() {
//
if (jobGraph.extraViewComposite == null || jobGraph.extraViewComposite.isDisposed()) {
jobGraph.addExtraView();
} else {
if (jobGridTab != null && !jobGridTab.isDisposed()) {
// just set this one active and get out...
//
jobGraph.extraViewTabFolder.setSelection(jobGridTab);
return;
}
}
jobGridTab = new CTabItem(jobGraph.extraViewTabFolder, SWT.NONE);
jobGridTab.setImage(GUIResource.getInstance().getImageShowGrid());
jobGridTab.setText(BaseMessages.getString(PKG, "Spoon.TransGraph.GridTab.Name"));
addControls();
jobGridTab.setControl(wTree);
jobGraph.extraViewTabFolder.setSelection(jobGridTab);
}
Aggregations