Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.KeyAdapter


    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() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtEnvName.equals(""))
          addEnvironment();
      }
    });
View Full Code Here


          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(""));
      }
    });
    txtIncludeNode.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtIncludeFilename.equals(""))
          addInclude();
      }
    });
View Full Code Here

    txtUsername.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtUsername.setFocus();
      }
    });
    txtUsername.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {    
        /*if ((txtUsername.getText().length() > 0) ) {
          txtUsername.setText(txtUsername.getText());
          txtUsername.setSelection(2);
        }*/
        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();
        }
       
View Full Code Here

          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(""));
      }
    });
    txtIncludeNode.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtIncludeFilename.equals(""))
          addInclude();
      }
    });
View Full Code Here

    final GridData gridData_12 = new GridData(GridData.FILL, GridData.FILL, true, true);
    gMain.setLayoutData(gridData_12);
    gMain.setLayout(gridLayout);
    GridData gridData61 = new org.eclipse.swt.layout.GridData(GridData.FILL, GridData.FILL, true, true, 1, 2);
    tComment = new Text(gMain, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL);
    tComment.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if(e.keyCode==97 && e.stateMask == SWT.CTRL){
              tComment.setSelection(0, tComment.getText().length());
        }
      }
    });
    tComment.addMouseListener(new MouseAdapter() {
      public void mouseDoubleClick(final MouseEvent e) {
        String text = sos.scheduler.editor.app.Utils.showClipboard(tComment.getText(), getShell(), true, "");
        if(text != null)
          tComment.setText(text);       
       
      }
    });
    tComment.setLayoutData(gridData61);
    tComment.setFont(ResourceManager.getFont("Courier New", 8, SWT.NONE));
    tComment.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if(init) return;
        listener.setComment(tComment.getText());
      }
    });

    final Button button = new Button(gMain, SWT.NONE);
    final GridData gridData = new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false);
    gridData.widthHint = 28;
    button.setLayoutData(gridData);
    button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        String text = sos.scheduler.editor.app.Utils.showClipboard(tComment.getText(), getShell(), true, "");
        if(text != null)
          tComment.setText(text);
      }
    });
    button.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_edit.gif"));

    only4width = new Button(gMain, SWT.CHECK);
    only4width.setVisible(false);
    only4width.setLayoutData(new GridData());
    only4width.setText("from Hot Folder");
    GridLayout gridLayout3 = new GridLayout();
    gridLayout3.numColumns = 2;
    gDescription = new Group(group, SWT.NONE);
    final GridData gridData_11 = new GridData(GridData.FILL, GridData.FILL, true, true);
    gDescription.setLayoutData(gridData_11);
    gDescription.setText("Job Description");
    gDescription.setLayout(gridLayout3);
       
    GridData gridData12 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData12.horizontalIndent = -1;
    tFileName = new Text(gDescription, SWT.BORDER);
    tFileName.setLayoutData(gridData12);
   
   
    tFileName.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        if(init) return;
        listener.setInclude(tFileName.getText(), butIsLiveFile.getSelection());       
        if(tFileName.getText()!= null && tFileName.getText().length() > 0 ) {         
          butShow.setEnabled(true);
          if(tFileName.getText().endsWith(".xml"))       
            butOpen.setEnabled(true);
          else
            butOpen.setEnabled(false);
        } else {
          butShow.setEnabled(false);
          butOpen.setEnabled(false);
        }
      }
    });

    butIsLiveFile = new Button(gDescription, SWT.CHECK);
    butIsLiveFile.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if(init) return;
        listener.setInclude(tFileName.getText(), butIsLiveFile.getSelection());
       
        if(tFileName.getText()!= null && tFileName.getText().length() > 0) {
          butShow.setEnabled(true);
          if(tFileName.getText().endsWith(".xml"))
            butOpen.setEnabled(true);
          else
            butOpen.setEnabled(false);
        } else {
          butShow.setEnabled(false);
          butOpen.setEnabled(false);
        }
      }
    });
    butIsLiveFile.setLayoutData(new GridData());
    butIsLiveFile.setText("from Hot Folder");
    GridData gridData14 = new org.eclipse.swt.layout.GridData(GridData.FILL, GridData.FILL, true, true, 1, 3);
    gridData14.horizontalIndent = -1;
    tDescription = new Text(gDescription, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.H_SCROLL);
    tDescription.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if(e.keyCode==97 && e.stateMask == SWT.CTRL){
          tDescription.setSelection(0, tDescription.getText().length());
        }
      }
View Full Code Here

        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);
      }
    });
    cErrorState.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR) {
          applyNode();
        }
      }
