Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.KeyAdapter


        e.doit = Utils.isOnlyDigits(e.text);
       
      }
    });
   
    stHour.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
                                  
        refreshPeriodsTable(e);
      }
    });
   
    stHour.setLayoutData(new GridData(24, SWT.DEFAULT));

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

    stMinutes = new Text(composite, SWT.BORDER);
    stMinutes.setTextLimit(2);
    stMinutes.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    stMinutes.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        //test
        if(_type != Editor.RUNTIME)
          return;

        setMinutes();

      }
    });
    stMinutes.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {




      }
    });
    stMinutes.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        stMinutes.selectAll();
      }
    });
    stMinutes.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });
    final GridData gridData_4 = new GridData(24, SWT.DEFAULT);
    stMinutes.setLayoutData(gridData_4);

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

    stSeconds = new Text(composite, SWT.BORDER);
    stSeconds.setTextLimit(2);
    stSeconds.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    stSeconds.addModifyListener(new ModifyListener() {
View Full Code Here


          public void modifyText(final ModifyEvent e) {
            if(butApply != null)
              butApply.setEnabled(txtName.getText().length() > 0);
          }
        });
        txtName.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            if (e.keyCode == SWT.CR && !txtName.getText().equals("")){
              addParam();
            }
          }
        });
        final GridData gridData = new GridData(GridData.FILL, GridData.CENTER, false, false);
        gridData.widthHint = 168;
        txtName.setLayoutData(gridData);
        txtName.setText("");
        txtName.setFocus();
      }


      final Label lblTitle = new Label(textParameterGroup, SWT.NONE);
      final GridData gridData_6 = new GridData(GridData.END, GridData.CENTER, false, false);
      gridData_6.widthHint = 41;
      lblTitle.setLayoutData(gridData_6);
      lblTitle.setAlignment(SWT.RIGHT);
      lblTitle.setText("Value");

      txtValue = new Text(textParameterGroup, SWT.BORDER);
      txtValue.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          butApply.setEnabled(txtName.getText().length() > 0);
        }
      });
      txtValue.addKeyListener(new KeyAdapter() {
        public void keyPressed(final KeyEvent e) {
          if (e.keyCode == SWT.CR && !txtName.getText().trim().equals(""))
            addParam();
        }
      });
View Full Code Here

                e.doit = false;                             
                return;
              }
          }
        });
        tSource.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            if(e.keyCode==97 && e.stateMask == SWT.CTRL){
              tSource.setSelection(0, tSource.getText().length());
        }
          }
