本文整理匯總了Java中org.eclipse.swt.widgets.Combo.getSelectionIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java Combo.getSelectionIndex方法的具體用法?Java Combo.getSelectionIndex怎麽用?Java Combo.getSelectionIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Combo
的用法示例。
在下文中一共展示了Combo.getSelectionIndex方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateTypesCombo
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private void updateTypesCombo( MidiToAudioSettings settings, List<MidiToAudioFormat> encodings, Combo eCombo , Combo tCombo ){
tCombo.removeAll();
int eIndex = eCombo.getSelectionIndex();
if( eIndex >= 0 && eIndex < encodings.size() ){
MidiToAudioFormat encoding = (MidiToAudioFormat)encodings.get( eIndex );
AudioFileFormat.Type[] types = encoding.getTypes();
int tSelectionIndex = 0;
for( int tIndex = 0 ; tIndex < types.length ; tIndex ++ ) {
tCombo.add( types[ tIndex ] + " (*." + types[ tIndex ].getExtension() + ")");
if( settings.getType() != null && settings.getType().equals( types[ tIndex] )){
tSelectionIndex = tIndex;
}
}
tCombo.select( tSelectionIndex );
}
}
示例2: getSelectedColumn
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private NormalColumn getSelectedColumn(final TableEditor tableEditor) {
final Combo foreignKeyCombo = (Combo) tableEditor.getEditor();
final int foreignKeyComboIndex = foreignKeyCombo.getSelectionIndex();
int startIndex = 1;
NormalColumn foreignKeyColumn = null;
final List<NormalColumn> foreignKeyList = editorReferencedMap.get(tableEditor);
if (foreignKeyList != null) {
if (foreignKeyComboIndex <= foreignKeyList.size()) {
foreignKeyColumn = foreignKeyList.get(foreignKeyComboIndex - startIndex);
} else {
startIndex += foreignKeyList.size();
}
}
if (foreignKeyColumn == null) {
foreignKeyColumn = candidateForeignKeyColumns.get(foreignKeyComboIndex - startIndex);
}
return foreignKeyColumn;
}
示例3: getErrorMessage
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@Override
protected String getErrorMessage() {
final Set<NormalColumn> selectedColumns = new HashSet<NormalColumn>();
for (final TableEditor tableEditor : tableEditorList) {
final Combo foreignKeyCombo = (Combo) tableEditor.getEditor();
final int index = foreignKeyCombo.getSelectionIndex();
if (index == 0) {
return "error.foreign.key.not.selected";
}
final NormalColumn selectedColumn = getSelectedColumn(tableEditor);
if (selectedColumns.contains(selectedColumn)) {
return "error.foreign.key.must.be.different";
}
selectedColumns.add(selectedColumn);
}
if (existForeignKeySet(selectedColumns)) {
return "error.foreign.key.already.exist";
}
return null;
}
示例4: getSelectedColumn
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private NormalColumn getSelectedColumn(TableEditor tableEditor) {
Combo foreignKeyCombo = (Combo) tableEditor.getEditor();
int foreignKeyComboIndex = foreignKeyCombo.getSelectionIndex();
int startIndex = 1;
NormalColumn foreignKeyColumn = null;
List<NormalColumn> foreignKeyList = this.editorReferencedMap
.get(tableEditor);
if (foreignKeyList != null) {
if (foreignKeyComboIndex <= foreignKeyList.size()) {
foreignKeyColumn = foreignKeyList.get(foreignKeyComboIndex
- startIndex);
} else {
startIndex += foreignKeyList.size();
}
}
if (foreignKeyColumn == null) {
foreignKeyColumn = this.candidateForeignKeyColumns
.get(foreignKeyComboIndex - startIndex);
}
return foreignKeyColumn;
}
示例5: getErrorMessage
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@Override
protected String getErrorMessage() {
Set<NormalColumn> selectedColumns = new HashSet<NormalColumn>();
for (TableEditor tableEditor : this.tableEditorList) {
Combo foreignKeyCombo = (Combo) tableEditor.getEditor();
int index = foreignKeyCombo.getSelectionIndex();
if (index == 0) {
return "error.foreign.key.not.selected";
}
NormalColumn selectedColumn = this.getSelectedColumn(tableEditor);
if (selectedColumns.contains(selectedColumn)) {
return "error.foreign.key.must.be.different";
}
selectedColumns.add(selectedColumn);
}
if (this.existForeignKeySet(selectedColumns)) {
return "error.foreign.key.already.exist";
}
return null;
}
示例6: widgetSelected
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@Override
public void widgetSelected(SelectionEvent e) {
Combo combo = (Combo) e.getSource();
int index = combo.getSelectionIndex();
Decision choice = Decision.valueOf(index);
userTaskChoices.put(item, choice);
}
示例7: getSelectedCategory
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
protected Category getSelectedCategory(final Combo categoryCombo) {
Category category = null;
final int categoryIndex = categoryCombo.getSelectionIndex();
if (categoryIndex != 0) {
category = categoryList.get(categoryIndex - 1);
}
return category;
}
示例8: getSelectedImgType
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private ImgType getSelectedImgType(Combo cmb) {
final int i = cmb.getSelectionIndex();
ImgTypeLabels type = ImgTypeLabels.valueOf(imgQualityChoices[i]);
if(type == null) {
logger.error("Could not determine selected image type: " + imgQualityChoices[i]);
type = ImgTypeLabels.Original;
}
return type.getImgType();
}
示例9: getSelectedCategory
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
protected Category getSelectedCategory(Combo categoryCombo) {
Category category = null;
int categoryIndex = categoryCombo.getSelectionIndex();
if (categoryIndex != 0) {
category = this.categoryList.get(categoryIndex - 1);
}
return category;
}