本文整理匯總了Java中org.eclipse.swt.widgets.Combo.removeAll方法的典型用法代碼示例。如果您正苦於以下問題:Java Combo.removeAll方法的具體用法?Java Combo.removeAll怎麽用?Java Combo.removeAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Combo
的用法示例。
在下文中一共展示了Combo.removeAll方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addCombovalues
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private void addCombovalues(Combo combo, String paramType) {
if(!PrimitiveType.isPrimitiveSig(paramType)) {
String sel = combo.getText();
combo.removeAll();
combo.add("null");
IType owner = (IType) method.getParent();
try {
IField[] fields = owner.getFields();
for(IField f : fields)
if(Flags.isStatic(f.getFlags()) && f.getTypeSignature().equals(paramType))
combo.add(f.getElementName());
} catch (JavaModelException e1) {
e1.printStackTrace();
}
if(sel.isEmpty())
combo.select(0);
else
combo.setText(sel);
}
}
示例2: 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 );
}
}
示例3: reloadChannelCombo
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void reloadChannelCombo(Combo combo, List<Integer> channels, int selected, String valueKey){
if(!(combo.getData() instanceof List) || isDifferentList(channels, (List<Integer>)combo.getData())){
combo.removeAll();
combo.setData(channels);
for( int i = 0 ; i < channels.size() ; i ++ ){
combo.add(TuxGuitar.getProperty(valueKey, new String[]{channels.get(i).toString()}));
}
}
for( int i = 0 ; i < channels.size() ; i ++ ){
Integer channel = (Integer)channels.get(i);
if( channel.intValue() == selected ){
combo.select( i );
}
}
}
示例4: loadChannels
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
protected void loadChannels(int selectedChannelId){
List<Integer> tgChannelsData = new ArrayList<Integer>();
List<TGChannel> tgChannelsAvailable = findSongManager().getChannels(findSong());
Combo tgChannelsCombo = this.instrumentCombo;
tgChannelsCombo.removeAll();
tgChannelsCombo.add(TuxGuitar.getProperty("track.instrument.default-select-option"));
tgChannelsCombo.select(0);
tgChannelsData.add(new Integer(-1));
for( int i = 0 ; i < tgChannelsAvailable.size() ; i ++) {
TGChannel tgChannel = (TGChannel)tgChannelsAvailable.get(i);
tgChannelsData.add(new Integer(tgChannel.getChannelId()));
tgChannelsCombo.add(tgChannel.getName());
if( tgChannel.getChannelId() == selectedChannelId ){
tgChannelsCombo.select(tgChannelsCombo.getItemCount() - 1);
}
}
tgChannelsCombo.setData(tgChannelsData);
}
示例5: reloadChannelCombo
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void reloadChannelCombo(Combo combo, List<Integer> channels, int selected, String valueKey){
if(!(combo.getData() instanceof List) || isDifferentList(channels, (List<Integer>) combo.getData())){
combo.removeAll();
combo.setData(channels);
for( int i = 0 ; i < channels.size() ; i ++ ){
combo.add(TuxGuitar.getProperty(valueKey, new String[]{channels.get(i).toString()}));
}
}
for( int i = 0 ; i < channels.size() ; i ++ ){
Integer channel = (Integer)channels.get(i);
if( channel.intValue() == selected ){
combo.select( i );
}
}
}
示例6: loadComboJarListFromBuildPath
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
@SuppressWarnings("restriction")
private void loadComboJarListFromBuildPath(Combo comboJarList, String newJarName) {
comboJarList.removeAll();
IProject iProject = BuildExpressionEditorDataSturcture.INSTANCE.getCurrentProject();
IJavaProject iJavaProject=null;
try {
iJavaProject = JavaCore.create(iProject);
PackageFragmentRoot srcfragmentRoot= BuildExpressionEditorDataSturcture.INSTANCE.getSrcPackageFragment(iJavaProject);
comboJarList.add(hydrograph.ui.common.util.Constants.ProjectSupport_SRC);
comboJarList.setData(String.valueOf(comboJarList.getItemCount() - 1), srcfragmentRoot);
for (IPackageFragmentRoot iPackageFragmentRoot : iJavaProject.getAllPackageFragmentRoots()) {
if (isJarPresentInLibFolder(iPackageFragmentRoot.getPath())
&& iPackageFragmentRoot.getKind() != IPackageFragmentRoot.K_SOURCE) {
comboJarList.add(iPackageFragmentRoot.getElementName());
comboJarList.setData(String.valueOf(comboJarList.getItemCount() - 1), iPackageFragmentRoot);
}
}
selectAndLoadJarData(newJarName);
} catch (JavaModelException javaModelException) {
LOGGER.error("Error occurred while loading engines-transform jar", javaModelException);
}
finally{
if(iJavaProject!=null){
try {
iJavaProject.close();
} catch (JavaModelException e) {
LOGGER.warn("JavaModelException occurred while closing java-project"+e);
}
}
}
}
示例7: populateTypeCombo
import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private void populateTypeCombo(final Combo combo) {
final String oldType = combo.getText();
combo.removeAll();
String[] types;
if (selectedProjectIndex >= 0) {
final Project project = projects[selectedProjectIndex];
final WorkItemType[] witTypes = project.getWorkItemTypes().getTypes();
types = new String[witTypes.length];
for (int i = 0; i < witTypes.length; i++) {
types[i] = witTypes[i].getName();
}
} else {
types = uniqueTypeNames;
}
Arrays.sort(types);
combo.add(""); //$NON-NLS-1$
boolean foundOldType = false;
for (int i = 0; i < types.length; i++) {
combo.add(types[i]);
if (types[i].equals(oldType)) {
foundOldType = true;
}
}
if (foundOldType) {
combo.setText(oldType);
} else {
combo.setText(""); //$NON-NLS-1$
}
}