本文整理了Java中org.eclipse.swt.widgets.List.getSelectionCount()
方法的一些代码示例,展示了List.getSelectionCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。List.getSelectionCount()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.List
类名称:List
方法名:getSelectionCount
[英]Returns the number of selected items contained in 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 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
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 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
private void ok() {
if ( constant != null && wbUseConstant.getSelection() ) {
selection = wConstantValue.getText();
} else if ( wSelection.getSelectionCount() > 0 ) {
selection = wSelection.getSelection()[0];
selectionNr = wSelection.getSelectionIndices()[0];
代码示例来源:origin: pentaho/pentaho-kettle
public void refreshGrid() {
applyChangedValue();
wTodo.removeAll();
wKey.setText( "" );
wMain.setText( "" );
wValue.setText( "" );
wSource.setText( "" );
selectedLocale = wLocale.getSelectionCount() == 0 ? null : wLocale.getSelection()[0];
selectedSourceFolder =
wPackages.table.getSelectionCount() == 0 ? null : wPackages.table.getSelection()[0].getText( 1 );
selectedMessagesPackage =
wPackages.table.getSelectionCount() == 0 ? null : wPackages.table.getSelection()[0].getText( 2 );
refreshPackages();
// Only continue with a locale & a messages package, otherwise we won't
// budge ;-)
//
if ( selectedLocale != null && selectedSourceFolder != null && selectedMessagesPackage != null ) {
// Get the list of keys that need a translation...
//
java.util.List<KeyOccurrence> todo =
getTodoList( selectedLocale, selectedMessagesPackage, selectedSourceFolder, false );
String[] todoItems = new String[todo.size()];
for ( int i = 0; i < todoItems.length; i++ ) {
todoItems[i] = todo.get( i ).getKey();
}
wTodo.setItems( todoItems );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void refreshGrid() {
try {
if ( wList.getSelectionCount() > 0 ) {
String[] languages = getSelectedLocale();
System.out.println( "Selected languages: " + languages.length );
for ( int i = 0; i < wList.getSelectionCount(); i++ ) {
String dir = wList.getSelection()[i];
代码示例来源: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 ( list.getSelectionCount() <= 0 ) {
return;
代码示例来源:origin: pentaho/pentaho-kettle
boolean multiStep = stepsList.getSelectionCount() > 1;
boolean multiData = dataList.getSelectionCount() > 1;
boolean calcMoving = !multiStep && !multiData; // A single metric shown for a single step
List<Double> movingList = new ArrayList<Double>();
代码示例来源:origin: pentaho/pentaho-kettle
boolean multiStep = stepsList.getSelectionCount() > 1;
boolean multiData = dataList.getSelectionCount() > 1;
boolean calcMoving = !multiStep && !multiData; // A single metric shown for a single step
List<Double> movingList = new ArrayList<Double>();
代码示例来源:origin: eclipse-color-theme/eclipse-color-theme
if (themeSelectionList.getSelectionCount() > 0) {
String selectedThemeName = themeSelectionList.getSelection()[0];
getPreferenceStore().setValue("colorTheme", selectedThemeName);
代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.ui
public void widgetSelected(SelectionEvent e) {
boolean enabled = (EditDriverDialog.this.list
.getSelectionCount() > 0);
EditDriverDialog.this.mEditJar.setEnabled(enabled);
EditDriverDialog.this.mRemoveJar
.setEnabled(enabled);
}
代码示例来源:origin: org.apache.uima/uimaj-ep-configurator
@Override
public void copyValuesFromGUI() {
m_selectedTypeNames = new String[typeList.getSelectionCount()];
for (int i = 0, j = 0; i < m_availableTypeNames.length; i++) {
if (typeList.isSelected(i)) {
m_selectedTypeNames[j++] = m_availableTypeNames[i];
}
}
}
代码示例来源:origin: infinitest/infinitest
private void jumpToSelectedLine(org.eclipse.swt.widgets.List list) {
if (list.getSelectionCount() > 0) {
StackTraceElement element = stackTrace.get(list.getSelectionIndex());
IFile classFile = getClassFile(element.getClassName());
if (classFile != null) {
jumpAndCloseDialog(element, classFile);
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.ui
public void widgetSelected(SelectionEvent e) {
if (EditDriverDialog.this.list.getSelectionCount() > 0) {
String selectedItem = EditDriverDialog.this.list
.getItem(EditDriverDialog.this.list
.getSelectionIndex());
handleLocationEditButtonPressed(selectedItem);
updateJarList();
}
}
});
代码示例来源:origin: org.eclipse/org.eclipse.wst.common.ui
public void widgetSelected(SelectionEvent event) {
if (selectedListBox.getSelectionCount() > 0)
setRemoveButtonEnabled(true);
else
setRemoveButtonEnabled(false);
return;
}
});
代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.ui
public void widgetSelected(SelectionEvent e) {
if (EditDriverDialog.this.list
.getSelectionCount() > 0) {
String[] selected = EditDriverDialog.this.list
.getSelection();
for (int i = 0; i < selected.length; i++) {
EditDriverDialog.this.list
.remove(selected[i]);
}
updateJarList();
}
}
});
内容来源于网络,如有侵权,请联系作者删除!