Examples of FocusAdapter


Examples of org.eclipse.swt.events.FocusAdapter

        group3.setLayout(gridLayout2);
        group3.setLayoutData(gridData2);
        label2 = new Label(group3, SWT.NONE);
        label2.setText("Set Back Count:");
        sSetBackCount = new Text(group3, SWT.BORDER);
        sSetBackCount.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            sSetBackCount.selectAll();
          }
        });
        sSetBackCount.addVerifyListener(new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
                e.doit = Utils.isOnlyDigits(e.text);
            }
        });
        sSetBackCount.setLayoutData(new GridData(48, SWT.DEFAULT));
        bIsMaximum = new Button(group3, SWT.CHECK);

        final Label delayLabel = new Label(group3, SWT.NONE);
        delayLabel.setText("Delay:");
        sSetBackHours = new Text(group3, SWT.BORDER);
        sSetBackHours.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            sSetBackHours.selectAll();
          }
        });
        sSetBackHours.addVerifyListener(new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
                e.doit = Utils.isOnlyDigits(e.text);
            }
        });
        label7 = new Label(group3, SWT.NONE);
        label7.setText(":");
        sSetBackCount.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
            public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
                getShell().setDefaultButton(bApplySetback);
                bApplySetback.setEnabled(true);
            }
        });
        bIsMaximum.setText("Max");
        bIsMaximum.setLayoutData(gridData6);
        sSetBackMinutes = new Text(group3, SWT.BORDER);
        sSetBackMinutes.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            sSetBackMinutes.selectAll();
          }
        });
        sSetBackMinutes.addVerifyListener(new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
                e.doit = Utils.isOnlyDigits(e.text);
            }
        });
        label9 = new Label(group3, SWT.NONE);
        label9.setText(":");
        sSetBackSeconds = new Text(group3, SWT.BORDER);
        sSetBackSeconds.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            sSetBackSeconds.selectAll();
          }
        });
        sSetBackSeconds.addVerifyListener(new VerifyListener() {
View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

    lblJob = new Label(jobsAndOrdersGroup, SWT.NONE);
    lblJob.setLayoutData(new GridData(73, SWT.DEFAULT));
    lblJob.setText("Job / Order ID");

    tJob = new Text(jobsAndOrdersGroup, SWT.BORDER);
    tJob.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tJob.selectAll();
      }
    });
    tJob.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if(type == Editor.JOB){
          listener.setJob(tJob.getText());
        } else {
          listener.setOrderId(tJob.getText());
        }

      }
    });
    final GridData gridData_3 = new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1);
    tJob.setLayoutData(gridData_3);
    final Label startAtLabel = new Label(jobsAndOrdersGroup, SWT.NONE);
    startAtLabel.setLayoutData(new GridData());
    startAtLabel.setText("Start at");

    final Composite composite = new Composite(jobsAndOrdersGroup, SWT.NONE);
    final GridData gridData = new GridData(GridData.BEGINNING, GridData.FILL, false, false);
    composite.setLayoutData(gridData);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 11;
    gridLayout.verticalSpacing = 0;
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 0;
    gridLayout.horizontalSpacing = 0;
    composite.setLayout(gridLayout);

    txtYear = new Text(composite, SWT.BORDER);
    txtYear.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(!event)
          return;
        setTime();
      }
    });
    txtYear.setEnabled(false);
    txtYear.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtYear.setTextLimit(4);
    final GridData gridData_7 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    gridData_7.widthHint = 40;
    txtYear.setLayoutData(gridData_7);

    final Label label = new Label(composite, SWT.NONE);
    label.setText("-");

    txtMonth = new Text(composite, SWT.BORDER);
    txtMonth.addFocusListener(new FocusAdapter() {
      public void focusLost(final FocusEvent e) {
        txtMonth.setText(Utils.fill(2, txtMonth.getText()));   
      }
    });
    txtMonth.setEnabled(false);
    txtMonth.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) { 
        if(!event)
          return;
        Utils.setBackground(1, 12, txtMonth);
        if(!txtMonth.getBackground().equals(Options.getRequiredColor()))
          setTime();
      }
    });
    txtMonth.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtMonth.setTextLimit(2);
    final GridData gridData_9 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    gridData_9.widthHint = 20;
    txtMonth.setLayoutData(gridData_9);

    final Label label_1 = new Label(composite, SWT.NONE);
    label_1.setText("-");

    txtDay = new Text(composite, SWT.BORDER);
    txtDay.addFocusListener(new FocusAdapter() {
      public void focusLost(final FocusEvent e) {
        txtDay.setText(Utils.fill(2, txtDay.getText()));
      }
    });
    txtDay.setEnabled(false);
    txtDay.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(!event)
          return;
        Utils.setBackground(1, 31, txtDay);
        if(!txtDay.getBackground().equals(Options.getRequiredColor()))
          setTime();
      }
    });
    txtDay.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtDay.setTextLimit(2);
    final GridData gridData_13 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    gridData_13.widthHint = 20;
    txtDay.setLayoutData(gridData_13);

    final Label label_2 = new Label(composite, SWT.NONE);
    label_2.setText("      ");

    txtHour = new Text(composite, SWT.BORDER);
    txtHour.addFocusListener(new FocusAdapter() {
      public void focusLost(final FocusEvent e) {
        txtHour.setText(Utils.fill(2, txtHour.getText()));
      }
    });
    txtHour.setEnabled(false);
    txtHour.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(!event)
          return;
        Utils.setBackground(0, 24, txtHour);
        if(!txtHour.getBackground().equals(Options.getRequiredColor()))
          setTime();
      }
    });
    txtHour.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtHour.setTextLimit(2);
    final GridData gridData_14 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    gridData_14.widthHint = 20;
    txtHour.setLayoutData(gridData_14);

    final Label label_3 = new Label(composite, SWT.NONE);
    label_3.setText(":");

    txtMin = new Text(composite, SWT.BORDER);
    txtMin.addFocusListener(new FocusAdapter() {
      public void focusLost(final FocusEvent e) {
        txtMin.setText(Utils.fill(2, txtMin.getText()));
      }
    });
    txtMin.setEnabled(false);
    txtMin.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(!event)
          return;
        Utils.setBackground(0, 60, txtMin);
        if(!txtMin.getBackground().equals(Options.getRequiredColor()))
          setTime();
      }
    });
    txtMin.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtMin.setTextLimit(2);
    final GridData gridData_1 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    gridData_1.widthHint = 20;
    txtMin.setLayoutData(gridData_1);

    final Label label_4 = new Label(composite, SWT.NONE);
    label_4.setText(":");

    txtSec = new Text(composite, SWT.BORDER);
    txtSec.addFocusListener(new FocusAdapter() {
      public void focusLost(final FocusEvent e) {
        txtSec.setText(Utils.fill(2, txtSec.getText()));
      }
    });
    txtSec.setEnabled(false);
    txtSec.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if(!event)
          return;
        Utils.setBackground(0, 60, txtSec);
        if(!txtSec.getBackground().equals(Options.getRequiredColor()))
          setTime();
      }
    });
    txtSec.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtSec.setTextLimit(2);
    final GridData gridData_6 = new GridData(GridData.FILL, GridData.CENTER, false, false);
    gridData_6.widthHint = 20;
    txtSec.setLayoutData(gridData_6);

    cboTimes = new Combo(jobsAndOrdersGroup, SWT.READ_ONLY);
    cboTimes.setVisibleItemCount(7);

    cboTimes.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        normalized(cboTimes.getText());
        setTime();
        initTimes(listener.getAt());
      }
    });
    cboTimes.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    priorityLabel = new Label(jobsAndOrdersGroup, SWT.NONE);
    final GridData gridData_11 = new GridData();
    priorityLabel.setLayoutData(gridData_11);
    priorityLabel.setText("Priority");

    tPriority = new Text(jobsAndOrdersGroup, SWT.BORDER);
    tPriority.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tPriority.selectAll();
      }
    });
    tPriority.setEnabled(false);
    tPriority.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        listener.setPriority(tPriority.getText());

      }
    });
    tPriority.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
    titleLabel = new Label(jobsAndOrdersGroup, SWT.NONE);
    titleLabel.setLayoutData(new GridData());
    titleLabel.setText("Title");

    tTitle = new Text(jobsAndOrdersGroup, SWT.BORDER);
    tTitle.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tTitle.selectAll();
      }
    });
    tTitle.setEnabled(false);
