Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.FocusAdapter


    final Label lblLogic = new Label(group, SWT.NONE);
    lblLogic.setLayoutData(new GridData());
    lblLogic.setText("Event Name");

    txtEventName = new Text(group, SWT.BORDER);
    txtEventName.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtEventName.selectAll();
      }
    });
   
    txtEventName.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtEventName.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtEventName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    butApply = new Button(group, SWT.NONE);
    butApply.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        apply();
      }
    });
    butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butApply.setText("Apply");

    final Label eventTitleLabel = new Label(group, SWT.NONE);
    eventTitleLabel.setLayoutData(new GridData());
    eventTitleLabel.setText("Event Title");

    txtTitle = new Text(group, SWT.BORDER);
   
    txtTitle.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtTitle.selectAll();
      }
    });
    txtTitle.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtTitle.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtTitle.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    butNew = new Button(group, SWT.NONE);
    butNew.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        refresh();
      }
    });
    butNew.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butNew.setText("New");

    matchingAttributesGroup = new Group(group, SWT.NONE);
    matchingAttributesGroup.setText("Matching Attributes");
    matchingAttributesGroup.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3, 1));
    final GridLayout gridLayout_1 = new GridLayout();
    gridLayout_1.marginTop = 5;
    gridLayout_1.numColumns = 4;
    matchingAttributesGroup.setLayout(gridLayout_1);

    final Label txtEventClass = new Label(matchingAttributesGroup, SWT.NONE);
    txtEventClass.setText("Event Class");

    cboEventClass = new Combo(matchingAttributesGroup, SWT.NONE);
    cboEventClass.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    cboEventClass.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    cboEventClass.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label labeld = new Label(matchingAttributesGroup, SWT.NONE);
    labeld.setText("Event Id");

    txtEventId = new Text(matchingAttributesGroup, SWT.BORDER);
    txtEventId.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtEventId.selectAll();   
      }
    });
    txtEventId.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtEventId.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtEventId.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label jobNameLabel = new Label(matchingAttributesGroup, SWT.NONE);
    jobNameLabel.setText("Job Name");

    txtJobname = new Text(matchingAttributesGroup, SWT.BORDER);
    txtJobname.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtJobname.selectAll();
      }
    });
    txtJobname.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtJobname.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtJobname.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label jobChainLabel = new Label(matchingAttributesGroup, SWT.NONE);
    jobChainLabel.setText("Job Chain");

    txtJobChain = new Text(matchingAttributesGroup, SWT.BORDER);
    txtJobChain.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtJobChain.selectAll();
      }
    });
    txtJobChain.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtJobChain.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtJobChain.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label lblOrderId = new Label(matchingAttributesGroup, SWT.NONE);
    lblOrderId.setText("Order Id");

    txtOrderId = new Text(matchingAttributesGroup, SWT.BORDER);
    txtOrderId.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtOrderId.selectAll();   
      }
    });
    txtOrderId.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtOrderId.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtOrderId.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label exitCodeLabel = new Label(matchingAttributesGroup, SWT.NONE);
    exitCodeLabel.setLayoutData(new GridData());
    exitCodeLabel.setText("Exit Code");

    txtExitCode = new Text(matchingAttributesGroup, SWT.BORDER);
    txtExitCode.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtExitCode.selectAll();
      }
    });
    txtExitCode.addModifyListener(new ModifyListener() {
View Full Code Here


    gridLayout_2.horizontalSpacing = 0;
    gridLayout_2.numColumns = 6;
    composite.setLayout(gridLayout_2);

    txtHourExpirationPeriod = new Text(composite, SWT.BORDER);
    txtHourExpirationPeriod.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtHourExpirationPeriod.selectAll();
      }
    });
    txtHourExpirationPeriod.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        Utils.setBackground(0, 23, txtHourExpirationPeriod);
      }
    });
    txtHourExpirationPeriod.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtHourExpirationPeriod.setLayoutData(new GridData(30, SWT.DEFAULT));
    txtHourExpirationPeriod.setTextLimit(2);

    final Label label = new Label(composite, SWT.NONE);
    label.setAlignment(SWT.CENTER);
    final GridData gridData_2 = new GridData(10, SWT.DEFAULT);
    label.setLayoutData(gridData_2);
    label.setText(":");

    txtMinExpirationPeriod = new Text(composite, SWT.BORDER);
    txtMinExpirationPeriod.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtMinExpirationPeriod.selectAll();
      }
    });
    txtMinExpirationPeriod.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        Utils.setBackground(0, 59, txtMinExpirationPeriod);
      }
    });
    txtMinExpirationPeriod.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtMinExpirationPeriod.setLayoutData(new GridData(30, SWT.DEFAULT));
    txtMinExpirationPeriod.setTextLimit(2);

    final Label label_1 = new Label(composite, SWT.NONE);
    final GridData gridData_2_1 = new GridData(10, SWT.DEFAULT);
    label_1.setLayoutData(gridData_2_1);
    label_1.setAlignment(SWT.CENTER);
    label_1.setText(":");

    txtSecExpirationPeriod = new Text(composite, SWT.BORDER);
    txtSecExpirationPeriod.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtSecExpirationPeriod.selectAll();
      }
    });
    txtSecExpirationPeriod.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        Utils.setBackground(0, 59, txtSecExpirationPeriod);
      }
    });
    txtSecExpirationPeriod.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtSecExpirationPeriod.setLayoutData(new GridData(30, SWT.DEFAULT));
    txtSecExpirationPeriod.setTextLimit(2);

    final Label hhmmssLabel = new Label(composite, SWT.NONE);
    final GridData gridData_3 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    gridData_3.horizontalIndent = 5;
    hhmmssLabel.setLayoutData(gridData_3);
    hhmmssLabel.setText("HH:MM:SS");


    final Label expirationCycleLabel = new Label(matchingAttributesGroup, SWT.NONE);
    expirationCycleLabel.setLayoutData(new GridData(96, SWT.DEFAULT));
    expirationCycleLabel.setText("Expiration Cycle");

    final Composite composite_1 = new Composite(matchingAttributesGroup, SWT.NONE);
    composite_1.setLayoutData(new GridData(GridData.BEGINNING, GridData.FILL, false, false));
    final GridLayout gridLayout_3 = new GridLayout();
    gridLayout_3.verticalSpacing = 0;
    gridLayout_3.numColumns = 6;
    gridLayout_3.marginWidth = 0;
    gridLayout_3.marginHeight = 0;
    gridLayout_3.horizontalSpacing = 0;
    composite_1.setLayout(gridLayout_3);

    txtHourExpirationCycle = new Text(composite_1, SWT.BORDER);
    txtHourExpirationCycle.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtHourExpirationCycle.selectAll();
      }
    });
    txtHourExpirationCycle.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        Utils.setBackground(0, 23, txtHourExpirationCycle);
      }
    });
    txtHourExpirationCycle.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtHourExpirationCycle.setTextLimit(2);
    final GridData gridData_4 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData_4.widthHint = 30;
    txtHourExpirationCycle.setLayoutData(gridData_4);

    final Label label_2 = new Label(composite_1, SWT.NONE);
    final GridData gridData_2_2 = new GridData(10, SWT.DEFAULT);
    label_2.setLayoutData(gridData_2_2);
    label_2.setAlignment(SWT.CENTER);
    label_2.setText(":");

    txtMinExpirationCycle = new Text(composite_1, SWT.BORDER);
    txtMinExpirationCycle.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtMinExpirationCycle.selectAll();
      }
    });
    txtMinExpirationCycle.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        Utils.setBackground(0, 59, txtMinExpirationCycle);
      }
    });
    txtMinExpirationCycle.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtMinExpirationCycle.setTextLimit(2);
    final GridData gridData_5 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData_5.widthHint = 30;
    txtMinExpirationCycle.setLayoutData(gridData_5);

    final Label label_1_1 = new Label(composite_1, SWT.NONE);
    final GridData gridData_2_1_1 = new GridData(10, SWT.DEFAULT);
    label_1_1.setLayoutData(gridData_2_1_1);
    label_1_1.setAlignment(SWT.CENTER);
    label_1_1.setText(":");

    txtSecExpirationCycle = new Text(composite_1, SWT.BORDER);
    txtSecExpirationCycle.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtSecExpirationCycle.selectAll();
      }
    });
    txtSecExpirationCycle.addModifyListener(new ModifyListener() {
View Full Code Here

    label10 = new Label(gOrder, SWT.NONE);
    label10.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    label10.setText("Order ID");

    tOrderId = new Text(gOrder, SWT.BORDER);
    tOrderId.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tOrderId.selectAll();
      }
    });
    tOrderId.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    tOrderId.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        /*if (event) {                 
                  listener.setOrderId(tOrderId.getText(), true, !checkName());
                    group.setText("Order: " + tOrderId.getText());
                }
         */

        if (event) {
          if(checkName()) {
            listener.setCommandAttribute("id", tOrderId.getText());
            existDetailsConfigurationsFile();
          }
        }
      }
    });
    tOrderId.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 5, 1));

    final Label jobchainLabel = new Label(gOrder, SWT.NONE);
    jobchainLabel.setText("Job chain");

    butGoto = new Button(gOrder, SWT.ARROW | SWT.DOWN);
    butGoto.setVisible(dom != null && !dom.isLifeElement());
    butGoto.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        ContextMenu.goTo(cJobchain.getText(), dom, Editor.JOB_CHAIN);
      }
    });
    butGoto.setAlignment(SWT.RIGHT);

    final Composite composite = new Composite(gOrder, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 5, 1));
    final GridLayout gridLayout = new GridLayout();
    gridLayout.verticalSpacing = 0;
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 0;
    gridLayout.horizontalSpacing = 0;
    composite.setLayout(gridLayout);


    cJobchain = new Combo(composite, SWT.NONE);

    cJobchain.setMenu(new sos.scheduler.editor.app.ContextMenu(cJobchain, dom, Editor.JOB_CHAIN).getMenu());
    cJobchain.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    cJobchain.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if (event)
          if(checkName()) {
            listener.setCommandAttribute("job_chain", cJobchain.getText());
            String curstate = listener.getCommandAttribute("state");
            tState.setItems(listener.getStates());                   
            tState.setText(curstate);

            cboStates.setItems(listener.getStates());
            cboStates.add("global");
            cboStates.setText("global");

            String curEndstate = listener.getCommandAttribute("end_state");
            cboEndState.setItems(listener.getStates());
            cboEndState.setText(curEndstate);
            butDetails.setEnabled(cJobchain.getText().length() > 0);
            cboStates.setEnabled(cJobchain.getText().length() > 0);
            existDetailsConfigurationsFile();
          }
      }
    });
    /*Button butBrowse = new Button(gOrder, SWT.NONE);
        butBrowse.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
        butBrowse.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {           
            String jobname = IOUtils.openDirectoryFile(MergeAllXMLinDirectory.MASK_JOB_CHAIN);
            if(jobname != null && jobname.length() > 0) {
              cJobchain.setText(jobname);
            }
          }
        });
        butBrowse.setText("Browse");
     */


    final Label titleLabel = new Label(gOrder, SWT.NONE);
    final GridData gridData_6 = new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1);
    gridData_6.widthHint = 47;
    titleLabel.setLayoutData(gridData_6);
    titleLabel.setText("Title");

    tTitle = new Text(gOrder, SWT.BORDER);
    tTitle.addFocusListener(new FocusAdapter() {         
      public void focusGained(final FocusEvent e) {
        tTitle.selectAll();
      }
    });
    tTitle.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if (event)
          listener.setCommandAttribute("title", tTitle.getText());
      }
    });
    tTitle.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 5, 1));

    final Label priorityLabel = new Label(gOrder, SWT.NONE);
    priorityLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    priorityLabel.setText("Priority");

    tPriority = new Text(gOrder, SWT.BORDER);
    tPriority.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tPriority.selectAll();
      }
    });
    tPriority.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    tPriority.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if (event)
          listener.setCommandAttribute("priority", tPriority.getText());
      }
    });
    tPriority.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 5, 1));

    final Label stateLabel = new Label(gOrder, SWT.NONE);
    stateLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    stateLabel.setText("State");

    tState = new Combo(gOrder, SWT.BORDER);
    tState.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if (event)
          listener.setCommandAttribute("state", tState.getText());
      }
    });
    tState.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 5, 1));

    final Label endStateLabel = new Label(gOrder, SWT.NONE);
    endStateLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    endStateLabel.setText("End State");

    cboEndState = new Combo(gOrder, SWT.NONE);
    cboEndState.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if (event)
          listener.setCommandAttribute("end_state", cboEndState.getText());
      }
    });
    cboEndState.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 5, 1));
    new Label(gOrder, SWT.NONE);
    new Label(gOrder, SWT.NONE);

    
    final Label stateLabel_1 = new Label(gOrder, SWT.NONE);
    stateLabel_1.setText("State:");

    cboStates = new Combo(gOrder, SWT.NONE);
    cboStates.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    butRemove = new Button(gOrder, SWT.NONE);
    butRemove.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        existDetailsConfigurationsFile();
      }
    });
    butRemove.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if(xmlDetailsConfigFilename!= null && xmlDetailsConfigFilename.length() > 0 && new File(xmlDetailsConfigFilename).exists()) {
          int ok = MainWindow.message(Messages.getString("detailform.remove_state"), //$NON-NLS-1$
              SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);

          if (ok == SWT.YES) {
            if(!new File(xmlDetailsConfigFilename).delete())
              MainWindow.message("could not Remove Job Chain Node File " + xmlDetailsConfigFilename, SWT.ICON_INFORMATION );           

          }
          existDetailsConfigurationsFile();
        }
      }
    });
    butRemove.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_delete.gif"));

    butDetails = new Button(gOrder, SWT.NONE);
    butDetails.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        existDetailsConfigurationsFile();
      }
    });
    butDetails.addSelectionListener(new SelectionAdapter() {
View Full Code Here

    label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    label.setText("Job Name:");
   
    tName = new Text(gMain, SWT.BORDER);
   
    tName.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        //tName.selectAll();
      }
      @Override
      public void focusLost(FocusEvent e) {
View Full Code Here

    label14.setText("Heartbeat Timeout");
    createComposite();
    label1 = new Label(gScript, SWT.NONE);
    label1.setText("Heartbeat Own Timeout");
    tOwnTimeout = new Text(gScript, SWT.BORDER);
    tOwnTimeout.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tOwnTimeout.selectAll();
      }
    });
   
    tOwnTimeout.setLayoutData(gridData);
    tOwnTimeout.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        listener.setHeartbeatOwnTimeout(tOwnTimeout.getText());
      }
    });
    label3 = new Label(gScript, SWT.NONE);
    label3.setText("Heartbeat Warn Timeout");

    tWarnTimeout = new Text(gScript, SWT.BORDER);
    tWarnTimeout.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tWarnTimeout.selectAll();
      }
    });
    tWarnTimeout.addModifyListener(new ModifyListener() {
View Full Code Here

    * This method initializes composite
    */
   private void createComposite() {

     tTimeout = new Text(gScript, SWT.BORDER);
     tTimeout.addFocusListener(new FocusAdapter() {
       public void focusGained(final FocusEvent e) {
         tTimeout.selectAll();
       }
     });
     tTimeout.addModifyListener(new ModifyListener() {
View Full Code Here

          }
          */
        }
      }
    });
    tName.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        //tName.selectAll();
      }
    });
    final GridData gridData_4 = new GridData(GridData.FILL, GridData.BEGINNING, true, false, 1, 1);
    gridData_4.widthHint = 273;
    tName.setLayoutData(gridData_4);
    tName.setText(listener.getChainName());
    tName.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    tName.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if(init) return;
       
        boolean existname = Utils.existName(tName.getText(), listener.getChain(), "job_chain");
        if (existname)
          tName.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
        else {
          //getShell().setDefaultButton(bApplyChain);
          tName.setBackground(null);
        }       

        if(update != null)
          update.updateTreeItem("Job Chain: " + tName.getText());
       
        listener.setChainName(tName.getText());

        jobChainGroup.setText("Job Chain:" + (listener.getChainName() != null ? listener.getChainName() : ""));               
        changeJobChainName = true;
      }
    });

    butDetails = new Button(jobChainGroup, SWT.NONE);
    butDetails.setEnabled(true);
    butDetails.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) { 
        if(listener.get_dom().isChanged() && changeJobChainName){
          if(listener.get_dom().getFilename() == null)
            MainWindow.message("Please save your Jobchain before selecting the Jobchain Node Parameters.", SWT.ICON_WARNING);
          else
            MainWindow.message("The Jobchain Name has been changed.\nPlease save your changes before selecting the Jobchain Node Parameters.", SWT.ICON_WARNING);
         
          return;
        } else {
          changeJobChainName = false;
        }
        showDetails(null);
      }
    });
    butDetails.setText("Parameter");
   
    final Label titleLabel = new Label(jobChainGroup, SWT.NONE);
    titleLabel.setText("Title");

    txtTitle = new Text(jobChainGroup, SWT.BORDER);
    txtTitle.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtTitle.selectAll();
      }
    });
    txtTitle.addModifyListener(new ModifyListener() {
View Full Code Here

    label3.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    label3.setText("Scheduler ID:");
    label3.setVisible(!listener.get_dom().isLifeElement() && !listener.get_dom().isDirectory());
    GridData gridData3 = new GridData(GridData.FILL, GridData.CENTER, false, false, 3, 1);
    tSpoolerID = new Text(gMain, SWT.BORDER);
    tSpoolerID.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tSpoolerID.selectAll();
      }
    });
    tSpoolerID.setLayoutData(gridData3);       
    tSpoolerID.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if(init) return;
        listener.setSpoolerID(tSpoolerID.getText());
      }
    });
   
    tSpoolerID.setVisible(!listener.get_dom().isLifeElement() && !listener.get_dom().isDirectory());

    final Label java_optionsLabel = new Label(gMain, SWT.NONE);
    java_optionsLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    java_optionsLabel.setText("Java Options:");

    txtJavaOptions = new Text(gMain, SWT.BORDER);
    txtJavaOptions.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtJavaOptions.selectAll();
      }
    });
    txtJavaOptions.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setJavaOptions(txtJavaOptions.getText());
      }
    });
    txtJavaOptions.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 3, 1));
   
    final Label ignore_signalLabel = new Label(gMain, SWT.NONE);
    ignore_signalLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    ignore_signalLabel.setText("Ignore Signals:");
   
    tIgnoreSignals = new Text(gMain, SWT.BORDER);
    tIgnoreSignals.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tIgnoreSignals.selectAll();
      }
    });
    tIgnoreSignals.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setIgnoreSignal(tIgnoreSignals.getText());
      }
    });
    final GridData gridData_3 = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