View Full Code Here

            }
          }
        }  */ 

        txtDir = new Text(schedulerGroup, SWT.BORDER);
        txtDir.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            try {
              if (e.keyCode == SWT.CR) {
                FTPProfile profile = listener.getCurrProfile();
                HashMap h = profile.changeDirectory(txtDir.getText());
View Full Code Here

        label3.setLayoutData(gridData8);
        GridData gridData9 = new org.eclipse.swt.layout.GridData(GridData.FILL, GridData.FILL, false, false);
        gridData9.heightHint = 80;
       
        tComment = new Text(group, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.BORDER | SWT.H_SCROLL);
        tComment.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            if(e.keyCode==97 && e.stateMask == SWT.CTRL){
          tComment.setSelection(0, tComment.getText().length());
        }
          }
View Full Code Here

              }
        previousCtrlX = isCtrlX;
       
      }
    });*/
    _styledText.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        //System.out.println("keyCod: " + e.keyCode);
        if(e.keyCode==122 && e.stateMask== SWT.CTRL)
          e.doit= false;
       
View Full Code Here

        sBeginMinutes.addMouseListener(new MouseAdapter() {
            public void mouseDown(final MouseEvent e) {

            }
        });
        sBeginMinutes.addKeyListener(new KeyAdapter() {
            public void keyPressed(final KeyEvent e) {

            }
        });
        sBeginMinutes.setLayoutData(gridData21);
        sBeginMinutes.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
            public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
                if (!beginBeforeAfter()) {
                    Utils.setBackground(0, 59, sBeginMinutes);
                }
               
                    listener.setPeriodTime(23, bApply, "begin", sBeginHours.getText(), sBeginMinutes.getText(),
                            sBeginSeconds.getText());
            }
        });
        label4 = new Label(gPeriod, SWT.NONE);
        label4.setText(":");
        sBeginSeconds = new Text(gPeriod, SWT.BORDER);
        sBeginSeconds.addVerifyListener(new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
                e.doit = Utils.isOnlyDigits(e.text);

            }
        });     
        sBeginSeconds.setLayoutData(gridData3);

        sBeginSeconds.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
            public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
                if (!beginBeforeAfter()) {
                    Utils.setBackground(0, 59, sBeginSeconds);
                }
               
                    listener.setPeriodTime(23, bApply, "begin", sBeginHours.getText(), sBeginMinutes.getText(),
                            sBeginSeconds.getText());
            }
        });
        label5 = new Label(gPeriod, SWT.NONE);
        label5.setText("hh:mm:ss");
        label5.setLayoutData(gridData2);
        label6 = new Label(gPeriod, SWT.NONE);
        label6.setText("End Time:");
        sEndHours = new Text(gPeriod, SWT.BORDER);
        sEndHours.addVerifyListener(new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
                e.doit = Utils.isOnlyDigits(e.text);

            }
        });
        sEndHours.addMouseListener(new MouseAdapter() {
            public void mouseDown(final MouseEvent e) {

            }
        });
        sEndHours.addKeyListener(new KeyAdapter() {
            public void keyPressed(final KeyEvent e) {
            }
        });
        sEndHours.setLayoutData(gridData41);

        sEndHours.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
            public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
                if (!beginBeforeAfter()) {
                    Utils.setBackground(0, 24, sEndHours);
                }
              
                    listener.setPeriodTime(24, bApply, "end", sEndHours.getText(), sEndMinutes.getText(), sEndSeconds
                            .getText());
            }
        });
        label7 = new Label(gPeriod, SWT.NONE);
        label7.setText(":");
        sEndMinutes = new Text(gPeriod, SWT.BORDER);
        sEndMinutes.addVerifyListener(new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
                e.doit = Utils.isOnlyDigits(e.text);

            }
        });
        sEndMinutes.addMouseListener(new MouseAdapter() {
            public void mouseDown(final MouseEvent e) {
            }
        });
        sEndMinutes.addKeyListener(new KeyAdapter() {
            public void keyPressed(final KeyEvent e) {

            }
        });
        sEndMinutes.setLayoutData(gridData5);

        sEndMinutes.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
            public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
                if (!beginBeforeAfter()) {
                    Utils.setBackground(0, 59, sEndMinutes);
                }
              
                    listener.setPeriodTime(24, bApply, "end", sEndHours.getText(), sEndMinutes.getText(), sEndSeconds
                            .getText());
            }
        });
        label8 = new Label(gPeriod, SWT.NONE);
        label8.setText(":");
        sEndSeconds = new Text(gPeriod, SWT.BORDER);
        sEndSeconds.addVerifyListener(new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
                e.doit = Utils.isOnlyDigits(e.text);

            }
        });
        sEndSeconds.addMouseListener(new MouseAdapter() {
            public void mouseDown(final MouseEvent e) {

            }
        });
        sEndSeconds.addKeyListener(new KeyAdapter() {
            public void keyPressed(final KeyEvent e) {

            }
        });
        sEndSeconds.setLayoutData(gridData6);
View Full Code Here

TOP

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

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.