bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
cJob.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.CR) {
applyNode();
}
}
});
final GridData gridData13 = new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1);
gridData13.widthHint = 579;
cJob.setLayoutData(gridData13);
final Composite composite = new Composite(gNodes, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
final GridLayout gridLayout_2 = new GridLayout();
gridLayout_2.marginWidth = 0;
gridLayout_2.marginHeight = 0;
gridLayout_2.numColumns = 2;
composite.setLayout(gridLayout_2);
butBrowse = new Button(composite, SWT.NONE);
butBrowse.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
butBrowse.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
String jobname = IOUtils.openDirectoryFile(MergeAllXMLinDirectory.MASK_JOB);
if(jobname != null && jobname.length() > 0)
cJob.setText(jobname);
}
});
butBrowse.setText("Browse");
if(!listener.get_dom().isLifeElement()) {
butImportJob = new Button(composite, SWT.NONE);
final GridData gridData_3 = new GridData(GridData.END, GridData.CENTER, false, false);
gridData_3.widthHint = 84;
butImportJob.setLayoutData(gridData_3);
butImportJob.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
JobAssistentImportJobsForm importJobs = new JobAssistentImportJobsForm(listener.get_dom(), update, Editor.JOB_CHAINS);
importJobs.setJobname(cJob);
importJobs.showAllImportJobs("order");
if (!listener.get_dom().isLifeElement())
update.updateOrders();
refresh = true;
}
});
butImportJob.setText("Import Job");
}
label8 = new Label(gNodes, SWT.NONE);
label8.setText("Next State:");
new Label(gNodes, SWT.NONE);
/*composite_2 = new Composite(gNodes, SWT.NONE);
composite_2.addListener (SWT.Resize, new org.eclipse.swt.widgets.Listener () {
public void handleEvent (Event e) {
cNextState.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);
txtStateText.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);
}
});
*/
/*final GridData gridData_2 = new GridData(GridData.FILL, GridData.FILL, true, false);
gridData_2.minimumWidth = 35;
composite_2.setLayoutData(gridData_2);
final Composite composite_4 = new Composite(gNodes, SWT.NONE);
final GridData gridData_4 = new GridData(GridData.FILL, GridData.FILL, false, false);
gridData_4.widthHint = 59;
composite_4.setLayoutData(gridData_4);
composite_4.setLayout(new GridLayout());
*/
cNextState = new Combo(gNodes, SWT.NONE);
cNextState.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
cNextState.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
cNextState.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.CR) {
applyNode();
}
}
});
//cNextState = new Combo(composite_4, SWT.BORDER);
/*cNextState.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);
cNextState.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
cNextState.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.CR) {
applyNode();
}
}
});
*/
//txtStateText = new Text(composite_2, SWT.BORDER);
//txtStateText.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);
final Label delayLabel = new Label(gNodes, SWT.NONE);
delayLabel.setText("Delay:");
tDelay = new Text(gNodes, SWT.BORDER);
tDelay.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
tDelay.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
}
});
final GridData gridData_8 = new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData_8.minimumWidth = 35;
gridData_8.widthHint = 186;
tDelay.setLayoutData(gridData_8);
bNewNode = new Button(gNodes, SWT.NONE);
bNewNode.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
isInsert = false;
getShell().setDefaultButton(null);
tNodes.deselectAll();
butDetailsJob.setEnabled(false);
listener.selectNode(null);
bRemoveNode.setEnabled(false);
enableNode(true);
fillNode(true);
tState.setFocus();
//test
//cNextState.setVisible(false);
//txtStateText.setVisible(true);
cNextState.setVisibleItemCount(0);
}
});
bNewNode.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
bNewNode.setText("New Chain &Node");
label9 = new Label(gNodes, SWT.NONE);
label9.setText("Error State:");
new Label(gNodes, SWT.NONE);
cErrorState = new Combo(gNodes, SWT.NONE);
cErrorState.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
cErrorState.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.CR) {
applyNode();
}
}
});
final GridData gridData15 = new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData15.widthHint = 80;
cErrorState.setLayoutData(gridData15);
final Label onErrorLabel = new Label(gNodes, SWT.NONE);
onErrorLabel.setText("On Error:");
cOnError = new Combo(gNodes, SWT.READ_ONLY);
cOnError.setItems(new String[] {"", "setback", "suspend"});
cOnError.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
cOnError.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.CR) {
applyNode();
}
}
});
final GridData gridData_12 = new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData_12.minimumWidth = 20;
cOnError.setLayoutData(gridData_12);
butInsert = new Button(gNodes, SWT.NONE);
butInsert.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
isInsert = true;
String state = tState.getText();
tState.setText("");
tDelay.setText("");
cErrorState.setText("");
cOnError.setText("");
cJob.setText("");
enableNode(true);
bFullNode.setSelection(true);
bEndNode.setSelection(false);
//n�chste status
cNextState.setText(state);
}
});
butInsert.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
butInsert.setText("Insert Chain Node");
cType = new Composite(gNodes, SWT.NONE);
final GridLayout gridLayout_4 = new GridLayout();
gridLayout_4.marginHeight = 0;
gridLayout_4.marginWidth = 0;
gridLayout_4.numColumns = 4;
cType.setLayout(gridLayout_4);
final GridData gridData5 = new GridData(GridData.FILL, GridData.CENTER, true, false, 5, 1);
gridData5.widthHint = 387;
gridData5.heightHint = 35;
cType.setLayoutData(gridData5);
bFullNode = new Button(cType, SWT.RADIO);
bFullNode.addSelectionListener(new SelectionAdapter() {
public void widgetDefaultSelected(final SelectionEvent e) {
}
});
bFullNode.setSelection(true);
bFullNode.setText("Full Node");
bEndNode = new Button(cType, SWT.RADIO);
bEndNode.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
if (bFileSink.getSelection()) {
cNextState.setEnabled(false);
cErrorState.setEnabled(false);
cOnError.setEnabled(false);
tDelay.setEnabled(false);
cJob.setEnabled(false);
cJob.setText("");
cNextState.setText("");
cErrorState.setText("");
cOnError.setText("");
tMoveTo.setEnabled(true);
bRemoveFile.setEnabled(true);
}
if (bEndNode.getSelection()) {
cNextState.setEnabled(false);
cErrorState.setEnabled(false);
cOnError.setEnabled(false);
tDelay.setEnabled(false);
cJob.setEnabled(false);
cJob.setText("");
cNextState.setText("");
cErrorState.setText("");
cOnError.setText("");
tMoveTo.setEnabled(false);
bRemoveFile.setEnabled(false);
}
if (bFullNode.getSelection()) {
tMoveTo.setEnabled(false);
bRemoveFile.setEnabled(false);
cNextState.setEnabled(true);
cErrorState.setEnabled(true);
cOnError.setEnabled(true);
cJob.setEnabled(true);
tDelay.setEnabled(true);
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
bApplyNode.setEnabled(isValidNode());
}
});
bEndNode.setText("End Node");
bFileSink = new Button(cType, SWT.RADIO);
final GridData gridData = new GridData(GridData.FILL, GridData.CENTER, false, false);
gridData.widthHint = 71;
bFileSink.setLayoutData(gridData);
bFileSink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
if (bFileSink.getSelection()) {
cNextState.setEnabled(false);
cErrorState.setEnabled(false);
cOnError.setEnabled(false);
cJob.setEnabled(false);
cJob.setText("");
cNextState.setText("");
cErrorState.setText("");
cOnError.setText("");
tMoveTo.setEnabled(true);
bRemoveFile.setEnabled(true);
if (tState.getText().equals(""))
bApplyNode.setEnabled(false);
}
}
});
bFileSink.setEnabled(false);
bFileSink.setText("File Sink");
final Composite composite_3 = new Composite(cType, SWT.NONE);
final GridData gridData_5 = new GridData(GridData.FILL, GridData.FILL, true, false);
gridData_5.widthHint = 238;
composite_3.setLayoutData(gridData_5);
final GridLayout gridLayout_7 = new GridLayout();
gridLayout_7.verticalSpacing = 0;
gridLayout_7.numColumns = 2;
gridLayout_7.marginWidth = 0;
gridLayout_7.marginHeight = 0;
gridLayout_7.horizontalSpacing = 0;
composite_3.setLayout(gridLayout_7);
final Label removeFileLabel = new Label(composite_3, SWT.NONE);
removeFileLabel.setText("Remove File");
bRemoveFile = new Button(composite_3, SWT.CHECK);
final GridData gridData_1 = new GridData();
gridData_1.horizontalIndent = 5;
bRemoveFile.setLayoutData(gridData_1);
bRemoveFile.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
if (bRemoveFile.getSelection())tMoveTo.setText("");
bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
bRemoveFile.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.CR) {
applyNode();
}
}
});
bRemoveFile.setEnabled(false);
final Label movweToLabel = new Label(composite_3, SWT.NONE);
movweToLabel.setText("Move to");
tMoveTo = new Text(composite_3, SWT.BORDER);
final GridData gridData_3 = new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData_3.horizontalIndent = 5;
tMoveTo.setLayoutData(gridData_3);
tMoveTo.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
if (!tMoveTo.getText().equals(""))bRemoveFile.setSelection(false);
bApplyNode.setEnabled(isValidNode());
if (bApplyNode.getEnabled())
getShell().setDefaultButton(bApplyNode);
}
});
tMoveTo.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.CR) {
applyNode();
}
}