Java Code Examples for org.eclipse.swt.widgets.Table#removeAll()

The following examples show how to use org.eclipse.swt.widgets.Table#removeAll() . 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: PrioritizeStreamsDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  Table table = wFields.table;
  if ( input.getTransformName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getTransformName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    if ( input.getTransformName()[ i ] != null ) {
      ti.setText( 1, input.getTransformName()[ i ] );
    }
  }

  wFields.removeEmptyRows();
  wFields.setRowNums();
  wFields.optWidth( true );

  wTransformName.selectAll();
  wTransformName.setFocus();
}
 
Example 2
Source File: FieldsChangeSequenceDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  wStart.setText( Const.NVL( input.getStart(), "1" ) );
  wIncrement.setText( Const.NVL( input.getIncrement(), "1" ) );
  wResult.setText( Const.NVL( input.getResultFieldName(), "result" ) );

  Table table = wFields.table;
  if ( input.getFieldName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getFieldName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    ti.setText( 1, input.getFieldName()[i] );
  }

  wFields.setRowNums();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 3
Source File: PrioritizeStreamsDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  Table table = wFields.table;
  if ( input.getStepName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getStepName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    if ( input.getStepName()[i] != null ) {
      ti.setText( 1, input.getStepName()[i] );
    }
  }

  wFields.removeEmptyRows();
  wFields.setRowNums();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 4
Source File: SortedMergeDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  Table table = wFields.table;
  if ( input.getFieldName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getFieldName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    ti.setText( 1, input.getFieldName()[i] );
    ti.setText( 2, input.getAscending()[i] ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages
      .getString( PKG, "System.Combo.No" ) );
  }

  wFields.setRowNums();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 5
Source File: BlockUntilStepsFinishDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  Table table = wFields.table;
  if ( input.getStepName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getStepName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    if ( input.getStepName()[i] != null ) {
      ti.setText( 1, input.getStepName()[i] );
      ti.setText( 2, "" + Const.toInt( input.getStepCopyNr()[i], 0 ) );
    }
  }

  wFields.removeEmptyRows();
  wFields.setRowNums();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 6
Source File: NewCodewindProjectPage.java    From codewind-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private void createItems(Table table, String filter) {
	// Create the items for the table.
	table.removeAll();
	if (templateList == null || templateList.isEmpty()) {
		return;
	}
	pattern.setPattern("*" + filter + "*");
	for (ProjectTemplateInfo templateInfo : templateList) {
		String template = templateInfo.getLabel();
		String type = ProjectType.getDisplayName(templateInfo.getProjectType());
		String language = ProjectLanguage.getDisplayName(templateInfo.getLanguage());
		String description = templateInfo.getDescription();
		String source = templateInfo.getSource();
		if (pattern.matches(template) || (type != null && pattern.matches(type)) || (language != null && pattern.matches(language)) ||
				(description != null && pattern.matches(description)) || (source != null && pattern.matches(source))) {
			TableItem item = new TableItem(table, SWT.NONE);
			item.setText(0, template);
			if (type != null) {
				item.setText(1, type);
			}
			if (language != null) {
				item.setText(2, language);
			}
			item.setData(templateInfo);
		}
	}
}
 
Example 7
Source File: ColumnBrowserWidget.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Update the content of the widget
 */
void updateContent() {
	if (columns == null) {
		return;
	}

	for (int i = 0; i < columns.size(); i++) {

		final Table table = columns.get(i);
		final int index = table.getSelectionIndex();
		table.removeAll();
		if (table.getData() == null) {
			continue;
		}
		for (final ColumnItem c : ((ColumnItem) table.getData()).getItems()) {
			final TableItem item = new TableItem(table, SWT.NONE);
			item.setData(c);
			if (c.getText() != null) {
				item.setText(c.getText());
			}
			if (c.getImage() != null) {
				item.setImage(c.getImage());
			}
		}
		table.setSelection(index);
	}
}
 
Example 8
Source File: WriteToLogDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  wLoglevel.select( input.getLogLevelByDesc().getLevel() );

  wPrintHeader.setSelection( input.isdisplayHeader() );
  wLimitRows.setSelection( input.isLimitRows() );
  wLimitRowsNumber.setText( "" + input.getLimitRowsNumber() );

  if ( input.getLogMessage() != null ) {
    wLogMessage.setText( input.getLogMessage() );
  }

  Table table = wFields.table;
  if ( input.getFieldName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getFieldName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    ti.setText( 1, input.getFieldName()[i] );
  }

  wFields.setRowNums();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 9
Source File: SortRowsDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  if ( input.getPrefix() != null ) {
    wPrefix.setText( input.getPrefix() );
  }
  if ( input.getDirectory() != null ) {
    wSortDir.setText( input.getDirectory() );
  }
  wSortSize.setText( Const.NVL( input.getSortSize(), "" ) );
  wFreeMemory.setText( Const.NVL( input.getFreeMemoryLimit(), "" ) );
  wCompress.setSelection( input.getCompressFiles() );
  wCompress.setVariableName( input.getCompressFilesVariable() );
  wUniqueRows.setSelection( input.isOnlyPassingUniqueRows() );

  Table table = wFields.table;
  if ( input.getFieldName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getFieldName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    ti.setText( 1, input.getFieldName()[i] );
    ti.setText( 2, input.getAscending()[i] ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages
      .getString( PKG, "System.Combo.No" ) );
    ti.setText( 3, input.getCaseSensitive()[i]
      ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages.getString( PKG, "System.Combo.No" ) );
    ti.setText( 4, input.getCollatorEnabled()[i]
      ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages.getString( PKG, "System.Combo.No" ) );
    ti.setText( 5, input.getCollatorStrength()[i] == 0
      ? BaseMessages.getString( PKG, "System.Combo.Primary" ) : Integer.toString( input.getCollatorStrength()[i] ) );
    ti.setText( 6, input.getPreSortedField()[i]
      ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages.getString( PKG, "System.Combo.No" ) );
  }

  wFields.setRowNums();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 10
