Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.ModifyListener


        projLabel.setLayoutData(gd);

        fProjText = new Text(comp, SWT.SINGLE | SWT.BORDER);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        fProjText.setLayoutData(gd);
        fProjText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                updateLaunchConfigurationDialog();
            }
        });
        fProjButton = createPushButton(comp, "Browse...", null);
View Full Code Here


        mainLabel.setLayoutData(gd);

        fMainText = new Text(comp, SWT.SINGLE | SWT.BORDER);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        fMainText.setLayoutData(gd);
        fMainText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                updateLaunchConfigurationDialog();
            }
        });
View Full Code Here

        lblName.setText("Name");

        cboConnectname = new Combo(group, SWT.NONE);

        cboConnectname.setItems(listener.getProfileNames());
        cboConnectname.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();

          }
        });
        final GridData gridData_2 = new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
        cboConnectname.setLayoutData(gridData_2);
        cboConnectname.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            //if( !cboConnectname.getText().equals(currProfile.get("name")))
            if( !cboConnectname.getText().equals(currProfile.getProfilename()))
              initForm();
          }
        });

        //if(!shell.isDisposed())
        //cboConnectname.setText(listener.getCurrProfileName());


        final Label protocolLabel = new Label(group, SWT.NONE);
        protocolLabel.setText("Protocol");

        cboProtokol = new Combo(group, SWT.NONE);
        cboProtokol.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
        cboProtokol.setItems(new String[] {"FTP", "SFTP"});

        cboProtokol.select(0);

        final Label hostnameOrIpLabel = new Label(group, SWT.NONE);
        hostnameOrIpLabel.setText("Host Name or IP Address");

        txtHost = new Text(group, SWT.BORDER);
        txtHost.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtHost.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

        final Label portLabel = new Label(group, SWT.NONE);
        portLabel.setText("Port");

        txtPort = new Text(group, SWT.BORDER);
        txtPort.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtPort.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

        final Label userNameLabel = new Label(group, SWT.NONE);
        userNameLabel.setText("User Name");

        txtUsername = new Text(group, SWT.BORDER);
        txtUsername.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtUsername.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
        //txtUsername.setText(currProfile.get("user") != null ? currProfile.get("user").toString() : "");

        final Label passwordLabel = new Label(group, SWT.NONE);
        passwordLabel.setText("Password");     

        txtPassword = new Text(group, SWT.PASSWORD | SWT.BORDER);
        txtPassword.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            if(init) {
              try {
                init = false;
                //TODO
                //System.out.println("todo");
                if(txtPassword.getText().length() > 0) {
                  /*  String key = Options.getProperty("profile.timestamp." + cboConnectname.getText());

                if(key != null && key.length() > 8) {
                  key = key.substring(key.length()-8);
                }
                String password = txtPassword.getText();

                if(password.length() > 0 && sosString.parseToString(key).length() > 0) {
                  password = SOSCrypt.decrypt(key, password);
                }
                txtPassword.setText(password);
                   */
                }
              } catch(Exception ex) {
                System.out.println(ex.getMessage());
              }
            }
            setEnabled();
          }
        });
        txtPassword.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
        //txtPassword.setText(currProfile.get("password") != null ? currProfile.get("password").toString() : "");

        final Label rootLabel = new Label(group, SWT.NONE);
        rootLabel.setText("Root Directory");

        txtRoot = new Text(group, SWT.BORDER);
        txtRoot.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtRoot.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
        //txtRoot.setText(currProfile.get("root") != null ? currProfile.get("root").toString() : "");

        final Label directoryFroLocalLabel = new Label(group, SWT.NONE);
        directoryFroLocalLabel.setText("Directory For Local Copy");

        txtLocalDirectory = new Text(group, SWT.BORDER);
        txtLocalDirectory.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtLocalDirectory.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

        final Label savePasswordLabel = new Label(group, SWT.NONE);
        final GridData gridData_5 = new GridData(SWT.DEFAULT, 24);
        gridData_5.verticalIndent = 5;
        savePasswordLabel.setLayoutData(gridData_5);
        savePasswordLabel.setText("Save Password");

        butSavePassword = new Button(group, SWT.CHECK);
        butSavePassword.setSelection(true);
        butSavePassword.addSelectionListener(new SelectionAdapter() {
          public void widgetDefaultSelected(final SelectionEvent e) {

          }
          public void widgetSelected(final SelectionEvent e) {
            setEnabled();
          }
        });
        butSavePassword.setLayoutData(new GridData());
        new Label(group, SWT.NONE);
        //txtLocalDirectory.setText(currProfile.get("localdirectory") != null ? currProfile.get("localdirectory").toString() : "");

        final Label transferModeLabel = new Label(group, SWT.NONE);
        final GridData gridData_3 = new GridData(GridData.BEGINNING, GridData.END, false, false);
        gridData_3.heightHint = 21;
        transferModeLabel.setLayoutData(gridData_3);
        transferModeLabel.setText("Transfer Mode");

        butAscii = new Button(group, SWT.RADIO);
        butAscii.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            setEnabled();
          }
        });
        butAscii.setLayoutData(new GridData());
        butAscii.setText("ASCII");


        butbinary = new Button(group, SWT.RADIO);
        butbinary.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            setEnabled();
          }
        });
        butbinary.setLayoutData(new GridData());
        butbinary.setText("Binary");

        final TabItem proxyTabItem = new TabItem(tabFolder, SWT.NONE);
        proxyTabItem.setText("Proxy");

        final Group group_1 = new Group(tabFolder, SWT.NONE);
        final GridLayout gridLayout_3 = new GridLayout();
        gridLayout_3.numColumns = 2;
        group_1.setLayout(gridLayout_3);
        proxyTabItem.setControl(group_1);

        useProxyButton = new Button(group_1, SWT.CHECK);
        useProxyButton.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            txtProxyServer.setEnabled(useProxyButton.getSelection());
            txtProxyPort.setEnabled(useProxyButton.getSelection());
            setEnabled();
          }
        });
        useProxyButton.setLayoutData(new GridData(SWT.DEFAULT, 52));
        useProxyButton.setText("Use Proxy");
        new Label(group_1, SWT.NONE);

        final Label proxyServerLabel = new Label(group_1, SWT.NONE);
        proxyServerLabel.setText("Proxy Server");

        txtProxyServer = new Text(group_1, SWT.BORDER);
        txtProxyServer.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtProxyServer.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

        final Label proxyPortLabel = new Label(group_1, SWT.NONE);
        proxyPortLabel.setText("Proxy Port");

        txtProxyPort = new Text(group_1, SWT.BORDER);
        txtProxyPort.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtProxyPort.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

        sshTabItem = new TabItem(tabFolder, SWT.NONE);
        sshTabItem.setText("SSH");

        groupAuthenticationMethods = new Group(tabFolder, SWT.NONE);
        groupAuthenticationMethods.setText("Authentication Methods");
        final GridLayout gridLayout_4 = new GridLayout();
        gridLayout_4.numColumns = 2;
        groupAuthenticationMethods.setLayout(gridLayout_4);
        sshTabItem.setControl(groupAuthenticationMethods);

        new Label(groupAuthenticationMethods, SWT.NONE);
        new Label(groupAuthenticationMethods, SWT.NONE);

        butPublicKey = new Button(groupAuthenticationMethods, SWT.RADIO);
        butPublicKey.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            setEnabled();
          }
        });
        final GridData gridData_4 = new GridData(GridData.BEGINNING, GridData.END, false, false, 2, 1);
        butPublicKey.setLayoutData(gridData_4);
        butPublicKey.setText("Public Key");

        butAuthPassword = new Button(groupAuthenticationMethods, SWT.RADIO);
        butAuthPassword.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            setEnabled();
          }
        });
        butAuthPassword.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
        butAuthPassword.setText("Password");

        butPasswordAndPublic = new Button(groupAuthenticationMethods, SWT.RADIO);
        butPasswordAndPublic.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            setEnabled();
          }
        });
        butPasswordAndPublic.setText("Public Key and Password");
        new Label(groupAuthenticationMethods, SWT.NONE);

        final Label pathToPublicLabel = new Label(groupAuthenticationMethods, SWT.NONE);
        pathToPublicLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
        pathToPublicLabel.setText("Private Key");

        txtDirPublicKey = new Text(groupAuthenticationMethods, SWT.BORDER);
        txtDirPublicKey.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            setEnabled();
          }
        });
        txtDirPublicKey.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

        final Button button_4 = new Button(groupAuthenticationMethods, SWT.NONE);
        button_4.setVisible(false);
        button_4.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
          }
        });
        button_4.setText("...");
        new Label(schedulerGroup, SWT.NONE);

        butApply = new Button(schedulerGroup, SWT.NONE);
        butApply.setEnabled(false);
        butApply.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            try {
              apply();
            } catch (Exception ex) {
              message("could not apply, cause: " + ex.toString(), SWT.ICON_WARNING);
            }

          }
        });
        butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
        butApply.setText("Apply");
        //txtHost.setText(currProfile.get("host") != null ? currProfile.get("host").toString() : "");

        final Button butNewProfile = new Button(schedulerGroup, SWT.NONE);
        butNewProfile.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            newProfile = true;
            cboConnectname.setText("");
            txtPort.setText("");
            txtUsername.setText("");
            txtPassword.setText("");
            txtRoot.setText("");
            txtLocalDirectory.setText("");
            butAscii.setSelection(true);
            butbinary.setSelection(false);
            butSavePassword.setSelection(true);
            txtHost.setText("");
           
            //Proxy
            txtProxyPort.setText("");
            txtProxyServer.setText("");
            txtProxyPort.setEnabled(false);
            txtProxyServer.setEnabled(false);
            useProxyButton.setSelection(false);
            cboProtokol.select(0);
            cboConnectname.setFocus();
            //auth
            txtDirPublicKey.setText("");
            butPublicKey.setSelection(false);
            butPasswordAndPublic.setSelection(false);
            butAuthPassword.setSelection(false);
          }
        });
        butNewProfile.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
        butNewProfile.setText("New Profile");
        //txtPort.setText(currProfile.get("port") != null ? currProfile.get("port").toString() : "");

        final Button butRemove = new Button(schedulerGroup, SWT.NONE);
        butRemove.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            if(cboConnectname.getText().length() == 0)
              return;

            listener.removeProfile(cboConnectname.getText());         
            if(cboConnectname.getItemCount() > 0)
              cboConnectname.select(0);
            initForm();
            saveSettings = true;
          }
        });
        butRemove.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
        butRemove.setText("Remove");


        /*if(currProfile.get("transfermode") != null && currProfile.get("transfermode").toString().equalsIgnoreCase("binary")) {
        butbinary.setSelection(true);
        butAscii.setSelection(false);
      } else {
        butbinary.setSelection(false);
        butAscii.setSelection(true);
      }*/

        // final Tree tree = new Tree(schedulerGroup, SWT.BORDER);



      }

      final Button butClose = new Button(shell, SWT.NONE);
      butClose.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {

          close();

          saved = true;
          shell.dispose();
        }
      });
      butClose.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
      butClose.setText("Close");
      cboProtokol.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {

          if(cboProtokol.getText().equalsIgnoreCase("FTP"))
            groupAuthenticationMethods.setEnabled(false);
          else
View Full Code Here

    gMain.setText("Commands");
    gMain.setLayout(gridLayout);

    cExitcode = new Combo(gMain, SWT.NONE);
    cExitcode.setItems(new String[] {"error", "success", "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"});
    cExitcode.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        listener.setExitCode(cExitcode.getText(), updateTree);
        jobsAndOrdersGroup.setText("Job: " + listener.getName() + " " + listener.getExitCode() + " "
            + (listener.isDisabled() ? " (Disabled)" : ""));
        if (event) {
View Full Code Here

        public void verifyText(final VerifyEvent e) {
          if(!init)//w�hrend der initialiserung sollen keine �berpr�fungen stattfinden
            e.doit = Utils.checkElement(txtName.getText(), dom, sos.scheduler.editor.app.Editor.SCHEDULE, null);
        }
      });
      txtName.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if(!init && !existScheduleName())
            listener.setName(txtName.getText());
        }
      });
      txtName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));


      final Label titleLabel = new Label(scheduleGroup, SWT.NONE);
      titleLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
      titleLabel.setText("Title");

      txtTitle = new Text(scheduleGroup, SWT.BORDER);
      txtTitle.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtTitle.selectAll();
        }
      });
      txtTitle.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if(!init)
            listener.setTitle(txtTitle.getText());
        }
      });
      txtTitle.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

      final Label substitueLabel = new Label(scheduleGroup, SWT.NONE);
      substitueLabel.setText("Substitute");

      cboCombo = new Combo(scheduleGroup, SWT.NONE);
      cboCombo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if(!init)
            listener.setSubstitut(cboCombo.getText());
        }
      });
      cboCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

      Label validFromLabel = new Label(scheduleGroup, SWT.NONE);
      validFromLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      validFromLabel.setText("Valid From");


      validFrom = new DatePicker(scheduleGroup, SWT.BORDER);
      validFrom.setEditable(true);



      validFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();         
        }



      });
      final GridData gridData = new GridData();
      gridData.grabExcessHorizontalSpace = true;
      gridData.horizontalAlignment = SWT.FILL;
      validFrom.setLayoutData(gridData);

      final Composite composite_1_1 = new Composite(scheduleGroup, SWT.NONE);
      composite_1_1.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
      final GridLayout gridLayout_1 = new GridLayout();
      gridLayout_1.numColumns = 6;
      composite_1_1.setLayout(gridLayout_1);

      txtHourFrom = new Text(composite_1_1, SWT.CENTER | SWT.BORDER);
      txtHourFrom.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtHourFrom.selectAll();
        }
      });
      txtHourFrom.setTextLimit(2);
      txtHourFrom.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtHourFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();
        }
      });
      txtHourFrom.setEnabled(false);
      final GridData gridData_1_1_1 = new GridData(GridData.FILL, GridData.FILL, false, false);
      gridData_1_1_1.minimumWidth = 30;
      gridData_1_1_1.widthHint = 30;
      txtHourFrom.setLayoutData(gridData_1_1_1);

      final Label label_2_1 = new Label(composite_1_1, SWT.NONE);
      label_2_1.setText(":");

      txtMinuteFrom = new Text(composite_1_1, SWT.CENTER | SWT.BORDER);
      txtMinuteFrom.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtMinuteFrom.selectAll();
        }
      });
      txtMinuteFrom.setTextLimit(2);
      txtMinuteFrom.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtMinuteFrom.setEnabled(false);
      txtMinuteFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();
        }
      });
      final GridData gridData_2_1_1 = new GridData(GridData.FILL, GridData.CENTER, false, false);
      gridData_2_1_1.minimumWidth = 30;
      gridData_2_1_1.widthHint = 30;
      txtMinuteFrom.setLayoutData(gridData_2_1_1);

      final Label label_1_1_1 = new Label(composite_1_1, SWT.NONE);
      label_1_1_1.setText(":");

      txtSecondFrom = new Text(composite_1_1, SWT.CENTER | SWT.BORDER);
      txtSecondFrom.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtSecondFrom.selectAll();
        }
      });
      txtSecondFrom.setTextLimit(2);
      txtSecondFrom.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtSecondFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();
        }
      });
      txtSecondFrom.setEnabled(false);
      txtSecondFrom.setLayoutData(new GridData(30, SWT.DEFAULT));

      final Label hhmmssLabel_1_1 = new Label(composite_1_1, SWT.NONE);
      hhmmssLabel_1_1.setText("hh:mm:ss");

      final Label validToLabel = new Label(scheduleGroup, SWT.NONE);
      validToLabel.setText("Valid To");

      validTo = new DatePicker(scheduleGroup, SWT.BORDER);
      validTo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
      validTo.setEditable(true);
      validTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateTo();         
        }
      });

      final Composite composite_1 = new Composite(scheduleGroup, SWT.NONE);
      composite_1.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
      final GridLayout gridLayout_2 = new GridLayout();
      gridLayout_2.numColumns = 6;
      composite_1.setLayout(gridLayout_2);

      txtHourTo = new Text(composite_1, SWT.CENTER | SWT.BORDER);
      txtHourTo.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtHourTo.selectAll();
        }
      });
      txtHourTo.setTextLimit(2);
      txtHourTo.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtHourTo.setEnabled(false);
      txtHourTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateTo();
        }
      });
      final GridData gridData_1_1 = new GridData(GridData.FILL, GridData.FILL, false, false);
      gridData_1_1.minimumWidth = 30;
      gridData_1_1.widthHint = 30;
      txtHourTo.setLayoutData(gridData_1_1);

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

      txtMinuteTo = new Text(composite_1, SWT.CENTER | SWT.BORDER);
      txtMinuteTo.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtMinuteTo.selectAll();
        }
      });
      txtMinuteTo.setTextLimit(2);
      txtMinuteTo.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtMinuteTo.setEnabled(false);
      txtMinuteTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateTo();
        }
      });
      final GridData gridData_2_1 = new GridData(GridData.FILL, GridData.CENTER, false, false);
      gridData_2_1.minimumWidth = 30;
      gridData_2_1.widthHint = 30;
      txtMinuteTo.setLayoutData(gridData_2_1);

      final Label label_1_1 = new Label(composite_1, SWT.NONE);
      label_1_1.setText(":");

      txtSecondTo = new Text(composite_1, SWT.CENTER | SWT.BORDER);
      txtSecondTo.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtSecondTo.selectAll();
        }
      });
      txtSecondTo.setTextLimit(2);
      txtSecondTo.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtSecondTo.setEnabled(false);
      txtSecondTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateTo();
        }
      });
      txtSecondTo.setLayoutData(new GridData(30, SWT.DEFAULT));
