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 = 2;
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();
}
});
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) {