Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Listener


    colDetails.setWidth(300);
    colDetails.setResizable(false);
   
   
    activityTable.setHeaderVisible(true);
    Listener computeLastRowWidthListener = new Listener() {
      // inUse flag to prevent a SWT stack overflow.  For some reason
      // the setWidth call was triggering a resize.
      boolean inUse = false;
      public void handleEvent(Event event) {
        if (inUse) {
          return;
        }

        inUse = true;
         try {
          if(activityTable == null || activityTable.isDisposed()) return;
          int totalWidth = activityTable.getClientArea().width;
          int remainingWidth = totalWidth
                                 - colStatus.getWidth()
                                 - colType.getWidth()
                                 - colName.getWidth();
          if(remainingWidth > 0)
            colDetails.setWidth(remainingWidth);

         } finally {
          inUse = false;
        }
      }
    };
    activityTable.addListener(SWT.Resize, computeLastRowWidthListener);   
    colStatus.addListener(SWT.Resize,computeLastRowWidthListener);
    colType.addListener(SWT.Resize,computeLastRowWidthListener);
    colName.addListener(SWT.Resize,computeLastRowWidthListener);
   
    activityTable.addListener(SWT.SetData, new Listener() {
      public void handleEvent(Event event) {
        TableItem item = (TableItem) event.item;
        int index = activityTable.indexOf (item);
        item.setText (0,MessageText.getString("DHTView.activity.status." + activities[index].isQueued()));
        item.setText (1,MessageText.getString("DHTView.activity.type." + activities[index].getType()));
View Full Code Here


      public void mouseDown(MouseEvent arg0) {
        Utils.launch((String) ((Label) arg0.widget).getText());
      }
    });
   
    servicesList.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        updateInfos();       
      }
    });
    servicesList.select(0);
View Full Code Here

    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(upload_session.getED2KLink().getAsString());
    label.setToolTipText(_._("uploadinfowindow.tab.general.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    label.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    label.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        Utils.setClipBoardText(upload_session.getED2KLink().getAsString());
      }
    });
   
View Full Code Here

    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(shared_file.getED2KLink().getAsString());
    label.setToolTipText(_._("sharedfilepropertieswindow.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    label.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    label.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        Utils.setClipBoardText(shared_file.getED2KLink().getAsString());
      }
    });
   
View Full Code Here

    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(search_result.getAsED2KLink().getAsString());
    label.setToolTipText(_._("searchpropertieswindow.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    label.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    label.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        Utils.setClipBoardText(search_result.getAsED2KLink().getAsString());
      }
    });
   
View Full Code Here

    label.setToolTipText(_
        ._("downloadinfowindow.tab.general.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(
        SWT.COLOR_BLUE));
    label.setCursor(new Cursor(SWTThread.getDisplay(), SWT.CURSOR_HAND));
    label.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        Utils.setClipBoardText(download_session.getED2KLink()
            .getAsString());
      }
    });
View Full Code Here

    setHeaderVisible(true);
    setLinesVisible (true);
   
   
   
    column_data_save_listener = new Listener() {
      public void handleEvent(Event arg0) {
        saveColumnSettings();
      }
    };
   
    addMenuDetectListener(new MenuDetectListener() {
      public void menuDetected(MenuDetectEvent arg0) {
        setMenu(getPopUpMenu());       
      }
    });
   
    addListener(SWT.SetData, new Listener(){
      public void handleEvent(Event arg0) {
        TableItem item = (TableItem) arg0.item;
        int index = indexOf(item);
       
        if (enable_alternate_background_color)
          if (index%2==0)
            item.setBackground(ROW_ALTERNATE_COLOR_2);
          else
            item.setBackground(ROW_ALTERNATE_COLOR_1);
       
        T object = (T)line_list.get(index).getData(SWTConstants.ROW_OBJECT_KEY);
        updateRow(object);
      }
    });
   
    addListener(SWT.MeasureItem, new Listener() {
      public void handleEvent(Event event) {
          switch(event.type) {
           case SWT.MeasureItem: {
            event.height = SWTConstants.TABLE_ROW_HEIGHT;
            break;
           }}}
    });
   
    addListener(SWT.PaintItem, new Listener() {
      public void handleEvent(Event event) {
        int row_id = indexOf((TableItem)event.item);
        int column_id = event.index;
        int width = getColumn(column_id).getWidth(); // event's width is not used !
        BufferedTableRow row = line_list.get(row_id);
View Full Code Here

    table_column.setMoveable(true);
    table_column.setResizable(true);
    table_column.addListener(SWT.Resize, column_data_save_listener);
    table_column.addListener(SWT.Move, column_data_save_listener);
   
    Listener sort_listener = new Listener() {
      private int sort_order = 0;
      public void handleEvent(final Event e) {
       
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
View Full Code Here

                        }});
              } catch (JMUpdaterException e) {}
                  }
                }).start();
              }
              shell.addListener(SWT.Close, new Listener() {
          public void handleEvent(Event arg0) {
            boolean exit = SWTPreferences.getInstance().promptOnExit() ?
                Utils.showConfirmMessage(shell, _._("mainwindow.exit_prompt_title"), _._("mainwindow.exit_prompt")) : true;
            arg0.doit = exit;
          }
View Full Code Here

  private boolean kbyte_selected = true;
 
  public GeneralTab(Composite parent) {
    super(parent);
 
    Listener number_filter = new Listener() {
      public void handleEvent(Event e) {
            String text = e.text;

            char[] chars = new char[text.length()];
            text.getChars(0, chars.length, chars, 0);
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.