//    gridData_3.widthHint = 48;
    tIgnoreSignals.setLayoutData(gridData_3);
   
    addButton = new Button(gMain, SWT.NONE);
    addButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if(init) return;
        if (tIgnoreSignals.getText().equals("")){
          tIgnoreSignals.setText(cSignals.getText());
        }else {
          tIgnoreSignals.setText( tIgnoreSignals.getText() + " " + cSignals.getText());
        }
      }
    });
    final GridData gridData_5 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    addButton.setLayoutData(gridData_5);
    addButton.setText("<- Add <-");
   
    cSignals = new Combo(gMain, SWT.NONE)
    cSignals.setItems(new String[] {"SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGIOT", "SIGBUS", "SIGFPE", "SIGKILL", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP", "SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGPOLL", "SIGIO", "SIGPWR", "SIGSYS."});
    final GridData gridData_4 = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
    cSignals.setLayoutData(gridData_4);
    label17 = new Label(gMain, SWT.NONE);
    final GridData gridData_7 = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
    gridData_7.widthHint = 41;
    label17.setLayoutData(gridData_7);
    label17.setText("Priority:");
   
    sPriority = new Combo(gMain, SWT.NONE);
    sPriority.setItems(new String[] { "idle", "below_normal", "normal", "above_normal", "high" });
    sPriority.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = (Utils.isOnlyDigits(e.text) || e.text.equals("idle") || e.text.equals("below_normal")
            || e.text.equals("normal") || e.text.equals("above_normal") || e.text.equals("high"));
       
      }
    });
    final GridData gridData_1 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData_1.verticalIndent = -1;
    sPriority.setLayoutData(gridData_1);
    sPriority.addModifyListener(new ModifyListener() {
     
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        Utils.setBackground(-20, 20, sPriority);
        listener.setPriority(sPriority.getText());
      }
    });
    new Label(gMain, SWT.NONE);
    new Label(gMain, SWT.NONE);

    final Label visibleLabel = new Label(gMain, SWT.NONE);
    visibleLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    visibleLabel.setText("Visible:");

    comVisible = new Combo(gMain, SWT.READ_ONLY);
    comVisible.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    comVisible.setItems(new String[] { "", "yes", "no", "never" });
    comVisible.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setVisivle(comVisible.getText());
      }
    });
    new Label(gMain, SWT.NONE);
    new Label(gMain, SWT.NONE);
    //gridData_16.widthHint = 17;

    final Label minMaskLabel = new Label(gMain, SWT.NONE);
    minMaskLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    minMaskLabel.setText("Min Tasks");
   
    tMintasks = new Text(gMain, SWT.BORDER);
    tMintasks.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tMintasks.selectAll();   
      }
    });
    tMintasks.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    tMintasks.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setMintasks(tMintasks.getText());
      }
    });
    final GridData gridData_2 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    tMintasks.setLayoutData(gridData_2);
    new Label(gMain, SWT.NONE);
    new Label(gMain, SWT.NONE);
   
    label15 = new Label(gMain, SWT.NONE);
    label15.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    label15.setText("Tasks:");
   
    sTasks = new Text(gMain, SWT.BORDER);
    sTasks.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        sTasks.selectAll();   
      }
    });
    sTasks.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    sTasks.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    sTasks.addSelectionListener(new SelectionAdapter() {
      public void widgetDefaultSelected(final SelectionEvent e) {
      }
    });
    sTasks.addModifyListener(new ModifyListener() {
     
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setTasks(sTasks.getText());
      }
    });
    new Label(gMain, SWT.NONE);
    new Label(gMain, SWT.NONE);
    label13 = new Label(gMain, SWT.NONE);
    label13.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    label13.setText("Timeout:");
   
    sTimeout = new Text(gMain, SWT.BORDER);
    sTimeout.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        sTimeout.selectAll();
      }
    });
    sTimeout.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        //e.doit = Utils.isOnlyDigits(e.text);
      }
    });
   
    sTimeout.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setTimeout(sTimeout.getText());
      }
    });
    final GridData gridData_9 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    //gridData_9.widthHint = 75;
    sTimeout.setLayoutData(gridData_9);

    final Label hhmmssLabel = new Label(gMain, SWT.NONE);
    hhmmssLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    hhmmssLabel.setText("HH:MM:SS ");
    label11 = new Label(gMain, SWT.NONE);
    label11.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
    label11.setText("Idle Timeout:");
   
    sIdleTimeout = new Text(gMain, SWT.BORDER);
    sIdleTimeout.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        sIdleTimeout.selectAll();
      }
    });
    sIdleTimeout.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
   
    sIdleTimeout.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        //e.doit = Utils.isOnlyDigits(e.text);
       
      }
    });
    sIdleTimeout.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setIdleTimeout(sIdleTimeout.getText());
      }
    });

    final Label hhmmssLabel_1 = new Label(gMain, SWT.NONE);
    hhmmssLabel_1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    hhmmssLabel_1.setText("HH:MM:SS or HH:MM or SS never");

    final Label warnIfLongerLabel = new Label(gMain, SWT.NONE);
    warnIfLongerLabel.setText("Warn if longer than:");

    txtWarnIfLongerThan = new Text(gMain, SWT.BORDER);
    txtWarnIfLongerThan.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
      }
    });
    txtWarnIfLongerThan.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtWarnIfLongerThan.selectAll();
      }
    });
    txtWarnIfLongerThan.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(init) return;
        listener.setWarnIfLongerThan(txtWarnIfLongerThan.getText());
      }
    });
    txtWarnIfLongerThan.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    final Label hhmmssLabel_1_1 = new Label(gMain, SWT.NONE);
    hhmmssLabel_1_1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    hhmmssLabel_1_1.setText("HH:MM:SS or Percentage");

    final Label warnIfShorterLabel = new Label(gMain, SWT.NONE);
    warnIfShorterLabel.setLayoutData(new GridData());
    warnIfShorterLabel.setText("Warn if shorter than:");

    txtWarnIfShorterThan = new Text(gMain, SWT.BORDER);
    txtWarnIfShorterThan.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtWarnIfShorterThan.selectAll();
      }
    });
    txtWarnIfShorterThan.addModifyListener(new ModifyListener() {
View Full Code Here

    final Label nameLabel = new Label(parameterGroup, SWT.NONE);
    nameLabel.setText("Name");

    txtName = new Text(parameterGroup, SWT.BORDER);
    txtName.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtName.selectAll();   
      }
    });
    txtName.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if( !txtName.getText().equals("") && 
            ( tableParams.getSelectionCount() == ||
                ( tableParams.getSelectionCount() > 0 && !tableParams.getSelection()[0].getText(0).equalsIgnoreCase(txtName.getText())))){
          isEditableParam=true;
          butApplyParam.setEnabled(isEditableParam);
          txtValue.setEnabled(true);
          butText.setEnabled(true);
          paramText.setText("");
          txtParamNote.setEnabled(true);
        } else {
          butText.setEnabled(false);         
        }
      }
    });
    txtName.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {

        if (e.keyCode == SWT.CR && !txtName.getText().equals("")){
          addParam();
        }

      }
    });

    txtName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    txtName.setFocus();
   
    final Label valueLabel = new Label(parameterGroup, SWT.NONE);
    valueLabel.setText("Value");

    txtValue = new Text(parameterGroup, SWT.BORDER);
    txtValue.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtValue.selectAll();
      }
    });
    txtValue.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtName.getText().equals("")){
          addParam();
        }
      }
    });
    txtValue.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {       
        if( !txtName.getText().equals("") && 
            ( tableParams.getSelectionCount() == ||
                ( tableParams.getSelectionCount() > 0 && !tableParams.getSelection()[0].getText(1).equalsIgnoreCase(txtValue.getText())))){
          isEditableParam=true;
          butApplyParam.setEnabled(isEditableParam);
          if(txtValue.getText().trim().length() > 0)
            butText.setEnabled(false);
          else
            butText.setEnabled(true);
       
      }
    });
    txtValue.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    butText = new Button(parameterGroup, SWT.NONE);
    butText.setEnabled(false);
    butText.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        String ntext = "";
        if(tableParams.getSelectionCount() > 0 ) {
          TableItem item = tableParams.getSelection()[0];
          ntext = item.getText(2);
        }
       
        String text = sos.scheduler.editor.app.Utils.showClipboard(ntext, getShell(), true, "");       
        if(text != null && !text.trim().equalsIgnoreCase(ntext)) {                 
          paramText.setText(text);
          txtValue.setText("");
          txtValue.setEnabled(false);
          butText.setEnabled(true);
          addParam();
        } else if (text == null)  {         
          txtValue.setEnabled(true);
          butText.setEnabled(true);
        } else {
          txtValue.setEnabled(true);
          butText.setEnabled(false);
        }
        butApply.setEnabled(true);

      }
    });
    butText.setText("Text");

    butApplyParam = new Button(parameterGroup, SWT.NONE);
    butApplyParam.setEnabled(isEditableParam);
    butApplyParam.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        addParam();

      }
    });
    final GridData gridData_9 = new GridData(GridData.FILL, GridData.BEGINNING, false, false);
    butApplyParam.setLayoutData(gridData_9);
    butApplyParam.setText("Apply");

    tableParams = new Table(parameterGroup, SWT.FULL_SELECTION | SWT.BORDER);
    tableParams.setEnabled(false);
    tableParams.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
       
        if(tableParams.getSelectionCount() > 0) {         
          TableItem item = tableParams.getSelection()[0];
          txtName.setText(item.getText(0));         

          //param value ist angegeben
          if(item.getText(1) != null && item.getText(1).trim().length() > 0) {
            paramText.setText("");
            txtValue.setText(item.getText(1));
            txtValue.setEnabled(true);           
            butText.setEnabled(false);
          }

          //param Textknoten ist angegeben
          if(item.getText(2) != null && item.getText(2).trim().length() > 0) {
            paramText.setText(item.getText(2));
            txtValue.setText("");
            txtValue.setEnabled(false);
            butText.setEnabled(true);
          }

          if(item.getText(1).trim().equals("") && item.getText(2).trim().equals("")) {
            paramText.setText("");
            txtValue.setText("");
            txtValue.setEnabled(true);
            butText.setEnabled(true);
          }


          txtParamNote.setText(detailListener.getParamNote(item.getText(0), comboLanguage.getText()));
          butRemove.setEnabled(true);
          txtParamNote.setEnabled(true);
          isEditableParam=false;
        } else {
          butRemove.setEnabled(false);
        }
      }
    });
    tableParams.setLinesVisible(true);
    tableParams.setHeaderVisible(true);
    final GridData gridData_4 = new GridData(GridData.FILL, GridData.FILL, true, true, 5, 7);
    tableParams.setLayoutData(gridData_4);

    final TableColumn newColumnTableColumn = new TableColumn(tableParams, SWT.NONE);
    newColumnTableColumn.setWidth(181);
    newColumnTableColumn.setText("Name");

    final TableColumn newColumnTableColumn_1 = new TableColumn(tableParams, SWT.NONE);
    newColumnTableColumn_1.setWidth(150);
    newColumnTableColumn_1.setText("Value");

    final TableColumn newColumnTableColumn_2 = new TableColumn(tableParams, SWT.NONE);
    newColumnTableColumn_2.setWidth(100);
    newColumnTableColumn_2.setText("Text");

    final Button butNew = new Button(parameterGroup, SWT.NONE);
    butNew.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        txtName.setText("");
        txtValue.setText("");
        paramText.setText("");
        txtValue.setEnabled(true);
        paramText.setEnabled(true);
        tableParams.deselectAll();
        txtParamNote.setText("");
      }
    });
    butNew.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butNew.setText("New");

    final Composite composite_2 = new Composite(parameterGroup, SWT.NONE);
    final GridData gridData_2_1 = new GridData(GridData.CENTER, GridData.CENTER, false, false);
    gridData_2_1.heightHint = 67;
    composite_2.setLayoutData(gridData_2_1);
    composite_2.setLayout(new GridLayout());

    butUp = new Button(composite_2, SWT.NONE);
    butUp.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        detailListener.changeUp(tableParams);
      }
    });
    butUp.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butUp.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_up.gif"));

    butDown = new Button(composite_2, SWT.NONE);
    butDown.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        detailListener.changeDown(tableParams);
      }
    });
    butDown.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
    butDown.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_down.gif"));


    final Button parameterButton = new Button(parameterGroup, SWT.NONE);
    parameterButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        startWizzard();
      }
    });
    //parameterButton.setVisible(type != Editor.DETAILS);
    parameterButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    parameterButton.setText("Wizzard");
    butRemove = new Button(parameterGroup, SWT.NONE);
    butRemove.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if(tableParams.getSelectionCount() > 0) {
          detailListener.deleteParameter(tableParams, tableParams.getSelectionIndex());
          txtParamNote.setText("");
          txtName.setText("");
          txtValue.setText("");
          tableParams.deselectAll();
          butRemove.setEnabled(false);
          txtParamNote.setText("");
          isEditableParam = false;
          butApplyParam.setEnabled(isEditableParam);
          butApply.setEnabled(isEditable);
          txtName.setFocus();
          if(gui!=null)
            gui.updateParam();
        }
      }
    });
    final GridData gridData_8 = new GridData(GridData.FILL, GridData.BEGINNING, false, true);
    gridData_8.widthHint = 64;
    gridData_8.minimumWidth = 50;
    butRemove.setLayoutData(gridData_8);
    butRemove.setText("Remove");

    final Button butTemp = new Button(parameterGroup, SWT.NONE);
    butTemp.setLayoutData(new GridData());
    butTemp.setText("Documentation");
    butTemp.setVisible(false);

    butApply = new Button(parameterGroup, SWT.NONE);   
    butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butApply.setEnabled(isEditable);
    FontData fontDatas[] = butApply.getFont().getFontData();
    FontData data = fontDatas[0];
    butApply.setFont(new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD));
    butApply.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
       
        save();
      }
    });
    butApply.setText("Apply Details");
    cancelButton = new Button(parameterGroup, SWT.NONE);
    cancelButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    cancelButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if(butApply.getEnabled()) {
          int count = MainWindow.message(getShell(), sos.scheduler.editor.app.Messages.getString("detailform.close"), SWT.ICON_WARNING | SWT.OK |SWT.CANCEL );
          if(count != SWT.OK) {
            return;
          }
        }
        getShell().dispose();
      }
    });
    cancelButton.setText("Cancel");


    txtParamNote = new Text(parameterGroup, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL);   
    txtParamNote.setEnabled(false);
    txtParamNote.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        if(e.keyCode == 8 || e.keyCode == 127) {
          isEditableParam = true;
          butApplyParam.setEnabled(isEditableParam);
        }
      }
    });
    txtParamNote.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        changeParameNote();

      }

    });
    final GridData gridData_5 = new GridData(GridData.FILL, GridData.FILL, true, true, 5, 3);
    gridData_5.heightHint = 73;
    txtParamNote.setLayoutData(gridData_5);

    comboLanguage = new Combo(parameterGroup, SWT.READ_ONLY);
    comboLanguage.setItems(new String[] {"de", "en"});
    final GridData gridData_7 = new GridData(GridData.FILL, GridData.BEGINNING, false, true);
    comboLanguage.setLayoutData(gridData_7);
    comboLanguage.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {

        txtJobchainNote.setText(detailListener.getNote(comboLanguage.getText()));
        if(tableParams.getSelectionCount() > 0) {
          TableItem item = tableParams.getSelection()[0];
          txtParamNote.setText(detailListener.getParamNote(item.getText(0), comboLanguage.getText()));       
        } else if (txtName.getText() != null && txtName.getText().length() > 0) {
          txtParamNote.setText(detailListener.getParamNote(txtName.getText(), comboLanguage.getText()));
        } else if(txtParamNote.getText() != null && txtParamNote.getText().length()>0) {
          txtParamNote.setText("");
        }
        isEditable=false;
        isEditableParam = false;
        //butApply.setEnabled(isEditable);
        butApplyParam.setEnabled(isEditableParam);
        butRemove.setEnabled(false);

      }
    });
    comboLanguage.select(0);

    butRefreshWizzardNoteParam = new Text(parameterGroup, SWT.CHECK);
    butRefreshWizzardNoteParam.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        refreshTable();
      }
    });
    butRefreshWizzardNoteParam.setVisible(false);
    butRefreshWizzardNoteParam.setLayoutData(new GridData());

    paramText = new Text(parameterGroup, SWT.BORDER);
    paramText.setVisible(false);
    final GridData gridData_14 = new GridData(GridData.CENTER, GridData.BEGINNING, false, false);
    gridData_14.widthHint = 27;
    paramText.setLayoutData(gridData_14);

    jobChainGroup = new Group(parameterGroup, SWT.NONE);
    jobChainGroup.setEnabled(false);
    jobChainGroup.setText("Note");
    jobChainGroup.setText("Note");
    final GridLayout gridLayout_1 = new GridLayout();
    gridLayout_1.numColumns = 2;
    jobChainGroup.setLayout(gridLayout_1);
    final GridData gridData = new GridData(GridData.FILL, GridData.FILL, false, false, 6, 1);
    gridData.horizontalIndent = -1;
    jobChainGroup.setLayoutData(gridData);

    txtJobchainNote = new Text(jobChainGroup, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL);
       
    txtJobchainNote.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
   
    if(detailListener != null) {
      isEditable=true;
      if(gui!=null )
        gui.updateNote();
      detailListener.setNote(txtJobchainNote.getText(), comboLanguage.getText());
      butApply.setEnabled(isEditable);
    }
   
      }
    });
    final GridData gridData_2 = new GridData(GridData.FILL, GridData.FILL, true, false, 1, 2);
    txtJobchainNote.setLayoutData(gridData_2);

    butXML = new Button(jobChainGroup, SWT.NONE);
    butXML.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butXML.setEnabled(false);

    butXML.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        try {
          if(dom != null && dom.isChanged()) {
            MainWindow.message("Please save jobchain configuration file before opening XML Editor.", SWT.ICON_ERROR);
            return;
          }

          if(dom == null && butApply.isEnabled()) {
            //ungespeichert
            int c = MainWindow.message("Should the current values be saved?", SWT.YES | SWT.NO | SWT.ICON_ERROR);
            if(c == SWT.YES)
              detailListener.save();

          }

          if(type == Editor.JOB_CHAINS) {
            DetailXMLEditorDialogForm dialog =
              new DetailXMLEditorDialogForm(detailListener.getConfigurationFilename(), jobChainname, state, _orderId, type, isLifeElement, path);

            dialog.showXMLEditor();

            getShell().dispose();
          } else {
            if(dom != null && dom.getFilename() != null && dom.getFilename().length() > 0) {
              DetailXMLEditorDialogForm dialog = new DetailXMLEditorDialogForm(dom, type, isLifeElement, path);
              dialog.setConfigurationData(confListener, tree, parent);
              dialog.showXMLEditor();
            } else {             
              MainWindow.message("Please save jobchain configuration file before opening XML Editor.", SWT.ICON_ERROR);
            }
          }

        } catch (Exception ex) {
          try {
            System.out.println("..error in " + sos.util.SOSClassUtil.getMethodName() + ": " +ex.getMessage());
            new ErrorLog("error in " + sos.util.SOSClassUtil.getMethodName(), ex);
          } catch(Exception ee) {
            //tu nichts
          }


        }
      }
    });
    butXML.setText("Open XML");

    butDocumentation = new Button(jobChainGroup, SWT.NONE);
    butDocumentation.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
    butDocumentation.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        String filename = null;
        try {

          if(type == Editor.JOB_CHAINS) {
            filename = detailListener.getConfigurationFilename();
          } else {
            if(dom!=null) {
              filename = dom.getFilename();
            }
          }
          if (filename != null && filename.length() > 0) {
            File file = new File(filename);
            if(file.exists()) {
              //Runtime.getRuntime().exec("cmd /C START iExplore ".concat(filename));

              Program prog = Program.findProgram("html");
              if (prog != null) {
                prog.execute(new File(filename).toURL().toString());               
              } else {
                String[] split = Options.getBrowserExec(new File(filename).toURL().toString(), Options.getLanguage());
                Runtime.getRuntime().exec(split);               

              }                  

            } else
              MainWindow.message("Missing documentation " + file.getCanonicalPath() , SWT.ICON_ERROR);
          } else {
            MainWindow.message("Please save jobchain configuration before opening documentation." , SWT.ICON_ERROR);

          }
        } catch (Exception ex) {
          try {
            System.out.println("..could not open file " + filename + " " + ex.getMessage());           
            new ErrorLog("error in " + sos.util.SOSClassUtil.getMethodName() + "..could not open file " + filename, ex);
          } catch(Exception ee) {
            //tu nichts
          }


        }
      }
    });
    butDocumentation.setText("Documentation");

    final Label fileLabel = new Label(parameterGroup, SWT.NONE);
    fileLabel.setLayoutData(new GridData());
    fileLabel.setText("Job Documentation: ");

    txtParamsFile = new Text(parameterGroup, SWT.BORDER);
    txtParamsFile.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtParamsFile.selectAll();
      }
    });
    txtParamsFile.addModifyListener(new ModifyListener() {
View Full Code Here

        group.setText("Job"); // Generated
        group.setLayout(gridLayout); // Generated
        label = new Label(group, SWT.NONE);
        label.setText("Name:"); // Generated
        tName = new Text(group, SWT.BORDER);
        tName.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            tName.selectAll();
          }
        });
        tName.setLayoutData(gridData); // Generated
        tName.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
            public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
                listener.setName(tName.getText());
                Utils.setBackground(tName, true);
            }
        });
        label1 = new Label(group, SWT.NONE);
        label1.setText("Title:"); // Generated
        tTitle = new Text(group, SWT.BORDER);
        tTitle.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            tTitle.selectAll();
          }
        });
        tTitle.setLayoutData(gridData1); // Generated
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.FocusAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.