本文整理了Java中org.eclipse.swt.widgets.Table.indexOf()
方法的一些代码示例,展示了Table.indexOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.indexOf()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:indexOf
[英]Searches the receiver's list starting at the first column (index 0) until a column is found that is equal to the argument, and returns the index of that column. If no column is found, returns -1.
[中]从第一列(索引0)开始搜索接收方列表,直到找到与参数相等的列,并返回该列的索引。如果没有找到列,则返回-1。
代码示例来源:origin: pentaho/pentaho-kettle
private void insertRowAfter() {
if ( readonly ) {
return;
}
TableItem row = activeTableItem;
if ( row == null ) {
return;
}
int rownr = table.indexOf( row );
insertRow( rownr + 1 );
}
代码示例来源:origin: pentaho/pentaho-kettle
private void insertRowBefore() {
if ( readonly ) {
return;
}
TableItem row = activeTableItem;
if ( row == null ) {
return;
}
int rownr = table.indexOf( row );
insertRow( rownr );
}
代码示例来源:origin: pentaho/pentaho-kettle
private int getCurrentRownr() {
if ( table.getItemCount() <= 1 ) {
return 0;
}
TableItem row = activeTableItem;
if ( row == null ) {
return 0;
}
int rownr = table.indexOf( row );
if ( rownr < 0 ) {
rownr = 0;
}
return rownr;
}
代码示例来源:origin: caoxinyu/RedisClient
@Override
public void handleEvent(Event event) {
TableItem item = (TableItem) event.item;
setPage(table.indexOf(item));
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void modifyText( ModifyEvent e ) {
TableItem row = activeTableItem;
if ( row == null ) {
return;
}
int colnr = activeTableColumn;
int rownr = table.indexOf( row );
if ( combo instanceof ComboVar ) {
row.setText( colnr, ( (ComboVar) combo ).getText() );
} else {
row.setText( colnr, ( (CCombo) combo ).getText() );
}
String[] afterEdit = getItemText( row );
checkChanged( new String[][]{ beforeEdit }, new String[][]{ afterEdit }, new int[]{ rownr } );
}
};
代码示例来源:origin: pentaho/pentaho-kettle
final int rownr = table.indexOf( row );
final Control ftext = text;
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void focusLost( FocusEvent e ) {
TableItem row = activeTableItem;
if ( row == null ) {
return;
}
int colnr = activeTableColumn;
int rownr = table.indexOf( row );
if ( colnr > 0 ) {
try {
if ( combo instanceof ComboVar ) {
row.setText( colnr, ( (ComboVar) combo ).getText() );
} else {
row.setText( colnr, ( (CCombo) combo ).getText() );
}
} catch ( Exception exc ) {
// Eat widget disposed error
}
String[] afterEdit = getItemText( row );
if ( afterEdit != null ) {
checkChanged( new String[][]{ beforeEdit }, new String[][]{ afterEdit }, new int[]{ rownr } );
}
}
combo.dispose();
tableViewModifyListener.cellFocusLost( rownr );
}
};
代码示例来源:origin: caoxinyu/RedisClient
protected void tableItemSelected() {
TableItem[] items = table.getSelection();
addModifyTextListener();
if(currentData.isItemChanged(items[0])){
switch(status){
case Normal:
status = Status.Update;
statusChanged();
break;
case Update:
break;
case Updating:
service.setValue(id, db, key, table.indexOf(currentData.getItem()), currentData.getItem().getText());
status = Status.Update;
statusChanged();
break;
}
currentData.setItem(items[0]);
}
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
if ( Const.indexOfString( v.getName(), groupingFields ) < 0 ) { // Not a grouping field
if ( !wKeyField.getText().equalsIgnoreCase( v.getName() ) ) { // Not the key field
int nr = tableItem.getParent().indexOf( tableItem ) + 1;
tableItem.setText( 1, BaseMessages.getString( PKG, "DenormaliserDialog.TargetFieldname.Label" )
+ nr ); // the target fieldname
tableItem.setText( 2, v.getName() );
tableItem.setText( 4, v.getTypeDesc() );
if ( v.getLength() >= 0 ) {
tableItem.setText( 6, "" + v.getLength() );
}
if ( v.getPrecision() >= 0 ) {
tableItem.setText( 7, "" + v.getPrecision() );
}
}
}
return true;
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
return;
int rowbefore = table.indexOf( row );
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
protected void clear(Widget item) {
if (item instanceof TableItem) {
int i = fTable.indexOf((TableItem)item);
if (i >= 0) {
fTable.clear(i);
}
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
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);
}
}
});
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void setWidthInPixels (int width) {
if (width < 0) return;
int index = parent.indexOf (this);
if (index == -1) return;
int /*long*/ hwnd = parent.handle;
if (width != (int)/*64*/OS.SendMessage (hwnd, OS.LVM_GETCOLUMNWIDTH, index, 0)) {
OS.SendMessage (hwnd, OS.LVM_SETCOLUMNWIDTH, index, width);
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
public void renderInitialization( final Widget widget ) throws IOException {
TableItem item = ( TableItem )widget;
JSWriter writer = JSWriter.getWriterFor( item );
Table parent = item.getParent();
int index = parent.indexOf( item );
Object[] args = new Object[] { parent, new Integer( index ) };
writer.newWidget( "org.eclipse.swt.widgets.TableItem", args );
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void _resize() {
if (row == null) {
setBounds(-200, -200, 0, 0);
} else {
int columnIndex = column == null ? 0 : table.indexOf(column);
setBounds(row.getBounds(columnIndex));
}
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
private ViewerRow getRowAbove() {
int index = item.getParent().indexOf(item) - 1;
if( index >= 0 ) {
return new TableViewerRow(item.getParent().getItem(index));
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
private Object getSelectionKeyFromCursor()
{
int idx = getTable().indexOf(fTableCursor.getRow());
int col = fTableCursor.getColumn();
return getVirtualContentModel().getKey(idx, col);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
Rectangle getBoundsInPixels () {
if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
int itemIndex = parent.indexOf (this);
if (itemIndex == -1) return new Rectangle (0, 0, 0, 0);
RECT rect = getBounds (itemIndex, 0, true, false, false);
int width = rect.right - rect.left, height = rect.bottom - rect.top;
return new Rectangle (rect.left, rect.top, width, height);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
Rectangle getBoundsInPixels (int index) {
if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
int itemIndex = parent.indexOf (this);
if (itemIndex == -1) return new Rectangle (0, 0, 0, 0);
RECT rect = getBounds (itemIndex, index, true, true, true);
int width = rect.right - rect.left, height = rect.bottom - rect.top;
return new Rectangle (rect.left, rect.top, width, height);
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
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());
}
});
内容来源于网络,如有侵权,请联系作者删除!