Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.ModifyListener


    txtIncludeFilename.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtIncludeFilename.selectAll();
      }
    });
    txtIncludeFilename.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butIncludesApply.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
        if(type == Editor.JOB || type == Editor.COMMANDS || type == Editor.JOB_COMMANDS)
          butIsLifeFile.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
      }
    });


    txtIncludeFilename.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtIncludeFilename.equals(""))
          addInclude();
      }
    });
    txtIncludeFilename.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    final Label lblNode = new Label(group_3, SWT.NONE);
    lblNode.setText("Node:");

    txtIncludeNode = new Text(group_3, SWT.BORDER);
    txtIncludeNode.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtIncludeNode.selectAll();
      }
    });
    txtIncludeNode.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butIncludesApply.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
        if(type == Editor.JOB || type == Editor.COMMANDS || type == Editor.JOB_COMMANDS)
          butIsLifeFile.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
      }
View Full Code Here


    cSource.setItems(new String[] { "order", "task" });

    cSource.setBounds(0, 0,250, 21);


    cSource.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        tParaValue.setText(cSource.getText());
      }
    });
    cSource.setVisible(false);
View Full Code Here

        }*/
        if (e.keyCode == SWT.CR && !txtUsername.getText().equals(""))
          applyHttpUser();
      }
    });
    txtUsername.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        //butApplyHttpUser.setEnabled(!txtUsername.getText().equals(""));
        //butEncrypt.setEnabled(!txtUsername.getText().equals(""));
       
      }
    });
    txtUsername.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
   
    final Label lblPassword = new Label(group_1, SWT.NONE);
    lblPassword.setText("Password");
   
    txtPassword = new Text(group_1, SWT.BORDER);
    txtPassword.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtPassword.selectAll();
      }
    });
    txtPassword.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtPassword.getText().equals("")){
          encrypt();
         
        }
       
      }
    });
    txtPassword.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        //butApplyHttpUser.setEnabled(!txtPassword.getText().equals(""));
        butEncrypt.setEnabled(!txtPassword.getText().equals(""));
      }
    });
    txtPassword.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
   
    butEncrypt = new Button(group_1, SWT.NONE);
    butEncrypt.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if(txtPassword.getText() != null && txtPassword.getText().length() > 0) {
          encrypt();
        }
       
      }
    });
    butEncrypt.setEnabled(false);
    butEncrypt.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butEncrypt.setText("Encrypt");
    new Label(group_1, SWT.NONE);
    new Label(group_1, SWT.NONE);
   
    final Label md5PasswordLabel = new Label(group_1, SWT.NONE);
    md5PasswordLabel.setText("MD5 Password");
   
    txtMD5Password = new Text(group_1, SWT.BORDER);
    txtMD5Password.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtMD5Password.selectAll();
      }
    });
    txtMD5Password.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtUsername.getText().equals("")){         
          applyHttpUser();
        }
       
      }
    });
    txtMD5Password.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApplyHttpUser.setEnabled(!txtMD5Password.getText().equals(""));
      }
    });
    txtMD5Password.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
View Full Code Here

      final Label lblNode_ = new Label(group_3, SWT.NONE);
      lblNode_.setText("File:");
    }

    txtIncludeFilename = new Text(group_3, SWT.BORDER);
    txtIncludeFilename.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butIncludesApply.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
        if(type == Editor.JOB || type == Editor.COMMANDS || type == Editor.JOB_COMMANDS)
          butIsLifeFile.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
      }
    });


    txtIncludeFilename.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtIncludeFilename.equals(""))
          addInclude();
      }
    });
    txtIncludeFilename.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    final Label lblNode = new Label(group_3, SWT.NONE);
    lblNode.setText("Node:");

    txtIncludeNode = new Text(group_3, SWT.BORDER);
    txtIncludeNode.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butIncludesApply.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
        if(type == Editor.JOB || type == Editor.COMMANDS || type == Editor.JOB_COMMANDS)
          butIsLifeFile.setEnabled(!txtIncludeFilename.getText().trim().equals(""));
      }