View Full Code Here

      lblName.setText("Name");

      cboConnectname = new Combo(group, SWT.NONE);
     
      cboConnectname.setItems(listener.getProfileNames());
      cboConnectname.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();

        }
      });
      cboConnectname.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
      cboConnectname.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          if( !cboConnectname.getText().equals(currProfile.get("name")))
            initForm();
        }
      });
      cboConnectname.select(0);

      final Label protocolLabel = new Label(group, SWT.NONE);
      protocolLabel.setText("Protocol");

      cboProtokol = new Combo(group, SWT.NONE);
      cboProtokol.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
      cboProtokol.setItems(new String[] {"FTP", "SFTP"});
     
      cboProtokol.select(0);

      final Label hostnameOrIpLabel = new Label(group, SWT.NONE);
      hostnameOrIpLabel.setText("Host Name or IP Address");

      txtHost = new Text(group, SWT.BORDER);
      txtHost.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtHost.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

      final Label portLabel = new Label(group, SWT.NONE);
      portLabel.setText("Port");

      txtPort = new Text(group, SWT.BORDER);
      txtPort.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtPort.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

      final Label userNameLabel = new Label(group, SWT.NONE);
      userNameLabel.setText("User Name");

      txtUsername = new Text(group, SWT.BORDER);
      txtUsername.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtUsername.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
      //txtUsername.setText(currProfile.get("user") != null ? currProfile.get("user").toString() : "");

      final Label passwordLabel = new Label(group, SWT.NONE);
      passwordLabel.setText("Password");     

      txtPassword = new Text(group, SWT.PASSWORD | SWT.BORDER);
      txtPassword.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if(init) {
            try {
              init = false;
              if(txtPassword.getText().length() > 0) {
                String key = Options.getProperty("profile.timestamp." + cboConnectname.getText());

                if(key != null && key.length() > 8) {
                  key = key.substring(key.length()-8);
                }
                String password = txtPassword.getText();

                if(password.length() > 0 && sosString.parseToString(key).length() > 0) {
                  password = SOSCrypt.decrypt(key, password);
                }
                txtPassword.setText(password);
              }
            } catch(Exception ex) {
              System.out.println(ex.getMessage());
            }
          }
          setEnabled();
        }
      });
      txtPassword.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
      //txtPassword.setText(currProfile.get("password") != null ? currProfile.get("password").toString() : "");

      final Label rootLabel = new Label(group, SWT.NONE);
      rootLabel.setText("Root Directory");

      txtRoot = new Text(group, SWT.BORDER);
      txtRoot.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtRoot.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
      //txtRoot.setText(currProfile.get("root") != null ? currProfile.get("root").toString() : "");

      final Label directoryFroLocalLabel = new Label(group, SWT.NONE);
      directoryFroLocalLabel.setText("Directory For Local Copy");

      txtLocalDirectory = new Text(group, SWT.BORDER);
      txtLocalDirectory.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtLocalDirectory.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

      final Label savePasswordLabel = new Label(group, SWT.NONE);
      final GridData gridData_5 = new GridData(SWT.DEFAULT, 24);
      gridData_5.verticalIndent = 5;
      savePasswordLabel.setLayoutData(gridData_5);
      savePasswordLabel.setText("Save Password");

      butSavePassword = new Button(group, SWT.CHECK);
      butSavePassword.addSelectionListener(new SelectionAdapter() {
        public void widgetDefaultSelected(final SelectionEvent e) {
         
        }
        public void widgetSelected(final SelectionEvent e) {
          setEnabled();
        }
      });
      new Label(group, SWT.NONE);
      //txtLocalDirectory.setText(currProfile.get("localdirectory") != null ? currProfile.get("localdirectory").toString() : "");

      final Label transferModeLabel = new Label(group, SWT.NONE);
      final GridData gridData_3 = new GridData(GridData.BEGINNING, GridData.END, false, false);
      gridData_3.heightHint = 21;
      transferModeLabel.setLayoutData(gridData_3);
      transferModeLabel.setText("Transfer Mode");

      butAscii = new Button(group, SWT.RADIO);
      butAscii.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          setEnabled();
        }
      });
      butAscii.setText("ASCII");


      butbinary = new Button(group, SWT.RADIO);
      butbinary.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          setEnabled();
        }
      });
      butbinary.setText("Binary");

      final TabItem proxyTabItem = new TabItem(tabFolder, SWT.NONE);
      proxyTabItem.setText("Proxy");

      final Group group_1 = new Group(tabFolder, SWT.NONE);
      final GridLayout gridLayout_3 = new GridLayout();
      gridLayout_3.numColumns = 2;
      group_1.setLayout(gridLayout_3);
      proxyTabItem.setControl(group_1);

      useProxyButton = new Button(group_1, SWT.CHECK);
      useProxyButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          txtProxyServer.setEnabled(useProxyButton.getSelection());
          txtProxyPort.setEnabled(useProxyButton.getSelection());
          setEnabled();
        }
      });
      useProxyButton.setLayoutData(new GridData(SWT.DEFAULT, 52));
      useProxyButton.setText("Use Proxy");
      new Label(group_1, SWT.NONE);

      final Label proxyServerLabel = new Label(group_1, SWT.NONE);
      proxyServerLabel.setText("Proxy Server");

      txtProxyServer = new Text(group_1, SWT.BORDER);
      txtProxyServer.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtProxyServer.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

      final Label proxyPortLabel = new Label(group_1, SWT.NONE);
      proxyPortLabel.setText("Proxy Port");

      txtProxyPort = new Text(group_1, SWT.BORDER);
      txtProxyPort.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtProxyPort.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

      sshTabItem = new TabItem(tabFolder, SWT.NONE);
      sshTabItem.setText("SSH");

      groupAuthenticationMethods = new Group(tabFolder, SWT.NONE);
      groupAuthenticationMethods.setText("Authentication Methods");
      final GridLayout gridLayout_4 = new GridLayout();
      gridLayout_4.numColumns = 2;
      groupAuthenticationMethods.setLayout(gridLayout_4);
      sshTabItem.setControl(groupAuthenticationMethods);

      new Label(groupAuthenticationMethods, SWT.NONE);
      new Label(groupAuthenticationMethods, SWT.NONE);

      butPublicKey = new Button(groupAuthenticationMethods, SWT.RADIO);
      butPublicKey.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          setEnabled();
        }
      });
      butPublicKey.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false, 2, 1));
      butPublicKey.setText("Public Key");

      butAuthPassword = new Button(groupAuthenticationMethods, SWT.RADIO);
      butAuthPassword.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          setEnabled();
        }
      });
      butAuthPassword.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
      butAuthPassword.setText("Password");

      butPasswordAndPublic = new Button(groupAuthenticationMethods, SWT.RADIO);
      butPasswordAndPublic.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          setEnabled();
        }
      });
      butPasswordAndPublic.setText("Public Key and Password");
      new Label(groupAuthenticationMethods, SWT.NONE);

      final Label pathToPublicLabel = new Label(groupAuthenticationMethods, SWT.NONE);
      pathToPublicLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
      pathToPublicLabel.setText("Private Key");

      txtDirPublicKey = new Text(groupAuthenticationMethods, SWT.BORDER);
      txtDirPublicKey.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtDirPublicKey.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

      final Button button_4 = new Button(groupAuthenticationMethods, SWT.NONE);
      button_4.setVisible(false);
      button_4.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
        }
      });
      button_4.setText("...");
      new Label(schedulerGroup, SWT.NONE);

      butApply = new Button(schedulerGroup, 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");
      //txtHost.setText(currProfile.get("host") != null ? currProfile.get("host").toString() : "");

      final Button butNewProfile = new Button(schedulerGroup, SWT.NONE);
      butNewProfile.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          newProfile = true;
          cboConnectname.setText("");
          txtPort.setText("");
          txtUsername.setText("");
          txtPassword.setText("");
          txtRoot.setText("");
          txtLocalDirectory.setText("");
          butAscii.setSelection(true);
          butbinary.setSelection(false);
          butSavePassword.setSelection(false);
          txtHost.setText("");
          txtProxyPort.setText("");
          txtProxyServer.setText("");
          txtProxyPort.setEnabled(false);
          txtProxyServer.setEnabled(false);
          useProxyButton.setSelection(false);
          cboProtokol.select(0);
        }
      });
      butNewProfile.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      butNewProfile.setText("New Profile");
      //txtPort.setText(currProfile.get("port") != null ? currProfile.get("port").toString() : "");

      final Button butRemove = new Button(schedulerGroup, SWT.NONE);
      butRemove.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          if(cboConnectname.getText().length() == 0)
            return;
         
          listener.removeProfile(cboConnectname.getText());         
          if(cboConnectname.getItemCount() > 0)
            cboConnectname.select(0);
          initForm();
          saveSettings = true;
        }
      });
      butRemove.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
      butRemove.setText("Remove");


      /*if(currProfile.get("transfermode") != null && currProfile.get("transfermode").toString().equalsIgnoreCase("binary")) {
        butbinary.setSelection(true);
        butAscii.setSelection(false);
      } else {
        butbinary.setSelection(false);
        butAscii.setSelection(true);
      }*/

      // final Tree tree = new Tree(schedulerGroup, SWT.BORDER);



    }
   
    lbErrorMessage = new Label(schedulerConfigurationShell, SWT.NONE);
    lbErrorMessage.setText("xxxxxxxxxxxxxxxxxxxx");
    lbErrorMessage.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
    lbErrorMessage.setFont(SWTResourceManager.getFont("Tahoma", 8, SWT.BOLD));

    final Button butClose = new Button(schedulerConfigurationShell, SWT.NONE);
    butClose.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
       
        close();
       
        saved = true;
        schedulerConfigurationShell.dispose();
      }
    });
    butClose.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
    butClose.setText("Close");
    cboProtokol.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
       
        if(cboProtokol.getText().equalsIgnoreCase("FTP"))
          groupAuthenticationMethods.setEnabled(false);
        else
