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

x33g5p2x  于2022-01-23 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(141)

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

List.select介绍

[英]Selects the item at the given zero-relative index in the receiver's list. If the item at the index was already selected, it remains selected. Indices that are out of range are ignored.
[中]选择接收方列表中给定零相对索引处的项。如果索引中的项目已被选中,则它将保持选中状态。将忽略超出范围的索引。

代码示例

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

public void widgetSelected( SelectionEvent e ) {
  // Clear the validation rules for a certain field...
  //
  int index = wValidationsList.getSelectionIndex();
  if ( index >= 0 ) {
   selectionList.remove( index );
   selectedField = null;
   wValidationsList.remove( index );
   enableFields();
   if ( selectionList.size() > 0 ) {
    wValidationsList.select( selectionList.size() - 1 );
   }
  }
 }
} );

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

@Override public void mouseUp( MouseEvent mouseEvent ) {
  MappingIODefinition definition = new MappingIODefinition();
  definition.setMainDataPath( true );
  definitions.add( definition );
  wInputList.add( tabTitle + ( definitions.size() > 1 ? String.valueOf( definitions.size() ) : "" ) );
  wInputList.select( definitions.size() - 1 );
  updateFields( definitions.get( wInputList.getSelectionIndex() ), input, wMainPath, wlInputStep, wInputStep,
   wbInputStep, wlOutputStep, wOutputStep,
   wbOutputStep, wlDescription, wDescription, wFieldMappings, wRenameOutput );
  wlNoItems.setVisible( false );
  wFieldsComposite.setVisible( true );
  wRemoveButton.setEnabled( true );
 }
} );

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

public boolean canFlipToNextPage() {
 refreshFields();
 if ( wFields.getItemCount() > 0 ) {
  wFields.select( 0 );
  showInfo();
 }
 return false;
}

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

public boolean canFlipToNextPage() {
 refreshFields();
 if ( wFields.getItemCount() > 0 ) {
  wFields.select( 0 );
  showInfo();
 }
 return false;
}

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

public boolean canFlipToNextPage() {
 refreshFields();
 if ( wFields.getItemCount() > 0 ) {
  wFields.select( 0 );
  showInfo();
 }
 return false;
}

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

public void modifyText( ModifyEvent event ) {
  // See if there is a selected Validation
  //
  if ( wValidationsList != null
   && wValidationsList.getItemCount() > 0 && wValidationsList.getSelection().length == 1 ) {
   int index = wValidationsList.getSelectionIndex();
   String description = wValidationsList.getItem( index );
   Validation validation = Validation.findValidation( selectionList, description );
   String newDescription = wDescription.getText();
   validation.setName( newDescription );
   wValidationsList.setItem( index, newDescription );
   wValidationsList.select( index );
  }
 }
} );

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

wInputList.select( index - 1 );
} else if ( definitions.size() > 0 ) {
 wInputList.select( index );
} else {
 index = -1;

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wTypes.select( input.getFileType() );
 if ( input.getFilenameField() != null ) {
  wFilenameField.setText( input.getFilenameField() );
 }
 wStepname.selectAll();
 wStepname.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 // Populate the list of validations...
 //
 refreshValidationsList();
 enableFields();
 wValidateAll.setSelection( input.isValidatingAll() );
 wConcatErrors.setSelection( input.isConcatenatingErrors() );
 wConcatSeparator.setText( Const.NVL( input.getConcatenationSeparator(), "" ) );
 // Select the first available field...
 //
 if ( input.getValidations().size() > 0 ) {
  Validation validatorField = input.getValidations().get( 0 );
  String description = validatorField.getName();
  int index = wValidationsList.indexOf( description );
  if ( index >= 0 ) {
   wValidationsList.select( index );
   showSelectedValidatorField( description );
  }
 }
 setFlags();
 wStepname.selectAll();
 wStepname.setFocus();
}

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

public void setAccessTypes() {
 if ( wDBType.getSelectionCount() < 1 ) {
  return;
 }
 int[] acc = DatabaseMeta.getAccessTypeList( wDBType.getSelection()[0] );
 wAccType.removeAll();
 for ( int i = 0; i < acc.length; i++ ) {
  wAccType.add( DatabaseMeta.getAccessTypeDescLong( acc[i] ) );
 }
 // If nothing is selected: select the first item (mostly the native driver)
 if ( wAccType.getSelectionIndex() < 0 ) {
  wAccType.select( 0 );
 }
}

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

if ( selectedSteps == null || selectedSteps.length == 0 ) {
 selectedSteps = new String[] { steps[0], }; // first step
 stepsList.select( 0 );
 dataList.select( 0 );

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

public void widgetSelected( SelectionEvent e ) {
  // Create a new validation rule page ...
  //
  EnterStringDialog enterStringDialog = new EnterStringDialog( shell, "",
   BaseMessages.getString( PKG, "ValidatorDialog.EnterValidationRuleName.Title" ),
   BaseMessages.getString( PKG, "ValidatorDialog.EnterValidationRuleName.Message" ) );
  String description = enterStringDialog.open();
  if ( description != null ) {
   if ( Validation.findValidation( selectionList, description ) != null ) {
    MessageBox messageBox = new MessageBox( shell, SWT.ICON_ERROR );
    //CHECKSTYLE:LineLength:OFF
    messageBox.setText( BaseMessages.getString( PKG, "ValidatorDialog.ValidationRuleNameAlreadyExists.Title" ) );
    messageBox.setMessage( BaseMessages.getString( PKG, "ValidatorDialog.ValidationRuleNameAlreadyExists.Message" ) );
    messageBox.open();
    return;
   }
   saveChanges();
   Validation validation = new Validation();
   validation.setName( description );
   selectionList.add( validation );
   selectedField = validation;
   refreshValidationsList();
   wValidationsList.select( selectionList.size() - 1 );
   getValidatorFieldData( validation );
  }
 }
} );

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

wStepList.add( stepNames.get( i ) );
wStepList.select( 0 );
props.setLook( wStepList );
fdStepList = new FormData();
 wStepList.select( 0 );
 show();

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wInput.setText( Const.NVL( input.getInputFileField(), "" ) );
 wOutput.setText( Const.NVL( input.getOutputFileField(), "" ) );
 for ( String name : input.getParameterFieldMap().keySet() ) {
  String field = input.getParameterFieldMap().get( name );
  TableItem item = new TableItem( wFields.table, SWT.NONE );
  item.setText( 1, name );
  item.setText( 2, field );
 }
 wFields.removeEmptyRows();
 wFields.setRowNums();
 wFields.optWidth( true );
 wProcessor.select( input.getOutputProcessorType().ordinal() );
 wStepname.selectAll();
 wStepname.setFocus();
 wParentFolder.setSelection( input.getCreateParentfolder() );
}

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

if ( selectedSteps == null || selectedSteps.length == 0 ) {
 selectedSteps = new String[] { steps[0], }; // first step
 stepsList.select( 0 );
 dataList.select( 0 );

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

wJobstatus.select( jobMeta.getJobstatus() - 1 );
wLogTypeList.select( 0 );
showJobLogTableOptions( (JobLogTable) logTables.get( 0 ) );

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

wDBType.select( idx );
} else {
 wDBType.select( 0 );

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

wSelection.select( 0 );

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

wInputList.select( 0 );
updateFields( definitions.get( 0 ), input, wMainPath, wlInputStep, wInputStep,
 wbInputStep, wlOutputStep, wOutputStep, wbOutputStep, wlDescription, wDescription, wFieldMappings,

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

wSelection.select( selectedNrs );
wSelection.showSelection();

相关文章

微信公众号

最新文章

更多

List类方法