lblName.setText("Name");
cboConnectname = new Combo(group, SWT.NONE);
cboConnectname.setItems(listener.getProfileNames());
cboConnectname.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
final GridData gridData_2 = new GridData(GridData.FILL, GridData.CENTER, true, false);
cboConnectname.setLayoutData(gridData_2);
cboConnectname.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
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));
cboProtokol.setItems(new String[] {"WebDav", "SWebDav"});
cboProtokol.select(0);
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));
//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));
//txtPassword.setText(currProfile.get("password") != null ? currProfile.get("password").toString() : "");
final Label urlLabel = new Label(group, SWT.NONE);
urlLabel.setText("URL");
txtURL = new Text(group, SWT.BORDER);
txtURL.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});
txtURL.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
//txturl.setText(currProfile.get("url") != null ? currProfile.get("url").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));
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();
}
});
butSavePassword.setLayoutData(new GridData());
final TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
tabItem.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);
tabItem.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));
//txtLocalDirectory.setText(currProfile.get("localdirectory") != null ? currProfile.get("localdirectory").toString() : "");
new Label(schedulerGroup, SWT.NONE);
butApply = new Button(schedulerGroup, SWT.NONE);
butApply.setEnabled(false);
butApply.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
apply();
}
});
butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
butApply.setText("Apply");
//txtHost.setText(currProfile.get("host") != null ? currProfile.get("host").toString() : "");
final Button butNewProfile = new Button(schedulerGroup, SWT.NONE);
butNewProfile.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
newProfile = true;
cboConnectname.setText("");
txtUsername.setText("");
txtPassword.setText("");
txtURL.setText("");
txtLocalDirectory.setText("");
butSavePassword.setSelection(false);
txtProxyPort.setText("");
txtProxyServer.setText("");
txtProxyPort.setEnabled(false);
txtProxyServer.setEnabled(false);
useProxyButton.setSelection(false);
cboProtokol.select(0);
}
});
butNewProfile.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
butNewProfile.setText("New Profile");
//txtPort.setText(currProfile.get("port") != null ? currProfile.get("port").toString() : "");
final Button butRemove = new Button(schedulerGroup, SWT.NONE);
butRemove.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
listener.removeProfile(cboConnectname.getText());
if(cboConnectname.getItemCount() > 0)
cboConnectname.select(0);
initForm();
saveSettings = true;
}
});
butRemove.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
butRemove.setText("Remove");
/*if(currProfile.get("transfermode") != null && currProfile.get("transfermode").toString().equalsIgnoreCase("binary")) {
butbinary.setSelection(true);
butAscii.setSelection(false);
} else {
butbinary.setSelection(false);
butAscii.setSelection(true);
}*/
// final Tree tree = new Tree(schedulerGroup, SWT.BORDER);
}
final Button butClose = new Button(schedulerConfigurationShell, SWT.NONE);
butClose.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
close();
saved = true;
schedulerConfigurationShell.dispose();
}
});
butClose.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
butClose.setText("Close");
cboProtokol.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
setEnabled();
}
});