in plugins/transforms/textfile/src/main/java/org/apache/hop/pipeline/transforms/fileinput/TextFileInputDialog.java [860:1452]
private void addContentTab() {
// ////////////////////////
// START OF CONTENT TAB///
// /
CTabItem wContentTab = new CTabItem(wTabFolder, SWT.NONE);
wContentTab.setFont(GuiResource.getInstance().getFontDefault());
wContentTab.setText(BaseMessages.getString(PKG, "TextFileInputDialog.ContentTab.TabTitle"));
FormLayout contentLayout = new FormLayout();
contentLayout.marginWidth = 3;
contentLayout.marginHeight = 3;
ScrolledComposite wContentSComp =
new ScrolledComposite(wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
wContentSComp.setLayout(new FillLayout());
Composite wContentComp = new Composite(wContentSComp, SWT.NONE);
PropsUi.setLook(wContentComp);
wContentComp.setLayout(contentLayout);
// Filetype line
Label wlFiletype = new Label(wContentComp, SWT.RIGHT);
wlFiletype.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Filetype.Label"));
PropsUi.setLook(wlFiletype);
FormData 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"));
PropsUi.setLook(wFiletype);
wFiletype.add("CSV");
wFiletype.add("Fixed");
wFiletype.select(0);
wFiletype.addModifyListener(lsMod);
FormData fdFiletype = new FormData();
fdFiletype.left = new FormAttachment(middle, 0);
fdFiletype.top = new FormAttachment(0, 0);
fdFiletype.right = new FormAttachment(100, 0);
wFiletype.setLayoutData(fdFiletype);
Label wlSeparator = new Label(wContentComp, SWT.RIGHT);
wlSeparator.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Separator.Label"));
PropsUi.setLook(wlSeparator);
FormData 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"));
PropsUi.setLook(wbSeparator);
FormData fdbSeparator = new FormData();
fdbSeparator.right = new FormAttachment(100, 0);
fdbSeparator.top = new FormAttachment(wFiletype, 0);
wbSeparator.setLayoutData(fdbSeparator);
wSeparator = new TextVar(variables, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wSeparator);
wSeparator.addModifyListener(lsMod);
FormData 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
Label wlEnclosure = new Label(wContentComp, SWT.RIGHT);
wlEnclosure.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Enclosure.Label"));
PropsUi.setLook(wlEnclosure);
FormData 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);
PropsUi.setLook(wEnclosure);
wEnclosure.addModifyListener(lsMod);
FormData 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
Label wlEnclBreaks = new Label(wContentComp, SWT.RIGHT);
wlEnclBreaks.setText(BaseMessages.getString(PKG, "TextFileInputDialog.EnclBreaks.Label"));
PropsUi.setLook(wlEnclBreaks);
FormData fdlEnclBreaks = new FormData();
fdlEnclBreaks.left = new FormAttachment(0, 0);
fdlEnclBreaks.top = new FormAttachment(wEnclosure, margin);
fdlEnclBreaks.right = new FormAttachment(middle, -margin);
wlEnclBreaks.setLayoutData(fdlEnclBreaks);
Button wEnclBreaks = new Button(wContentComp, SWT.CHECK);
PropsUi.setLook(wEnclBreaks);
FormData fdEnclBreaks = new FormData();
fdEnclBreaks.left = new FormAttachment(middle, 0);
fdEnclBreaks.top = new FormAttachment(wlEnclBreaks, 0, SWT.CENTER);
wEnclBreaks.setLayoutData(fdEnclBreaks);
// Disable until the logic works...
wlEnclBreaks.setEnabled(false);
wEnclBreaks.setEnabled(false);
// Escape
Label wlEscape = new Label(wContentComp, SWT.RIGHT);
wlEscape.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Escape.Label"));
PropsUi.setLook(wlEscape);
FormData 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);
PropsUi.setLook(wEscape);
wEscape.addModifyListener(lsMod);
FormData 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
Label wlHeader = new Label(wContentComp, SWT.RIGHT);
wlHeader.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Header.Label"));
PropsUi.setLook(wlHeader);
FormData 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);
PropsUi.setLook(wHeader);
FormData fdHeader = new FormData();
fdHeader.left = new FormAttachment(middle, 0);
fdHeader.top = new FormAttachment(wlHeader, 0, SWT.CENTER);
wHeader.setLayoutData(fdHeader);
// NrHeader
wlNrHeader = new Label(wContentComp, SWT.RIGHT);
wlNrHeader.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrHeader.Label"));
PropsUi.setLook(wlNrHeader);
FormData fdlNrHeader = new FormData();
fdlNrHeader.left = new FormAttachment(wHeader, margin);
fdlNrHeader.top = new FormAttachment(wlNrHeader, 0, SWT.CENTER);
wlNrHeader.setLayoutData(fdlNrHeader);
wNrHeader = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrHeader.setTextLimit(3);
PropsUi.setLook(wNrHeader);
wNrHeader.addModifyListener(lsMod);
FormData fdNrHeader = new FormData();
fdNrHeader.left = new FormAttachment(wlNrHeader, margin);
fdNrHeader.top = new FormAttachment(wlNrHeader, 0, SWT.CENTER);
fdNrHeader.right = new FormAttachment(100, 0);
wNrHeader.setLayoutData(fdNrHeader);
Label wlFooter = new Label(wContentComp, SWT.RIGHT);
wlFooter.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Footer.Label"));
PropsUi.setLook(wlFooter);
FormData 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);
PropsUi.setLook(wFooter);
FormData fdFooter = new FormData();
fdFooter.left = new FormAttachment(middle, 0);
fdFooter.top = new FormAttachment(wlFooter, 0, SWT.CENTER);
wFooter.setLayoutData(fdFooter);
// NrFooter
wlNrFooter = new Label(wContentComp, SWT.RIGHT);
wlNrFooter.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrFooter.Label"));
PropsUi.setLook(wlNrFooter);
FormData fdlNrFooter = new FormData();
fdlNrFooter.left = new FormAttachment(wFooter, margin);
fdlNrFooter.top = new FormAttachment(wlFooter, 0, SWT.CENTER);
wlNrFooter.setLayoutData(fdlNrFooter);
wNrFooter = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrFooter.setTextLimit(3);
PropsUi.setLook(wNrFooter);
wNrFooter.addModifyListener(lsMod);
FormData fdNrFooter = new FormData();
fdNrFooter.left = new FormAttachment(wlNrFooter, margin);
fdNrFooter.top = new FormAttachment(wlFooter, 0, SWT.CENTER);
fdNrFooter.right = new FormAttachment(100, 0);
wNrFooter.setLayoutData(fdNrFooter);
// Wraps
Label wlWraps = new Label(wContentComp, SWT.RIGHT);
wlWraps.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Wraps.Label"));
PropsUi.setLook(wlWraps);
FormData 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);
PropsUi.setLook(wWraps);
FormData fdWraps = new FormData();
fdWraps.left = new FormAttachment(middle, 0);
fdWraps.top = new FormAttachment(wlWraps, 0, SWT.CENTER);
wWraps.setLayoutData(fdWraps);
// NrWraps
wlNrWraps = new Label(wContentComp, SWT.RIGHT);
wlNrWraps.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NrWraps.Label"));
PropsUi.setLook(wlNrWraps);
FormData fdlNrWraps = new FormData();
fdlNrWraps.left = new FormAttachment(wWraps, margin);
fdlNrWraps.top = new FormAttachment(wlWraps, 0, SWT.CENTER);
wlNrWraps.setLayoutData(fdlNrWraps);
wNrWraps = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrWraps.setTextLimit(3);
PropsUi.setLook(wNrWraps);
wNrWraps.addModifyListener(lsMod);
FormData fdNrWraps = new FormData();
fdNrWraps.left = new FormAttachment(wlNrWraps, margin);
fdNrWraps.top = new FormAttachment(wlWraps, 0, SWT.CENTER);
fdNrWraps.right = new FormAttachment(100, 0);
wNrWraps.setLayoutData(fdNrWraps);
// Pages
Label wlLayoutPaged = new Label(wContentComp, SWT.RIGHT);
wlLayoutPaged.setText(BaseMessages.getString(PKG, "TextFileInputDialog.LayoutPaged.Label"));
PropsUi.setLook(wlLayoutPaged);
FormData 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);
PropsUi.setLook(wLayoutPaged);
FormData fdLayoutPaged = new FormData();
fdLayoutPaged.left = new FormAttachment(middle, 0);
fdLayoutPaged.top = new FormAttachment(wlLayoutPaged, 0, SWT.CENTER);
wLayoutPaged.setLayoutData(fdLayoutPaged);
// Nr of lines per page
wlNrLinesPerPage = new Label(wContentComp, SWT.RIGHT);
wlNrLinesPerPage.setText(
BaseMessages.getString(PKG, "TextFileInputDialog.NrLinesPerPage.Label"));
PropsUi.setLook(wlNrLinesPerPage);
FormData fdlNrLinesPerPage = new FormData();
fdlNrLinesPerPage.left = new FormAttachment(wLayoutPaged, margin);
fdlNrLinesPerPage.top = new FormAttachment(wlLayoutPaged, 0, SWT.CENTER);
wlNrLinesPerPage.setLayoutData(fdlNrLinesPerPage);
wNrLinesPerPage = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wNrLinesPerPage.setTextLimit(3);
PropsUi.setLook(wNrLinesPerPage);
wNrLinesPerPage.addModifyListener(lsMod);
FormData fdNrLinesPerPage = new FormData();
fdNrLinesPerPage.left = new FormAttachment(wlNrLinesPerPage, margin);
fdNrLinesPerPage.top = new FormAttachment(wlLayoutPaged, 0, SWT.CENTER);
fdNrLinesPerPage.right = new FormAttachment(100, 0);
wNrLinesPerPage.setLayoutData(fdNrLinesPerPage);
// NrPages
wlNrLinesDocHeader = new Label(wContentComp, SWT.RIGHT);
wlNrLinesDocHeader.setText(
BaseMessages.getString(PKG, "TextFileInputDialog.NrLinesDocHeader.Label"));
PropsUi.setLook(wlNrLinesDocHeader);
FormData 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);
PropsUi.setLook(wNrLinesDocHeader);
wNrLinesDocHeader.addModifyListener(lsMod);
FormData 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
Label wlCompression = new Label(wContentComp, SWT.RIGHT);
wlCompression.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Compression.Label"));
PropsUi.setLook(wlCompression);
FormData 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"));
PropsUi.setLook(wCompression);
wCompression.setItems(CompressionProviderFactory.getInstance().getCompressionProviderNames());
wCompression.addModifyListener(lsMod);
FormData fdCompression = new FormData();
fdCompression.left = new FormAttachment(middle, 0);
fdCompression.top = new FormAttachment(wNrLinesDocHeader, margin);
fdCompression.right = new FormAttachment(100, 0);
wCompression.setLayoutData(fdCompression);
Label wlNoempty = new Label(wContentComp, SWT.RIGHT);
wlNoempty.setText(BaseMessages.getString(PKG, "TextFileInputDialog.NoEmpty.Label"));
PropsUi.setLook(wlNoempty);
FormData 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);
PropsUi.setLook(wNoempty);
wNoempty.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.NoEmpty.Tooltip"));
FormData fdNoempty = new FormData();
fdNoempty.left = new FormAttachment(middle, 0);
fdNoempty.top = new FormAttachment(wlNoempty, 0, SWT.CENTER);
fdNoempty.right = new FormAttachment(100, 0);
wNoempty.setLayoutData(fdNoempty);
Label wlInclFilename = new Label(wContentComp, SWT.RIGHT);
wlInclFilename.setText(BaseMessages.getString(PKG, "TextFileInputDialog.InclFilename.Label"));
PropsUi.setLook(wlInclFilename);
FormData 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);
PropsUi.setLook(wInclFilename);
wInclFilename.setToolTipText(
BaseMessages.getString(PKG, "TextFileInputDialog.InclFilename.Tooltip"));
FormData fdInclFilename = new FormData();
fdInclFilename.left = new FormAttachment(middle, 0);
fdInclFilename.top = new FormAttachment(wlInclFilename, 0, SWT.CENTER);
wInclFilename.setLayoutData(fdInclFilename);
wlInclFilenameField = new Label(wContentComp, SWT.LEFT);
wlInclFilenameField.setText(
BaseMessages.getString(PKG, "TextFileInputDialog.InclFilenameField.Label"));
PropsUi.setLook(wlInclFilenameField);
FormData fdlInclFilenameField = new FormData();
fdlInclFilenameField.left = new FormAttachment(wInclFilename, margin);
fdlInclFilenameField.top = new FormAttachment(wlInclFilename, 0, SWT.CENTER);
wlInclFilenameField.setLayoutData(fdlInclFilenameField);
wInclFilenameField = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wInclFilenameField);
wInclFilenameField.addModifyListener(lsMod);
FormData fdInclFilenameField = new FormData();
fdInclFilenameField.left = new FormAttachment(wlInclFilenameField, margin);
fdInclFilenameField.top = new FormAttachment(wlInclFilename, 0, SWT.CENTER);
fdInclFilenameField.right = new FormAttachment(100, 0);
wInclFilenameField.setLayoutData(fdInclFilenameField);
Label wlInclRownum = new Label(wContentComp, SWT.RIGHT);
wlInclRownum.setText(BaseMessages.getString(PKG, "TextFileInputDialog.InclRownum.Label"));
PropsUi.setLook(wlInclRownum);
FormData 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);
PropsUi.setLook(wInclRownum);
wInclRownum.setToolTipText(
BaseMessages.getString(PKG, "TextFileInputDialog.InclRownum.Tooltip"));
FormData fdRownum = new FormData();
fdRownum.left = new FormAttachment(middle, 0);
fdRownum.top = new FormAttachment(wlInclRownum, 0, SWT.CENTER);
wInclRownum.setLayoutData(fdRownum);
wlInclRownumField = new Label(wContentComp, SWT.RIGHT);
wlInclRownumField.setText(
BaseMessages.getString(PKG, "TextFileInputDialog.InclRownumField.Label"));
PropsUi.setLook(wlInclRownumField);
FormData fdlInclRownumField = new FormData();
fdlInclRownumField.left = new FormAttachment(wInclRownum, margin);
fdlInclRownumField.top = new FormAttachment(wlInclRownum, 0, SWT.CENTER);
wlInclRownumField.setLayoutData(fdlInclRownumField);
wInclRownumField = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wInclRownumField);
wInclRownumField.addModifyListener(lsMod);
FormData fdInclRownumField = new FormData();
fdInclRownumField.left = new FormAttachment(wlInclRownumField, margin);
fdInclRownumField.top = new FormAttachment(wlInclRownum, 0, SWT.CENTER);
fdInclRownumField.right = new FormAttachment(100, 0);
wInclRownumField.setLayoutData(fdInclRownumField);
wlRownumByFileField = new Label(wContentComp, SWT.RIGHT);
wlRownumByFileField.setText(
BaseMessages.getString(PKG, "TextFileInputDialog.RownumByFile.Label"));
PropsUi.setLook(wlRownumByFileField);
FormData fdlRownumByFile = new FormData();
fdlRownumByFile.left = new FormAttachment(wInclRownum, margin);
fdlRownumByFile.top = new FormAttachment(wInclRownumField, margin);
wlRownumByFileField.setLayoutData(fdlRownumByFile);
wRownumByFile = new Button(wContentComp, SWT.CHECK);
PropsUi.setLook(wRownumByFile);
wRownumByFile.setToolTipText(
BaseMessages.getString(PKG, "TextFileInputDialog.RownumByFile.Tooltip"));
FormData fdRownumByFile = new FormData();
fdRownumByFile.left = new FormAttachment(wlRownumByFileField, margin);
fdRownumByFile.top = new FormAttachment(wlRownumByFileField, 0, SWT.CENTER);
wRownumByFile.setLayoutData(fdRownumByFile);
Label wlFormat = new Label(wContentComp, SWT.RIGHT);
wlFormat.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Format.Label"));
PropsUi.setLook(wlFormat);
FormData 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"));
PropsUi.setLook(wFormat);
wFormat.add("DOS");
wFormat.add("Unix");
wFormat.add("mixed");
wFormat.select(0);
wFormat.addModifyListener(lsMod);
FormData 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);
Label wlEncoding = new Label(wContentComp, SWT.RIGHT);
wlEncoding.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Encoding.Label"));
PropsUi.setLook(wlEncoding);
FormData 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);
PropsUi.setLook(wEncoding);
wEncoding.addModifyListener(lsMod);
FormData 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() {
@Override
public void focusLost(FocusEvent e) {
// Do nothing
}
@Override
public void focusGained(FocusEvent e) {
Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
shell.setCursor(busy);
setEncodings();
shell.setCursor(null);
busy.dispose();
}
});
Label wlLimit = new Label(wContentComp, SWT.RIGHT);
wlLimit.setText(BaseMessages.getString(PKG, "TextFileInputDialog.Limit.Label"));
PropsUi.setLook(wlLimit);
FormData fdlLimit = new FormData();
fdlLimit.left = new FormAttachment(0, 0);
fdlLimit.top = new FormAttachment(wEncoding, margin);
fdlLimit.right = new FormAttachment(middle, -margin);
wlLimit.setLayoutData(fdlLimit);
wLimit = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wLimit);
wLimit.addModifyListener(lsMod);
FormData fdLimit = new FormData();
fdLimit.left = new FormAttachment(middle, 0);
fdLimit.top = new FormAttachment(wEncoding, margin);
fdLimit.right = new FormAttachment(100, 0);
wLimit.setLayoutData(fdLimit);
// Date Lenient checkbox
Label wlDateLenient = new Label(wContentComp, SWT.RIGHT);
wlDateLenient.setText(BaseMessages.getString(PKG, "TextFileInputDialog.DateLenient.Label"));
PropsUi.setLook(wlDateLenient);
FormData 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"));
PropsUi.setLook(wDateLenient);
FormData fdDateLenient = new FormData();
fdDateLenient.left = new FormAttachment(middle, 0);
fdDateLenient.top = new FormAttachment(wlDateLenient, 0, SWT.CENTER);
wDateLenient.setLayoutData(fdDateLenient);
Label wlDateLocale = new Label(wContentComp, SWT.RIGHT);
wlDateLocale.setText(BaseMessages.getString(PKG, "TextFileInputDialog.DateLocale.Label"));
PropsUi.setLook(wlDateLocale);
FormData 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"));
PropsUi.setLook(wDateLocale);
wDateLocale.addModifyListener(lsMod);
FormData 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() {
@Override
public void focusLost(FocusEvent e) {
// Do nothing
}
@Override
public void focusGained(FocusEvent e) {
Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
shell.setCursor(busy);
setLocales();
shell.setCursor(null);
busy.dispose();
}
});
// ///////////////////////////////
// START OF AddFileResult GROUP //
// ///////////////////////////////
Group wAddFileResult = new Group(wContentComp, SWT.SHADOW_NONE);
PropsUi.setLook(wAddFileResult);
wAddFileResult.setText(BaseMessages.getString(PKG, "TextFileInputDialog.wAddFileResult.Label"));
FormLayout addFileResultgroupLayout = new FormLayout();
addFileResultgroupLayout.marginWidth = 10;
addFileResultgroupLayout.marginHeight = 10;
wAddFileResult.setLayout(addFileResultgroupLayout);
Label wlAddResult = new Label(wAddFileResult, SWT.RIGHT);
wlAddResult.setText(BaseMessages.getString(PKG, "TextFileInputDialog.AddResult.Label"));
PropsUi.setLook(wlAddResult);
FormData 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);
PropsUi.setLook(wAddResult);
wAddResult.setToolTipText(BaseMessages.getString(PKG, "TextFileInputDialog.AddResult.Tooltip"));
FormData fdAddResult = new FormData();
fdAddResult.left = new FormAttachment(middle, 0);
fdAddResult.top = new FormAttachment(wlAddResult, 0, SWT.CENTER);
wAddResult.setLayoutData(fdAddResult);
FormData 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);
FormData 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
// ///////////////////////////////////////////////////////////
}