當前位置: 首頁>>代碼示例>>Java>>正文


Java Combo.getSelectionIndex方法代碼示例

本文整理匯總了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 );
	}
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:18,代碼來源:MidiToAudioSettingsDialog.java

示例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;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:23,代碼來源:RelationByExistingColumnsDialog.java

示例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;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:27,代碼來源:RelationByExistingColumnsDialog.java

示例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;
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:26,代碼來源:RelationByExistingColumnsDialog.java

示例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;
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:27,代碼來源:RelationByExistingColumnsDialog.java

示例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);
}
 
開發者ID:alfsch,項目名稱:workspacemechanic,代碼行數:8,代碼來源:MechanicDialog.java

示例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;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:12,代碼來源:AbstractExportDialog.java

示例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();
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:10,代碼來源:CommonExportDialog.java

示例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;
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:12,代碼來源:AbstractExportDialog.java


注:本文中的org.eclipse.swt.widgets.Combo.getSelectionIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。