}
});
butGoto.setAlignment(SWT.RIGHT);
cJob = new Combo(gNodes, SWT.BORDER);
cJob.setVisibleItemCount(9);
cJob.setMenu(new sos.scheduler.editor.app.ContextMenu(cJob, dom, Editor.JOB).getMenu());
//Utils.goTo(cJob.getText(), listener.get_dom(), sos.scheduler.editor.app.Editor.JOB);
/*cJob.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event e) {
//e.doit = cJob.getSelectionCount() > 0;
}
});
*/
cJob.addMouseListener(new MouseAdapter() {
public void mouseDown(final MouseEvent e) {
if(refresh) {
if(listener.getJobs() != null) {
cJob.setItems(listener.getJobs());
refresh = false;
}
}
}
});
cJob.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
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())