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

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

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

Table.getItem介绍

[英]Returns the item at the given, zero-relative index in the receiver. Throws an exception if the index is out of range.
[中]

代码示例

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

public void setText( String text, int colnr, int rownr ) {
 TableItem item = table.getItem( rownr );
 item.setText( colnr, text );
}

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

public void setRowNums() {
 for ( int i = 0; i < table.getItemCount(); i++ ) {
  TableItem item = table.getItem( i );
  if ( item != null ) {
   String num = "" + ( i + 1 );
   // for(int j=num.length();j<3;j++) num="0"+num;
   if ( !item.getText( 0 ).equals( num ) ) {
    item.setText( 0, num );
   }
  }
 }
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 if ( jobEntry.getName() != null ) {
  wName.setText( jobEntry.getName() );
 }
 if ( jobEntry.arguments != null ) {
  for ( int i = 0; i < jobEntry.arguments.length; i++ ) {
   TableItem ti = wFields.table.getItem( i );
   if ( jobEntry.arguments[i] != null ) {
    ti.setText( 1, jobEntry.arguments[i] );
   }
   if ( jobEntry.filemasks[i] != null ) {
    ti.setText( 2, jobEntry.filemasks[i] );
   }
  }
  wFields.setRowNums();
  wFields.optWidth( true );
 }
 wPrevious.setSelection( jobEntry.argFromPrevious );
 wIncludeSubfolders.setSelection( jobEntry.includeSubfolders );
 wDeleteAllBefore.setSelection( jobEntry.deleteallbefore );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 if ( jobEntry.getName() != null ) {
  wName.setText( jobEntry.getName() );
 }
 if ( jobEntry.arguments != null ) {
  for ( int i = 0; i < jobEntry.arguments.length; i++ ) {
   TableItem ti = wFields.table.getItem( i );
   if ( jobEntry.arguments[i] != null ) {
    ti.setText( 1, jobEntry.arguments[i] );
   }
   if ( jobEntry.filemasks[i] != null ) {
    ti.setText( 2, jobEntry.filemasks[i] );
   }
  }
  wFields.setRowNums();
  wFields.optWidth( true );
 }
 wPrevious.setSelection( jobEntry.argFromPrevious );
 wIncludeSubfolders.setSelection( jobEntry.includeSubfolders );
 wName.selectAll();
 wName.setFocus();
}

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

public void setButtonString( String str ) {
 Point p = getButtonPosition();
 TableItem item = table.getItem( p.y );
 item.setText( p.x, str );
}

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

private void copyToAll() {
 TableItem row = activeTableItem;
 if ( row == null || row.isDisposed() ) {
  return;
 }
 int colnr = activeTableColumn;
 if ( colnr == 0 ) {
  return;
 }
 String str = row.getText( colnr );
 // Get undo information: all columns
 int size = table.getItemCount();
 String[][] before = new String[size][];
 String[][] after = new String[size][];
 int[] index = new int[size];
 for ( int i = 0; i < table.getItemCount(); i++ ) {
  TableItem item = table.getItem( i );
  index[i] = i;
  before[i] = getItemText( item );
  item.setText( colnr, str );
  after[i] = getItemText( item );
 }
 // Add the undo information!
 TransAction ta = new TransAction();
 ta.setChanged( before, after, index );
 addUndo( ta );
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 for ( int i = 0; i < input.getFieldname().length; i++ ) {
  TableItem item = wFields.table.getItem( i );
  item.setText( 1, input.getFieldname()[i] );
  item.setText( 2, ValueMetaFactory.getValueMetaName( input.getType()[i] ) );
  int len = input.getLength()[i];
  int prc = input.getPrecision()[i];
  item.setText( 3, len >= 0 ? "" + len : "" );
  item.setText( 4, prc >= 0 ? "" + prc : "" );
 }
 wStepname.selectAll();
 wStepname.setFocus();
}

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

@Override
 public void insertText( String string, int position ) {
  StringBuilder buffer = new StringBuilder( table.getItem( rownr ).getText( colnr ) );
  buffer.insert( position, string );
  table.getItem( rownr ).setText( colnr, buffer.toString() );
  edit( rownr, colnr );
  setModified();
 }
};

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wStepname.setText( stepname );
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem item = wFields.table.getItem( i );
  String name = input.getFieldName()[i];
  String type = input.getReplaceByFieldValue()[i];
  if ( name != null ) {
   item.setText( 1, name );
  }
  if ( type != null ) {
   item.setText( 2, type );
  }
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

private void populateProperties() {
 int rowIndex = 0;
 for ( Map.Entry<String, String> entry : meta.getPropertyValuesByName().entrySet() ) {
  TableItem key = propertiesTable.getTable().getItem( rowIndex++ );
  key.setText( 1, entry.getKey() );
  key.setText( 2, entry.getValue() );
 }
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 for ( int i = 0; i < input.getFieldname().length; i++ ) {
  TableItem item = wFields.table.getItem( i );
  item.setText( 1, input.getFieldname()[i] == null ? "" : input.getFieldname()[i] );
  item.setText( 2, ValueMetaFactory.getValueMetaName( input.getType()[i] ) );
  int len = input.getLength()[i];
  int prc = input.getPrecision()[i];
  item.setText( 3, len >= 0 ? "" + len : "" );
  item.setText( 4, prc >= 0 ? "" + prc : "" );
 }
 wStepname.selectAll();
 wStepname.setFocus();
}

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