View Full Code Here

      gridData.heightHint = 685;
      jobGroup.setLayoutData(gridData);
     
     
      txtXML = new Text(jobGroup, SWT.V_SCROLL | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL);
      txtXML.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          butApply.setEnabled(true);
        }
      });
      final GridData gridData_2 = new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 2);
View Full Code Here

        gridData_15.widthHint = 28;
        atLabel.setLayoutData(gridData_15);
        atLabel.setText("at");

        txtDayAtHour = new Text(jobGroup, SWT.CENTER | SWT.BORDER);       
        txtDayAtHour.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            if(!checkTime(txtDayAtHour.getText(), "hour")) {
              txtDayAtHour.setBackground(Options.getRequiredColor());
              txtDayAtHour.setFocus();
            } else {
              txtDayAtHour.setBackground(null);
            }
          }
        });

        final GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData.minimumWidth = 25;
        txtDayAtHour.setLayoutData(gridData);

        final Label label = new Label(jobGroup, SWT.NONE);
        label.setLayoutData(new GridData());
        label.setText(":");

        txtDayAtMinutes = new Text(jobGroup, SWT.CENTER | SWT.BORDER);       
        txtDayAtMinutes.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            if(!checkTime(txtDayAtMinutes.getText(), "minutes")) {
              txtDayAtMinutes.setBackground(Options.getRequiredColor());
              txtDayAtMinutes.setFocus();
            } else {
              txtDayAtMinutes.setBackground(null);
            }
          }
        });

        final GridData gridData_3 = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData_3.widthHint = 12;
        gridData_3.minimumWidth = 25;
        txtDayAtMinutes.setLayoutData(gridData_3);

        final Label label_1 = new Label(jobGroup, SWT.NONE);
        label_1.setLayoutData(new GridData());
        label_1.setText(":");

        txtDayAtSecound = new Text(jobGroup, SWT.CENTER | SWT.BORDER);       
        txtDayAtSecound.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            if(!checkTime(txtDayAtSecound.getText(), "secound")) {
              txtDayAtSecound.setBackground(Options.getRequiredColor());
              txtDayAtSecound.setFocus();
            } else {
              txtDayAtSecound.setBackground(null);
            }
          }
        });
        final GridData gridData_4 = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
        gridData_4.minimumWidth = 25;
        txtDayAtSecound.setLayoutData(gridData_4);

        {
          final Label hhmmssLabel = new Label(jobGroup, SWT.NONE);
          hhmmssLabel.setLayoutData(new GridData());
          hhmmssLabel.setText("hh:mm:ss");
        }

        {
          optSpecificDay = new Button(jobGroup, SWT.CHECK);
          optSpecificDay.setLayoutData(new GridData());
          optSpecificDay.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              if(optSpecificDay.getSelection()) {
                txtSpeDay.setEnabled(true);
                txtSpeDayHour.setEnabled(true);
                txtSpeDayAtMinutes.setEnabled(true);
                txtSpeDayAtSecound.setEnabled(true);
                butAdd.setEnabled(true);
              } else {
                txtSpeDay.setEnabled(false);
                txtSpeDayHour.setEnabled(false);
                txtSpeDayAtMinutes.setEnabled(false);
                txtSpeDayAtSecound.setEnabled(false);
              }
            }
          });
          optSpecificDay.setText(SPECIFIC_DAY);
        }

        txtSpeDay = new DatePicker(jobGroup, SWT.NONE);
        final GridData gridData_16 = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData_16.widthHint = 131;
        txtSpeDay.setLayoutData(gridData_16);
        txtSpeDay.setEnabled(false);

        final Label atLabel_1 = new Label(jobGroup, SWT.NONE);
        atLabel_1.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
        atLabel_1.setText("at");

        txtSpeDayHour = new Text(jobGroup, SWT.CENTER | SWT.BORDER);
        txtSpeDayHour.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            if(!checkTime(txtSpeDayHour.getText(), "hour")) {
              txtSpeDayHour.setBackground(Options.getRequiredColor());
              txtSpeDayHour.setFocus();
            } else {
              txtSpeDayHour.setBackground(null);
            }
          }
        });

        final GridData gridData_5 = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData_5.minimumWidth = 25;
        gridData_5.widthHint = 0;
        txtSpeDayHour.setLayoutData(gridData_5);

        final Label label_2 = new Label(jobGroup, SWT.NONE);
        label_2.setLayoutData(new GridData());
        label_2.setText(":");

        txtSpeDayAtMinutes = new Text(jobGroup, SWT.CENTER | SWT.BORDER);       

        txtSpeDayAtMinutes.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {           

            if(!checkTime(txtSpeDayHour.getText(), "minutes")) {
              txtSpeDayAtMinutes.setBackground(Options.getRequiredColor());
              txtSpeDayAtMinutes.setFocus();
            }else {
              txtSpeDayAtMinutes.setBackground(null);
            }

          }
        });
        final GridData gridData_3_1 = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData_3_1.widthHint = 7;
        gridData_3_1.minimumWidth = 25;
        txtSpeDayAtMinutes.setLayoutData(gridData_3_1);

        final Label label_1_1 = new Label(jobGroup, SWT.NONE);
        label_1_1.setLayoutData(new GridData());
        label_1_1.setText(":");

        txtSpeDayAtSecound = new Text(jobGroup, SWT.CENTER | SWT.BORDER);
        txtSpeDayAtSecound.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {             
            if(!checkTime(txtSpeDayAtSecound.getText(), "secound")) {
              txtSpeDayAtSecound.setBackground(Options.getRequiredColor());
              txtSpeDayAtSecound.setFocus();
            } else {
              txtSpeDayAtSecound.setBackground(null);
            }
          }
        });

        final GridData gridData_4_1 = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
        gridData_4_1.minimumWidth = 25;
        txtSpeDayAtSecound.setLayoutData(gridData_4_1);

        final Label hhmmssLabel_1 = new Label(jobGroup, SWT.NONE);
        hhmmssLabel_1.setLayoutData(new GridData());
        hhmmssLabel_1.setText("hh:mm:ss");

        optEveryWeeksdays = new Button(jobGroup, SWT.CHECK);
        optEveryWeeksdays.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            if(optEveryWeeksdays.getSelection()) {
              butAdd.setEnabled(true);
              comboEveryWeekdays.setEnabled(true);
              txtWeekAtHour.setEnabled(true);
              txtWeekAtMinutes.setEnabled(true);
              txtWeekAtSecound.setEnabled(true);
            } else {
              comboEveryWeekdays.setEnabled(false);
              txtWeekAtHour.setEnabled(false);
              txtWeekAtMinutes.setEnabled(false);
              txtWeekAtSecound.setEnabled(false);
            }
          }
        });
        optEveryWeeksdays.setText(WEEK_DAY);

        comboEveryWeekdays = new Combo(jobGroup, SWT.NONE);       
        comboEveryWeekdays.setItems(DaysListener.getWeekdays());
        comboEveryWeekdays.select(0);
        comboEveryWeekdays.setEnabled(false);
        final GridData gridData_17 = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData_17.widthHint = 148;
        comboEveryWeekdays.setLayoutData(gridData_17);

        final Label atLabel_2 = new Label(jobGroup, SWT.NONE);
        atLabel_2.setLayoutData(new GridData(37, SWT.DEFAULT));
        atLabel_2.setAlignment(SWT.RIGHT);
        atLabel_2.setText("at");

        txtWeekAtHour = new Text(jobGroup, SWT.CENTER | SWT.BORDER);       
        txtWeekAtHour.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {           
            if(!checkTime(txtWeekAtHour.getText(), "hour")) {
              txtWeekAtHour.setBackground(Options.getRequiredColor());
              txtWeekAtHour.setFocus();
            } else {
              txtWeekAtHour.setBackground(null);
            }
          }
        });
        final GridData gridData_6 = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData_6.minimumWidth = 25;
        gridData_6.widthHint = 0;
        txtWeekAtHour.setLayoutData(gridData_6);

        final Label label_3 = new Label(jobGroup, SWT.NONE);
        label_3.setLayoutData(new GridData());
        label_3.setText(":");

        txtWeekAtMinutes = new Text(jobGroup, SWT.CENTER | SWT.BORDER);
        txtWeekAtMinutes.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {           
            if(!checkTime(txtWeekAtMinutes.getText(), "minutes")) {
              txtWeekAtMinutes.setBackground(Options.getRequiredColor());
              txtWeekAtMinutes.setFocus();
            }else {
              txtWeekAtMinutes.setBackground(null);
            }
          }
        });
        final GridData gridData_11 = new GridData(GridData.FILL, GridData.CENTER, false, false);
        gridData_11.widthHint = 5;
        gridData_11.minimumWidth = 25;

        final GridData gridData_9 = new GridData(11, SWT.DEFAULT);
        gridData_9.minimumWidth = 25;

        final GridData gridData_3_2 = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
        gridData_3_2.minimumWidth = 25;
        txtWeekAtMinutes.setLayoutData(gridData_3_2);

        final Label label_1_2 = new Label(jobGroup, SWT.NONE);
        label_1_2.setLayoutData(new GridData());
        label_1_2.setText(":");

        txtWeekAtSecound = new Text(jobGroup, SWT.CENTER | SWT.BORDER);
        txtWeekAtSecound.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {           
            if(!checkTime(txtWeekAtSecound.getText(), "secound")) {
              txtWeekAtSecound.setBackground(Options.getRequiredColor());
              txtWeekAtSecound.setFocus();
            } else {
              txtWeekAtSecound.setBackground(null);
            }
          }
        });
        final GridData gridData_12 = new GridData(GridData.FILL, GridData.CENTER, false, false);
        gridData_12.widthHint = 2;
        gridData_12.minimumWidth = 25;

        final GridData gridData_10 = new GridData(10, SWT.DEFAULT);
        gridData_10.minimumHeight = 25;

        final GridData gridData_4_2 = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
        gridData_4_2.minimumWidth = 25;
        txtWeekAtSecound.setLayoutData(gridData_4_2);

        final Label hhmmssLabel_2 = new Label(jobGroup, SWT.NONE);
        hhmmssLabel_2.setLayoutData(new GridData());
        hhmmssLabel_2.setText("hh:mm:ss");

        {
          optEveryMonths = new Button(jobGroup, SWT.CHECK);
          optEveryMonths.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              if(optEveryMonths.getSelection()) {
                butAdd.setEnabled(true);
                comboMonth.setEnabled(true);
                txtMonthAtHour.setEnabled(true);
                txtMonthAtMinutes.setEnabled(true);
                txtMonthAtSecound.setEnabled(true);
              } else {
                comboMonth.setEnabled(false);
                txtMonthAtHour.setEnabled(false);
                txtMonthAtMinutes.setEnabled(false);
                txtMonthAtSecound.setEnabled(false);
              }
            }
          });
          optEveryMonths.setText(MONTH_DAY);
        }

        {
          comboMonth = new Combo(jobGroup, SWT.NONE);         
          comboMonth.setItems(DaysListener.getMonthdays());
          comboMonth.select(0);
          comboMonth.setEnabled(false);
          comboMonth.select(0);
          comboMonth.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
        }

        final Label atLabel_3 = new Label(jobGroup, SWT.NONE);
        atLabel_3.setLayoutData(new GridData(37, SWT.DEFAULT));
        atLabel_3.setAlignment(SWT.RIGHT);
        atLabel_3.setText("at");

        txtMonthAtHour = new Text(jobGroup, SWT.CENTER | SWT.BORDER);
        txtMonthAtHour.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {           
            if(!checkTime(txtMonthAtHour.getText(), "hour")) {
              txtMonthAtHour.setBackground(Options.getRequiredColor());
              txtMonthAtHour.setFocus();
            } else {
              txtMonthAtHour.setBackground(null);
            }
          }
        });
        final GridData gridData_13 = new GridData(GridData.FILL, GridData.CENTER, false, false);
        gridData_13.widthHint = 11;

        final GridData gridData_8 = new GridData(13, SWT.DEFAULT);
        gridData_8.minimumWidth = 25;


        final GridData gridData_7 = new GridData(GridData.FILL, GridData.CENTER, true, false);
        gridData_7.minimumWidth = 25;
        gridData_7.widthHint = 0;
        txtMonthAtHour.setLayoutData(gridData_7);

        final Label label_4 = new Label(jobGroup, SWT.NONE);
        label_4.setLayoutData(new GridData());
        label_4.setText(":");

        txtMonthAtMinutes = new Text(jobGroup, SWT.CENTER | SWT.BORDER);
        txtMonthAtMinutes.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {           
            if(!checkTime(txtMonthAtMinutes.getText(), "minutes")) {
              txtMonthAtMinutes.setBackground(Options.getRequiredColor());
              txtMonthAtMinutes.setFocus();
            } else {
              txtMonthAtMinutes.setBackground(null);
            }
          }
        });
        final GridData gridData_14 = new GridData(GridData.FILL, GridData.CENTER, false, false);
        gridData_14.widthHint = 15;
        gridData_14.minimumHeight = 25;


        final GridData gridData_3_3 = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
        gridData_3_3.minimumWidth = 25;
        txtMonthAtMinutes.setLayoutData(gridData_3_3);

        final Label label_1_3 = new Label(jobGroup, SWT.NONE);
        label_1_3.setLayoutData(new GridData());
        label_1_3.setText(":");

        txtMonthAtSecound = new Text(jobGroup, SWT.CENTER | SWT.BORDER);
        txtMonthAtSecound.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {           
            if(!checkTime(txtMonthAtSecound.getText(), "minutes")) {
              txtMonthAtSecound.setBackground(Options.getRequiredColor());
              txtMonthAtSecound.setFocus();
            }else {
View Full Code Here

        public void focusGained(final FocusEvent e) {
          txtName.selectAll();
        }
      });
      txtName.setBackground(SWTResourceManager.getColor(255, 255, 217));
      txtName.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          refresh();
        }
      });
      txtName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));

      final Label jobketteLabel = new Label(eventgroup, SWT.NONE);
      jobketteLabel.setLayoutData(new GridData());
      jobketteLabel.setText("Jobchain");

      txtJobChain = new Text(eventgroup, SWT.BORDER);
      txtJobChain.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtJobChain.selectAll();   
        }
      });
      txtJobChain.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          refresh();
        }
      });
      txtJobChain.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));

      final Label jobLabel = new Label(eventgroup, SWT.NONE);
      jobLabel.setLayoutData(new GridData());
      jobLabel.setText("Job");



      txtJob = new Text(eventgroup, SWT.BORDER);
      txtJob.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtJob.selectAll();
        }
      });
      txtJob.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          refresh();
        }
      });
      txtJob.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));



      final Label eventClassLabel = new Label(eventgroup, SWT.NONE);
      eventClassLabel.setLayoutData(new GridData());
      eventClassLabel.setText("Event Class");


      txtEventClass = new Text(eventgroup, SWT.BORDER);
      txtEventClass.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtEventClass.selectAll();
        }
      });
      txtEventClass.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          refresh();
        }
      });
      txtEventClass.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
View Full Code Here

    txtEnvName.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtEnvName.selectAll();
      }
    });
    txtEnvName.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butEnvApply.setEnabled(!txtEnvName.getText().trim().equals(""));
      }
    });
    txtEnvName.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtEnvName.equals(""))
          addEnvironment();
      }
    });
    final GridData gridData_5 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    txtEnvName.setLayoutData(gridData_5);

    final Label valueLabel = new Label(group_2, SWT.NONE);
    valueLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
    valueLabel.setText("Value: ");

    txtEnvValue = new Text(group_2, SWT.BORDER);
    txtEnvValue.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtEnvValue.selectAll();
      }
    });
    txtEnvValue.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butEnvApply.setEnabled(!txtEnvName.getText().trim().equals(""));
      }
    });
    txtEnvValue.addKeyListener(new KeyAdapter() {
View Full Code Here

TOP

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

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.