org.eclipse.swt.widgets.Table.getItems()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(265)

本文整理了Java中org.eclipse.swt.widgets.Table.getItems()方法的一些代码示例,展示了Table.getItems()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getItems()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getItems

Table.getItems介绍

[英]Returns a (possibly empty) array of TableItems which are the items in the receiver.

Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
[中]返回一个TableItem的数组(可能为空),该数组是接收方中的项。
注意:这不是接收方维护其项目列表所使用的实际结构,因此修改数组不会影响接收方。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public String[] getFieldNames() {
 return stream( fieldsTable.getTable().getItems() ).map( row -> row.getText( 2 ) ).toArray( String[]::new );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override protected String[] getFieldNames() {
 return stream( fieldsTable.getTable().getItems() ).map( row -> row.getText( 2 ) ).toArray( String[]::new );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override protected int[] getFieldTypes() {
 return stream( fieldsTable.getTable().getItems() )
  .mapToInt( row -> ValueMetaFactory.getIdForValueMeta( row.getText( 3 ) ) ).toArray();
}

代码示例来源:origin: caoxinyu/RedisClient

private void gotoMember(String member){
  TableItem[] items = table.getItems();
  
  for(TableItem item : items){
    if(item.getText(1).equals(member)){
      table.setSelection(item);
      return;
    }
  }
}
@Override

代码示例来源:origin: caoxinyu/RedisClient

@SuppressWarnings("unchecked")
  @Override
  public void widgetSelected(SelectionEvent e) {
    TableItem[] items = table.getItems();
    
    for(TableItem item : items){
      ((ArrayList<Favorite>) result).add((Favorite) item.getData());
    }
    
    shell.dispose();
  }
});

代码示例来源:origin: pentaho/pentaho-kettle

public int[] getFieldTypes() {
 return stream( fieldsTable.getTable().getItems() )
  .mapToInt( row -> ValueMetaFactory.getIdForValueMeta( row.getText( 3 ) ) ).toArray();
}

代码示例来源:origin: caoxinyu/RedisClient

private void gotoField(String field){
  TableItem[] items = table.getItems();
  
  for(TableItem item: items){
    if(item.getText(0).equals(field)){
      table.setSelection(item);
      table.setSelection(-1);
    }
  }
}

代码示例来源:origin: pentaho/pentaho-kettle

private void view() {
 StringBuilder message = new StringBuilder();
 TableItem[] item = wFields.table.getSelection();
 // None selected: don't waste users time: select them all!
 if ( item.length == 0 ) {
  item = wFields.table.getItems();
 }
 for ( int i = 0; i < item.length; i++ ) {
  if ( i > 0 ) {
   message
    .append( "_______________________________________________________________________________" ).append(
     Const.CR ).append( Const.CR );
  }
  message.append( "[" ).append( item[i].getText( 2 ) ).append( "] " ).append( item[i].getText( 1 ) ).append(
   Const.CR );
  message.append( "  " ).append( item[i].getText( 3 ) ).append( Const.CR ).append( Const.CR );
 }
 String subtitle =
  ( item.length != 1
   ? BaseMessages.getString( PKG, "CheckResultDialog.TextDialog.SubtitlePlural" ) : BaseMessages
    .getString( PKG, "CheckResultDialog.TextDialog.Subtitle" ) );
 EnterTextDialog etd =
  new EnterTextDialog(
   shell, BaseMessages.getString( PKG, "CheckResultDialog.TextDialog.Title" ), subtitle, message
    .toString() );
 etd.setReadOnly();
 etd.open();
}

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    TableItem[] items = ((NewZSetContent)dataContent).getTable().getItems();
    String key = dataContent.getKey();
    Map<String, Double> values = new HashMap<String, Double>();
    if (items.length == 0)
      MessageDialog.openError((Shell) shell, RedisClient.i18nFile.getText(I18nFile.ERROR),
          RedisClient.i18nFile.getText(I18nFile.INPUTZSET));
    else {
      okSelected(items, key, values);
    }
  }
};

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    TableItem[] items = ((NewSetContent)dataContent).getTable().getItems();
    String key = dataContent.getKey();
    Set<String> values = new HashSet<String>();
    if (items.length == 0)
      MessageDialog.openError((Shell) shell, RedisClient.i18nFile.getText(I18nFile.ERROR),
          RedisClient.i18nFile.getText(I18nFile.INPUTSET));
    else {
      okSelected(items, key, values);
    }
  }
};

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    TableItem[] items = ((NewHashContent)dataContent).getTable().getItems();
    String key = dataContent.getKey();
    Map<String, String> values = new HashMap<String, String>();
    if (items.length == 0)
      MessageDialog.openError((Shell) shell, RedisClient.i18nFile.getText(I18nFile.ERROR),
          RedisClient.i18nFile.getText(I18nFile.INPUTHASH));
    else {
      okSelected(items, key, values);
    }
  }
};

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    TableItem[] items = ((NewListContent)dataContent).getTable().getItems();
    String key = dataContent.getKey();
    List<String> values = new ArrayList<String>();
    if (items.length == 0)
      MessageDialog.openError((Shell) shell, RedisClient.i18nFile.getText(I18nFile.ERROR),
          RedisClient.i18nFile.getText(I18nFile.INPUTLIST));
    else {
      okSelected(items, key, values);
    }
  }
};

