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

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

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

List.getSelection介绍

[英]Returns an array of Strings that are currently selected in the receiver. The order of the items is unspecified. An empty array indicates that no items are selected.

Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
[中]返回接收器中当前选定的String个数组。项目的顺序未指定。空数组表示未选择任何项。
注意:这不是接收器用于保持其选择的实际结构,因此修改阵列不会影响接收器。

代码示例

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

public void widgetSelected( SelectionEvent event ) {
  showSelectedValidatorField( wValidationsList.getSelection()[0] );
 }
} );

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

private void add() {
 if ( wSource.getSelectionCount() == 1 && wTarget.getSelectionCount() == 1 ) {
  String sourceString = wSource.getSelection()[0];
  String targetString = wTarget.getSelection()[0];
  int srcIndex = Const.indexOfString( sourceString, sourceList );
  int tgtIndex = Const.indexOfString( targetString, targetList );
  if ( srcIndex >= 0 && tgtIndex >= 0 ) {
   // New mapping: add it to the list...
   SourceToTargetMapping mapping = new SourceToTargetMapping( srcIndex, tgtIndex );
   mappings.add( mapping );
   refreshMappings();
  }
 }
}

代码示例来源: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

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

public boolean canFinish() {
 String[] sel = wListSource.getSelection();
 boolean canFlip = sel.length > 0;
 return canFlip;
}

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

public void widgetSelected( SelectionEvent event ) {
  if ( list.getSelectionCount() <= 0 ) {
   return;
  }
  String name = list.getSelection()[0];
  String value = variables.getVariable( name );
  Rectangle shellBounds = shell.getBounds();
  String message = BaseMessages.getString( PKG, "TextVar.VariableValue.Message", name, value );
  if ( name.startsWith( Const.INTERNAL_VARIABLE_PREFIX ) ) {
   message += BaseMessages.getString( PKG, "TextVar.InternalVariable.Message" );
  }
  toolTip.setText( message );
  toolTip.hide();
  toolTip.show( new Point( shellBounds.width, 0 ) );
 }
} );

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

public String getSelection() {
  return wListSource.getSelection()[0];
 }
}

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

public void dragSetData( DragSourceEvent event ) {
 String[] ti = wListSource.getSelection();
 String data = new String();
 for ( int i = 0; i < ti.length; i++ ) {
  data += ti[i] + Const.CR;
 }
 event.data = data;
}

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

public DatabaseMeta getTargetDatabase() {
 if ( wTargetDB.getSelection().length == 1 ) {
  String targetDbName = wTargetDB.getSelection()[0];
  return DatabaseMeta.findDatabase( databases, targetDbName );
 }
 return null;
}

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

public DatabaseMeta getSourceDatabase() {
 if ( wSourceDB.getSelection().length == 1 ) {
  String sourceDbName = wSourceDB.getSelection()[0];
  return DatabaseMeta.findDatabase( databases, sourceDbName );
 }
 return null;
}

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

public DatabaseMeta getSourceDatabase() {
 if ( wSourceDB.getSelection().length == 1 ) {
  String sourceDbName = wSourceDB.getSelection()[0];
  return DatabaseMeta.findDatabase( databases, sourceDbName );
 }
 return null;
}

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

public DatabaseMeta getTargetDatabase() {
 if ( wTargetDB.getSelection().length == 1 ) {
  String targetDbName = wTargetDB.getSelection()[0];
  return DatabaseMeta.findDatabase( databases, targetDbName );
 }
 return null;
}

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

public void keyPressed( KeyEvent e ) {
  if ( e.character == SWT.CR ) {
   delFromSelection( wListDest.getSelection() );
  }
 }
} );

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

public void keyPressed( KeyEvent e ) {
  if ( e.character == SWT.CR ) {
   addToSelection( wListSource.getSelection() );
  }
 }
} );

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

/**
 * Remove the selected entries from the allowed entries
 */
protected void removeAllowedValue() {
 String[] selection = wAllowedValues.getSelection();
 for ( String string : selection ) {
  wAllowedValues.remove( string );
 }
}

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

public void widgetSelected( SelectionEvent e ) {
  delFromSelection( wListDest.getSelection() );
 }
} );

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

public void widgetDefaultSelected( SelectionEvent e ) {
  addToSelection( wListSource.getSelection() );
 }
} );

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

public void widgetSelected( SelectionEvent e ) {
  addToSelection( wListSource.getSelection() );
 }
} );

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

public void widgetDefaultSelected( SelectionEvent e ) {
  delFromSelection( wListDest.getSelection() );
 }
} );

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

private void delete() {
 String[] result = wResult.getSelection();
 for ( int i = result.length - 1; i >= 0; i-- ) {
  int idx = wResult.indexOf( result[i] );
  if ( idx >= 0 && idx < mappings.size() ) {
   mappings.remove( idx );
  }
 }
 refreshMappings();
}

相关文章

微信公众号

最新文章

更多

List类方法