View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

        final Label lblLogic = new Label(actionsGroup, SWT.NONE);
        lblLogic.setText("Logic:");

        txtLogic = new Text(actionsGroup, SWT.BORDER);
        txtLogic.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            txtLogic.selectAll();
          }
        });
        txtLogic.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            listener.setLogic(txtLogic.getText());
          }
        });
        txtLogic.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

        butEventsOperation = new Button(actionsGroup, SWT.NONE);
        butEventsOperation.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            ArrayList list = new ArrayList();
            list.addAll(listener.getGroups());
           
            LogicOperationDialog logicOperationDialog = new LogicOperationDialog(SWT.NONE);
            logicOperationDialog.open(txtLogic, list);
          }
        });
        butEventsOperation.setText("Operation");

        final Label label = new Label(actionsGroup, SWT.HORIZONTAL | SWT.SEPARATOR);
        final GridData gridData_1 = new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1);
        //gridData_1.heightHint = 18;
        label.setLayoutData(gridData_1);
        label.setText("label");
        new Label(actionsGroup, SWT.NONE);

        final Group group = new Group(actionsGroup, SWT.NONE);
        group.setText("Events Group");
        final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true, 3, 1);
        group.setLayoutData(gridData);
        final GridLayout gridLayout_1 = new GridLayout();
        gridLayout_1.numColumns = 4;
        group.setLayout(gridLayout_1);

        final Label groupLabel = new Label(group, SWT.NONE);
        groupLabel.setText("Group: ");

        txtGroup = new Text(group, SWT.BORDER);
        txtGroup.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            txtGroup.selectAll();   
          }
        });
        txtGroup.setBackground(SWTResourceManager.getColor(255, 255, 217));
       
        txtGroup.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            if (e.keyCode == SWT.CR && !txtGroup.equals(""))
              apply();
          }
        });
        txtGroup.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            butApply.setEnabled(true);
            butEventGroupOperation.setEnabled(txtGroup.getText().length() > 0);
               
          }
        });
        txtGroup.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));

        butApply = new Button(group, SWT.NONE);
        butApply.setEnabled(false);
        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 logicLabel = new Label(group, SWT.NONE);
        logicLabel.setText("Logic: ");

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

Examples of org.eclipse.swt.events.FocusAdapter

        groupStartTimeFuction.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
        final GridLayout gridLayout = new GridLayout();
        groupStartTimeFuction.setLayout(gridLayout);

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

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

Examples of org.eclipse.swt.events.FocusAdapter

    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

Examples of org.eclipse.swt.events.FocusAdapter

    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

Examples of org.eclipse.swt.events.FocusAdapter

    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

Examples of org.eclipse.swt.events.FocusAdapter

    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

Examples of org.eclipse.swt.events.FocusAdapter

    * 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
TOP
Copyright © 2018 www.massapi.com. 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.