View Full Code Here

          bApplyNode.setEnabled(isValidNode());
          if (bApplyNode.getEnabled())
            getShell().setDefaultButton(bApplyNode);
        }
      });
      cJob.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, 3, 1);
      gridData13.widthHint = 579;
      cJob.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;
      gridLayout_2.numColumns = 2;
      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);
          if(jobname != null && jobname.length() > 0)
            cJob.setText(jobname);
        }
      });
      butBrowse.setText("Browse");

      if(!listener.get_dom().isLifeElement()) {
        butImportJob = new Button(composite, SWT.NONE);
        final GridData gridData_3 = new GridData(GridData.END, GridData.CENTER, false, false);
        gridData_3.widthHint = 84;
        butImportJob.setLayoutData(gridData_3);
        butImportJob.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            JobAssistentImportJobsForm importJobs = new JobAssistentImportJobsForm(listener.get_dom(), update, Editor.JOB_CHAINS);
            importJobs.setJobname(cJob);
            importJobs.showAllImportJobs("order");
            if (!listener.get_dom().isLifeElement())
              update.updateOrders();
            refresh = true;

          }
        });
        butImportJob.setText("Import Job");
      }
      label8 = new Label(gNodes, SWT.NONE);
      label8.setText("Next State:");
      new Label(gNodes, SWT.NONE);

      /*composite_2 = new Composite(gNodes, SWT.NONE);
      composite_2.addListener (SWT.Resize,  new org.eclipse.swt.widgets.Listener () {
          public void handleEvent (Event e) {
            cNextState.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);
            txtStateText.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);
            }
          });
*/
     
      /*final GridData gridData_2 = new GridData(GridData.FILL, GridData.FILL, true, false);
      gridData_2.minimumWidth = 35;
      composite_2.setLayoutData(gridData_2);

      final Composite composite_4 = new Composite(gNodes, SWT.NONE);
      final GridData gridData_4 = new GridData(GridData.FILL, GridData.FILL, false, false);
      gridData_4.widthHint = 59;
      composite_4.setLayoutData(gridData_4);
      composite_4.setLayout(new GridLayout());
*/
      cNextState = new Combo(gNodes, SWT.NONE);
      cNextState.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
      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();
          }
        }
      });
      //cNextState = new Combo(composite_4, SWT.BORDER);
     
      /*cNextState.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);
     
      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();
          }
        }
      });
*/
      //txtStateText = new Text(composite_2, SWT.BORDER);
      //txtStateText.setBounds(0, 0, composite_2.getBounds().height, composite_2.getBounds().height);

     
      final Label delayLabel = new Label(gNodes, SWT.NONE);
      delayLabel.setText("Delay:");

      tDelay = new Text(gNodes, SWT.BORDER);
      tDelay.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          bApplyNode.setEnabled(isValidNode());
          if (bApplyNode.getEnabled())
            getShell().setDefaultButton(bApplyNode);
        }
      });
      tDelay.addKeyListener(new KeyAdapter() {
        public void keyPressed(final KeyEvent e) {
        }
      });
      final GridData gridData_8 = new GridData(GridData.FILL, GridData.CENTER, true, false);
      gridData_8.minimumWidth = 35;
      gridData_8.widthHint = 186;
      tDelay.setLayoutData(gridData_8);

      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();
          //test
          //cNextState.setVisible(false);
          //txtStateText.setVisible(true);
          cNextState.setVisibleItemCount(0);
         
         
        }
      });
      bNewNode.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
      bNewNode.setText("New Chain &Node");

      label9 = new Label(gNodes, SWT.NONE);
      label9.setText("Error State:");
      new Label(gNodes, SWT.NONE);

      cErrorState = new Combo(gNodes, SWT.NONE);
      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();
          }
        }
      });
      final GridData gridData15 = new GridData(GridData.FILL, GridData.CENTER, true, false);
      gridData15.widthHint = 80;
      cErrorState.setLayoutData(gridData15);

      final Label onErrorLabel = new Label(gNodes, SWT.NONE);
      onErrorLabel.setText("On Error:");

      cOnError = new Combo(gNodes, SWT.READ_ONLY);
      cOnError.setItems(new String[] {"", "setback", "suspend"});
      cOnError.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          bApplyNode.setEnabled(isValidNode());
          if (bApplyNode.getEnabled())
            getShell().setDefaultButton(bApplyNode);
        }
      });
      cOnError.addKeyListener(new KeyAdapter() {
        public void keyPressed(final KeyEvent e) {
          if (e.keyCode == SWT.CR) {
            applyNode();
          }
        }
      });
      final GridData gridData_12 = new GridData(GridData.FILL, GridData.CENTER, true, false);
      gridData_12.minimumWidth = 20;
      cOnError.setLayoutData(gridData_12);

      butInsert = new Button(gNodes, SWT.NONE);
      butInsert.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          isInsert = true;
          String state = tState.getText();
          tState.setText("");
          tDelay.setText("");       
          cErrorState.setText("");
          cOnError.setText("");
          cJob.setText("");
          enableNode(true);
          bFullNode.setSelection(true);
          bEndNode.setSelection(false);
          //n�chste status
          cNextState.setText(state);



        }
      });
      butInsert.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      butInsert.setText("Insert Chain Node");

      cType = new Composite(gNodes, SWT.NONE);
      final GridLayout gridLayout_4 = new GridLayout();
      gridLayout_4.marginHeight = 0;
      gridLayout_4.marginWidth = 0;
      gridLayout_4.numColumns = 4;
      cType.setLayout(gridLayout_4);
      final GridData gridData5 = new GridData(GridData.FILL, GridData.CENTER, true, false, 5, 1);
      gridData5.widthHint = 387;
      gridData5.heightHint = 35;
      cType.setLayoutData(gridData5);

      bFullNode = new Button(cType, SWT.RADIO);
      bFullNode.addSelectionListener(new SelectionAdapter() {
        public void widgetDefaultSelected(final SelectionEvent e) {
        }
      });
      bFullNode.setSelection(true);
      bFullNode.setText("Full Node");

      bEndNode = new Button(cType, SWT.RADIO);
      bEndNode.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {

          if (bFileSink.getSelection()) {
            cNextState.setEnabled(false);
            cErrorState.setEnabled(false);
            cOnError.setEnabled(false);
            tDelay.setEnabled(false);
            cJob.setEnabled(false);
            cJob.setText("");
            cNextState.setText("");
            cErrorState.setText("");
            cOnError.setText("");
            tMoveTo.setEnabled(true);
            bRemoveFile.setEnabled(true);
          }

          if (bEndNode.getSelection()) {
            cNextState.setEnabled(false);
            cErrorState.setEnabled(false);
            cOnError.setEnabled(false);
            tDelay.setEnabled(false);
            cJob.setEnabled(false);
            cJob.setText("");
            cNextState.setText("");
            cErrorState.setText("");
            cOnError.setText("");
            tMoveTo.setEnabled(false);
            bRemoveFile.setEnabled(false);
          }

          if (bFullNode.getSelection()) {
            tMoveTo.setEnabled(false);
            bRemoveFile.setEnabled(false);
            cNextState.setEnabled(true);
            cErrorState.setEnabled(true);
            cOnError.setEnabled(true);
            cJob.setEnabled(true);
            tDelay.setEnabled(true);
            if (bApplyNode.getEnabled())
              getShell().setDefaultButton(bApplyNode);
          }
          bApplyNode.setEnabled(isValidNode());

        }
      });
      bEndNode.setText("End Node");

      bFileSink = new Button(cType, SWT.RADIO);
      final GridData gridData = new GridData(GridData.FILL, GridData.CENTER, false, false);
      gridData.widthHint = 71;
      bFileSink.setLayoutData(gridData);
      bFileSink.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          if (bFileSink.getSelection()) {
            cNextState.setEnabled(false);
            cErrorState.setEnabled(false);
            cOnError.setEnabled(false);
            cJob.setEnabled(false);
            cJob.setText("");
            cNextState.setText("");         
            cErrorState.setText("");
            cOnError.setText("");
            tMoveTo.setEnabled(true);
            bRemoveFile.setEnabled(true);

            if (tState.getText().equals(""))
              bApplyNode.setEnabled(false);
          }
        }
      });
      bFileSink.setEnabled(false);
      bFileSink.setText("File Sink");

      final Composite composite_3 = new Composite(cType, SWT.NONE);
      final GridData gridData_5 = new GridData(GridData.FILL, GridData.FILL, true, false);
      gridData_5.widthHint = 238;
      composite_3.setLayoutData(gridData_5);
      final GridLayout gridLayout_7 = new GridLayout();
      gridLayout_7.verticalSpacing = 0;
      gridLayout_7.numColumns = 2;
      gridLayout_7.marginWidth = 0;
      gridLayout_7.marginHeight = 0;
      gridLayout_7.horizontalSpacing = 0;
      composite_3.setLayout(gridLayout_7);

      final Label removeFileLabel = new Label(composite_3, SWT.NONE);
      removeFileLabel.setText("Remove File");

      bRemoveFile = new Button(composite_3, SWT.CHECK);
      final GridData gridData_1 = new GridData();
      gridData_1.horizontalIndent = 5;
      bRemoveFile.setLayoutData(gridData_1);
      bRemoveFile.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(final SelectionEvent e) {
          if (bRemoveFile.getSelection())tMoveTo.setText("");
          bApplyNode.setEnabled(isValidNode());
          if (bApplyNode.getEnabled())
            getShell().setDefaultButton(bApplyNode);

        }
      });
      bRemoveFile.addKeyListener(new KeyAdapter() {
        public void keyPressed(final KeyEvent e) {
          if (e.keyCode == SWT.CR) {
            applyNode();
          }
        }
      });
      bRemoveFile.setEnabled(false);

      final Label movweToLabel = new Label(composite_3, SWT.NONE);
      movweToLabel.setText("Move to");

      tMoveTo = new Text(composite_3, SWT.BORDER);
      final GridData gridData_3 = new GridData(GridData.FILL, GridData.CENTER, true, false);
      gridData_3.horizontalIndent = 5;
      tMoveTo.setLayoutData(gridData_3);
      tMoveTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if (!tMoveTo.getText().equals(""))bRemoveFile.setSelection(false);
          bApplyNode.setEnabled(isValidNode());
          if (bApplyNode.getEnabled())
            getShell().setDefaultButton(bApplyNode);

        }
      });
      tMoveTo.addKeyListener(new KeyAdapter() {
        public void keyPressed(final KeyEvent e) {
          if (e.keyCode == SWT.CR) {
            applyNode();
          }
        }
View Full Code Here

    tUrlPath.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tUrlPath.selectAll();
      }
    });
    tUrlPath.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {    
        if ((tUrlPath.getText().length() > 0) && (tUrlPath.getText().charAt(0) != '/')) {
          tUrlPath.setText("/" + tUrlPath.getText());
          tUrlPath.setSelection(2);
        }
        if (e.keyCode == SWT.CR && !tUrlPath.getText().equals(""))
          applyHttpDirectory();
      }
    });
    tUrlPath.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        bApplyHttpDirectory.setEnabled(!tUrlPath.getText().equals(""));

      }
    });
    tUrlPath.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    final Label pathLabel = new Label(group_1, SWT.NONE);
    pathLabel.setText("Path");

    tPath = new Text(group_1, SWT.BORDER);
    tPath.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tPath.selectAll();
      }
    });
    tPath.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !tUrlPath.getText().equals(""))
          applyHttpDirectory();

      }
