Group.setLayout(gridLayout);
parameterTabItem.setControl(Group);
label2 = new Label(Group, SWT.NONE);
label2.setText("Name: ");
tParaName = new Text(Group, SWT.BORDER);
tParaName.addFocusListener(new FocusAdapter() {
public void focusGained(final FocusEvent e) {
tParaName.selectAll();
}
});
final GridData gridData_4 = new GridData(GridData.FILL, GridData.CENTER, true, false);
tParaName.setLayoutData(gridData_4);
tParaName.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {
public void keyPressed(org.eclipse.swt.events.KeyEvent e) {
if (e.keyCode == SWT.CR && !tParaName.getText().equals(""))
addParam();
}
});
tParaName.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
bApply.setEnabled(!tParaName.getText().trim().equals(""));
}
});
label6 = new Label(Group, SWT.NONE);
label6.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
label6.setText("Value: ");
tParaValue = new Text(Group, SWT.BORDER);
tParaValue.addFocusListener(new FocusAdapter() {
public void focusGained(final FocusEvent e) {
tParaValue.selectAll();
}
});
final GridData gridData_9 = new GridData(GridData.FILL, GridData.CENTER, true, false);
tParaValue.setLayoutData(gridData_9);
tParaValue.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {
public void keyPressed(org.eclipse.swt.events.KeyEvent e) {
if (e.keyCode == SWT.CR && !tParaName.getText().trim().equals(""))
addParam();
}
});
tParaValue.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
bApply.setEnabled(!tParaName.getText().equals(""));
}
});
final Button button = new Button(Group, SWT.NONE);
final GridData gridDatax = new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false);
gridDatax.widthHint = 28;
button.setLayoutData(gridDatax);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
String text = sos.scheduler.editor.app.Utils.showClipboard(tParaValue.getText(), getShell(), true, "");
if(text != null)
tParaValue.setText(text);
}
});
button.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_edit.gif"));
bApply = new Button(Group, SWT.NONE);
bApply.setEnabled(false);
final GridData gridData_7 = new GridData(GridData.FILL, GridData.CENTER, false, false);
gridData_7.widthHint = 36;
bApply.setLayoutData(gridData_7);
bApply.setText("&Apply");
bApply.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
addParam();
}
});
label4 = new Label(Group, SWT.SEPARATOR | SWT.HORIZONTAL);
label4.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 6, 1));
label4.setText("Label");
tParameter = new Table(Group, SWT.FULL_SELECTION | SWT.BORDER);
tParameter.setLinesVisible(true);
final GridData gridData_1 = new GridData(GridData.FILL, GridData.FILL, true, true, 5, 4);
tParameter.setLayoutData(gridData_1);
tParameter.setHeaderVisible(true);
tParameter.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
if(bApply.isEnabled()) {
int ok = MainWindow.message(Messages.getString("MainListener.apply_changes"), //$NON-NLS-1$
SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);
if (ok == SWT.YES) {
addParam();
return;
}
}
TableItem item = (TableItem) e.item;
if (item == null)
return;
tParaName.setText(item.getText(0));
tParaValue.setText(item.getText(1));
bRemove.setEnabled(tParameter.getSelectionCount() > 0);
if(type == Editor.JOB) {
//txtParameterDescription.setText(listener.getParameterDescription(item.getText(0)));
try {
txtParameterDescription.setText(sosString.parseToString(item.getData("parameter_description_" + Options.getLanguage())));
} catch(Exception ew) {}
}
bApply.setEnabled(false);
}
});
TableColumn tcName = new TableColumn(tParameter, SWT.NONE);
tcName.setWidth(262);
tcName.setText("Name");
TableColumn tcValue = new TableColumn(tParameter, SWT.NONE);
tcValue.setWidth(500);
tcValue.setText("Value");
butNewParam = new Button(Group, SWT.NONE);
butNewParam.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
tParaName.setText("");
tParaValue.setText("");
bRemove.setEnabled(false);
tParameter.deselectAll();
tParaName.setFocus();
}
});
butNewParam.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
butNewParam.setText("New");
final Composite composite = new Composite(Group, SWT.NONE);
final GridData gridData_2 = new GridData(GridData.CENTER, GridData.CENTER, false, false);
gridData_2.heightHint = 67;
composite.setLayoutData(gridData_2);
composite.setLayout(new GridLayout());
butUp = new Button(composite, SWT.NONE);
butUp.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
//selektierte Datensatz wird eine Zeile nach oben verschoben
listener.changeUp(tParameter);
}
});
butUp.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
//butUp.setText("Up");
butUp.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_up.gif"));
butDown = new Button(composite, SWT.NONE);
butDown.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
listener.changeDown(tParameter);
}
});
butDown.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
//butDown.setText("Down");
butDown.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_down.gif"));
butImport = new Button(Group, SWT.NONE);
butImport.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
//butImport.setText("import");
butImport.setText(WIZZARD);
butImport.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
startWizzard();
tParaName.setFocus();
}
});
//butImport.setText("Import");
butImport.setText(WIZZARD);
bRemove = new Button(Group, SWT.NONE);
final GridData gridData_8 = new GridData(GridData.FILL, GridData.BEGINNING, false, true);
bRemove.setLayoutData(gridData_8);
bRemove.setText("Remove");
bRemove.setEnabled(false);
bRemove.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
int index = tParameter.getSelectionIndex();
listener.deleteParameter(tParameter, index);
tParaName.setText("");
tParaValue.setText("");
tParameter.deselectAll();
bRemove.setEnabled(false);
bApply.setEnabled(false);
if (index >= tParameter.getItemCount())
index--;
if (index >= 0) {
tParameter.select(index);
tParameter.setSelection(index);
setParams(tParameter.getItem(index));
}
}
});
if(type == Editor.JOB) {
txtParameterDescription = new Text(Group, SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL);
final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true, 5, 1);
gridData.minimumHeight = 100;
txtParameterDescription.setLayoutData(gridData);
txtParameterDescription.addFocusListener(new FocusAdapter() {
public void focusGained(final FocusEvent e) {
tParaName.setFocus();
}
});