Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.KeyAdapter


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

        butApply = new Button(group, SWT.NONE);
        butApply.setEnabled(false);
        butApply.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            apply();
          }
        });
        butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
        butApply.setText("Apply");

        final Label logicLabel = new Label(group, SWT.NONE);
        logicLabel.setText("Logic: ");

        txtGroupLogic = new Text(group, SWT.BORDER);
        txtGroupLogic.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            txtGroupLogic.selectAll();
          }
        });
        txtGroupLogic.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            butApply.setEnabled(true);
          }
        });
        txtGroupLogic.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            if (e.keyCode == SWT.CR && !txtGroup.equals(""))
              apply();
          }
        });
        txtGroupLogic.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

        butEventGroupOperation = new Button(group, SWT.NONE);
        butEventGroupOperation.setLayoutData(new GridData());
        butEventGroupOperation.setEnabled(false);
        butEventGroupOperation.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
            ArrayList list = new ArrayList();           
            list.addAll(listener.getEventClassAndId(txtGroup.getText()));
           
            LogicOperationDialog logicOperationDialog = new LogicOperationDialog(SWT.NONE);
            logicOperationDialog.open(txtGroupLogic, list);
          }
        });
        butEventGroupOperation.setText("Operation");

        butNew = new Button(group, SWT.NONE);
        butNew.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {
                 
                txtGroup.setText("");
                txtGroupLogic.setText("");
                cboEventClass.setText("");
                table.deselectAll();               
                butNew.setToolTipText(Messages.getTooltip("events.button_new"));
                butApply.setEnabled(false);
                butRemove.setEnabled(false);
                txtGroup.setFocus();
          }
        });
        butNew.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
        butNew.setText("New");

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

        cboEventClass = new Combo(group, SWT.BORDER);
       
        cboEventClass.addModifyListener(new ModifyListener() {
          public void modifyText(final ModifyEvent e) {
            butApply.setEnabled(true);
          }
        });
        cboEventClass.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            if (e.keyCode == SWT.CR && !txtGroup.equals(""))
              apply();
          }
        });
View Full Code Here


        commandsGroup.setText("Commands");
        commandsGroup.setLayout(gridLayout);
        createTable();

        tCommands = new Text(commandsGroup, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL);
        tCommands.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
            if(e.keyCode==97 && e.stateMask == SWT.CTRL){
              tCommands.setSelection(0, tCommands.getText().length());
        }
          }