代码示例来源:origin: pentaho/pentaho-kettle

String filename = transMeta.environmentSubstitute( wFilenameList.getItem( 0 )[ 0 ] );
List<String> paths = new ArrayList<>();
for ( int i = 0; i < wFields.table.getItems().length; i++ ) {
 TableItem item = wFields.table.getItem( i );
 paths.add( item.getText( 2 ) );

代码示例来源:origin: pentaho/pentaho-kettle

protected void getCompositesData() {
 for ( TableItem item : table.getItems() ) {
  item.dispose();

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    TableItem[] items = table.getItems();
    TableItem[] selectedItems = table.getSelection();
    String selectedText = selectedItems[0].getText();
    int selected = table.getSelectionIndex();
    String upText = items[selected - 1].getText();
    items[selected].setText(upText);
    items[selected - 1].setText(selectedText);
    table.setSelection(selected - 1);
    if (selected == 1)
      tableItemSelected();
  }
});

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void moveRow( int position1, int position2 ) {
 //if one of rows is empty -- don't move data
 if ( !wFields.getNonEmptyIndexes().contains( position1 )
     || !wFields.getNonEmptyIndexes().contains( position2 ) ) {
  wFields.nrNonEmpty();
  return;
 }
 Integer fieldRealPosition1 =  getIdxByValue( wFields.getNonEmptyIndexes(), position1 );
 Integer fieldRealPosition2 =  getIdxByValue( wFields.getNonEmptyIndexes(), position2 );
 if ( fieldRealPosition1 == null || fieldRealPosition2 == null ) {
  return; //can not happen (prevent warnings)
 }
 //data table have one technical column
 int dataPosition1 = fieldRealPosition1 + 1;
 int dataPosition2 = fieldRealPosition2 + 1;
 for ( TableItem item : wData.table.getItems() ) {
  String value1 = item.getText( dataPosition1 );
  String value2 = item.getText( dataPosition2 );
  item.setText( dataPosition2, value1 );
  item.setText( dataPosition1, value2 );
 }
 wFields.nrNonEmpty();
}

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent event ) {
  if ( outWsdlParamContainer == null ) {
   try {
    loadWebService( wURL.getText() );
    loadOperation( wOperation.getText() );
   } catch ( KettleException e ) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  }
  RowMetaInterface r = getOutWebServiceFields();
  if ( r != null ) {
   BaseStepDialog.getFieldsFromPrevious(
    r, fieldOutTableView, 2, new int[] { 1, 2 }, new int[] {}, -1, -1, null );
  }
  // Define type for new entries
  if ( outWsdlParamContainer != null ) {
   TableItem[] items = fieldOutTableView.table.getItems();
   for ( int i = 0; i < items.length; i++ ) {
    items[i].setText( 3, outWsdlParamContainer.getParamType( items[i].getText( 2 ) ) );
   }
  }
 }
} );

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    TableItem[] items = table.getItems();
    TableItem[] selectedItems = table.getSelection();
    String selectedText = selectedItems[0].getText();
    int selected = table.getSelectionIndex();
    String downText = items[selected + 1].getText();
    items[selected].setText(downText);
    items[selected + 1].setText(selectedText);
    table.setSelection(selected + 1);
    if (selected == table.getItemCount() - 2)
      tableItemSelected();
  }
});

代码示例来源:origin: pentaho/pentaho-kettle

@Override
 public void widgetSelected( SelectionEvent event ) {
  if ( inWsdlParamContainer == null ) {
   try {
    loadWebService( wURL.getText() );
    loadOperation( wOperation.getText() );
   } catch ( KettleException e ) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  }
  RowMetaInterface r = getInWebServiceFields();
  if ( r != null ) {
   BaseStepDialog.getFieldsFromPrevious(
    r, fieldInTableView, 2, new int[] { 2 }, new int[] {}, -1, -1, null );
  }
  // Define type for new entries
  if ( inWsdlParamContainer != null ) {
   TableItem[] items = fieldInTableView.table.getItems();
   for ( int i = 0; i < items.length; i++ ) {
    String type = inWsdlParamContainer.getParamType( items[i].getText( 2 ) );
    if ( type != null ) {
     items[i].setText( 3, type );
    } else {
     items[i].dispose();
    }
   }
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

@Override protected void additionalOks( BaseStreamStepMeta meta ) {
 mqttMeta.setMqttServer( wConnection.getText() );
 mqttMeta.setTopics( stream( topicsTable.getTable().getItems() )
  .map( item -> item.getText( 1 ) )
  .filter( t -> !"".equals( t ) )

相关文章

Table类方法