Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.TableItem


  }
 

  public void handleEvent(Event event) {
    final Point pt = new Point(event.x, event.y);
    final TableItem item = _viewer.getTable().getItem(pt);   
    if (item != null) {
      for (int column = 0; column < _viewer.getTable().getColumnCount(); column++) {
        Rectangle rect = item.getBounds(column);
        if (rect.contains(pt)) {
          _doubleClick = true;
          _viewer.editElement(item.getData(), column);
          _doubleClick = false;
          return;
        }
      }
    }
View Full Code Here


      updateTableItem(bean);
    }   
  }

  protected void updateTableItem(Object bean) {
    TableItem items[] = getTable().getItems();
    for (TableItem item : items) {
      if (item.getData().equals(bean)) {
        if (_model.isBeanEditable((T)bean)) {
          item.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
        } else {
View Full Code Here

  public void init(List<WGARemoteServer> servers) { 
    _table.removeAll();
    Iterator<WGARemoteServer> it = servers.iterator();
    while (it.hasNext()) {
      WGARemoteServer currentServer = it.next();
      TableItem item = new TableItem(_table, SWT.NONE);       
      item.setText(new String[] { currentServer.getName(), currentServer.getUrl().toString(), "" });
      item.setData(currentServer);
    }

    for(TableColumn current : _table.getColumns()){
      current.pack();     
    }
View Full Code Here

     
      PluginInterface plugin = (PluginInterface)pis.get(0);
     
      List  selected_plugins = ((UnInstallPluginWizard)wizard).getPluginList();
     
      TableItem item = new TableItem(pluginList,SWT.NULL);
      item.setData(plugin);
      item.setText(0, display_name);
      item.setChecked( selected_plugins.contains( plugin ));
      String version = plugin.getPluginVersion();
      if(version == null) version = MessageText.getString("installPluginsWizard.list.nullversion");
      item.setText(1,version);
    }
 
  pluginList.addListener(SWT.Selection,new Listener() {
    public void handleEvent(Event e) {
      updateList();   
View Full Code Here

    switch (event.type) {
      case SWT.MouseHover: {
        if (toolTipShell != null && !toolTipShell.isDisposed())
          toolTipShell.dispose();

        TableItem item = table.getItem( new Point( event.x, event.y ));
       
        if (item == null)
          return;
       
        Object oToolTip = item.getData( "tooltip" );
       
        if ( oToolTip == null ){
       
          oToolTip = item.getText(0);
        }
       
        // TODO: support composite, image, etc
        if (oToolTip == null || !(oToolTip instanceof String))
          return;
View Full Code Here

      {
        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());         
        }
      });
   
   
   
View Full Code Here

    popularity.setWidth(70);
    popularity.setResizable(false);
   
    subscriptionsList.addListener(SWT.SetData, new Listener() {
      public void handleEvent(Event e) {
        TableItem item = (TableItem) e.item;
        int index = subscriptionsList.indexOf(item);
        if(index >= 0 && index < subscriptionItems.length) {
          SubscriptionItemModel subscriptionItem = subscriptionItems[index];
          item.setText(0,subscriptionItem.name);
          item.setText(1,subscriptionItem.popularityDisplay);
        }
      }
    });
   
    subscriptionsList.setSortColumn(popularity);
View Full Code Here

    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()));
        item.setText (2,ByteFormatter.nicePrint(activities[index].getTarget()));
        item.setText (3,activities[index].getDescription());
      }
    });
   
  }
View Full Code Here

      }
    });
   
    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);
      }
    });
View Full Code Here

          BufferedTableRow table_row = new BufferedTableRow(this);
          line_list.add(table_row);
          default_line_list.add(table_row);
          default_custom_control_list.add(new LinkedList<Object>());
        
          TableItem item = getItem(ifactor+i);
          table_row.setSWTRow(item);
       
         table_row.setData(SWTConstants.ROW_OBJECT_KEY, object[i]);
         // updateLine(object[i]);
View Full Code Here

TOP

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

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.