Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Listener


//        layout.marginWidth= 2;
//        layout.horizontalSpacing= 0;
//        layout.verticalSpacing= 0;
//        _toolbarComposite.setLayout(layout);

        _toolbarComposite.addListener(SWT.Resize, new Listener() {
            public void handleEvent(Event event) {
                int height= _toolbarComposite.getClientArea().height;

                    Image image= createGradientImage(height, event.display);
                    _toolbarComposite.setBackgroundImage(image);
View Full Code Here


       
        final ToolBar schemaSectionToolBar = new ToolBar(schemaSection, SWT.FLAT);
        final ToolItem schemaSectionItemNew = new ToolItem(schemaSectionToolBar, SWT.DROP_DOWN);
        schemaSectionItemNew.setText("new");
        schemaSectionItemNew.setImage(Plugin.getDefault().getImageRegistry().get(Plugin.IMAGE_SCHEMADEFINITION_ADD));
        schemaSectionItemNew.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event event) {

                  Rectangle rect = schemaSectionItemNew.getBounds();
                  Point pt = new Point(rect.x, rect.y + rect.height);
                  pt = schemaSectionToolBar.toDisplay(pt);
View Full Code Here

    buddy_table.setLayoutData(grid_data);
   
   
    buddy_table.addListener(
      SWT.SetData,
      new Listener()
      {
        public void
        handleEvent(
          Event event)
        {
          TableItem item = (TableItem)event.item;
         
          int index = buddy_table.indexOf(item);
 
          if ( index < 0 || index >= participants.size()){
           
            return;
          }
         
          BuddyPluginAZ2.chatParticipant  participant = (BuddyPluginAZ2.chatParticipant)participants.get(index);
         
          BuddyPluginBuddy buddy = participant.getBuddy();
         
          if ( buddy == null ){
           
            item.setForeground( 0, Colors.red );
           
          }else if ( buddy.isOnline( false )){
           
            item.setForeground( 0, Colors.black );
           
          }else{
           
            item.setForeground( 0, Colors.grey );
          }
         
          item.setText(0, participant.getName());         
        }
      });
   
   
   
   
      // Text
   
    final Text text = new Text( shell, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP | SWT.BORDER);
    grid_data = new GridData(GridData.FILL_HORIZONTAL );
    grid_data.horizontalSpan = 2;
    grid_data.heightHint = 50;
    text.setLayoutData(grid_data);
       
    text.addKeyListener(
      new KeyListener()
      {
        public void
        keyPressed(
          KeyEvent e)
        {
          if ( e.keyCode == SWT.CR ){
       
            e.doit = false;
           
            sendMessage( text.getText());
           
            text.setText( "" );
          }
        }
       
        public void
        keyReleased(
          KeyEvent e )
        {
        }
      });
   
    text.setFocus();
   
    shell.addListener(
      SWT.Traverse,
      new Listener()
      { 
        public void
        handleEvent(
          Event e )
        {
View Full Code Here

     
      alt_method.setText(MessageText.getString("externalLogin.auth_method_proxy"));
     
      alt_method.setSelection( authMode == WebEngine.AM_PROXY );
     
      alt_method.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event arg0) {
 
          setCaptureMethod( browser, !f_alt_method.getSelection(), true );
        }
      });
    }
   
    setCaptureMethod( browser, authMode == WebEngine.AM_TRANSPARENT, true );
       
    Button cancel = new Button(shell,SWT.PUSH);
    cancel.setText(MessageText.getString("Button.cancel"));
   
    Button done = new Button(shell,SWT.PUSH);
    done.setText(MessageText.getString("Button.done"));
   
    cancel.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        if(listener != null) {
          listener.canceled(ExternalLoginWindow.this);
        }
        shell.dispose();
      }
    });
   
    done.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        if(listener != null) {
          listener.done(ExternalLoginWindow.this,cookiesToString());
        }
        shell.dispose();
View Full Code Here

          }
        }
      }
    });
   
    drawCanvas.addListener(SWT.Resize, new Listener() {
      public void handleEvent(Event event) {
        drawChart(true);
      }
    });
  }
View Full Code Here

        };
       
        // Reuse the same label as defined for Azureus UI reset buttons.
        reset_button_holder[0] = new ButtonParameter(area, "ConfigView.section.style.colorOverrides.reset");
        reset_button_holder[0].getControl().setEnabled(color_param.isOverridden());
        reset_button_holder[0].getControl().addListener(SWT.Selection, new Listener(){
          public void handleEvent(Event event) {
            reset_button_holder[0].getControl().setEnabled(false);
            color_param.resetToDefault();
            color_param.reloadParamDataFromConfig(false);
          }
View Full Code Here

     
      Button browse = new Button(pluginGroup, SWT.PUSH);
      ImageLoader.getInstance().setButtonImage(browse, getBrowseImageResource());
      browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));

      browse.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          String path = DirectoryParameter.this.openDialog(pluginGroup.getShell(), sp.getValue());
          if (path != null) {
            sp.setValue(path);
          }
View Full Code Here

    sParamName = name;

    inputField = new Text(composite, SWT.BORDER);
    float value = COConfigurationManager.getFloatParameter(name);
    inputField.setText(String.valueOf(value));
    inputField.addListener(SWT.Verify, new Listener() {
      public void handleEvent(Event e) {
        String text = e.text;
        char[] chars = new char[text.length()];
        text.getChars(0, chars.length, chars, 0);
        for (int i = 0; i < chars.length; i++) {
          if ( !((chars[i] >= '0' && chars[i] <= '9') || chars[i] == '.') ) {
            e.doit = false;
            return;
          }
        }
      }
    });

    inputField.addListener(SWT.Modify, new Listener() {
      public void handleEvent(Event event) {
        try {
          float val = Float.parseFloat(inputField.getText());
          if (val < fMinValue) {
            if (!(allowZero && val == 0)) {
              val = fMinValue;
            }
          }
          if (val > fMaxValue) {
            if (fMaxValue > -1) {
              val = fMaxValue;
            }
          }
          COConfigurationManager.setParameter(name, val);
        }
        catch (Exception e) {}
      }
    });

    inputField.addListener(SWT.FocusOut, new Listener() {
      public void handleEvent(Event event) {
        try {
          float val = Float.parseFloat(inputField.getText());
          if (val < fMinValue) {
            if (!(allowZero && val == 0)) {
View Full Code Here

    b = COConfigurationManager.getIntParameter(name+".blue",_b);
    updateButtonColor(composite.getDisplay(), r, g, b);

    COConfigurationManager.addParameterListener(sParamName, this);
   
    colorChooser.addListener(SWT.Dispose, new Listener() {
      public void handleEvent(Event e) {
        COConfigurationManager.removeParameterListener(sParamName, ColorParameter.this);
        if(img != null && ! img.isDisposed()) {
          img.dispose();         
        }
      }
    });

    colorChooser.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ColorDialog cd = new ColorDialog(composite.getShell());
        cd.setRGB(new RGB(r,g,b));
        RGB newColor = cd.open();
        if (newColor == null)
View Full Code Here

    }
    int iDefaultValue = COConfigurationManager.getIntParameter(sConfigName);

    radioButton = new Button(composite, SWT.RADIO);
    radioButton.setSelection(iDefaultValue == iButtonValue);
    radioButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        boolean selected = radioButton.getSelection();
        if (selected)
          COConfigurationManager.setParameter(sConfigName, iButtonValue);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Listener

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.