Java Code Examples for org.eclipse.swt.widgets.TableItem#isDisposed()

The following examples show how to use org.eclipse.swt.widgets.TableItem#isDisposed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableView.java    From hop with Apache License 2.0 5 votes vote down vote up
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!
  ChangeAction ta = new ChangeAction();
  ta.setChanged( before, after, index );
  addUndo( ta );
}
 
Example 2
Source File: TableView.java    From hop with Apache License 2.0 5 votes vote down vote up
private String[] getItemText( TableItem row ) {
  if ( row.isDisposed() ) {
    return null;
  }

  String[] retval = new String[ table.getColumnCount() - 1 ];
  for ( int i = 0; i < retval.length; i++ ) {
    retval[ i ] = row.getText( i + 1 );
  }

  return retval;
}
 
Example 3
Source File: TableView.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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 );
}
 
Example 4
Source File: TableView.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private String[] getItemText( TableItem row ) {
  if ( row.isDisposed() ) {
    return null;
  }

  String[] retval = new String[table.getColumnCount() - 1];
  for ( int i = 0; i < retval.length; i++ ) {
    retval[i] = row.getText( i + 1 );
  }

  return retval;
}