private void populateFieldData() {
 TableItem messageItem = fieldsTable.getTable().getItem( 0 );
 messageItem.setText( 1, BaseMessages.getString( PKG, "JmsConsumerDialog.InputName.Message" ) );
 messageItem.setText( 2, message );
 messageItem.setText( 3, "String" );
 TableItem topicItem = fieldsTable.getTable().getItem( 1 );
 topicItem.setText( 1, BaseMessages.getString( PKG, "JmsConsumerDialog.InputName.Destination" ) );
 topicItem.setText( 2, destination );
 topicItem.setText( 3, "String" );
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wStepname.setText( stepname );
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem item = wFields.table.getItem( i );
  String name = input.getFieldName()[i];
  String type = RandomValueMeta.getTypeDesc( input.getFieldType()[i] );
  if ( name != null ) {
   item.setText( 1, name );
  }
  if ( type != null ) {
   item.setText( 2, type );
  }
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

@Override
 public void insertText( String string, int position ) {
  StringBuilder buffer = new StringBuilder( table.getItem( rownr ).getText( colnr ) );
  buffer.insert( position, string );
  table.getItem( rownr ).setText( colnr, buffer.toString() );
  int newPosition = position + string.length();
  edit( rownr, colnr );
  ( (TextVar) text ).setSelection( newPosition );
  ( (TextVar) text ).showSelection();
  setColumnWidthBasedOnTextField( colnr, useVariables );
 }
};

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wStepname.setText( stepname );
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem item = wFields.table.getItem( i );
  String name = input.getFieldName()[i];
  String type = input.getFieldType()[i].getDescription();
  if ( name != null ) {
   item.setText( 1, name );
  }
  if ( type != null ) {
   item.setText( 2, type );
  }
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

private void populateTopicsData() {
 List<String> topics = mqttMeta.getTopics();
 int rowIndex = 0;
 for ( String topic : topics ) {
  TableItem key = topicsTable.getTable().getItem( rowIndex++ );
  if ( topic != null ) {
   key.setText( 1, topic );
  }
 }
}

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

TableItem ti = wFields.table.getItem( i );
  if ( jobEntry.source_filefolder[i] != null ) {
   String sourceUrl = jobEntry.source_filefolder[i];
      clusterName.startsWith( JobEntryCopyFiles.STATIC_SOURCE_FILE ) ? STATIC_ENVIRONMENT : clusterName;
    ti.setText( 1, clusterName );
    sourceUrl =
      clusterName.equals( LOCAL_ENVIRONMENT ) || clusterName.equals( STATIC_ENVIRONMENT ) ? sourceUrl
    sourceUrl = "";
   ti.setText( 2, sourceUrl );
   ti.setText( 3, jobEntry.wildcard[i] );
wName.selectAll();
wName.setFocus();

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

private void populateFieldData() {
 TableItem messageItem = fieldsTable.getTable().getItem( 0 );
 messageItem.setText( 1, BaseMessages.getString( PKG, "MQTTConsumerDialog.InputName.Message" ) );
 messageItem.setText( 2, mqttMeta.getMsgOutputName() );
 messageItem.setText( 3, "String" );
 TableItem topicItem = fieldsTable.getTable().getItem( 1 );
 topicItem.setText( 1, BaseMessages.getString( PKG, "MQTTConsumerDialog.InputName.Topic" ) );
 topicItem.setText( 2, mqttMeta.getTopicOutputName() );
 topicItem.setText( 3, "String" );
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wStepname.setText( stepname );
 for ( int i = 0; i < input.getFields().length; i++ ) {
  TableItem item = wFields.table.getItem( i );
  String name = input.getFields()[i].getFieldName();
  String type = input.getFields()[i].getFieldValue();
  if ( name != null ) {
   item.setText( 1, name );
  }
  if ( type != null ) {
   item.setText( 2, type );
  }
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

private void setPage(int index) {
  TableItem item;
  int start;
  int end;
  
  if(!addHead){
    start = index / PAGE_SIZE * PAGE_SIZE;
    end = Math.min(start + PAGE_SIZE, count);
  }else{
    start = index / PAGE_SIZE * PAGE_SIZE-1;
    if(start < 0)
      start = 0;
    end = Math.min(start + PAGE_SIZE, count-1);
  }
  
  this.page.initPage(start, end);
  
  
  for (int i = start; i < end; i++) {
    if(!addHead)
      item = table.getItem (i);
    else{
      item = table.getItem (i+1);
    }
    item.setText (this.page.getText(i));
  }
}
public void setCount(){

相关文章

Table类方法