use of org.pentaho.di.ui.core.dialog.EnterSelectionDialog in project pentaho-kettle by pentaho.
the class ExcelInputDialog method showFiles.
private void showFiles() {
ExcelInputMeta eii = new ExcelInputMeta();
getInfo(eii);
String[] files = eii.getFilePaths(transMeta);
if (files.length > 0) {
EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, BaseMessages.getString(PKG, "ExcelInputDialog.FilesRead.DialogTitle"), BaseMessages.getString(PKG, "ExcelInputDialog.FilesRead.DialogMessage"));
esd.setViewOnly();
esd.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "ExcelInputDialog.NoFilesFound.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
mb.open();
}
}
use of org.pentaho.di.ui.core.dialog.EnterSelectionDialog in project pentaho-kettle by pentaho.
the class RssOutputDialog method open.
public String open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
props.setLook(shell);
setShellImage(shell, input);
ModifyListener lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
input.setChanged();
}
};
backupChanged = input.hasChanged();
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "RssOutputDialog.DialogTitle"));
// get previous fields name
getFields();
// Stepname line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
props.setLook(wlStepname);
fdlStepname = new FormData();
fdlStepname.left = new FormAttachment(0, 0);
fdlStepname.right = new FormAttachment(middle, -margin);
fdlStepname.top = new FormAttachment(0, margin);
wlStepname.setLayoutData(fdlStepname);
wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wStepname.setText(stepname);
props.setLook(wStepname);
wStepname.addModifyListener(lsMod);
fdStepname = new FormData();
fdStepname.left = new FormAttachment(middle, 0);
fdStepname.top = new FormAttachment(0, margin);
fdStepname.right = new FormAttachment(100, 0);
wStepname.setLayoutData(fdStepname);
wTabFolder = new CTabFolder(shell, SWT.BORDER);
props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
// ////////////////////////
// START OF CHANNEL TAB ///
// ////////////////////////
wChannelTab = new CTabItem(wTabFolder, SWT.NONE);
wChannelTab.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelTab.TabTitle"));
wChannelComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wChannelComp);
FormLayout channelLayout = new FormLayout();
channelLayout.marginWidth = 3;
channelLayout.marginHeight = 3;
wChannelComp.setLayout(channelLayout);
// Create Custom RSS?
wlCustomRss = new Label(wChannelComp, SWT.RIGHT);
wlCustomRss.setText(BaseMessages.getString(PKG, "RssOutputDialog.CustomRss.Label"));
props.setLook(wlCustomRss);
fdlCustomRss = new FormData();
fdlCustomRss.left = new FormAttachment(0, 0);
fdlCustomRss.top = new FormAttachment(0, margin);
fdlCustomRss.right = new FormAttachment(middle, -margin);
wlCustomRss.setLayoutData(fdlCustomRss);
wCustomRss = new Button(wChannelComp, SWT.CHECK);
wCustomRss.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.CustomRss.Tooltip"));
props.setLook(wCustomRss);
fdCustomRss = new FormData();
fdCustomRss.left = new FormAttachment(middle, 0);
fdCustomRss.top = new FormAttachment(0, margin);
fdCustomRss.right = new FormAttachment(100, 0);
wCustomRss.setLayoutData(fdCustomRss);
wCustomRss.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setCustomRSS();
input.setChanged();
}
});
// Create Custom RSS?
wlDisplayItem = new Label(wChannelComp, SWT.RIGHT);
wlDisplayItem.setText(BaseMessages.getString(PKG, "RssOutputDialog.DisplayItem.Label"));
props.setLook(wlDisplayItem);
fdlDisplayItem = new FormData();
fdlDisplayItem.left = new FormAttachment(0, 0);
fdlDisplayItem.top = new FormAttachment(wCustomRss, margin);
fdlDisplayItem.right = new FormAttachment(middle, -margin);
wlDisplayItem.setLayoutData(fdlDisplayItem);
wDisplayItem = new Button(wChannelComp, SWT.CHECK);
wDisplayItem.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.DisplayItem.Tooltip"));
props.setLook(wDisplayItem);
fdDisplayItem = new FormData();
fdDisplayItem.left = new FormAttachment(middle, 0);
fdDisplayItem.top = new FormAttachment(wCustomRss, margin);
fdDisplayItem.right = new FormAttachment(100, 0);
wDisplayItem.setLayoutData(fdDisplayItem);
wDisplayItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// ChannelGroup grouping?
// ////////////////////////
// START OF ChannelGroup GROUP
//
wChannelGroup = new Group(wChannelComp, SWT.SHADOW_NONE);
props.setLook(wChannelGroup);
wChannelGroup.setText(BaseMessages.getString(PKG, "RssOutputDialog.Group.ChannelGroup.Label"));
FormLayout groupChannelGroupLayout = new FormLayout();
groupChannelGroupLayout.marginWidth = 10;
groupChannelGroupLayout.marginHeight = 10;
wChannelGroup.setLayout(groupChannelGroupLayout);
// RemarqChannel
wlRemarqChannel = new Label(wChannelGroup, SWT.RIGHT);
wlRemarqChannel.setText(BaseMessages.getString(PKG, "RssOutputDialog.RemarqChannel.Label"));
props.setLook(wlRemarqChannel);
fdlRemarqChannel = new FormData();
fdlRemarqChannel.left = new FormAttachment(0, 0);
fdlRemarqChannel.top = new FormAttachment(wDisplayItem, margin);
// fdlRemarq.right = new FormAttachment(middle, -margin);
wlRemarqChannel.setLayoutData(fdlRemarqChannel);
// RemarqMandatory
wlRemarqMandatory = new Label(wChannelGroup, SWT.RIGHT);
wlRemarqMandatory.setText(BaseMessages.getString(PKG, "RssOutputDialog.RemarqMandatory.Label"));
props.setLook(wlRemarqMandatory);
fdlRemarqMandatory = new FormData();
fdlRemarqMandatory.left = new FormAttachment(0, 0);
fdlRemarqMandatory.top = new FormAttachment(wlRemarqChannel, margin);
// fdlRemarq.right = new FormAttachment(middle, -margin);
wlRemarqMandatory.setLayoutData(fdlRemarqMandatory);
// ChannelTitle line
wlChannelTitle = new Label(wChannelGroup, SWT.RIGHT);
wlChannelTitle.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelTitle.Label"));
props.setLook(wlChannelTitle);
fdlChannelTitle = new FormData();
fdlChannelTitle.left = new FormAttachment(0, 0);
fdlChannelTitle.top = new FormAttachment(wlRemarqMandatory, 2 * margin);
fdlChannelTitle.right = new FormAttachment(middle, -margin);
wlChannelTitle.setLayoutData(fdlChannelTitle);
wChannelTitle = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelTitle.setEditable(true);
wChannelTitle.setItems(fieldNames);
props.setLook(wChannelTitle);
wChannelTitle.addModifyListener(lsMod);
fdChannelTitle = new FormData();
fdChannelTitle.left = new FormAttachment(middle, 0);
fdChannelTitle.top = new FormAttachment(wlRemarqMandatory, 2 * margin);
fdChannelTitle.right = new FormAttachment(100, 0);
wChannelTitle.setLayoutData(fdChannelTitle);
// Channel Description
wlChannelDescription = new Label(wChannelGroup, SWT.RIGHT);
wlChannelDescription.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelDescription.Label"));
props.setLook(wlChannelDescription);
fdlChannelDescription = new FormData();
fdlChannelDescription.left = new FormAttachment(0, 0);
fdlChannelDescription.top = new FormAttachment(wChannelTitle, margin);
fdlChannelDescription.right = new FormAttachment(middle, -margin);
wlChannelDescription.setLayoutData(fdlChannelDescription);
wChannelDescription = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelDescription.setEditable(true);
wChannelDescription.setItems(fieldNames);
props.setLook(wChannelDescription);
wChannelDescription.addModifyListener(lsMod);
fdChannelDescription = new FormData();
fdChannelDescription.left = new FormAttachment(middle, 0);
fdChannelDescription.top = new FormAttachment(wChannelTitle, margin);
fdChannelDescription.right = new FormAttachment(100, 0);
wChannelDescription.setLayoutData(fdChannelDescription);
// ChannelLink line
wlChannelLink = new Label(wChannelGroup, SWT.RIGHT);
wlChannelLink.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelLink.Label"));
props.setLook(wlChannelLink);
fdlChannelLink = new FormData();
fdlChannelLink.left = new FormAttachment(0, 0);
fdlChannelLink.top = new FormAttachment(wChannelDescription, margin);
fdlChannelLink.right = new FormAttachment(middle, -margin);
wlChannelLink.setLayoutData(fdlChannelLink);
wChannelLink = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelLink.setEditable(true);
wChannelLink.setItems(fieldNames);
props.setLook(wChannelLink);
wChannelLink.addModifyListener(lsMod);
fdChannelLink = new FormData();
fdChannelLink.left = new FormAttachment(middle, 0);
fdChannelLink.top = new FormAttachment(wChannelDescription, margin);
fdChannelLink.right = new FormAttachment(100, 0);
wChannelLink.setLayoutData(fdChannelLink);
// ChannelPubDate line
wlChannelPubDate = new Label(wChannelGroup, SWT.RIGHT);
wlChannelPubDate.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelPubDate.Label"));
props.setLook(wlChannelPubDate);
fdlChannelPubDate = new FormData();
fdlChannelPubDate.left = new FormAttachment(0, 0);
fdlChannelPubDate.top = new FormAttachment(wChannelLink, margin);
fdlChannelPubDate.right = new FormAttachment(middle, -margin);
wlChannelPubDate.setLayoutData(fdlChannelPubDate);
wChannelPubDate = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelPubDate.setEditable(true);
wChannelPubDate.setItems(fieldNames);
props.setLook(wChannelPubDate);
wChannelPubDate.addModifyListener(lsMod);
fdChannelPubDate = new FormData();
fdChannelPubDate.left = new FormAttachment(middle, 0);
fdChannelPubDate.top = new FormAttachment(wChannelLink, margin);
fdChannelPubDate.right = new FormAttachment(100, 0);
wChannelPubDate.setLayoutData(fdChannelPubDate);
// Channel Language
wlChannelLanguage = new Label(wChannelGroup, SWT.RIGHT);
wlChannelLanguage.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelLanguage.Label"));
props.setLook(wlChannelLanguage);
fdlChannelLanguage = new FormData();
fdlChannelLanguage.left = new FormAttachment(0, 0);
fdlChannelLanguage.top = new FormAttachment(wChannelPubDate, margin);
fdlChannelLanguage.right = new FormAttachment(middle, -margin);
wlChannelLanguage.setLayoutData(fdlChannelLanguage);
wChannelLanguage = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelLanguage.setEditable(true);
wChannelLanguage.setItems(fieldNames);
props.setLook(wChannelLanguage);
wChannelLanguage.addModifyListener(lsMod);
fdChannelLanguage = new FormData();
fdChannelLanguage.left = new FormAttachment(middle, 0);
fdChannelLanguage.top = new FormAttachment(wChannelPubDate, margin);
fdChannelLanguage.right = new FormAttachment(100, 0);
wChannelLanguage.setLayoutData(fdChannelLanguage);
// Channel Author
wlChannelAuthor = new Label(wChannelGroup, SWT.RIGHT);
wlChannelAuthor.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelAuthor.Label"));
props.setLook(wlChannelAuthor);
fdlChannelAuthor = new FormData();
fdlChannelAuthor.left = new FormAttachment(0, 0);
fdlChannelAuthor.top = new FormAttachment(wChannelLanguage, margin);
fdlChannelAuthor.right = new FormAttachment(middle, -margin);
wlChannelAuthor.setLayoutData(fdlChannelAuthor);
wChannelAuthor = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelAuthor.setEditable(true);
wChannelAuthor.setItems(fieldNames);
props.setLook(wChannelAuthor);
wChannelAuthor.addModifyListener(lsMod);
fdChannelAuthor = new FormData();
fdChannelAuthor.left = new FormAttachment(middle, 0);
fdChannelAuthor.top = new FormAttachment(wChannelLanguage, margin);
fdChannelAuthor.right = new FormAttachment(100, 0);
wChannelAuthor.setLayoutData(fdChannelAuthor);
// Channel Copyright
wlChannelCopyright = new Label(wChannelGroup, SWT.RIGHT);
wlChannelCopyright.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelCopyright.Label"));
props.setLook(wlChannelCopyright);
fdlChannelCopyright = new FormData();
fdlChannelCopyright.left = new FormAttachment(0, 0);
fdlChannelCopyright.top = new FormAttachment(wChannelAuthor, margin);
fdlChannelCopyright.right = new FormAttachment(middle, -margin);
wlChannelCopyright.setLayoutData(fdlChannelCopyright);
wChannelCopyright = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelCopyright.setEditable(true);
wChannelCopyright.setItems(fieldNames);
props.setLook(wChannelCopyright);
wChannelCopyright.addModifyListener(lsMod);
fdChannelCopyright = new FormData();
fdChannelCopyright.left = new FormAttachment(middle, 0);
fdChannelCopyright.top = new FormAttachment(wChannelAuthor, margin);
fdChannelCopyright.right = new FormAttachment(100, 0);
wChannelCopyright.setLayoutData(fdChannelCopyright);
// Add Image ?
wlAddImage = new Label(wChannelGroup, SWT.RIGHT);
wlAddImage.setText(BaseMessages.getString(PKG, "RssOutputDialog.AddImage.Label"));
props.setLook(wlAddImage);
fdlAddImage = new FormData();
fdlAddImage.left = new FormAttachment(0, 0);
fdlAddImage.top = new FormAttachment(wChannelCopyright, margin);
fdlAddImage.right = new FormAttachment(middle, -margin);
wlAddImage.setLayoutData(fdlAddImage);
wAddImage = new Button(wChannelGroup, SWT.CHECK);
wAddImage.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.AddImage.Tooltip"));
props.setLook(wAddImage);
fdAddImage = new FormData();
fdAddImage.left = new FormAttachment(middle, 0);
fdAddImage.top = new FormAttachment(wChannelCopyright, margin);
fdAddImage.right = new FormAttachment(100, 0);
wAddImage.setLayoutData(fdAddImage);
wAddImage.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setImage();
input.setChanged();
}
});
// Channel Image title
wlChannelImageTitle = new Label(wChannelGroup, SWT.RIGHT);
wlChannelImageTitle.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelImageTitle.Label"));
props.setLook(wlChannelImageTitle);
fdlChannelImageTitle = new FormData();
fdlChannelImageTitle.left = new FormAttachment(0, 0);
fdlChannelImageTitle.top = new FormAttachment(wAddImage, margin);
fdlChannelImageTitle.right = new FormAttachment(middle, -margin);
wlChannelImageTitle.setLayoutData(fdlChannelImageTitle);
wChannelImageTitle = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelImageTitle.setEditable(true);
wChannelImageTitle.setItems(fieldNames);
props.setLook(wChannelImageTitle);
wChannelImageTitle.addModifyListener(lsMod);
fdChannelImageTitle = new FormData();
fdChannelImageTitle.left = new FormAttachment(middle, 0);
fdChannelImageTitle.top = new FormAttachment(wAddImage, margin);
fdChannelImageTitle.right = new FormAttachment(100, 0);
wChannelImageTitle.setLayoutData(fdChannelImageTitle);
// Channel Image Link
wlChannelImageLink = new Label(wChannelGroup, SWT.RIGHT);
wlChannelImageLink.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelImageLink.Label"));
props.setLook(wlChannelImageLink);
fdlChannelImageLink = new FormData();
fdlChannelImageLink.left = new FormAttachment(0, 0);
fdlChannelImageLink.top = new FormAttachment(wChannelImageTitle, margin);
fdlChannelImageLink.right = new FormAttachment(middle, -margin);
wlChannelImageLink.setLayoutData(fdlChannelImageLink);
wChannelImageLink = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelImageLink.setEditable(true);
wChannelImageLink.setItems(fieldNames);
props.setLook(wChannelImageLink);
wChannelImageLink.addModifyListener(lsMod);
fdChannelImageLink = new FormData();
fdChannelImageLink.left = new FormAttachment(middle, 0);
fdChannelImageLink.top = new FormAttachment(wChannelImageTitle, margin);
fdChannelImageLink.right = new FormAttachment(100, 0);
wChannelImageLink.setLayoutData(fdChannelImageLink);
// Channel Image Url
wlChannelImageUrl = new Label(wChannelGroup, SWT.RIGHT);
wlChannelImageUrl.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelImageUrl.Label"));
props.setLook(wlChannelImageUrl);
fdlChannelImageUrl = new FormData();
fdlChannelImageUrl.left = new FormAttachment(0, 0);
fdlChannelImageUrl.top = new FormAttachment(wChannelImageLink, margin);
fdlChannelImageUrl.right = new FormAttachment(middle, -margin);
wlChannelImageUrl.setLayoutData(fdlChannelImageUrl);
wChannelImageUrl = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelImageUrl.setEditable(true);
wChannelImageUrl.setItems(fieldNames);
props.setLook(wChannelImageUrl);
wChannelImageUrl.addModifyListener(lsMod);
fdChannelImageUrl = new FormData();
fdChannelImageUrl.left = new FormAttachment(middle, 0);
fdChannelImageUrl.top = new FormAttachment(wChannelImageLink, margin);
fdChannelImageUrl.right = new FormAttachment(100, 0);
wChannelImageUrl.setLayoutData(fdChannelImageUrl);
// Channel Image Description
wlChannelImageDescription = new Label(wChannelGroup, SWT.RIGHT);
wlChannelImageDescription.setText(BaseMessages.getString(PKG, "RssOutputDialog.ChannelImageDescription.Label"));
props.setLook(wlChannelImageDescription);
fdlChannelImageDescription = new FormData();
fdlChannelImageDescription.left = new FormAttachment(0, 0);
fdlChannelImageDescription.top = new FormAttachment(wChannelImageUrl, margin);
fdlChannelImageDescription.right = new FormAttachment(middle, -margin);
wlChannelImageDescription.setLayoutData(fdlChannelImageDescription);
wChannelImageDescription = new CCombo(wChannelGroup, SWT.BORDER | SWT.READ_ONLY);
wChannelImageDescription.setEditable(true);
wChannelImageDescription.setItems(fieldNames);
props.setLook(wChannelImageDescription);
wChannelImageDescription.addModifyListener(lsMod);
fdChannelImageDescription = new FormData();
fdChannelImageDescription.left = new FormAttachment(middle, 0);
fdChannelImageDescription.top = new FormAttachment(wChannelImageUrl, margin);
fdChannelImageDescription.right = new FormAttachment(100, 0);
wChannelImageDescription.setLayoutData(fdChannelImageDescription);
// Encoding
wlEncoding = new Label(wChannelComp, SWT.RIGHT);
wlEncoding.setText(BaseMessages.getString(PKG, "RssOutputDialog.Encoding.Label"));
props.setLook(wlEncoding);
fdlEncoding = new FormData();
fdlEncoding.left = new FormAttachment(0, 0);
fdlEncoding.top = new FormAttachment(wChannelGroup, 2 * margin);
fdlEncoding.right = new FormAttachment(middle, -margin);
wlEncoding.setLayoutData(fdlEncoding);
wEncoding = new CCombo(wChannelComp, 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(wChannelGroup, 2 * 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();
}
});
// Version
wlVersion = new Label(wChannelComp, SWT.RIGHT);
wlVersion.setText(BaseMessages.getString(PKG, "RssOutputDialog.Version.Label"));
props.setLook(wlVersion);
fdlVersion = new FormData();
fdlVersion.left = new FormAttachment(0, 0);
fdlVersion.top = new FormAttachment(wEncoding, margin);
fdlVersion.right = new FormAttachment(middle, -margin);
wlVersion.setLayoutData(fdlVersion);
wVersion = new CCombo(wChannelComp, SWT.BORDER | SWT.READ_ONLY);
wVersion.setEditable(true);
wVersion.setItems(rss_versions);
props.setLook(wVersion);
wVersion.addModifyListener(lsMod);
fdVersion = new FormData();
fdVersion.left = new FormAttachment(middle, 0);
fdVersion.top = new FormAttachment(wEncoding, margin);
fdVersion.right = new FormAttachment(100, 0);
wVersion.setLayoutData(fdVersion);
fdChannelGroup = new FormData();
fdChannelGroup.left = new FormAttachment(0, margin);
fdChannelGroup.top = new FormAttachment(wDisplayItem, margin);
fdChannelGroup.right = new FormAttachment(100, -margin);
wChannelGroup.setLayoutData(fdChannelGroup);
// ///////////////////////////////////////////////////////////
// / END OF ChannelGroup GROUP
// ///////////////////////////////////////////////////////////
fdChannelComp = new FormData();
fdChannelComp.left = new FormAttachment(0, 0);
fdChannelComp.top = new FormAttachment(0, 0);
fdChannelComp.right = new FormAttachment(100, 0);
fdChannelComp.bottom = new FormAttachment(100, 0);
wChannelComp.setLayoutData(fdChannelComp);
wChannelComp.layout();
wChannelTab.setControl(wChannelComp);
props.setLook(wChannelComp);
// ///////////////////////////////////////////////////////////
// / END OF GENERAL TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF GENERAL TAB ///
// ////////////////////////
wGeneralTab = new CTabItem(wTabFolder, SWT.NONE);
wGeneralTab.setText(BaseMessages.getString(PKG, "RssOutputDialog.GeneralTab.TabTitle"));
wGeneralComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wGeneralComp);
FormLayout generalLayout = new FormLayout();
generalLayout.marginWidth = 3;
generalLayout.marginHeight = 3;
wGeneralComp.setLayout(generalLayout);
// Fields grouping?
// ////////////////////////
// START OF Fields GROUP
//
wFields = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wFields);
wFields.setText(BaseMessages.getString(PKG, "RssOutputDialog.Group.Fields.Label"));
FormLayout groupFieldsLayout = new FormLayout();
groupFieldsLayout.marginWidth = 10;
groupFieldsLayout.marginHeight = 10;
wFields.setLayout(groupFieldsLayout);
// RemarqItem
wlRemarqItem = new Label(wFields, SWT.RIGHT);
wlRemarqItem.setText(BaseMessages.getString(PKG, "RssOutputDialog.RemarqItem.Label"));
props.setLook(wlRemarqItem);
fdlRemarqItem = new FormData();
fdlRemarqItem.left = new FormAttachment(0, 0);
fdlRemarqItem.top = new FormAttachment(0, margin);
// fdlRemarq.right = new FormAttachment(middle, -margin);
wlRemarqItem.setLayoutData(fdlRemarqItem);
// Item Title
wlItemTitle = new Label(wFields, SWT.RIGHT);
wlItemTitle.setText(BaseMessages.getString(PKG, "RssOutputDialog.ItemTitle.Label"));
props.setLook(wlItemTitle);
fdlItemTitle = new FormData();
fdlItemTitle.left = new FormAttachment(0, 0);
fdlItemTitle.top = new FormAttachment(wlRemarqItem, 3 * margin);
fdlItemTitle.right = new FormAttachment(middle, -margin);
wlItemTitle.setLayoutData(fdlItemTitle);
wItemTitle = new CCombo(wFields, SWT.BORDER | SWT.READ_ONLY);
wItemTitle.setEditable(true);
wItemTitle.setItems(fieldNames);
props.setLook(wItemTitle);
wItemTitle.addModifyListener(lsMod);
fdItemTitle = new FormData();
fdItemTitle.left = new FormAttachment(middle, 0);
fdItemTitle.top = new FormAttachment(wlRemarqItem, 3 * margin);
fdItemTitle.right = new FormAttachment(100, 0);
wItemTitle.setLayoutData(fdItemTitle);
// Item Description
wlItemDescription = new Label(wFields, SWT.RIGHT);
wlItemDescription.setText(BaseMessages.getString(PKG, "RssOutputDialog.ItemDescripion.Label"));
props.setLook(wlItemDescription);
fdlItemDescription = new FormData();
fdlItemDescription.left = new FormAttachment(0, 0);
fdlItemDescription.top = new FormAttachment(wItemTitle, margin);
fdlItemDescription.right = new FormAttachment(middle, -margin);
wlItemDescription.setLayoutData(fdlItemDescription);
wItemDescription = new CCombo(wFields, SWT.BORDER | SWT.READ_ONLY);
wItemDescription.setEditable(true);
wItemDescription.setItems(fieldNames);
props.setLook(wItemDescription);
wItemDescription.addModifyListener(lsMod);
fdItemDescription = new FormData();
fdItemDescription.left = new FormAttachment(middle, 0);
fdItemDescription.top = new FormAttachment(wItemTitle, margin);
fdItemDescription.right = new FormAttachment(100, 0);
wItemDescription.setLayoutData(fdItemDescription);
// Item Link
wlItemLink = new Label(wFields, SWT.RIGHT);
wlItemLink.setText(BaseMessages.getString(PKG, "RssOutputDialog.ItemLink.Label"));
props.setLook(wlItemLink);
fdlItemLink = new FormData();
fdlItemLink.left = new FormAttachment(0, 0);
fdlItemLink.top = new FormAttachment(wItemDescription, margin);
fdlItemLink.right = new FormAttachment(middle, -margin);
wlItemLink.setLayoutData(fdlItemLink);
wItemLink = new CCombo(wFields, SWT.BORDER | SWT.READ_ONLY);
wItemLink.setEditable(true);
wItemLink.setItems(fieldNames);
props.setLook(wItemLink);
wItemLink.addModifyListener(lsMod);
fdItemLink = new FormData();
fdItemLink.left = new FormAttachment(middle, 0);
fdItemLink.top = new FormAttachment(wItemDescription, margin);
fdItemLink.right = new FormAttachment(100, 0);
wItemLink.setLayoutData(fdItemLink);
// Item PubDate
wlItemPubDate = new Label(wFields, SWT.RIGHT);
wlItemPubDate.setText(BaseMessages.getString(PKG, "RssOutputDialog.ItemPubDate.Label"));
props.setLook(wlItemPubDate);
fdlItemPubDate = new FormData();
fdlItemPubDate.left = new FormAttachment(0, 0);
fdlItemPubDate.top = new FormAttachment(wItemLink, margin);
fdlItemPubDate.right = new FormAttachment(middle, -margin);
wlItemPubDate.setLayoutData(fdlItemPubDate);
wItemPubDate = new CCombo(wFields, SWT.BORDER | SWT.READ_ONLY);
wItemPubDate.setEditable(true);
wItemPubDate.setItems(fieldNames);
props.setLook(wItemPubDate);
wItemPubDate.addModifyListener(lsMod);
fdItemPubDate = new FormData();
fdItemPubDate.left = new FormAttachment(middle, 0);
fdItemPubDate.top = new FormAttachment(wItemLink, margin);
fdItemPubDate.right = new FormAttachment(100, 0);
wItemPubDate.setLayoutData(fdItemPubDate);
// Item Author
wlItemAuthor = new Label(wFields, SWT.RIGHT);
wlItemAuthor.setText(BaseMessages.getString(PKG, "RssOutputDialog.ItemAuthor.Label"));
props.setLook(wlItemAuthor);
fdlItemAuthor = new FormData();
fdlItemAuthor.left = new FormAttachment(0, 0);
fdlItemAuthor.top = new FormAttachment(wItemPubDate, margin);
fdlItemAuthor.right = new FormAttachment(middle, -margin);
wlItemAuthor.setLayoutData(fdlItemAuthor);
wItemAuthor = new CCombo(wFields, SWT.BORDER | SWT.READ_ONLY);
wItemAuthor.setEditable(true);
wItemAuthor.setItems(fieldNames);
props.setLook(wItemAuthor);
wItemAuthor.addModifyListener(lsMod);
fdItemAuthor = new FormData();
fdItemAuthor.left = new FormAttachment(middle, 0);
fdItemAuthor.top = new FormAttachment(wItemPubDate, margin);
fdItemAuthor.right = new FormAttachment(100, 0);
wItemAuthor.setLayoutData(fdItemAuthor);
// Add GeoRSS ?
wlAddGeoRSS = new Label(wFields, SWT.RIGHT);
wlAddGeoRSS.setText(BaseMessages.getString(PKG, "RssOutputDialog.AddGeoRSS.Label"));
props.setLook(wlAddGeoRSS);
fdlAddGeoRSS = new FormData();
fdlAddGeoRSS.left = new FormAttachment(0, 0);
fdlAddGeoRSS.top = new FormAttachment(wItemAuthor, margin);
fdlAddGeoRSS.right = new FormAttachment(middle, -margin);
wlAddGeoRSS.setLayoutData(fdlAddGeoRSS);
wAddGeoRSS = new Button(wFields, SWT.CHECK);
wAddGeoRSS.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.AddGeoRSS.Tooltip"));
props.setLook(wAddGeoRSS);
fdAddGeoRSS = new FormData();
fdAddGeoRSS.left = new FormAttachment(middle, 0);
fdAddGeoRSS.top = new FormAttachment(wItemAuthor, margin);
fdAddGeoRSS.right = new FormAttachment(100, 0);
wAddGeoRSS.setLayoutData(fdAddGeoRSS);
wAddGeoRSS.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activateGeoRSS();
input.setChanged();
}
});
// Add GeoRSS ?
wluseGeoRSSGML = new Label(wFields, SWT.RIGHT);
wluseGeoRSSGML.setText(BaseMessages.getString(PKG, "RssOutputDialog.useGeoRSSGML.Label"));
props.setLook(wluseGeoRSSGML);
fdluseGeoRSSGML = new FormData();
fdluseGeoRSSGML.left = new FormAttachment(0, 0);
fdluseGeoRSSGML.top = new FormAttachment(wAddGeoRSS, margin);
fdluseGeoRSSGML.right = new FormAttachment(middle, -margin);
wluseGeoRSSGML.setLayoutData(fdluseGeoRSSGML);
wuseGeoRSSGML = new Button(wFields, SWT.CHECK);
wuseGeoRSSGML.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.useGeoRSSGML.Tooltip"));
props.setLook(wuseGeoRSSGML);
fduseGeoRSSGML = new FormData();
fduseGeoRSSGML.left = new FormAttachment(middle, 0);
fduseGeoRSSGML.top = new FormAttachment(wAddGeoRSS, margin);
fduseGeoRSSGML.right = new FormAttachment(100, 0);
wuseGeoRSSGML.setLayoutData(fduseGeoRSSGML);
wuseGeoRSSGML.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// GeoPointLat
wlGeoPointLat = new Label(wFields, SWT.RIGHT);
wlGeoPointLat.setText(BaseMessages.getString(PKG, "RssOutputDialog.GeoPointLat.Label"));
props.setLook(wlGeoPointLat);
fdlGeoPointLat = new FormData();
fdlGeoPointLat.left = new FormAttachment(0, 0);
fdlGeoPointLat.top = new FormAttachment(wuseGeoRSSGML, margin);
fdlGeoPointLat.right = new FormAttachment(middle, -margin);
wlGeoPointLat.setLayoutData(fdlGeoPointLat);
wGeoPointLat = new CCombo(wFields, SWT.BORDER | SWT.READ_ONLY);
wGeoPointLat.setEditable(true);
wGeoPointLat.setItems(fieldNames);
props.setLook(wGeoPointLat);
wGeoPointLat.addModifyListener(lsMod);
fdGeoPointLat = new FormData();
fdGeoPointLat.left = new FormAttachment(middle, 0);
fdGeoPointLat.top = new FormAttachment(wuseGeoRSSGML, margin);
fdGeoPointLat.right = new FormAttachment(100, 0);
wGeoPointLat.setLayoutData(fdGeoPointLat);
// GeoPointLong
wlGeoPointLong = new Label(wFields, SWT.RIGHT);
wlGeoPointLong.setText(BaseMessages.getString(PKG, "RssOutputDialog.GeoPointLong.Label"));
props.setLook(wlGeoPointLong);
fdlGeoPointLong = new FormData();
fdlGeoPointLong.left = new FormAttachment(0, 0);
fdlGeoPointLong.top = new FormAttachment(wGeoPointLat, margin);
fdlGeoPointLong.right = new FormAttachment(middle, -margin);
wlGeoPointLong.setLayoutData(fdlGeoPointLong);
wGeoPointLong = new CCombo(wFields, SWT.BORDER | SWT.READ_ONLY);
wGeoPointLong.setEditable(true);
wGeoPointLong.setItems(fieldNames);
props.setLook(wGeoPointLong);
wGeoPointLong.addModifyListener(lsMod);
fdGeoPointLong = new FormData();
fdGeoPointLong.left = new FormAttachment(middle, 0);
fdGeoPointLong.top = new FormAttachment(wGeoPointLat, margin);
fdGeoPointLong.right = new FormAttachment(100, 0);
wGeoPointLong.setLayoutData(fdGeoPointLong);
fdFields = new FormData();
fdFields.left = new FormAttachment(0, margin);
fdFields.top = new FormAttachment(0, margin);
fdFields.right = new FormAttachment(100, -margin);
wFields.setLayoutData(fdFields);
// ///////////////////////////////////////////////////////////
// / END OF Fields GROUP
// ///////////////////////////////////////////////////////////
fdGeneralComp = new FormData();
fdGeneralComp.left = new FormAttachment(0, 0);
fdGeneralComp.top = new FormAttachment(0, 0);
fdGeneralComp.right = new FormAttachment(100, 0);
fdGeneralComp.bottom = new FormAttachment(100, 0);
wGeneralComp.setLayoutData(fdGeneralComp);
wGeneralComp.layout();
wGeneralTab.setControl(wGeneralComp);
props.setLook(wGeneralComp);
// ///////////////////////////////////////////////////////////
// / END OF GENERAL TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF CUSTOM TAB ///
// ////////////////////////
wCustomTab = new CTabItem(wTabFolder, SWT.NONE);
wCustomTab.setText(BaseMessages.getString(PKG, "RssOutputDialog.CustomTab.TabTitle"));
wCustomComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wCustomComp);
FormLayout customLayout = new FormLayout();
customLayout.marginWidth = 3;
customLayout.marginHeight = 3;
wCustomComp.setLayout(customLayout);
wlChannelCustom = new Label(wCustomComp, SWT.NONE);
wlChannelCustom.setText(BaseMessages.getString(PKG, "RssOutputDialog.Keys.Label"));
props.setLook(wlChannelCustom);
fdlChannelCustom = new FormData();
fdlChannelCustom.left = new FormAttachment(0, 0);
fdlChannelCustom.top = new FormAttachment(0, margin);
wlChannelCustom.setLayoutData(fdlChannelCustom);
int nrChannelCols = 2;
int nrChannelRows = (input.getChannelCustomFields() != null ? input.getChannelCustomFields().length : 1);
ColumnInfo[] ciChannel = new ColumnInfo[nrChannelCols];
ciChannel[0] = new ColumnInfo(BaseMessages.getString(PKG, "RssOutputDialog.ColumnInfo.Tag"), ColumnInfo.COLUMN_TYPE_TEXT, false);
ciChannel[1] = new ColumnInfo(BaseMessages.getString(PKG, "RssOutputDialog.ColumnInfo.Field"), ColumnInfo.COLUMN_TYPE_CCOMBO);
ciChannel[0].setUsingVariables(true);
ciChannel[1].setComboValues(fieldNames);
wChannelCustom = new TableView(transMeta, wCustomComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciChannel, nrChannelRows, lsMod, props);
wGet = new Button(wCustomComp, SWT.PUSH);
wGet.setText(BaseMessages.getString(PKG, "RssOutputDialog.GetFields.Button"));
fdGet = new FormData();
fdGet.right = new FormAttachment(100, 0);
fdGet.top = new FormAttachment(wlChannelCustom, margin);
wGet.setLayoutData(fdGet);
fdChannelCustom = new FormData();
fdChannelCustom.left = new FormAttachment(0, 0);
fdChannelCustom.top = new FormAttachment(wlChannelCustom, margin);
fdChannelCustom.right = new FormAttachment(wGet, -margin);
fdChannelCustom.bottom = new FormAttachment(wlChannelCustom, 190);
wChannelCustom.setLayoutData(fdChannelCustom);
// THE BUTTONS
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
setButtonPositions(new Button[] { wOK, wCancel }, margin, null);
// THE Item Custom
wlItemCustom = new Label(wCustomComp, SWT.NONE);
wlItemCustom.setText(BaseMessages.getString(PKG, "RssOutputDialog.ItemCustom.Label"));
props.setLook(wlItemCustom);
fdlItemCustom = new FormData();
fdlItemCustom.left = new FormAttachment(0, 0);
fdlItemCustom.top = new FormAttachment(wChannelCustom, margin);
wlItemCustom.setLayoutData(fdlItemCustom);
int UpInsCols = 2;
int UpInsRows = (input.getItemCustomFields() != null ? input.getItemCustomFields().length : 1);
ColumnInfo[] ciItem = new ColumnInfo[UpInsCols];
ciItem[0] = new ColumnInfo(BaseMessages.getString(PKG, "RssOutputDialog.ColumnInfo.Tag"), ColumnInfo.COLUMN_TYPE_TEXT, false);
ciItem[1] = new ColumnInfo(BaseMessages.getString(PKG, "RssOutputDialog.ColumnInfo.Field"), ColumnInfo.COLUMN_TYPE_CCOMBO);
ciItem[1].setComboValues(fieldNames);
wItemCustom = new TableView(transMeta, wCustomComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciItem, UpInsRows, lsMod, props);
wGetCustomItem = new Button(wCustomComp, SWT.PUSH);
wGetCustomItem.setText(BaseMessages.getString(PKG, "RssOutputDialog.GetItemFields.Label"));
fdGetCustomItem = new FormData();
fdGetCustomItem.top = new FormAttachment(wlItemCustom, margin);
fdGetCustomItem.right = new FormAttachment(100, 0);
wGetCustomItem.setLayoutData(fdGetCustomItem);
fdItemCustom = new FormData();
fdItemCustom.left = new FormAttachment(0, 0);
fdItemCustom.top = new FormAttachment(wlItemCustom, margin);
fdItemCustom.right = new FormAttachment(wGetCustomItem, -margin);
fdItemCustom.bottom = new FormAttachment(100, -2 * margin);
wItemCustom.setLayoutData(fdItemCustom);
fdCustomComp = new FormData();
fdCustomComp.left = new FormAttachment(0, 0);
fdCustomComp.top = new FormAttachment(0, 0);
fdCustomComp.right = new FormAttachment(100, 0);
fdCustomComp.bottom = new FormAttachment(100, 0);
wCustomComp.setLayoutData(fdCustomComp);
wCustomComp.layout();
wCustomTab.setControl(wCustomComp);
props.setLook(wCustomComp);
// ///////////////////////////////////////////////////////////
// / END OF CUSTOM TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////////////////
// START OF CUSTOM NAMESPACE TAB ///
// ////////////////////////////////////
wCustomNameSpace = new CTabItem(wTabFolder, SWT.NONE);
wCustomNameSpace.setText(BaseMessages.getString(PKG, "RssOutputDialog.CustomNameSpace.TabTitle"));
wCustomNameSpaceComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wCustomNameSpaceComp);
FormLayout customnamespaceLayout = new FormLayout();
customnamespaceLayout.marginWidth = 3;
customnamespaceLayout.marginHeight = 3;
wCustomNameSpaceComp.setLayout(customnamespaceLayout);
// Namespaces
wlNameSpace = new Label(wCustomNameSpaceComp, SWT.NONE);
wlNameSpace.setText(BaseMessages.getString(PKG, "RssOutputDialog.NameSpace.Label"));
props.setLook(wlNameSpace);
fdlNameSpace = new FormData();
fdlNameSpace.left = new FormAttachment(0, 0);
fdlNameSpace.top = new FormAttachment(0, margin);
wlNameSpace.setLayoutData(fdlItemCustom);
int nrRows = (input.getNameSpaces() != null ? input.getNameSpaces().length : 1);
ColumnInfo[] ciNameSpace = new ColumnInfo[2];
ciNameSpace[0] = new ColumnInfo(BaseMessages.getString(PKG, "RssOutputDialog.ColumnInfo.NameSpace.Title"), ColumnInfo.COLUMN_TYPE_TEXT, false);
ciNameSpace[1] = new ColumnInfo(BaseMessages.getString(PKG, "RssOutputDialog.ColumnInfo.NameSpace"), ColumnInfo.COLUMN_TYPE_TEXT, false);
ciNameSpace[0].setUsingVariables(true);
ciNameSpace[1].setUsingVariables(true);
wNameSpaceCustom = new TableView(transMeta, wCustomNameSpaceComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciNameSpace, nrRows, lsMod, props);
fdNameSpaceCustom = new FormData();
fdNameSpaceCustom.left = new FormAttachment(0, 0);
fdNameSpaceCustom.top = new FormAttachment(wlNameSpace, margin);
fdNameSpaceCustom.right = new FormAttachment(100, -margin);
fdNameSpaceCustom.bottom = new FormAttachment(100, -2 * margin);
wNameSpaceCustom.setLayoutData(fdNameSpaceCustom);
fdCustomNameSpace = new FormData();
fdCustomNameSpace.left = new FormAttachment(0, 0);
fdCustomNameSpace.top = new FormAttachment(0, 0);
fdCustomNameSpace.right = new FormAttachment(100, 0);
fdCustomNameSpace.bottom = new FormAttachment(100, 0);
wCustomNameSpaceComp.setLayoutData(fdCustomNameSpace);
wCustomNameSpaceComp.layout();
wCustomNameSpace.setControl(wCustomNameSpaceComp);
props.setLook(wCustomNameSpaceComp);
// ///////////////////////////////////////////////////////////
// / END OF CUSTOM NAMESPACE TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF CONTENT TAB///
// /
wContentTab = new CTabItem(wTabFolder, SWT.NONE);
wContentTab.setText(BaseMessages.getString(PKG, "RssOutputDialog.ContentTab.TabTitle"));
FormLayout contentLayout = new FormLayout();
contentLayout.marginWidth = 3;
contentLayout.marginHeight = 3;
wContentComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wContentComp);
wContentComp.setLayout(contentLayout);
// File grouping?
// ////////////////////////
// START OF FileName GROUP
//
wFileName = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wFileName);
wFileName.setText(BaseMessages.getString(PKG, "RssOutputDialog.Group.File.Label"));
FormLayout groupFileLayout = new FormLayout();
groupFileLayout.marginWidth = 10;
groupFileLayout.marginHeight = 10;
wFileName.setLayout(groupFileLayout);
// Filename line
wlFilename = new Label(wFileName, SWT.RIGHT);
wlFilename.setText(BaseMessages.getString(PKG, "RssOutputDialog.Filename.Label"));
props.setLook(wlFilename);
fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
fdlFilename.top = new FormAttachment(wFields, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
wbFilename = new Button(wFileName, SWT.PUSH | SWT.CENTER);
props.setLook(wbFilename);
wbFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
fdbFilename = new FormData();
fdbFilename.right = new FormAttachment(100, 0);
fdbFilename.top = new FormAttachment(wFields, 0);
wbFilename.setLayoutData(fdbFilename);
wFilename = new TextVar(transMeta, wFileName, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wFilename);
wFilename.addModifyListener(lsMod);
fdFilename = new FormData();
fdFilename.left = new FormAttachment(middle, 0);
fdFilename.top = new FormAttachment(wFields, margin);
fdFilename.right = new FormAttachment(wbFilename, -margin);
wFilename.setLayoutData(fdFilename);
// Create Parent Folder
wlCreateParentFolder = new Label(wFileName, SWT.RIGHT);
wlCreateParentFolder.setText(BaseMessages.getString(PKG, "RssOutputDialog.CreateParentFolder.Label"));
props.setLook(wlCreateParentFolder);
fdlCreateParentFolder = new FormData();
fdlCreateParentFolder.left = new FormAttachment(0, 0);
fdlCreateParentFolder.top = new FormAttachment(wFilename, margin);
fdlCreateParentFolder.right = new FormAttachment(middle, -margin);
wlCreateParentFolder.setLayoutData(fdlCreateParentFolder);
wCreateParentFolder = new Button(wFileName, SWT.CHECK);
wCreateParentFolder.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.CreateParentFolder.Tooltip"));
props.setLook(wCreateParentFolder);
fdCreateParentFolder = new FormData();
fdCreateParentFolder.left = new FormAttachment(middle, 0);
fdCreateParentFolder.top = new FormAttachment(wFilename, margin);
fdCreateParentFolder.right = new FormAttachment(100, 0);
wCreateParentFolder.setLayoutData(fdCreateParentFolder);
wCreateParentFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// FileName defined in a field
wlFileNameInField = new Label(wFileName, SWT.RIGHT);
wlFileNameInField.setText(BaseMessages.getString(PKG, "RssOutputDialog.FileNameInField.Label"));
props.setLook(wlFileNameInField);
fdlFileNameInField = new FormData();
fdlFileNameInField.left = new FormAttachment(0, 0);
fdlFileNameInField.top = new FormAttachment(wCreateParentFolder, margin);
fdlFileNameInField.right = new FormAttachment(middle, -margin);
wlFileNameInField.setLayoutData(fdlFileNameInField);
wFileNameInField = new Button(wFileName, SWT.CHECK);
wFileNameInField.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.FileNameInField.Tooltip"));
props.setLook(wFileNameInField);
fdFileNameInField = new FormData();
fdFileNameInField.left = new FormAttachment(middle, 0);
fdFileNameInField.top = new FormAttachment(wCreateParentFolder, margin);
fdFileNameInField.right = new FormAttachment(100, 0);
wFileNameInField.setLayoutData(fdFileNameInField);
wFileNameInField.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setFieldFilename();
input.setChanged();
}
});
// FieldFieldFileName line
wlFieldFilename = new Label(wFileName, SWT.RIGHT);
wlFieldFilename.setText(BaseMessages.getString(PKG, "RssOutputDialog.FieldFilename.Label"));
props.setLook(wlFieldFilename);
fdlFieldFilename = new FormData();
fdlFieldFilename.left = new FormAttachment(0, 0);
fdlFieldFilename.top = new FormAttachment(wFileNameInField, margin);
fdlFieldFilename.right = new FormAttachment(middle, -margin);
wlFieldFilename.setLayoutData(fdlFieldFilename);
wFieldFilename = new CCombo(wFileName, SWT.BORDER | SWT.READ_ONLY);
wFieldFilename.setEditable(true);
wFieldFilename.setItems(fieldNames);
props.setLook(wFieldFilename);
wFieldFilename.addModifyListener(lsMod);
fdFieldFilename = new FormData();
fdFieldFilename.left = new FormAttachment(middle, 0);
fdFieldFilename.top = new FormAttachment(wFileNameInField, margin);
fdFieldFilename.right = new FormAttachment(100, -margin);
wFieldFilename.setLayoutData(fdFieldFilename);
// Extension line
wlExtension = new Label(wFileName, SWT.RIGHT);
wlExtension.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
props.setLook(wlExtension);
fdlExtension = new FormData();
fdlExtension.left = new FormAttachment(0, 0);
fdlExtension.top = new FormAttachment(wFieldFilename, margin);
fdlExtension.right = new FormAttachment(middle, -margin);
wlExtension.setLayoutData(fdlExtension);
wExtension = new TextVar(transMeta, wFileName, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wExtension);
wExtension.addModifyListener(lsMod);
fdExtension = new FormData();
fdExtension.left = new FormAttachment(middle, 0);
fdExtension.top = new FormAttachment(wFieldFilename, margin);
fdExtension.right = new FormAttachment(100, -margin);
wExtension.setLayoutData(fdExtension);
// Create multi-part file?
wlAddStepnr = new Label(wFileName, SWT.RIGHT);
wlAddStepnr.setText(BaseMessages.getString(PKG, "RssOutputDialog.AddStepnr.Label"));
props.setLook(wlAddStepnr);
fdlAddStepnr = new FormData();
fdlAddStepnr.left = new FormAttachment(0, 0);
fdlAddStepnr.top = new FormAttachment(wExtension, 2 * margin);
fdlAddStepnr.right = new FormAttachment(middle, -margin);
wlAddStepnr.setLayoutData(fdlAddStepnr);
wAddStepnr = new Button(wFileName, SWT.CHECK);
props.setLook(wAddStepnr);
fdAddStepnr = new FormData();
fdAddStepnr.left = new FormAttachment(middle, 0);
fdAddStepnr.top = new FormAttachment(wExtension, 2 * margin);
fdAddStepnr.right = new FormAttachment(100, 0);
wAddStepnr.setLayoutData(fdAddStepnr);
wAddStepnr.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// Create multi-part file?
wlAddDate = new Label(wFileName, SWT.RIGHT);
wlAddDate.setText(BaseMessages.getString(PKG, "RssOutputDialog.AddDate.Label"));
props.setLook(wlAddDate);
fdlAddDate = new FormData();
fdlAddDate.left = new FormAttachment(0, 0);
fdlAddDate.top = new FormAttachment(wAddStepnr, margin);
fdlAddDate.right = new FormAttachment(middle, -margin);
wlAddDate.setLayoutData(fdlAddDate);
wAddDate = new Button(wFileName, SWT.CHECK);
props.setLook(wAddDate);
fdAddDate = new FormData();
fdAddDate.left = new FormAttachment(middle, 0);
fdAddDate.top = new FormAttachment(wAddStepnr, margin);
fdAddDate.right = new FormAttachment(100, 0);
wAddDate.setLayoutData(fdAddDate);
wAddDate.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
// System.out.println("wAddDate.getSelection()="+wAddDate.getSelection());
}
});
// Create multi-part file?
wlAddTime = new Label(wFileName, SWT.RIGHT);
wlAddTime.setText(BaseMessages.getString(PKG, "RssOutputDialog.AddTime.Label"));
props.setLook(wlAddTime);
fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
fdlAddTime.top = new FormAttachment(wAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(wFileName, SWT.CHECK);
props.setLook(wAddTime);
fdAddTime = new FormData();
fdAddTime.left = new FormAttachment(middle, 0);
fdAddTime.top = new FormAttachment(wAddDate, margin);
fdAddTime.right = new FormAttachment(100, 0);
wAddTime.setLayoutData(fdAddTime);
wAddTime.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
wbShowFiles = new Button(wFileName, SWT.PUSH | SWT.CENTER);
props.setLook(wbShowFiles);
wbShowFiles.setText(BaseMessages.getString(PKG, "RssOutputDialog.ShowFiles.Button"));
fdbShowFiles = new FormData();
fdbShowFiles.left = new FormAttachment(middle, 0);
fdbShowFiles.top = new FormAttachment(wAddTime, margin * 2);
wbShowFiles.setLayoutData(fdbShowFiles);
wbShowFiles.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
RssOutputMeta tfoi = new RssOutputMeta();
getInfo(tfoi);
try {
String[] files = tfoi.getFiles(transMeta);
if (files != null && files.length > 0) {
EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, BaseMessages.getString(PKG, "RssOutputDialog.SelectOutputFiles.DialogTitle"), BaseMessages.getString(PKG, "RssOutputDialog.SelectOutputFiles.DialogMessage"));
esd.setViewOnly();
esd.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "RssOutputDialog.NoFilesFound.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "System.DialogTitle.Error"));
mb.open();
}
} catch (KettleStepException s) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "RssOutputDialog.ErrorGettingFiles.DialogMessage", s.getMessage()));
mb.setText(BaseMessages.getString(PKG, "System.DialogTitle.Error"));
mb.open();
}
}
});
fdFileName = new FormData();
fdFileName.left = new FormAttachment(0, margin);
fdFileName.top = new FormAttachment(wFields, margin);
fdFileName.right = new FormAttachment(100, -margin);
wFileName.setLayoutData(fdFileName);
// ///////////////////////////////////////////////////////////
// / END OF FileName GROUP
// ///////////////////////////////////////////////////////////
// File grouping?
// ////////////////////////
// START OF ResultFile GROUP
//
wResultFile = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wResultFile);
wResultFile.setText(BaseMessages.getString(PKG, "RssOutputDialog.Group.ResultFile.Label"));
FormLayout groupResultFile = new FormLayout();
groupResultFile.marginWidth = 10;
groupResultFile.marginHeight = 10;
wResultFile.setLayout(groupResultFile);
// Add File to the result files name
wlAddToResult = new Label(wResultFile, SWT.RIGHT);
wlAddToResult.setText(BaseMessages.getString(PKG, "RssOutputDialog.AddFileToResult.Label"));
props.setLook(wlAddToResult);
fdlAddToResult = new FormData();
fdlAddToResult.left = new FormAttachment(0, 0);
fdlAddToResult.top = new FormAttachment(wFileName, margin);
fdlAddToResult.right = new FormAttachment(middle, -margin);
wlAddToResult.setLayoutData(fdlAddToResult);
wAddToResult = new Button(wResultFile, SWT.CHECK);
wAddToResult.setToolTipText(BaseMessages.getString(PKG, "RssOutputDialog.AddFileToResult.Tooltip"));
props.setLook(wAddToResult);
fdAddToResult = new FormData();
fdAddToResult.left = new FormAttachment(middle, 0);
fdAddToResult.top = new FormAttachment(wFileName, margin);
fdAddToResult.right = new FormAttachment(100, 0);
wAddToResult.setLayoutData(fdAddToResult);
SelectionAdapter lsSelAR = new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
input.setChanged();
}
};
wAddToResult.addSelectionListener(lsSelAR);
fdResultFile = new FormData();
fdResultFile.left = new FormAttachment(0, margin);
fdResultFile.top = new FormAttachment(wFileName, margin);
fdResultFile.right = new FormAttachment(100, -margin);
wResultFile.setLayoutData(fdResultFile);
// ///////////////////////////////////////////////////////////
// / END OF ResultFile GROUP
// ///////////////////////////////////////////////////////////
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(wContentComp);
wContentComp.layout();
wContentTab.setControl(wContentComp);
// ///////////////////////////////////////////////////////////
// / END OF CONTENT TAB
// ///////////////////////////////////////////////////////////
fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
fdTabFolder.top = new FormAttachment(wStepname, margin);
fdTabFolder.right = new FormAttachment(100, 0);
fdTabFolder.bottom = new FormAttachment(100, -50);
wTabFolder.setLayoutData(fdTabFolder);
// Add listeners
lsOK = new Listener() {
public void handleEvent(Event e) {
ok();
}
};
lsCancel = new Listener() {
public void handleEvent(Event e) {
cancel();
}
};
lsGet = new Listener() {
public void handleEvent(Event e) {
get(wChannelCustom);
}
};
lsGetCustomItem = new Listener() {
public void handleEvent(Event e) {
get(wItemCustom);
}
};
wOK.addListener(SWT.Selection, lsOK);
wCancel.addListener(SWT.Selection, lsCancel);
wGet.addListener(SWT.Selection, lsGet);
wGetCustomItem.addListener(SWT.Selection, lsGetCustomItem);
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
wbFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(shell, SWT.SAVE);
dialog.setFilterExtensions(new String[] { "*.txt", "*.TXT", "*" });
if (wFilename.getText() != null) {
dialog.setFileName(transMeta.environmentSubstitute(wFilename.getText()));
}
dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "System.FileType.TextFiles"), BaseMessages.getString(PKG, "System.FileType.CSVFiles"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
if (dialog.open() != null) {
String extension = wExtension.getText();
if (extension != null && dialog.getFileName() != null && dialog.getFileName().endsWith("." + extension)) {
// The extension is filled in and matches the end
// of the selected file => Strip off the extension.
String fileName = dialog.getFileName();
wFilename.setText(dialog.getFilterPath() + System.getProperty("file.separator") + fileName.substring(0, fileName.length() - (extension.length() + 1)));
} else {
wFilename.setText(dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName());
}
}
}
});
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
cancel();
}
});
lsResize = new Listener() {
public void handleEvent(Event event) {
// Point size = shell.getSize();
}
};
shell.addListener(SWT.Resize, lsResize);
wTabFolder.setSelection(0);
// Set the shell size, based upon previous time...
setSize();
getData();
setCustomRSS();
setFieldFilename();
setImage();
activateGeoRSS();
// backupChanged);
input.setChanged(changed);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return stepname;
}
use of org.pentaho.di.ui.core.dialog.EnterSelectionDialog in project pentaho-kettle by pentaho.
the class InsertUpdateDialog method getSchemaNames.
private void getSchemaNames() {
DatabaseMeta databaseMeta = transMeta.findDatabase(wConnection.getText());
if (databaseMeta != null) {
Database database = new Database(loggingObject, databaseMeta);
try {
database.connect();
String[] schemas = database.getSchemas();
if (null != schemas && schemas.length > 0) {
schemas = Const.sortStrings(schemas);
EnterSelectionDialog dialog = new EnterSelectionDialog(shell, schemas, BaseMessages.getString(PKG, "InsertUpDateDialog.AvailableSchemas.Title", wConnection.getText()), BaseMessages.getString(PKG, "InsertUpDateDialog.AvailableSchemas.Message", wConnection.getText()));
String d = dialog.open();
if (d != null) {
wSchema.setText(Const.NVL(d, ""));
setTableFieldCombo();
}
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "InsertUpDateDialog.NoSchema.Error"));
mb.setText(BaseMessages.getString(PKG, "InsertUpDateDialog.GetSchemas.Error"));
mb.open();
}
} catch (Exception e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "InsertUpDateDialog.ErrorGettingSchemas"), e);
} finally {
database.disconnect();
}
}
}
use of org.pentaho.di.ui.core.dialog.EnterSelectionDialog in project pentaho-kettle by pentaho.
the class LoadFileInputDialog method open.
public String open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
props.setLook(shell);
setShellImage(shell, input);
lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
input.setChanged();
}
};
changed = input.hasChanged();
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.DialogTitle"));
middle = props.getMiddlePct();
margin = Const.MARGIN;
// Stepname line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
props.setLook(wlStepname);
fdlStepname = new FormData();
fdlStepname.left = new FormAttachment(0, 0);
fdlStepname.top = new FormAttachment(0, margin);
fdlStepname.right = new FormAttachment(middle, -margin);
wlStepname.setLayoutData(fdlStepname);
wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wStepname.setText(stepname);
props.setLook(wStepname);
wStepname.addModifyListener(lsMod);
fdStepname = new FormData();
fdStepname.left = new FormAttachment(middle, 0);
fdStepname.top = new FormAttachment(0, margin);
fdStepname.right = new FormAttachment(100, 0);
wStepname.setLayoutData(fdStepname);
wTabFolder = new CTabFolder(shell, SWT.BORDER);
props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
// ////////////////////////
// START OF FILE TAB ///
// ////////////////////////
wFileTab = new CTabItem(wTabFolder, SWT.NONE);
wFileTab.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.File.Tab"));
wFileComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wFileComp);
FormLayout fileLayout = new FormLayout();
fileLayout.marginWidth = 3;
fileLayout.marginHeight = 3;
wFileComp.setLayout(fileLayout);
// ///////////////////////////////
// START OF Output Field GROUP //
// ///////////////////////////////
wOutputField = new Group(wFileComp, SWT.SHADOW_NONE);
props.setLook(wOutputField);
wOutputField.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.wOutputField.Label"));
FormLayout outputfieldgroupLayout = new FormLayout();
outputfieldgroupLayout.marginWidth = 10;
outputfieldgroupLayout.marginHeight = 10;
wOutputField.setLayout(outputfieldgroupLayout);
// Is filename defined in a Field
wlFilenameInField = new Label(wOutputField, SWT.RIGHT);
wlFilenameInField.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameInField.Label"));
props.setLook(wlFilenameInField);
fdlFilenameInField = new FormData();
fdlFilenameInField.left = new FormAttachment(0, -margin);
fdlFilenameInField.top = new FormAttachment(0, margin);
fdlFilenameInField.right = new FormAttachment(middle, -2 * margin);
wlFilenameInField.setLayoutData(fdlFilenameInField);
wFilenameInField = new Button(wOutputField, SWT.CHECK);
props.setLook(wFilenameInField);
wFilenameInField.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameInField.Tooltip"));
fdFileNameInField = new FormData();
fdFileNameInField.left = new FormAttachment(middle, -margin);
fdFileNameInField.top = new FormAttachment(0, margin);
wFilenameInField.setLayoutData(fdFileNameInField);
SelectionAdapter lsxmlstream = new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
ActiveXmlStreamField();
input.setChanged();
}
};
wFilenameInField.addSelectionListener(lsxmlstream);
// If Filename defined in a Field
wlFilenameField = new Label(wOutputField, SWT.RIGHT);
wlFilenameField.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameField.Label"));
props.setLook(wlFilenameField);
fdlFilenameField = new FormData();
fdlFilenameField.left = new FormAttachment(0, margin);
fdlFilenameField.top = new FormAttachment(wFilenameInField, margin);
fdlFilenameField.right = new FormAttachment(middle, -2 * margin);
wlFilenameField.setLayoutData(fdlFilenameField);
wFilenameField = new CCombo(wOutputField, SWT.BORDER | SWT.READ_ONLY);
wFilenameField.setEditable(true);
props.setLook(wFilenameField);
wFilenameField.addModifyListener(lsMod);
fdXMLField = new FormData();
fdXMLField.left = new FormAttachment(middle, -margin);
fdXMLField.top = new FormAttachment(wFilenameInField, margin);
fdXMLField.right = new FormAttachment(100, -margin);
wFilenameField.setLayoutData(fdXMLField);
wFilenameField.addFocusListener(new FocusListener() {
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
}
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
setDynamicFilenameField();
}
});
fdOutputField = new FormData();
fdOutputField.left = new FormAttachment(0, margin);
fdOutputField.top = new FormAttachment(wFilenameList, margin);
fdOutputField.right = new FormAttachment(100, -margin);
wOutputField.setLayoutData(fdOutputField);
// ///////////////////////////////////////////////////////////
// / END OF Output Field GROUP
// ///////////////////////////////////////////////////////////
middle = middle / 2;
// Filename line
wlFilename = new Label(wFileComp, SWT.RIGHT);
wlFilename.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.Filename.Label"));
props.setLook(wlFilename);
fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
fdlFilename.top = new FormAttachment(wOutputField, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
wbbFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbbFilename);
wbbFilename.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameBrowse.Button"));
wbbFilename.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForFileOrDirAndAdd"));
fdbFilename = new FormData();
fdbFilename.right = new FormAttachment(100, 0);
fdbFilename.top = new FormAttachment(wOutputField, margin);
wbbFilename.setLayoutData(fdbFilename);
wbaFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbaFilename);
wbaFilename.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameAdd.Button"));
wbaFilename.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameAdd.Tooltip"));
fdbaFilename = new FormData();
fdbaFilename.right = new FormAttachment(wbbFilename, -margin);
fdbaFilename.top = new FormAttachment(wOutputField, margin);
wbaFilename.setLayoutData(fdbaFilename);
wFilename = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wFilename);
wFilename.addModifyListener(lsMod);
fdFilename = new FormData();
fdFilename.left = new FormAttachment(middle, 0);
fdFilename.right = new FormAttachment(wbaFilename, -margin);
fdFilename.top = new FormAttachment(wOutputField, margin);
wFilename.setLayoutData(fdFilename);
wlFilemask = new Label(wFileComp, SWT.RIGHT);
wlFilemask.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.RegExp.Label"));
props.setLook(wlFilemask);
fdlFilemask = new FormData();
fdlFilemask.left = new FormAttachment(0, 0);
fdlFilemask.top = new FormAttachment(wFilename, 2 * margin);
fdlFilemask.right = new FormAttachment(middle, -margin);
wlFilemask.setLayoutData(fdlFilemask);
wFilemask = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wFilemask);
wFilemask.addModifyListener(lsMod);
fdFilemask = new FormData();
fdFilemask.left = new FormAttachment(middle, 0);
fdFilemask.top = new FormAttachment(wFilename, 2 * margin);
fdFilemask.right = new FormAttachment(100, 0);
wFilemask.setLayoutData(fdFilemask);
wlExcludeFilemask = new Label(wFileComp, SWT.RIGHT);
wlExcludeFilemask.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.ExcludeFilemask.Label"));
props.setLook(wlExcludeFilemask);
fdlExcludeFilemask = new FormData();
fdlExcludeFilemask.left = new FormAttachment(0, 0);
fdlExcludeFilemask.top = new FormAttachment(wFilemask, margin);
fdlExcludeFilemask.right = new FormAttachment(middle, -margin);
wlExcludeFilemask.setLayoutData(fdlExcludeFilemask);
wExcludeFilemask = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wExcludeFilemask);
wExcludeFilemask.addModifyListener(lsMod);
fdExcludeFilemask = new FormData();
fdExcludeFilemask.left = new FormAttachment(middle, 0);
fdExcludeFilemask.top = new FormAttachment(wFilemask, margin);
fdExcludeFilemask.right = new FormAttachment(wFilename, 0, SWT.RIGHT);
wExcludeFilemask.setLayoutData(fdExcludeFilemask);
// Filename list line
wlFilenameList = new Label(wFileComp, SWT.RIGHT);
wlFilenameList.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameList.Label"));
props.setLook(wlFilenameList);
fdlFilenameList = new FormData();
fdlFilenameList.left = new FormAttachment(0, 0);
fdlFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
fdlFilenameList.right = new FormAttachment(middle, -margin);
wlFilenameList.setLayoutData(fdlFilenameList);
// Buttons to the right of the screen...
wbdFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbdFilename);
wbdFilename.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameRemove.Label"));
wbdFilename.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameRemove.Tooltip"));
fdbdFilename = new FormData();
fdbdFilename.right = new FormAttachment(100, 0);
fdbdFilename.top = new FormAttachment(wExcludeFilemask, 40);
wbdFilename.setLayoutData(fdbdFilename);
wbeFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbeFilename);
wbeFilename.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameEdit.Label"));
wbeFilename.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.FilenameEdit.Tooltip"));
fdbeFilename = new FormData();
fdbeFilename.right = new FormAttachment(100, 0);
fdbeFilename.top = new FormAttachment(wbdFilename, margin);
wbeFilename.setLayoutData(fdbeFilename);
wbShowFiles = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbShowFiles);
wbShowFiles.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.ShowFiles.Button"));
fdbShowFiles = new FormData();
fdbShowFiles.left = new FormAttachment(middle, 0);
fdbShowFiles.bottom = new FormAttachment(100, 0);
wbShowFiles.setLayoutData(fdbShowFiles);
ColumnInfo[] colinfo = new ColumnInfo[5];
colinfo[0] = new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.Files.Filename.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
colinfo[1] = new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.Files.Wildcard.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
colinfo[2] = new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.Files.ExcludeWildcard.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
colinfo[0].setUsingVariables(true);
colinfo[1].setUsingVariables(true);
colinfo[1].setToolTip(BaseMessages.getString(PKG, "LoadFileInputDialog.Files.Wildcard.Tooltip"));
colinfo[2].setUsingVariables(true);
colinfo[2].setToolTip(BaseMessages.getString(PKG, "LoadFileInputDialog.Files.ExcludeWildcard.Tooltip"));
colinfo[3] = new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.Required.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO);
colinfo[3].setToolTip(BaseMessages.getString(PKG, "LoadFileInputDialog.Required.Tooltip"));
colinfo[4] = new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.IncludeSubDirs.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO);
colinfo[4].setToolTip(BaseMessages.getString(PKG, "LoadFileInputDialog.IncludeSubDirs.Tooltip"));
wFilenameList = new TableView(transMeta, wFileComp, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER, colinfo, 2, lsMod, props);
props.setLook(wFilenameList);
fdFilenameList = new FormData();
fdFilenameList.left = new FormAttachment(middle, 0);
fdFilenameList.right = new FormAttachment(wbdFilename, -margin);
fdFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
fdFilenameList.bottom = new FormAttachment(wbShowFiles, -margin);
wFilenameList.setLayoutData(fdFilenameList);
fdFileComp = new FormData();
fdFileComp.left = new FormAttachment(0, 0);
fdFileComp.top = new FormAttachment(0, 0);
fdFileComp.right = new FormAttachment(100, 0);
fdFileComp.bottom = new FormAttachment(100, 0);
wFileComp.setLayoutData(fdFileComp);
wFileComp.layout();
wFileTab.setControl(wFileComp);
// ///////////////////////////////////////////////////////////
// / END OF FILE TAB
// ///////////////////////////////////////////////////////////
middle = props.getMiddlePct();
// ////////////////////////
// START OF CONTENT TAB///
// /
wContentTab = new CTabItem(wTabFolder, SWT.NONE);
wContentTab.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.Content.Tab"));
FormLayout contentLayout = new FormLayout();
contentLayout.marginWidth = 3;
contentLayout.marginHeight = 3;
wContentComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wContentComp);
wContentComp.setLayout(contentLayout);
// ///////////////////////////////
// START OF FileConf Field GROUP //
// ///////////////////////////////
wFileConf = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wFileConf);
wFileConf.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.FileConf.Label"));
FormLayout XmlConfgroupLayout = new FormLayout();
XmlConfgroupLayout.marginWidth = 10;
XmlConfgroupLayout.marginHeight = 10;
wFileConf.setLayout(XmlConfgroupLayout);
wlEncoding = new Label(wFileConf, SWT.RIGHT);
wlEncoding.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.Encoding.Label"));
props.setLook(wlEncoding);
fdlEncoding = new FormData();
fdlEncoding.left = new FormAttachment(0, 0);
fdlEncoding.top = new FormAttachment(0, margin);
fdlEncoding.right = new FormAttachment(middle, -margin);
wlEncoding.setLayoutData(fdlEncoding);
wEncoding = new CCombo(wFileConf, 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(0, 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) {
setEncodings();
}
});
// Ignore Empty File
wlIgnoreEmptyFile = new Label(wFileConf, SWT.RIGHT);
wlIgnoreEmptyFile.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.IgnoreEmptyFile.Label"));
props.setLook(wlIgnoreEmptyFile);
fdlIgnoreEmptyFile = new FormData();
fdlIgnoreEmptyFile.left = new FormAttachment(0, 0);
fdlIgnoreEmptyFile.top = new FormAttachment(wEncoding, margin);
fdlIgnoreEmptyFile.right = new FormAttachment(middle, -margin);
wlIgnoreEmptyFile.setLayoutData(fdlIgnoreEmptyFile);
wIgnoreEmptyFile = new Button(wFileConf, SWT.CHECK);
props.setLook(wIgnoreEmptyFile);
wIgnoreEmptyFile.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.IgnoreEmptyFile.Tooltip"));
fdIgnoreEmptyFile = new FormData();
fdIgnoreEmptyFile.left = new FormAttachment(middle, 0);
fdIgnoreEmptyFile.top = new FormAttachment(wEncoding, margin);
wIgnoreEmptyFile.setLayoutData(fdIgnoreEmptyFile);
wIgnoreEmptyFile.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// Ignore missing path
wlIgnoreMissingPath = new Label(wFileConf, SWT.RIGHT);
wlIgnoreMissingPath.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.IgnoreMissingPath.Label"));
props.setLook(wlIgnoreMissingPath);
fdlIgnoreMissingPath = new FormData();
fdlIgnoreMissingPath.left = new FormAttachment(0, 0);
fdlIgnoreMissingPath.top = new FormAttachment(wIgnoreEmptyFile, margin);
fdlIgnoreMissingPath.right = new FormAttachment(middle, -margin);
wlIgnoreMissingPath.setLayoutData(fdlIgnoreMissingPath);
wIgnoreMissingPath = new Button(wFileConf, SWT.CHECK);
props.setLook(wIgnoreMissingPath);
wIgnoreMissingPath.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.IgnoreMissingPath.Tooltip"));
fdIgnoreMissingPath = new FormData();
fdIgnoreMissingPath.left = new FormAttachment(middle, 0);
fdIgnoreMissingPath.top = new FormAttachment(wIgnoreEmptyFile, margin);
wIgnoreMissingPath.setLayoutData(fdIgnoreMissingPath);
wIgnoreMissingPath.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// preview limit
wlLimit = new Label(wFileConf, SWT.RIGHT);
wlLimit.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.Limit.Label"));
props.setLook(wlLimit);
fdlLimit = new FormData();
fdlLimit.left = new FormAttachment(0, 0);
fdlLimit.top = new FormAttachment(wIgnoreMissingPath, margin);
fdlLimit.right = new FormAttachment(middle, -margin);
wlLimit.setLayoutData(fdlLimit);
wLimit = new Text(wFileConf, 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(wIgnoreMissingPath, margin);
fdLimit.right = new FormAttachment(100, 0);
wLimit.setLayoutData(fdLimit);
fdXmlConf = new FormData();
fdXmlConf.left = new FormAttachment(0, margin);
fdXmlConf.top = new FormAttachment(0, margin);
fdXmlConf.right = new FormAttachment(100, -margin);
wFileConf.setLayoutData(fdXmlConf);
// ///////////////////////////////////////////////////////////
// / END OF XmlConf Field GROUP
// ///////////////////////////////////////////////////////////
// ///////////////////////////////
// START OF Additional Fields GROUP //
// ///////////////////////////////
wAdditionalFields = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wAdditionalFields);
wAdditionalFields.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.wAdditionalFields.Label"));
FormLayout AdditionalFieldsgroupLayout = new FormLayout();
AdditionalFieldsgroupLayout.marginWidth = 10;
AdditionalFieldsgroupLayout.marginHeight = 10;
wAdditionalFields.setLayout(AdditionalFieldsgroupLayout);
wlInclFilename = new Label(wAdditionalFields, SWT.RIGHT);
wlInclFilename.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.InclFilename.Label"));
props.setLook(wlInclFilename);
fdlInclFilename = new FormData();
fdlInclFilename.left = new FormAttachment(0, 0);
fdlInclFilename.top = new FormAttachment(wFileConf, 4 * margin);
fdlInclFilename.right = new FormAttachment(middle, -margin);
wlInclFilename.setLayoutData(fdlInclFilename);
wInclFilename = new Button(wAdditionalFields, SWT.CHECK);
props.setLook(wInclFilename);
wInclFilename.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.InclFilename.Tooltip"));
fdInclFilename = new FormData();
fdInclFilename.left = new FormAttachment(middle, 0);
fdInclFilename.top = new FormAttachment(wFileConf, 4 * margin);
wInclFilename.setLayoutData(fdInclFilename);
wlInclFilenameField = new Label(wAdditionalFields, SWT.LEFT);
wlInclFilenameField.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.InclFilenameField.Label"));
props.setLook(wlInclFilenameField);
fdlInclFilenameField = new FormData();
fdlInclFilenameField.left = new FormAttachment(wInclFilename, margin);
fdlInclFilenameField.top = new FormAttachment(wLimit, 4 * margin);
wlInclFilenameField.setLayoutData(fdlInclFilenameField);
wInclFilenameField = new TextVar(transMeta, wAdditionalFields, 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(wLimit, 4 * margin);
fdInclFilenameField.right = new FormAttachment(100, 0);
wInclFilenameField.setLayoutData(fdInclFilenameField);
wlInclRownum = new Label(wAdditionalFields, SWT.RIGHT);
wlInclRownum.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.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(wAdditionalFields, SWT.CHECK);
props.setLook(wInclRownum);
wInclRownum.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.InclRownum.Tooltip"));
fdRownum = new FormData();
fdRownum.left = new FormAttachment(middle, 0);
fdRownum.top = new FormAttachment(wInclFilenameField, margin);
wInclRownum.setLayoutData(fdRownum);
wlInclRownumField = new Label(wAdditionalFields, SWT.RIGHT);
wlInclRownumField.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.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 TextVar(transMeta, wAdditionalFields, 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);
fdAdditionalFields = new FormData();
fdAdditionalFields.left = new FormAttachment(0, margin);
fdAdditionalFields.top = new FormAttachment(wFileConf, margin);
fdAdditionalFields.right = new FormAttachment(100, -margin);
wAdditionalFields.setLayoutData(fdAdditionalFields);
// ///////////////////////////////////////////////////////////
// / END OF Additional Fields GROUP
// ///////////////////////////////////////////////////////////
// ///////////////////////////////
// START OF AddFileResult GROUP //
// ///////////////////////////////
wAddFileResult = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wAddFileResult);
wAddFileResult.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.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, "LoadFileInputDialog.AddResult.Label"));
props.setLook(wlAddResult);
fdlAddResult = new FormData();
fdlAddResult.left = new FormAttachment(0, 0);
fdlAddResult.top = new FormAttachment(wAdditionalFields, margin);
fdlAddResult.right = new FormAttachment(middle, -margin);
wlAddResult.setLayoutData(fdlAddResult);
wAddResult = new Button(wAddFileResult, SWT.CHECK);
props.setLook(wAddResult);
wAddResult.setToolTipText(BaseMessages.getString(PKG, "LoadFileInputDialog.AddResult.Tooltip"));
fdAddResult = new FormData();
fdAddResult.left = new FormAttachment(middle, 0);
fdAddResult.top = new FormAttachment(wAdditionalFields, margin);
wAddResult.setLayoutData(fdAddResult);
wAddResult.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
fdAddFileResult = new FormData();
fdAddFileResult.left = new FormAttachment(0, margin);
fdAddFileResult.top = new FormAttachment(wAdditionalFields, margin);
fdAddFileResult.right = new FormAttachment(100, -margin);
wAddFileResult.setLayoutData(fdAddFileResult);
// ///////////////////////////////////////////////////////////
// / END OF AddFileResult GROUP
// ///////////////////////////////////////////////////////////
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);
wContentComp.layout();
wContentTab.setControl(wContentComp);
// ///////////////////////////////////////////////////////////
// / END OF CONTENT TAB
// ///////////////////////////////////////////////////////////
// Fields tab...
//
wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
wFieldsTab.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.Fields.Tab"));
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, "LoadFileInputDialog.GetFields.Button"));
fdGet = new FormData();
fdGet.left = new FormAttachment(50, 0);
fdGet.bottom = new FormAttachment(100, 0);
wGet.setLayoutData(fdGet);
final int FieldsRows = input.getInputFields().length;
ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Name.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Element.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, org.pentaho.di.trans.steps.loadfileinput.LoadFileInputField.ElementTypeDesc, true), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Type.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames(), true), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Format.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getConversionFormats()), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Length.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Precision.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Currency.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Decimal.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Group.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.TrimType.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, LoadFileInputField.trimTypeDesc, true), new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Repeat.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { BaseMessages.getString(PKG, "System.Combo.Yes"), BaseMessages.getString(PKG, "System.Combo.No") }, true) };
colinf[0].setUsingVariables(true);
colinf[0].setToolTip(BaseMessages.getString(PKG, "LoadFileInputDialog.FieldsTable.Name.Column.Tooltip"));
colinfo[2] = new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.Required.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO);
colinfo[2].setToolTip(BaseMessages.getString(PKG, "LoadFileInputDialog.Required.Tooltip"));
colinfo[3] = new ColumnInfo(BaseMessages.getString(PKG, "LoadFileInputDialog.IncludeSubDirs.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO);
colinfo[3].setToolTip(BaseMessages.getString(PKG, "LoadFileInputDialog.IncludeSubDirs.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);
addAdditionalFieldsTab();
fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
fdTabFolder.top = new FormAttachment(wStepname, margin);
fdTabFolder.right = new FormAttachment(100, 0);
fdTabFolder.bottom = new FormAttachment(100, -50);
wTabFolder.setLayoutData(fdTabFolder);
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wPreview = new Button(shell, SWT.PUSH);
wPreview.setText(BaseMessages.getString(PKG, "LoadFileInputDialog.Button.PreviewRows"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
setButtonPositions(new Button[] { wOK, wPreview, wCancel }, margin, wTabFolder);
// Add listeners
lsOK = new Listener() {
public void handleEvent(Event e) {
ok();
}
};
lsGet = new Listener() {
public void handleEvent(Event e) {
get();
}
};
lsPreview = new Listener() {
public void handleEvent(Event e) {
preview();
}
};
lsCancel = new Listener() {
public void handleEvent(Event e) {
cancel();
}
};
wOK.addListener(SWT.Selection, lsOK);
wGet.addListener(SWT.Selection, lsGet);
wPreview.addListener(SWT.Selection, lsPreview);
wCancel.addListener(SWT.Selection, lsCancel);
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
wLimit.addSelectionListener(lsDef);
wInclRownumField.addSelectionListener(lsDef);
wInclFilenameField.addSelectionListener(lsDef);
// Add the file to the list of files...
SelectionAdapter selA = new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
wFilenameList.add(new String[] { wFilename.getText(), wFilemask.getText(), wExcludeFilemask.getText(), LoadFileInputMeta.RequiredFilesCode[0], LoadFileInputMeta.RequiredFilesCode[0] });
wFilename.setText("");
wFilemask.setText("");
wExcludeFilemask.setText("");
wFilenameList.removeEmptyRows();
wFilenameList.setRowNums();
wFilenameList.optWidth(true);
}
};
wbaFilename.addSelectionListener(selA);
wFilename.addSelectionListener(selA);
// Delete files from the list of files...
wbdFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
int[] idx = wFilenameList.getSelectionIndices();
wFilenameList.remove(idx);
wFilenameList.removeEmptyRows();
wFilenameList.setRowNums();
}
});
// Edit the selected file & remove from the list...
wbeFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
int idx = wFilenameList.getSelectionIndex();
if (idx >= 0) {
String[] string = wFilenameList.getItem(idx);
wFilename.setText(string[0]);
wFilemask.setText(string[1]);
wExcludeFilemask.setText(string[2]);
wFilenameList.remove(idx);
}
wFilenameList.removeEmptyRows();
wFilenameList.setRowNums();
}
});
// Show the files that are selected at this time...
wbShowFiles.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
try {
LoadFileInputMeta tfii = new LoadFileInputMeta();
getInfo(tfii);
FileInputList fileInputList = tfii.getFiles(transMeta);
String[] files = fileInputList.getFileStrings();
if (files != null && files.length > 0) {
EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, BaseMessages.getString(PKG, "LoadFileInputDialog.FilesReadSelection.DialogTitle"), BaseMessages.getString(PKG, "LoadFileInputDialog.FilesReadSelection.DialogMessage"));
esd.setViewOnly();
esd.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "LoadFileInputDialog.NoFileFound.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
mb.open();
}
} catch (Exception ex) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "LoadFileInputDialog.ErrorParsingData.DialogTitle"), BaseMessages.getString(PKG, "LoadFileInputDialog.ErrorParsingData.DialogMessage"), ex);
}
}
});
// Enable/disable the right fields to allow a filename to be added to each row...
wInclFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setIncludeFilename();
input.setChanged();
}
});
// Enable/disable the right fields to allow a row number to be added to each row...
wInclRownum.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setIncludeRownum();
input.setChanged();
}
});
// Whenever something changes, set the tooltip to the expanded version of the filename:
wFilename.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
wFilename.setToolTipText(wFilename.getText());
}
});
// Listen to the Browse... button
wbbFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (!Utils.isEmpty(wFilemask.getText()) || !Utils.isEmpty(wExcludeFilemask.getText())) {
// A mask: a directory!
DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN);
if (wFilename.getText() != null) {
String fpath = transMeta.environmentSubstitute(wFilename.getText());
dialog.setFilterPath(fpath);
}
if (dialog.open() != null) {
String str = dialog.getFilterPath();
wFilename.setText(str);
}
} else {
FileDialog dialog = new FileDialog(shell, SWT.OPEN);
dialog.setFilterExtensions(new String[] { "*.txt;", "*.csv", "*.TRT", "*" });
if (wFilename.getText() != null) {
String fname = transMeta.environmentSubstitute(wFilename.getText());
dialog.setFileName(fname);
}
dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "System.FileType.TextFiles"), BaseMessages.getString(PKG, "LoadFileInputDialog.FileType.TextAndCSVFiles"), BaseMessages.getString(PKG, "LoadFileInput.FileType.TRTFiles"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
if (dialog.open() != null) {
String str = dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName();
wFilename.setText(str);
}
}
}
});
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
cancel();
}
});
wTabFolder.setSelection(0);
// Set the shell size, based upon previous time...
setSize();
getData(input);
ActiveXmlStreamField();
input.setChanged(changed);
wFields.optWidth(true);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return stepname;
}
use of org.pentaho.di.ui.core.dialog.EnterSelectionDialog in project pentaho-kettle by pentaho.
the class LDIFInputDialog method open.
public String open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
props.setLook(shell);
setShellImage(shell, input);
lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
input.setChanged();
}
};
changed = input.hasChanged();
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "LDIFInputDialog.DialogTitle"));
middle = props.getMiddlePct();
margin = Const.MARGIN;
// Stepname line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
props.setLook(wlStepname);
fdlStepname = new FormData();
fdlStepname.left = new FormAttachment(0, 0);
fdlStepname.top = new FormAttachment(0, margin);
fdlStepname.right = new FormAttachment(middle, -margin);
wlStepname.setLayoutData(fdlStepname);
wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wStepname.setText(stepname);
props.setLook(wStepname);
wStepname.addModifyListener(lsMod);
fdStepname = new FormData();
fdStepname.left = new FormAttachment(middle, 0);
fdStepname.top = new FormAttachment(0, margin);
fdStepname.right = new FormAttachment(100, 0);
wStepname.setLayoutData(fdStepname);
wTabFolder = new CTabFolder(shell, SWT.BORDER);
props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
// ////////////////////////
// START OF FILE TAB ///
// ////////////////////////
wFileTab = new CTabItem(wTabFolder, SWT.NONE);
wFileTab.setText(BaseMessages.getString(PKG, "LDIFInputDialog.File.Tab"));
wFileComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wFileComp);
FormLayout fileLayout = new FormLayout();
fileLayout.marginWidth = 3;
fileLayout.marginHeight = 3;
wFileComp.setLayout(fileLayout);
// ///////////////////////////////
// START OF Origin files GROUP //
// ///////////////////////////////
wOriginFiles = new Group(wFileComp, SWT.SHADOW_NONE);
props.setLook(wOriginFiles);
wOriginFiles.setText(BaseMessages.getString(PKG, "LDIFInputDialog.wOriginFiles.Label"));
FormLayout OriginFilesgroupLayout = new FormLayout();
OriginFilesgroupLayout.marginWidth = 10;
OriginFilesgroupLayout.marginHeight = 10;
wOriginFiles.setLayout(OriginFilesgroupLayout);
// Is Filename defined in a Field
wlFileField = new Label(wOriginFiles, SWT.RIGHT);
wlFileField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FileField.Label"));
props.setLook(wlFileField);
fdlFileField = new FormData();
fdlFileField.left = new FormAttachment(0, -margin);
fdlFileField.top = new FormAttachment(0, margin);
fdlFileField.right = new FormAttachment(middle, -2 * margin);
wlFileField.setLayoutData(fdlFileField);
wFileField = new Button(wOriginFiles, SWT.CHECK);
props.setLook(wFileField);
wFileField.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FileField.Tooltip"));
fdFileField = new FormData();
fdFileField.left = new FormAttachment(middle, -margin);
fdFileField.top = new FormAttachment(0, margin);
wFileField.setLayoutData(fdFileField);
SelectionAdapter lfilefield = new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
ActiveFileField();
input.setChanged();
}
};
wFileField.addSelectionListener(lfilefield);
// Filename field
wlFilenameField = new Label(wOriginFiles, SWT.RIGHT);
wlFilenameField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.wlFilenameField.Label"));
props.setLook(wlFilenameField);
fdlFilenameField = new FormData();
fdlFilenameField.left = new FormAttachment(0, -margin);
fdlFilenameField.top = new FormAttachment(wFileField, margin);
fdlFilenameField.right = new FormAttachment(middle, -2 * margin);
wlFilenameField.setLayoutData(fdlFilenameField);
wFilenameField = new CCombo(wOriginFiles, SWT.BORDER | SWT.READ_ONLY);
wFilenameField.setEditable(true);
props.setLook(wFilenameField);
wFilenameField.addModifyListener(lsMod);
fdFilenameField = new FormData();
fdFilenameField.left = new FormAttachment(middle, -margin);
fdFilenameField.top = new FormAttachment(wFileField, margin);
fdFilenameField.right = new FormAttachment(100, -margin);
wFilenameField.setLayoutData(fdFilenameField);
wFilenameField.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);
setFileField();
shell.setCursor(null);
busy.dispose();
}
});
fdOriginFiles = new FormData();
fdOriginFiles.left = new FormAttachment(0, margin);
fdOriginFiles.top = new FormAttachment(wFilenameList, margin);
fdOriginFiles.right = new FormAttachment(100, -margin);
wOriginFiles.setLayoutData(fdOriginFiles);
// ///////////////////////////////////////////////////////////
// / END OF Origin files GROUP
// ///////////////////////////////////////////////////////////
// Filename line
wlFilename = new Label(wFileComp, SWT.RIGHT);
wlFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Filename.Label"));
props.setLook(wlFilename);
fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
fdlFilename.top = new FormAttachment(wOriginFiles, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
wbbFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbbFilename);
wbbFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameBrowse.Button"));
wbbFilename.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForFileOrDirAndAdd"));
fdbFilename = new FormData();
fdbFilename.right = new FormAttachment(100, 0);
fdbFilename.top = new FormAttachment(wOriginFiles, margin);
wbbFilename.setLayoutData(fdbFilename);
wbaFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbaFilename);
wbaFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameAdd.Button"));
wbaFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameAdd.Tooltip"));
fdbaFilename = new FormData();
fdbaFilename.right = new FormAttachment(wbbFilename, -margin);
fdbaFilename.top = new FormAttachment(wOriginFiles, margin);
wbaFilename.setLayoutData(fdbaFilename);
wFilename = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wFilename);
wFilename.addModifyListener(lsMod);
fdFilename = new FormData();
fdFilename.left = new FormAttachment(middle, 0);
fdFilename.right = new FormAttachment(wbaFilename, -margin);
fdFilename.top = new FormAttachment(wOriginFiles, margin);
wFilename.setLayoutData(fdFilename);
wlFilemask = new Label(wFileComp, SWT.RIGHT);
wlFilemask.setText(BaseMessages.getString(PKG, "LDIFInputDialog.RegExp.Label"));
props.setLook(wlFilemask);
fdlFilemask = new FormData();
fdlFilemask.left = new FormAttachment(0, 0);
fdlFilemask.top = new FormAttachment(wFilename, margin);
fdlFilemask.right = new FormAttachment(middle, -margin);
wlFilemask.setLayoutData(fdlFilemask);
wFilemask = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wFilemask);
wFilemask.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.RegExp.Tooltip"));
wFilemask.addModifyListener(lsMod);
fdFilemask = new FormData();
fdFilemask.left = new FormAttachment(middle, 0);
fdFilemask.top = new FormAttachment(wFilename, margin);
fdFilemask.right = new FormAttachment(100, 0);
wFilemask.setLayoutData(fdFilemask);
wlExcludeFilemask = new Label(wFileComp, SWT.RIGHT);
wlExcludeFilemask.setText(BaseMessages.getString(PKG, "LDIFInputDialog.ExcludeFilemask.Label"));
props.setLook(wlExcludeFilemask);
fdlExcludeFilemask = new FormData();
fdlExcludeFilemask.left = new FormAttachment(0, 0);
fdlExcludeFilemask.top = new FormAttachment(wFilemask, margin);
fdlExcludeFilemask.right = new FormAttachment(middle, -margin);
wlExcludeFilemask.setLayoutData(fdlExcludeFilemask);
wExcludeFilemask = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wExcludeFilemask);
wExcludeFilemask.addModifyListener(lsMod);
fdExcludeFilemask = new FormData();
fdExcludeFilemask.left = new FormAttachment(middle, 0);
fdExcludeFilemask.top = new FormAttachment(wFilemask, margin);
fdExcludeFilemask.right = new FormAttachment(wFilename, 0, SWT.RIGHT);
wExcludeFilemask.setLayoutData(fdExcludeFilemask);
// Filename list line
wlFilenameList = new Label(wFileComp, SWT.RIGHT);
wlFilenameList.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameList.Label"));
props.setLook(wlFilenameList);
fdlFilenameList = new FormData();
fdlFilenameList.left = new FormAttachment(0, 0);
fdlFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
fdlFilenameList.right = new FormAttachment(middle, -margin);
wlFilenameList.setLayoutData(fdlFilenameList);
// Buttons to the right of the screen...
wbdFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbdFilename);
wbdFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameRemove.Button"));
wbdFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameRemove.Tooltip"));
fdbdFilename = new FormData();
fdbdFilename.right = new FormAttachment(100, 0);
fdbdFilename.top = new FormAttachment(wExcludeFilemask, 40);
wbdFilename.setLayoutData(fdbdFilename);
wbeFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbeFilename);
wbeFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameEdit.Button"));
wbeFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameEdit.Tooltip"));
fdbeFilename = new FormData();
fdbeFilename.right = new FormAttachment(100, 0);
fdbeFilename.top = new FormAttachment(wbdFilename, margin);
wbeFilename.setLayoutData(fdbeFilename);
wbShowFiles = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbShowFiles);
wbShowFiles.setText(BaseMessages.getString(PKG, "LDIFInputDialog.ShowFiles.Button"));
fdbShowFiles = new FormData();
fdbShowFiles.left = new FormAttachment(middle, 0);
fdbShowFiles.bottom = new FormAttachment(100, 0);
wbShowFiles.setLayoutData(fdbShowFiles);
ColumnInfo[] colinfo = new ColumnInfo[5];
colinfo[0] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Files.Filename.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
colinfo[1] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Files.Wildcard.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
colinfo[2] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Files.ExcludeWildcard.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
colinfo[3] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Required.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, LDIFInputMeta.RequiredFilesDesc);
colinfo[4] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.IncludeSubDirs.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, LDIFInputMeta.RequiredFilesDesc);
colinfo[0].setUsingVariables(true);
colinfo[1].setUsingVariables(true);
colinfo[1].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.Files.Wildcard.Tooltip"));
colinfo[2].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.Required.Tooltip"));
colinfo[2].setUsingVariables(true);
colinfo[2].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.Files.ExcludeWildcard.Tooltip"));
colinfo[4].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.IncludeSubDirs.Tooltip"));
wFilenameList = new TableView(transMeta, wFileComp, SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER, colinfo, 2, lsMod, props);
props.setLook(wFilenameList);
fdFilenameList = new FormData();
fdFilenameList.left = new FormAttachment(middle, 0);
fdFilenameList.right = new FormAttachment(wbdFilename, -margin);
fdFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
fdFilenameList.bottom = new FormAttachment(wbShowFiles, -margin);
wFilenameList.setLayoutData(fdFilenameList);
fdFileComp = new FormData();
fdFileComp.left = new FormAttachment(0, 0);
fdFileComp.top = new FormAttachment(0, 0);
fdFileComp.right = new FormAttachment(100, 0);
fdFileComp.bottom = new FormAttachment(100, 0);
wFileComp.setLayoutData(fdFileComp);
wFileComp.layout();
wFileTab.setControl(wFileComp);
// ///////////////////////////////////////////////////////////
// / END OF FILE TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF CONTENT TAB///
// /
wContentTab = new CTabItem(wTabFolder, SWT.NONE);
wContentTab.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Content.Tab"));
FormLayout contentLayout = new FormLayout();
contentLayout.marginWidth = 3;
contentLayout.marginHeight = 3;
wContentComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wContentComp);
wContentComp.setLayout(contentLayout);
wlInclFilename = new Label(wContentComp, SWT.RIGHT);
wlInclFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclFilename.Label"));
props.setLook(wlInclFilename);
fdlInclFilename = new FormData();
fdlInclFilename.left = new FormAttachment(0, 0);
fdlInclFilename.top = new FormAttachment(0, 2 * margin);
fdlInclFilename.right = new FormAttachment(middle, -margin);
wlInclFilename.setLayoutData(fdlInclFilename);
wInclFilename = new Button(wContentComp, SWT.CHECK);
props.setLook(wInclFilename);
wInclFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.InclFilename.Tooltip"));
fdInclFilename = new FormData();
fdInclFilename.left = new FormAttachment(middle, 0);
fdInclFilename.top = new FormAttachment(0, 2 * margin);
wInclFilename.setLayoutData(fdInclFilename);
wlInclFilenameField = new Label(wContentComp, SWT.LEFT);
wlInclFilenameField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclFilenameField.Label"));
props.setLook(wlInclFilenameField);
fdlInclFilenameField = new FormData();
fdlInclFilenameField.left = new FormAttachment(wInclFilename, margin);
fdlInclFilenameField.top = new FormAttachment(0, 2 * margin);
wlInclFilenameField.setLayoutData(fdlInclFilenameField);
wInclFilenameField = new TextVar(transMeta, 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(0, 2 * margin);
fdInclFilenameField.right = new FormAttachment(100, 0);
wInclFilenameField.setLayoutData(fdInclFilenameField);
wlInclRownum = new Label(wContentComp, SWT.RIGHT);
wlInclRownum.setText(BaseMessages.getString(PKG, "LDIFInputDialog.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, "LDIFInputDialog.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, ("LDIFInputDialog.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 TextVar(transMeta, 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);
// Add content type field?
wlInclContentType = new Label(wContentComp, SWT.RIGHT);
wlInclContentType.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclContentType.Label"));
props.setLook(wlInclContentType);
fdlInclContentType = new FormData();
fdlInclContentType.left = new FormAttachment(0, 0);
fdlInclContentType.top = new FormAttachment(wInclRownumField, margin);
fdlInclContentType.right = new FormAttachment(middle, -margin);
wlInclContentType.setLayoutData(fdlInclContentType);
wInclContentType = new Button(wContentComp, SWT.CHECK);
props.setLook(wInclContentType);
wInclContentType.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.InclContentType.Tooltip"));
fdInclContentType = new FormData();
fdInclContentType.left = new FormAttachment(middle, 0);
fdInclContentType.top = new FormAttachment(wInclRownumField, margin);
wInclContentType.setLayoutData(fdInclContentType);
// Content type field name
wlInclContentTypeField = new Label(wContentComp, SWT.LEFT);
wlInclContentTypeField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclContentTypeField.Label"));
props.setLook(wlInclContentTypeField);
fdlInclContentTypeField = new FormData();
fdlInclContentTypeField.left = new FormAttachment(wInclContentType, margin);
fdlInclContentTypeField.top = new FormAttachment(wInclRownumField, margin);
wlInclContentTypeField.setLayoutData(fdlInclContentTypeField);
wInclContentTypeField = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wInclContentTypeField);
wInclContentTypeField.addModifyListener(lsMod);
fdInclContentTypeField = new FormData();
fdInclContentTypeField.left = new FormAttachment(wlInclContentTypeField, margin);
fdInclContentTypeField.top = new FormAttachment(wInclRownumField, margin);
fdInclContentTypeField.right = new FormAttachment(100, 0);
wInclContentTypeField.setLayoutData(fdInclContentTypeField);
// Add content type field?
wlInclDN = new Label(wContentComp, SWT.RIGHT);
wlInclDN.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclDN.Label"));
props.setLook(wlInclDN);
fdlInclDN = new FormData();
fdlInclDN.left = new FormAttachment(0, 0);
fdlInclDN.top = new FormAttachment(wInclContentTypeField, margin);
fdlInclDN.right = new FormAttachment(middle, -margin);
wlInclDN.setLayoutData(fdlInclDN);
wInclDN = new Button(wContentComp, SWT.CHECK);
props.setLook(wInclDN);
wInclDN.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.InclDN.Tooltip"));
fdInclDN = new FormData();
fdInclDN.left = new FormAttachment(middle, 0);
fdInclDN.top = new FormAttachment(wInclContentTypeField, margin);
wInclDN.setLayoutData(fdInclDN);
// Content type field name
wlInclDNField = new Label(wContentComp, SWT.LEFT);
wlInclDNField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclDNField.Label"));
props.setLook(wlInclDNField);
fdlInclDNField = new FormData();
fdlInclDNField.left = new FormAttachment(wInclDN, margin);
fdlInclDNField.top = new FormAttachment(wInclContentTypeField, margin);
wlInclDNField.setLayoutData(fdlInclDNField);
wInclDNField = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wInclDNField);
wInclDNField.addModifyListener(lsMod);
fdInclDNField = new FormData();
fdInclDNField.left = new FormAttachment(wlInclDNField, margin);
fdInclDNField.top = new FormAttachment(wInclContentTypeField, margin);
fdInclDNField.right = new FormAttachment(100, 0);
wInclDNField.setLayoutData(fdInclDNField);
// Limit to preview
wlLimit = new Label(wContentComp, SWT.RIGHT);
wlLimit.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Limit.Label"));
props.setLook(wlLimit);
fdlLimit = new FormData();
fdlLimit.left = new FormAttachment(0, 0);
fdlLimit.top = new FormAttachment(wInclDNField, 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(wInclDNField, margin);
fdLimit.right = new FormAttachment(100, 0);
wLimit.setLayoutData(fdLimit);
// Multi valued field separator
wlMultiValuedSeparator = new Label(wContentComp, SWT.RIGHT);
wlMultiValuedSeparator.setText(BaseMessages.getString(PKG, "LDIFInputDialog.MultiValuedSeparator.Label"));
props.setLook(wlMultiValuedSeparator);
fdlMultiValuedSeparator = new FormData();
fdlMultiValuedSeparator.left = new FormAttachment(0, 0);
fdlMultiValuedSeparator.top = new FormAttachment(wLimit, margin);
fdlMultiValuedSeparator.right = new FormAttachment(middle, -margin);
wlMultiValuedSeparator.setLayoutData(fdlMultiValuedSeparator);
wMultiValuedSeparator = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wMultiValuedSeparator);
wMultiValuedSeparator.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.MultiValuedSeparator.Tooltip"));
wMultiValuedSeparator.addModifyListener(lsMod);
fdMultiValuedSeparator = new FormData();
fdMultiValuedSeparator.left = new FormAttachment(middle, 0);
fdMultiValuedSeparator.top = new FormAttachment(wLimit, margin);
fdMultiValuedSeparator.right = new FormAttachment(100, 0);
wMultiValuedSeparator.setLayoutData(fdMultiValuedSeparator);
// ///////////////////////////////
// START OF AddFileResult GROUP //
// ///////////////////////////////
wAddFileResult = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wAddFileResult);
wAddFileResult.setText(BaseMessages.getString(PKG, "LDIFInputDialog.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, "LDIFInputDialog.AddResult.Label"));
props.setLook(wlAddResult);
fdlAddResult = new FormData();
fdlAddResult.left = new FormAttachment(0, 0);
fdlAddResult.top = new FormAttachment(wMultiValuedSeparator, margin);
fdlAddResult.right = new FormAttachment(middle, -margin);
wlAddResult.setLayoutData(fdlAddResult);
wAddResult = new Button(wAddFileResult, SWT.CHECK);
props.setLook(wAddResult);
wAddResult.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.AddResult.Tooltip"));
fdAddResult = new FormData();
fdAddResult.left = new FormAttachment(middle, 0);
fdAddResult.top = new FormAttachment(wMultiValuedSeparator, margin);
wAddResult.setLayoutData(fdAddResult);
fdAddFileResult = new FormData();
fdAddFileResult.left = new FormAttachment(0, margin);
fdAddFileResult.top = new FormAttachment(wMultiValuedSeparator, margin);
fdAddFileResult.right = new FormAttachment(100, -margin);
wAddFileResult.setLayoutData(fdAddFileResult);
// ///////////////////////////////////////////////////////////
// / END OF AddFileResult GROUP
// ///////////////////////////////////////////////////////////
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);
wContentComp.layout();
wContentTab.setControl(wContentComp);
// ///////////////////////////////////////////////////////////
// / END OF CONTENT TAB
// ///////////////////////////////////////////////////////////
// Fields tab...
//
wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
wFieldsTab.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Fields.Tab"));
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, "LDIFInputDialog.GetFields.Button"));
fdGet = new FormData();
fdGet.left = new FormAttachment(50, 0);
fdGet.bottom = new FormAttachment(100, 0);
wGet.setLayoutData(fdGet);
final int FieldsRows = input.getInputFields().length;
ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Name.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Attribut.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Type.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames(), true), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Format.Column"), ColumnInfo.COLUMN_TYPE_FORMAT, 3), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Length.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Precision.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Currency.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Decimal.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Group.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.TrimType.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, LDIFInputField.trimTypeDesc, true), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Repeat.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { BaseMessages.getString(PKG, "System.Combo.Yes"), BaseMessages.getString(PKG, "System.Combo.No") }, true) };
colinf[0].setUsingVariables(true);
colinf[0].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Name.Column.Tooltip"));
colinf[1].setUsingVariables(true);
colinf[1].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Attribut.Column.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);
addAdditionalFieldsTab();
fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
fdTabFolder.top = new FormAttachment(wStepname, margin);
fdTabFolder.right = new FormAttachment(100, 0);
fdTabFolder.bottom = new FormAttachment(100, -50);
wTabFolder.setLayoutData(fdTabFolder);
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wPreview = new Button(shell, SWT.PUSH);
wPreview.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Button.PreviewRows"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
setButtonPositions(new Button[] { wOK, wPreview, wCancel }, margin, wTabFolder);
// Add listeners
lsOK = new Listener() {
public void handleEvent(Event e) {
ok();
}
};
lsGet = new Listener() {
public void handleEvent(Event e) {
get();
}
};
lsPreview = new Listener() {
public void handleEvent(Event e) {
preview();
}
};
lsCancel = new Listener() {
public void handleEvent(Event e) {
cancel();
}
};
wOK.addListener(SWT.Selection, lsOK);
wGet.addListener(SWT.Selection, lsGet);
wPreview.addListener(SWT.Selection, lsPreview);
wCancel.addListener(SWT.Selection, lsCancel);
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
wLimit.addSelectionListener(lsDef);
wInclRownumField.addSelectionListener(lsDef);
wInclFilenameField.addSelectionListener(lsDef);
// Add the file to the list of files...
SelectionAdapter selA = new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
wFilenameList.add(new String[] { wFilename.getText(), wFilemask.getText(), wExcludeFilemask.getText(), LDIFInputMeta.RequiredFilesCode[0], LDIFInputMeta.RequiredFilesCode[0] });
wFilename.setText("");
wFilemask.setText("");
wExcludeFilemask.setText("");
wFilenameList.removeEmptyRows();
wFilenameList.setRowNums();
wFilenameList.optWidth(true);
}
};
wbaFilename.addSelectionListener(selA);
wFilename.addSelectionListener(selA);
// Delete files from the list of files...
wbdFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
int[] idx = wFilenameList.getSelectionIndices();
wFilenameList.remove(idx);
wFilenameList.removeEmptyRows();
wFilenameList.setRowNums();
}
});
// Edit the selected file & remove from the list...
wbeFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
int idx = wFilenameList.getSelectionIndex();
if (idx >= 0) {
String[] string = wFilenameList.getItem(idx);
wFilename.setText(string[0]);
wFilemask.setText(string[1]);
wExcludeFilemask.setText(string[2]);
wFilenameList.remove(idx);
}
wFilenameList.removeEmptyRows();
wFilenameList.setRowNums();
}
});
// Show the files that are selected at this time...
wbShowFiles.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
try {
LDIFInputMeta tfii = new LDIFInputMeta();
getInfo(tfii);
FileInputList fileInputList = tfii.getFiles(transMeta);
String[] files = fileInputList.getFileStrings();
if (files != null && files.length > 0) {
EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, BaseMessages.getString(PKG, "LDIFInputDialog.FilesReadSelection.DialogTitle"), BaseMessages.getString(PKG, "LDIFInputDialog.FilesReadSelection.DialogMessage"));
esd.setViewOnly();
esd.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "LDIFInputDialog.NoFileFound.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
mb.open();
}
} catch (KettleException ex) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "LDIFInputDialog.ErrorParsingData.DialogTitle"), BaseMessages.getString(PKG, "LDIFInputDialog.ErrorParsingData.DialogMessage"), ex);
}
}
});
// Enable/disable the right fields to allow a filename to be added to
// each row...
wInclFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setIncludeFilename();
}
});
// Enable/disable the right fields to allow a row number to be added to
// each row...
wInclRownum.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setIncludeRownum();
}
});
// Enable/disable the right fields to allow a content type to be added to
// each row...
wInclContentType.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setContenType();
}
});
// Enable/disable the right fields to allow a content type to be added to
// each row...
wInclDN.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setDN();
}
});
// Whenever something changes, set the tooltip to the expanded version
// of the filename:
wFilename.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
wFilename.setToolTipText(transMeta.environmentSubstitute(wFilename.getText()));
}
});
// Listen to the Browse... button
wbbFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (!Utils.isEmpty(wFilemask.getText()) || !Utils.isEmpty(wExcludeFilemask.getText())) {
DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN);
if (wFilename.getText() != null) {
String fpath = transMeta.environmentSubstitute(wFilename.getText());
dialog.setFilterPath(fpath);
}
if (dialog.open() != null) {
String str = dialog.getFilterPath();
wFilename.setText(str);
}
} else {
FileDialog dialog = new FileDialog(shell, SWT.OPEN);
dialog.setFilterExtensions(new String[] { "*ldif;*.LDIF", "*" });
if (wFilename.getText() != null) {
String fname = transMeta.environmentSubstitute(wFilename.getText());
dialog.setFileName(fname);
}
dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "LDIFInputDialog.FileType"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
if (dialog.open() != null) {
String str = dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName();
wFilename.setText(str);
}
}
}
});
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
cancel();
}
});
wTabFolder.setSelection(0);
// Set the shell size, based upon previous time...
setSize();
getData(input);
ActiveFileField();
setContenType();
setDN();
input.setChanged(changed);
wFields.optWidth(true);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return stepname;
}
Aggregations