View Full Code Here

     * Initializes the Viewer.
     */
    private void initViewer()
    {
        viewer.setInput( new ProjectsViewRoot( viewer ) );
        viewer.getTable().addKeyListener( new KeyAdapter()
        {
            public void keyReleased( KeyEvent e )
            {
                if ( ( e.keyCode == Action.findKeyCode( "BACKSPACE" ) ) //$NON-NLS-1$
                    || ( e.keyCode == Action.findKeyCode( "DELETE" ) ) ) //$NON-NLS-1$
View Full Code Here

            @Override
            protected int indexOf(Object object) {
                return clauses.indexOf(object);
            }
        });
        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemoveSelectedClauses();
                } else if (e.character == '+') {
View Full Code Here

    javaPackage = new Text(container, SWT.BORDER | SWT.SINGLE);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    javaPackage.setLayoutData(gd);
    javaPackageModified = false;
    javaPackage.addKeyListener(new KeyAdapter() {
      @Override
      public void keyPressed(KeyEvent e) {
        javaPackageModified = true;
      }
    });
View Full Code Here

            @Override
            protected int indexOf(Object object) {
                return clauses.indexOf(object);
            }
        });
        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemoveSelectedClauses();
                } else if (e.character == '+') {
View Full Code Here

        viewer.addSelectionChangedListener(new ISelectionChangedListener() {
            public void selectionChanged(SelectionChangedEvent event) {
                removeTool.setEnabled(!viewer.getSelection().isEmpty());
            }
        });
        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemove();
                } else if (e.character == '+') {
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.