下面列出了org.eclipse.swt.widgets.Table#removeAll ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
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);
}
}
}
/**
* 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);
}
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}