View Full Code Here

        gComment.setLayoutData(new org.eclipse.swt.layout.GridData(GridData.FILL, GridData.FILL, true, true));
        final GridLayout gridLayout_1 = new GridLayout();
        gridLayout_1.numColumns = 2;
        gComment.setLayout(gridLayout_1);
        tComment = new Text(gComment, SWT.MULTI | 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

      });
      butProfiles.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));
      butProfiles.setText("Profiles");

      txtUrl = new Text(schedulerGroup, SWT.BORDER);
      txtUrl.addKeyListener(new KeyAdapter() {
        public void keyPressed(final KeyEvent e) {
          if (e.keyCode == SWT.CR) {
            if(!txtUrl.getText().endsWith("/"))
              txtUrl.setText(txtUrl.getText() + "/");
View Full Code Here

      public void focusGained(final FocusEvent e) {
        txtEventName.selectAll();
      }
    });
   
    txtEventName.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtEventName.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtEventName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    butApply = new Button(group, SWT.NONE);
    butApply.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        apply();
      }
    });
    butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butApply.setText("Apply");

    final Label eventTitleLabel = new Label(group, SWT.NONE);
    eventTitleLabel.setLayoutData(new GridData());
    eventTitleLabel.setText("Event Title");

    txtTitle = new Text(group, SWT.BORDER);
   
    txtTitle.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtTitle.selectAll();
      }
    });
    txtTitle.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtTitle.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtTitle.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    butNew = new Button(group, SWT.NONE);
    butNew.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        refresh();
      }
    });
    butNew.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
    butNew.setText("New");

    matchingAttributesGroup = new Group(group, SWT.NONE);
    matchingAttributesGroup.setText("Matching Attributes");
    matchingAttributesGroup.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3, 1));
    final GridLayout gridLayout_1 = new GridLayout();
    gridLayout_1.marginTop = 5;
    gridLayout_1.numColumns = 4;
    matchingAttributesGroup.setLayout(gridLayout_1);

    final Label txtEventClass = new Label(matchingAttributesGroup, SWT.NONE);
    txtEventClass.setText("Event Class");

    cboEventClass = new Combo(matchingAttributesGroup, SWT.NONE);
    cboEventClass.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    cboEventClass.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    cboEventClass.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label labeld = new Label(matchingAttributesGroup, SWT.NONE);
    labeld.setText("Event Id");

    txtEventId = new Text(matchingAttributesGroup, SWT.BORDER);
    txtEventId.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtEventId.selectAll();   
      }
    });
    txtEventId.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtEventId.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtEventId.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label jobNameLabel = new Label(matchingAttributesGroup, SWT.NONE);
    jobNameLabel.setText("Job Name");

    txtJobname = new Text(matchingAttributesGroup, SWT.BORDER);
    txtJobname.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtJobname.selectAll();
      }
    });
    txtJobname.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtJobname.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtJobname.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label jobChainLabel = new Label(matchingAttributesGroup, SWT.NONE);
    jobChainLabel.setText("Job Chain");

    txtJobChain = new Text(matchingAttributesGroup, SWT.BORDER);
    txtJobChain.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtJobChain.selectAll();
      }
    });
    txtJobChain.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtJobChain.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtJobChain.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label lblOrderId = new Label(matchingAttributesGroup, SWT.NONE);
    lblOrderId.setText("Order Id");

    txtOrderId = new Text(matchingAttributesGroup, SWT.BORDER);
    txtOrderId.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtOrderId.selectAll();   
      }
    });
    txtOrderId.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtOrderId.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
    txtOrderId.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));

    final Label exitCodeLabel = new Label(matchingAttributesGroup, SWT.NONE);
    exitCodeLabel.setLayoutData(new GridData());
    exitCodeLabel.setText("Exit Code");

    txtExitCode = new Text(matchingAttributesGroup, SWT.BORDER);
    txtExitCode.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtExitCode.selectAll();
      }
    });
    txtExitCode.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        butApply.setEnabled(true);
      }
    });
    txtExitCode.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR )
          apply();
      }
    });
View Full Code Here

    tInclude.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        bAdd.setEnabled(!tInclude.getText().equals(""));
      }
    });
    tInclude.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !tInclude.getText().equals("")) {         
          listener.addInclude(tableIncludes, tInclude.getText(), butIsLifeFile.getSelection());         
          listener.fillTable(tableIncludes);
          tInclude.setText("");
View Full Code Here

    final Label lblDirectory = new Label(jobGroup, SWT.NONE);
    lblDirectory.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
    lblDirectory.setText("Directory");

    txtDirectory = new Text(jobGroup, SWT.BORDER);   
    txtDirectory.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR)
          apply();
      }
    });
    txtDirectory.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
    txtDirectory.setFocus();

    final Composite composite = new Composite(jobGroup, SWT.NONE);
    final GridData gridData_4 = new GridData(GridData.FILL, GridData.FILL, false, false, 1, 2);
    gridData_4.heightHint = 59;
    gridData_4.widthHint = 72;
    composite.setLayoutData(gridData_4);
    final GridLayout gridLayout_4 = new GridLayout();
    gridLayout_4.horizontalSpacing = 0;
    gridLayout_4.marginWidth = 0;
    gridLayout_4.marginHeight = 0;
    composite.setLayout(gridLayout_4);

    butApply = new Button(composite, SWT.NONE);
    final GridData gridData_2 = new GridData(GridData.FILL, GridData.CENTER, true, false);
    butApply.setLayoutData(gridData_2);
    butApply.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        apply();       
      }
    });
    butApply.setText("Apply Dir");

    butNewDirectory = new Button(composite, SWT.NONE);
    final GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData.widthHint = 47;
    butNewDirectory.setLayoutData(gridData);
    butNewDirectory.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {

        txtDirectory.setText("");
        txtRegExp.setText("");
        txtDirectory.setFocus();
        tableWatchDirectory.deselectAll();

      }
    });
    butNewDirectory.setText("New");

    final Label lblRegExp = new Label(jobGroup, SWT.NONE);
    lblRegExp.setText("Regular expression ");

    txtRegExp = new Text(jobGroup, SWT.BORDER);
    txtRegExp.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR)
          apply();
      }
    });