View Full Code Here

    cSource.setItems(new String[] { "order", "task" });

    cSource.setBounds(0, 0,250, 21);


    cSource.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        tParaValue.setText(cSource.getText());
      }
    });
    cSource.setVisible(false);
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) {

        if (event) {
          listener.setName(txtName.getText());         
        }
      }
    });
    final GridData gridData_1 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData_1.widthHint = 288;
    txtName.setLayoutData(gridData_1);

    addJobButton = new Button(gMain, SWT.NONE);
    addJobButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
    addJobButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        addJob();
      }
    });
    addJobButton.setText("Add Job");

    final Label schedulerHostLabel = new Label(gMain, SWT.NONE);
    schedulerHostLabel.setLayoutData(new GridData());
    schedulerHostLabel.setText("Scheduler Host:");

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

    addOrderButton = new Button(gMain, SWT.NONE);
    addOrderButton.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false, 2, 1));
    addOrderButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        addOrder();
      }
    });
    addOrderButton.setText("Add Order");

    final Label schedulerPortLabel = new Label(gMain, SWT.NONE);
    schedulerPortLabel.setLayoutData(new GridData());
    schedulerPortLabel.setText("Scheduler Port: ");

    txtPort = new Text(gMain, SWT.BORDER);   
    txtPort.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtPort.selectAll();
      }
    });
    txtPort.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    txtPort.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        if (event) {
          listener.setPort(txtPort.getText());         
        }
      }
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);
      cboConnectname.setLayoutData(gridData_2);
      cboConnectname.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          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));
      cboProtokol.setItems(new String[] {"WebDav", "SWebDav"});
     
      cboProtokol.select(0);

      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));
      //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));
      //txtPassword.setText(currProfile.get("password") != null ? currProfile.get("password").toString() : "");

      final Label urlLabel = new Label(group, SWT.NONE);
      urlLabel.setText("URL");

      txtURL = new Text(group, SWT.BORDER);
      txtURL.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setEnabled();
        }
      });
      txtURL.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      //txturl.setText(currProfile.get("url") != null ? currProfile.get("url").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));

      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();
        }
      });
      butSavePassword.setLayoutData(new GridData());

      final TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
      tabItem.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);
      tabItem.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));
      //txtLocalDirectory.setText(currProfile.get("localdirectory") != null ? currProfile.get("localdirectory").toString() : "");
      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("");         
          txtUsername.setText("");
          txtPassword.setText("");
          txtURL.setText("");
          txtLocalDirectory.setText("");
          butSavePassword.setSelection(false);         
          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) {
          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(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) {
               
        setEnabled();
      }
    });
View Full Code Here

    tState.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tState.selectAll();
      }
    });
    tState.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        boolean valid = listener.isValidState(tState.getText());
        if (!valid)
          tState.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
        else
          tState.setBackground(null);
        bApplyNode.setEnabled(isValidNode()&& valid);
        if (bApplyNode.getEnabled())
          getShell().setDefaultButton(bApplyNode);       
      }     
    });

    final GridData gridData18 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData18.widthHint = 459;
    tState.setLayoutData(gridData18);

    bApplyNode = new Button(gNodes, SWT.NONE);
    bApplyNode.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        applyNode();
      }
    });   
    final GridData gridData7 = new GridData(GridData.FILL, GridData.BEGINNING, false, false);
    bApplyNode.setLayoutData(gridData7);
    bApplyNode.setEnabled(false);
    bApplyNode.setText("&Apply Chain Node");

    label7 = new Label(gNodes, SWT.NONE);
    label7.setLayoutData(new GridData());
    label7.setText("Job Chain:");

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

    cJobChain = new Combo(gNodes, SWT.BORDER);
    cJobChain.setMenu(new sos.scheduler.editor.app.ContextMenu(cJobChain, dom, sos.scheduler.editor.app.Editor.JOB_CHAIN).getMenu());
    cJobChain.addMouseListener(new MouseAdapter() {
      public void mouseDown(final MouseEvent e) {           
        if(refresh) {
          if(listener.getJobChains() != null) {
            cJobChain.setItems(listener.getJobChains());
            refresh = false;
          }
        }
      }
     

    });

    cJobChain.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        bApplyNode.setEnabled(isValidNode());
        if (bApplyNode.getEnabled())
          getShell().setDefaultButton(bApplyNode);
      }
    });
    cJobChain.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {           
        if (e.keyCode == SWT.CR) {
          applyNode();
        }
      }
    });
    final GridData gridData13 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData13.widthHint = 579;
    cJobChain.setLayoutData(gridData13);

    final Composite composite = new Composite(gNodes, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
    final GridLayout gridLayout_2 = new GridLayout();
    gridLayout_2.marginWidth = 0;
    gridLayout_2.marginHeight = 0;
    composite.setLayout(gridLayout_2);

    butBrowse = new Button(composite, SWT.NONE);
    butBrowse.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    butBrowse.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        String jobname = IOUtils.openDirectoryFile(MergeAllXMLinDirectory.MASK_JOB_CHAIN);
        if(jobname != null && jobname.length() > 0)
          cJobChain.setText(jobname);
      }
    });
    butBrowse.setText("Browse");

    if(!listener.get_dom().isLifeElement()) {
    }
    label8 = new Label(gNodes, SWT.NONE);
    label8.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    label8.setText("Next State:");

    cNextState = new Combo(gNodes, SWT.BORDER);
    cNextState.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        bApplyNode.setEnabled(isValidNode());
        if (bApplyNode.getEnabled())
          getShell().setDefaultButton(bApplyNode);
      }
    });
    cNextState.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR) {
          applyNode();
        }
      }
    });
    final GridData gridData14 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData14.widthHint = 80;
    cNextState.setLayoutData(gridData14);

    bNewNode = new Button(gNodes, SWT.NONE);
    bNewNode.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        isInsert = false;
        getShell().setDefaultButton(null);
        tNodes.deselectAll();
        butDetailsJob.setEnabled(false);
        listener.selectNode(null);
        bRemoveNode.setEnabled(false);
        enableNode(true);
        fillNode(true);
        tState.setFocus();
      }
    });
    bNewNode.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
    bNewNode.setText("New Chain &Node");

    label9 = new Label(gNodes, SWT.NONE);
    label9.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    label9.setText("Error State:");

    cErrorState = new Combo(gNodes, SWT.BORDER);
    cErrorState.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        bApplyNode.setEnabled(isValidNode());
        if (bApplyNode.getEnabled())
          getShell().setDefaultButton(bApplyNode);
      }
