本文整理了Java中org.eclipse.swt.widgets.List.getSelectionIndices()
方法的一些代码示例,展示了List.getSelectionIndices()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。List.getSelectionIndices()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.List
类名称:List
方法名:getSelectionIndices
[英]Returns the zero-relative indices of the items which are currently selected in the receiver. The order of the indices is unspecified. The array is empty if 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.
[中]返回接收器中当前选定项的零相对索引。未指定索引的顺序。如果未选择任何项目,则数组为空。
注意:这不是接收器用于保持其选择的实际结构,因此修改阵列不会影响接收器。
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent event ) {
// If there are multiple selections here AND there are multiple selections in the steps list, we only take the
// first step in the selection...
//
if ( dataList.getSelectionCount() > 1 && stepsList.getSelectionCount() > 1 ) {
stepsList.setSelection( stepsList.getSelectionIndices()[0] );
}
updateGraph();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent arg0 ) {
int[] idx = wList.getSelectionIndices();
reload();
wList.setSelection( idx );
refreshGrid();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent event ) {
// If there are multiple selections here AND there are multiple selections in the steps list, we only take the
// first step in the selection...
//
if ( dataList.getSelectionCount() > 1 && stepsList.getSelectionCount() > 1 ) {
stepsList.setSelection( stepsList.getSelectionIndices()[0] );
}
updateGraph();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent event ) {
// If there are multiple selections here AND there are multiple selections in the data list, we only take the
// first data item in the selection...
//
if ( dataList.getSelectionCount() > 1 && stepsList.getSelectionCount() > 1 ) {
dataList.setSelection( dataList.getSelectionIndices()[0] );
}
updateGraph();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent event ) {
// If there are multiple selections here AND there are multiple selections in the data list, we only take the
// first data item in the selection...
//
if ( dataList.getSelectionCount() > 1 && stepsList.getSelectionCount() > 1 ) {
dataList.setSelection( dataList.getSelectionIndices()[0] );
}
updateGraph();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
} else if ( wSelection.getSelectionCount() > 0 ) {
selection = wSelection.getSelection()[0];
selectionNr = wSelection.getSelectionIndices()[0];
if ( quickSearch ) {
for ( int i = 0; i < choices.length; i++ ) {
indices = wSelection.getSelectionIndices();
代码示例来源:origin: pentaho/pentaho-kettle
stepsList.select( 0 );
int[] dataIndices = dataList.getSelectionIndices();
if ( dataIndices == null || dataIndices.length == 0 ) {
dataIndices = new int[] { DATA_CHOICE_WRITTEN, };
代码示例来源:origin: pentaho/pentaho-kettle
stepsList.select( 0 );
int[] dataIndices = dataList.getSelectionIndices();
if ( dataIndices == null || dataIndices.length == 0 ) {
dataIndices = new int[] { DATA_CHOICE_WRITTEN, };
代码示例来源:origin: pentaho/pentaho-kettle
jobEntry.setFileType( wTypes.getSelectionIndices() );
jobEntry.setZipFilename( wZipFilename.getText() );
jobEntry.setZipFiles( wZipFiles.getSelection() );
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
@Override
protected int[] listGetSelectionIndices() {
return list.getSelectionIndices();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
@Override
protected int[] listGetSelectionIndices() {
return list.getSelectionIndices();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
protected int[] listGetSelectionIndices() {
return list.getSelectionIndices();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
/**
* Remove the current selection in the build list.
*/
private void removeSelection() {
this.buildList.remove(this.buildList.getSelectionIndices());
}
代码示例来源:origin: stefanhaustein/flowgrid
@Override
public void widgetSelected(SelectionEvent e) {
int[] indices = swtList.getSelectionIndices();
clipboard.clear();
for (int i = 0; i < indices.length; i++) {
clipboard.add(newList.get(indices[i]));
}
for (int i = indices.length - 1; i >= 0; i--) {
newList.remove(indices[i]);
swtList.remove(indices[i]);
}
}
代码示例来源:origin: stefanhaustein/flowgrid
int getInsertPostion() {
int[] selected = swtList.getSelectionIndices();
return selected.length == 0 ? swtList.getItemCount() : selected[0];
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.ide.application
protected void removeSelectedWorkspaces() {
// This would be a lot less code if we could use Jakarta CollectionUtils and/or ArrayUtils
int[] selected = workspacesList.getSelectionIndices();
java.util.List<String> workspaces = new ArrayList<String>(Arrays.asList(workspacesList.getItems()));
// Iterate bottom-up because removal changes indices in the list
for (int i = selected.length-1; i >= 0; i--) {
workspaces.remove(selected[i]);
}
String[] newItems = new String[workspaces.size()];
workspaces.toArray(newItems);
workspacesList.setItems(newItems);
}
代码示例来源:origin: atdl4j/atdl4j
public String getControlValueRaw()
{
String value = "";
java.util.List<ListItemT> listItems = control instanceof MultiSelectListT ? ( (MultiSelectListT) control ).getListItem()
: ( (SingleSelectListT) control ).getListItem();
int[] selection = listBox.getSelectionIndices();
for ( int i = 0; i < selection.length; i++ )
{
value += listItems.get( selection[ i ] ).getEnumID();
if ( i + 1 != selection.length )
value += " ";
}
return "".equals( value ) ? null : value;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static void preserveSelection( final List list ) {
IWidgetAdapter adapter = WidgetUtil.getAdapter( list );
Object selection;
if( isSingle( list ) ) {
selection = new Integer( list.getSelectionIndex() );
} else {
selection = list.getSelectionIndices();
}
adapter.preserve( PROP_SELECTION, selection );
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer
public void widgetSelected(SelectionEvent e) {
if (sc.isMultiple()) {
int[] indices = list.getSelectionIndices();
String[] values = new String[indices.length];
for (int i = 0; i < indices.length; i++) {
values[i] = (String) _values.get(indices[i]);
}
sc.setMultipleValues(values);
} else {
sc.setValue((String) _values.get(list
.getSelectionIndex()));
}
}
});
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public void preserveValues( List list ) {
preserveProperty( list, PROP_ITEMS, list.getItems() );
preserveProperty( list, PROP_SELECTION_INDICES, list.getSelectionIndices() );
preserveProperty( list, PROP_TOP_INDEX, list.getTopIndex() );
preserveProperty( list, PROP_FOCUS_INDEX, list.getFocusIndex() );
preserveProperty( list, PROP_ITEM_DIMENSIONS, getItemDimensions( list ) );
}
内容来源于网络,如有侵权,请联系作者删除!