View Full Code Here

        } else {
          butText.setEnabled(false);         
        }
      }
    });
    txtName.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {

        if (e.keyCode == SWT.CR && !txtName.getText().equals("")){
          addParam();
        }

      }
    });

    txtName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    txtName.setFocus();
   
    final Label valueLabel = new Label(parameterGroup, SWT.NONE);
    valueLabel.setText("Value");

    txtValue = new Text(parameterGroup, SWT.BORDER);
    txtValue.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        txtValue.selectAll();
      }
    });
    txtValue.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        if (e.keyCode == SWT.CR && !txtName.getText().equals("")){
          addParam();
        }
      }
View Full Code Here

    button.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_edit.gif"));
   
   
   
    tComment = new Text(group, SWT.MULTI | 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

    label2 = new Label(groupSlottime, SWT.NONE);
    label2.setLayoutData(new GridData(86, SWT.DEFAULT));
    label2.setText("Begin Time:");
    sBeginHours = new Text(groupSlottime, SWT.BORDER);
    sBeginHours.setTextLimit(2);
    sBeginHours.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    sBeginHours.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        sBeginHours.selectAll();
      }
    });
    sBeginHours.setLayoutData(new GridData(24, SWT.DEFAULT));

    sBeginHours.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });

    sBeginHours.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        //test
        if(_type != Editor.RUNTIME)
          return;
       
        setBeginHours();
      }
    });
    label3 = new Label(groupSlottime, SWT.NONE);
    label3.setText(":");
    sBeginMinutes = new Text(groupSlottime, SWT.BORDER);
    sBeginMinutes.setTextLimit(2);
    sBeginMinutes.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    sBeginMinutes.addFocusListener(new FocusAdapter() {     
      public void focusGained(final FocusEvent e) {
        sBeginMinutes.selectAll();
      }
    });
    sBeginMinutes.setLayoutData(new GridData(24, SWT.DEFAULT));
    sBeginMinutes.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);
      }
    });

    sBeginMinutes.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        //test
        if(_type != Editor.RUNTIME)
          return;
       
       
        setBeginminutes();
       
      }
    });
    label4 = new Label(groupSlottime, SWT.NONE);
    label4.setText(":");
    sBeginSeconds = new Text(groupSlottime, SWT.BORDER);
    sBeginSeconds.setTextLimit(2);
    sBeginSeconds.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    sBeginSeconds.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        sBeginSeconds.selectAll();
      }
    });
    final GridData gridData_2 = new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1);
    gridData_2.widthHint = 24;
    sBeginSeconds.setLayoutData(gridData_2);
    sBeginSeconds.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);

      }
    });


    sBeginSeconds.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
       
        //test
        if(_type != Editor.RUNTIME)
          return;
       
        setBeginSeconds();
       
      }
    });
    label5 = new Label(groupSlottime, SWT.NONE);
    label5.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    label5.setText("hh:mm:ss");
    label6 = new Label(groupSlottime, SWT.NONE);
    label6.setLayoutData(new GridData(86, SWT.DEFAULT));
    label6.setText("End Time:");
    sEndHours = new Text(groupSlottime, SWT.BORDER);
    sEndHours.setTextLimit(2);
    sEndHours.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    sEndHours.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        sEndHours.selectAll();
      }
    });
    sEndHours.setLayoutData(new GridData(24, SWT.DEFAULT));
    sEndHours.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);

      }
    });


    sEndHours.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        //test
        if(_type != Editor.RUNTIME)
          return;
       
        setEndHours();
       
      }
    });
    label7 = new Label(groupSlottime, SWT.NONE);
    label7.setText(":");
    sEndMinutes = new Text(groupSlottime, SWT.BORDER);
    sEndMinutes.setTextLimit(2);
    sEndMinutes.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    sEndMinutes.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        sEndMinutes.selectAll();
      }
    });
    sEndMinutes.setLayoutData(new GridData(24, SWT.DEFAULT));
    sEndMinutes.addVerifyListener(new VerifyListener() {
      public void verifyText(final VerifyEvent e) {
        e.doit = Utils.isOnlyDigits(e.text);

      }
    });


    sEndMinutes.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
      public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
       
        //test
        if(_type != Editor.RUNTIME)
          return;
       
        setEndMinutes();
       
      }
    });
    label8 = new Label(groupSlottime, SWT.NONE);
    label8.setText(":");
    sEndSeconds = new Text(groupSlottime, SWT.BORDER);
    sEndSeconds.setTextLimit(2);
    sEndSeconds.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {
        refreshPeriodsTable(e);
      }
    });
    sEndSeconds.addFocusListener(new FocusAdapter() {
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.