View Full Code Here

      });
      txtHour.setText(hour == 0? "" : Utils.getIntegerAsString(hour));
      final GridData gridData = new GridData(17, SWT.DEFAULT);
      gridData.minimumWidth = 17;
      txtHour.setLayoutData(gridData);
      txtHour.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          Utils.setBackground(0, 23, txtHour);
          if (!Utils.isNumeric( txtHour.getText())) {
            MainWindow.message(shellSetBack, Messages.getString("assistent.no_numeric"), SWT.OK );
          }
          modify = true;
        }
      });
    }

    {
      txtMin = new Text(jobGroup, SWT.BORDER);
      txtMin.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtMin.setText(min == 0? "" : Utils.getIntegerAsString(min));
      final GridData gridData = new GridData(17, SWT.DEFAULT);
      gridData.minimumWidth = 17;
      txtMin.setLayoutData(gridData);
      txtMin.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          Utils.setBackground(0, 59, txtMin);   
          if (!Utils.isNumeric( txtMin.getText())) {
            MainWindow.message(shellSetBack, Messages.getString("assistent.no_numeric"), SWT.OK );
          }
          modify = true;
        }
      });
    }

    {
      txtSecound = new Text(jobGroup, SWT.BORDER);
      txtSecound.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      final GridData gridData = new GridData(GridData.FILL, GridData.CENTER, false, false);
      gridData.widthHint = 17;
      gridData.minimumWidth = 17;
      txtSecound.setLayoutData(gridData);
      txtSecound.setText(sec==0? "" : Utils.getIntegerAsString(sec));
      txtSecound.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          Utils.setBackground(0, 59, txtSecound);
          if (!Utils.isNumeric( txtSecound.getText())) {
            MainWindow.message(shellSetBack, Messages.getString("assistent.no_numeric"), SWT.OK );
          }
          modify = true;
        }
      });
    }

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

    {
      lblOftenSetBack = new Label(jobGroup, SWT.NONE);
      lblOftenSetBack.setLayoutData(new GridData());
      lblOftenSetBack.setText(Messages.getString("assistent.delay_order_after_setback.setback_count"));
    }
    txtSetBack = new Text(jobGroup, SWT.BORDER);
    txtSetBack.setText(setback!=null?setback:"");
    txtSetBack.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        modify = true;
      }
    });
View Full Code Here

        } else {
          filenameLabel.setText("Filename");
        }

        txtFilename = new Text(schedulerGroup, SWT.BORDER);           
        txtFilename.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            if(listener == null)
              listener = ftpProfilePicker.getListener()
            butOpenOrSave.setEnabled(listener.getCurrProfile().isLoggedIn() && txtFilename.getText().length() > 0);
          }
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.