Source File: SetValueConstantDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  wuseVars.setSelection( input.isUseVars() );
  Table table = wFields.table;
  if ( input.getFields().size() > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getFields().size(); i++ ) {
    SetValueConstantMeta.Field field = input.getField( i );
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    if ( field.getFieldName() != null ) {
      ti.setText( 1, field.getFieldName() );
    }
    if ( field.getReplaceValue() != null ) {
      ti.setText( 2, field.getReplaceValue() );
    }
    if ( field.getReplaceMask() != null ) {
      ti.setText( 3, field.getReplaceMask() );
    }
    ti.setText( 4, field.isEmptyString() ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages
            .getString( PKG, "System.Combo.No" ) );

  }

  wFields.setRowNums();
  wFields.removeEmptyRows();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 11
Source File: CheckSumDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  wType.select( input.getTypeByDesc() );
  if ( input.getResultFieldName() != null ) {
    wResult.setText( input.getResultFieldName() );
  }
  if ( input.getFieldSeparatorString() != null ) {
    wFieldSeparatorString.setText( input.getFieldSeparatorString() );
  }
  wResultType.setText( input.getResultTypeDesc( input.getResultType() ) );
  wCompatibility.setSelection( input.isCompatibilityMode() );
  wOldChecksumBehaviour.setSelection( input.isOldChecksumBehaviour() );

  Table table = wFields.table;
  if ( input.getFieldName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getFieldName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    ti.setText( 1, input.getFieldName()[i] );
  }

  wFields.setRowNums();
  wFields.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 12
Source File: StepsMetricsDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  Table table = wFields.table;
  if ( input.getTransformName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getTransformName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    if ( input.getTransformName()[ i ] != null ) {
      ti.setText( 1, input.getTransformName()[ i ] );
      ti.setText( 2, String.valueOf( Const.toInt( input.getTransformCopyNr()[ i ], 0 ) ) );
      ti.setText( 3, input.getRequiredTransformsDesc( input.getTransformRequired()[ i ] ) );
    }
  }

  wFields.removeEmptyRows();
  wFields.setRowNums();
  wFields.optWidth( true );

  if ( input.getTransformNameFieldName() != null ) {
    wTransformNameField.setText( input.getTransformNameFieldName() );
  }
  if ( input.getTransformIdFieldName() != null ) {
    wTransformIdField.setText( input.getTransformIdFieldName() );
  }
  if ( input.getTransformLinesInputFieldName() != null ) {
    wLinesinputField.setText( input.getTransformLinesInputFieldName() );
  }
  if ( input.getTransformLinesOutputFieldName() != null ) {
    wLinesoutputField.setText( input.getTransformLinesOutputFieldName() );
  }
  if ( input.getTransformLinesReadFieldName() != null ) {
    wLinesreadField.setText( input.getTransformLinesReadFieldName() );
  }
  if ( input.getTransformLinesWrittenFieldName() != null ) {
    wLineswrittenField.setText( input.getTransformLinesWrittenFieldName() );
  }
  if ( input.getTransformLinesUpdatedFieldName() != null ) {
    wLinesupdatedField.setText( input.getTransformLinesUpdatedFieldName() );
  }
  if ( input.getTransformLinesErrorsFieldName() != null ) {
    wLineserrorsField.setText( input.getTransformLinesErrorsFieldName() );
  }
  if ( input.getTransformSecondsFieldName() != null ) {
    wSecondsField.setText( input.getTransformSecondsFieldName() );
  }

  wTransformName.selectAll();
  wTransformName.setFocus();
}
 
Example 13
Source File: StepsMetricsDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  Table table = wFields.table;
  if ( input.getStepName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getStepName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    if ( input.getStepName()[i] != null ) {
      ti.setText( 1, input.getStepName()[i] );
      ti.setText( 2, String.valueOf( Const.toInt( input.getStepCopyNr()[i], 0 ) ) );
      ti.setText( 3, input.getRequiredStepsDesc( input.getStepRequired()[i] ) );
    }
  }

  wFields.removeEmptyRows();
  wFields.setRowNums();
  wFields.optWidth( true );

  if ( input.getStepNameFieldName() != null ) {
    wStepnameField.setText( input.getStepNameFieldName() );
  }
  if ( input.getStepIdFieldName() != null ) {
    wStepidField.setText( input.getStepIdFieldName() );
  }
  if ( input.getStepLinesInputFieldName() != null ) {
    wLinesinputField.setText( input.getStepLinesInputFieldName() );
  }
  if ( input.getStepLinesOutputFieldName() != null ) {
    wLinesoutputField.setText( input.getStepLinesOutputFieldName() );
  }
  if ( input.getStepLinesReadFieldName() != null ) {
    wLinesreadField.setText( input.getStepLinesReadFieldName() );
  }
  if ( input.getStepLinesWrittenFieldName() != null ) {
    wLineswrittenField.setText( input.getStepLinesWrittenFieldName() );
  }
  if ( input.getStepLinesUpdatedFieldName() != null ) {
    wLinesupdatedField.setText( input.getStepLinesUpdatedFieldName() );
  }
  if ( input.getStepLinesErrorsFieldName() != null ) {
    wLineserrorsField.setText( input.getStepLinesErrorsFieldName() );
  }
  if ( input.getStepSecondsFieldName() != null ) {
    wSecondsField.setText( input.getStepSecondsFieldName() );
  }

  wStepname.selectAll();
  wStepname.setFocus();
}