schedulerConfigurationShell.setText("Profiles");
{
schedulerGroup = new Group(schedulerConfigurationShell, SWT.NONE);
/*schedulerGroup.addTraverseListener(new TraverseListener() {
public void keyTraversed(final TraverseEvent e) {
if(e.detail == SWT.TRAVERSE_ESCAPE) {
close();
saved = true;
schedulerConfigurationShell.dispose();
}
}
});*/
schedulerGroup.setText("Profiles");
final GridData gridData = new GridData(GridData.FILL,
GridData.FILL, true, true);
gridData.widthHint = 581;
gridData.heightHint = 233;
schedulerGroup.setLayoutData(gridData);
final GridLayout gridLayout_1 = new GridLayout();
gridLayout_1.numColumns = 2;
gridLayout_1.marginTop = 5;
gridLayout_1.marginRight = 5;
gridLayout_1.marginLeft = 5;
gridLayout_1.marginBottom = 5;
schedulerGroup.setLayout(gridLayout_1);
final TabFolder tabFolder = new TabFolder(schedulerGroup, SWT.NONE);
final GridData gridData_1 = new GridData(GridData.FILL, GridData.FILL, true, true, 1, 4);
gridData_1.heightHint = 178;
tabFolder.setLayoutData(gridData_1);
final TabItem propertiesTabItem = new TabItem(tabFolder, SWT.NONE);
propertiesTabItem.setText("Properties");
final Group group = new Group(tabFolder, SWT.NONE);
final GridLayout gridLayout_2 = new GridLayout();
gridLayout_2.numColumns = 3;
group.setLayout(gridLayout_2);
propertiesTabItem.setControl(group);
final Label lblName = new Label(group, SWT.NONE);
lblName.setText("Name");
cboConnectname = new Combo(group, SWT.NONE);
cboConnectname.setItems(listener.getProfileNames());
cboConnectname.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
cboConnectname.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
cboConnectname.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
if( !cboConnectname.getText().equals(currProfile.get("name")))
initForm();
}
});
cboConnectname.select(0);
final Label protocolLabel = new Label(group, SWT.NONE);
protocolLabel.setText("Protocol");
cboProtokol = new Combo(group, SWT.NONE);
cboProtokol.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
cboProtokol.setItems(new String[] {"FTP", "SFTP"});
cboProtokol.select(0);
final Label hostnameOrIpLabel = new Label(group, SWT.NONE);
hostnameOrIpLabel.setText("Host Name or IP Address");
txtHost = new Text(group, SWT.BORDER);
txtHost.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtHost.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
final Label portLabel = new Label(group, SWT.NONE);
portLabel.setText("Port");
txtPort = new Text(group, SWT.BORDER);
txtPort.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtPort.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
final Label userNameLabel = new Label(group, SWT.NONE);
userNameLabel.setText("User Name");
txtUsername = new Text(group, SWT.BORDER);
txtUsername.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtUsername.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
//txtUsername.setText(currProfile.get("user") != null ? currProfile.get("user").toString() : "");
final Label passwordLabel = new Label(group, SWT.NONE);
passwordLabel.setText("Password");
txtPassword = new Text(group, SWT.PASSWORD | SWT.BORDER);
txtPassword.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
if(init) {
try {
init = false;
if(txtPassword.getText().length() > 0) {
String key = Options.getProperty("profile.timestamp." + cboConnectname.getText());
if(key != null && key.length() > 8) {
key = key.substring(key.length()-8);
}
String password = txtPassword.getText();
if(password.length() > 0 && sosString.parseToString(key).length() > 0) {
password = SOSCrypt.decrypt(key, password);
}
txtPassword.setText(password);
}
} catch(Exception ex) {
System.out.println(ex.getMessage());
}
}
setEnabled();
}
});
txtPassword.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
//txtPassword.setText(currProfile.get("password") != null ? currProfile.get("password").toString() : "");
final Label rootLabel = new Label(group, SWT.NONE);
rootLabel.setText("Root Directory");
txtRoot = new Text(group, SWT.BORDER);
txtRoot.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtRoot.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
//txtRoot.setText(currProfile.get("root") != null ? currProfile.get("root").toString() : "");
final Label directoryFroLocalLabel = new Label(group, SWT.NONE);
directoryFroLocalLabel.setText("Directory For Local Copy");
txtLocalDirectory = new Text(group, SWT.BORDER);
txtLocalDirectory.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtLocalDirectory.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
final Label savePasswordLabel = new Label(group, SWT.NONE);
final GridData gridData_5 = new GridData(SWT.DEFAULT, 24);
gridData_5.verticalIndent = 5;
savePasswordLabel.setLayoutData(gridData_5);
savePasswordLabel.setText("Save Password");
butSavePassword = new Button(group, SWT.CHECK);
butSavePassword.addSelectionListener(new SelectionAdapter() {
public void widgetDefaultSelected(final SelectionEvent e) {
}
public void widgetSelected(final SelectionEvent e) {
setEnabled();
}
});
new Label(group, SWT.NONE);
//txtLocalDirectory.setText(currProfile.get("localdirectory") != null ? currProfile.get("localdirectory").toString() : "");
final Label transferModeLabel = new Label(group, SWT.NONE);
final GridData gridData_3 = new GridData(GridData.BEGINNING, GridData.END, false, false);
gridData_3.heightHint = 21;
transferModeLabel.setLayoutData(gridData_3);
transferModeLabel.setText("Transfer Mode");
butAscii = new Button(group, SWT.RADIO);
butAscii.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
setEnabled();
}
});
butAscii.setText("ASCII");
butbinary = new Button(group, SWT.RADIO);
butbinary.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
setEnabled();
}
});
butbinary.setText("Binary");
final TabItem proxyTabItem = new TabItem(tabFolder, SWT.NONE);
proxyTabItem.setText("Proxy");
final Group group_1 = new Group(tabFolder, SWT.NONE);
final GridLayout gridLayout_3 = new GridLayout();
gridLayout_3.numColumns = 2;
group_1.setLayout(gridLayout_3);
proxyTabItem.setControl(group_1);
useProxyButton = new Button(group_1, SWT.CHECK);
useProxyButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
txtProxyServer.setEnabled(useProxyButton.getSelection());
txtProxyPort.setEnabled(useProxyButton.getSelection());
setEnabled();
}
});
useProxyButton.setLayoutData(new GridData(SWT.DEFAULT, 52));
useProxyButton.setText("Use Proxy");
new Label(group_1, SWT.NONE);
final Label proxyServerLabel = new Label(group_1, SWT.NONE);
proxyServerLabel.setText("Proxy Server");
txtProxyServer = new Text(group_1, SWT.BORDER);
txtProxyServer.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtProxyServer.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
final Label proxyPortLabel = new Label(group_1, SWT.NONE);
proxyPortLabel.setText("Proxy Port");
txtProxyPort = new Text(group_1, SWT.BORDER);
txtProxyPort.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtProxyPort.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
sshTabItem = new TabItem(tabFolder, SWT.NONE);
sshTabItem.setText("SSH");
groupAuthenticationMethods = new Group(tabFolder, SWT.NONE);
groupAuthenticationMethods.setText("Authentication Methods");
final GridLayout gridLayout_4 = new GridLayout();
gridLayout_4.numColumns = 2;
groupAuthenticationMethods.setLayout(gridLayout_4);
sshTabItem.setControl(groupAuthenticationMethods);