本文整理匯總了Java中org.eclipse.swt.widgets.List.removeAll方法的典型用法代碼示例。如果您正苦於以下問題:Java List.removeAll方法的具體用法?Java List.removeAll怎麽用?Java List.removeAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.List
的用法示例。
在下文中一共展示了List.removeAll方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadListOfServers
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
private void loadListOfServers(List list) {
ServerStore serverStore = new ServerStore(
uk.ac.york.mondo.integration.api.dt.Activator.getDefault().getPreferenceStore());
java.util.List<Server> servers = serverStore.readAllServers();
list.removeAll();
list.add(CUSTOM_URL_TEXT);
list.setSelection(0); // by default select option "Custom URL"
for (Server server : servers) {
list.add(server.getBaseURL());
}
userName.setEnabled(false);
userName.setText("");
frontRepoURL.setText("");
}
示例2: setListData
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
* 為List組件設置數據
* @param list
* @param data
*/
private void setListData(List list, Map<String, String> data) {
list.removeAll();
if (data == null) {
return;
}
for (Entry<String, String> entry : data.entrySet()) {
list.add(entry.getKey());
}
}
示例3: setListData
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
* 為List組件設置數據
* @param list
* @param data
*/
private void setListData(List list, Map<String, String> data) {
list.removeAll();
if (data == null || data.size() == 0) {
return;
}
for (Entry<String, String> entry : data.entrySet()) {
list.add(entry.getKey());
}
}
示例4: loadFieldList
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
public void loadFieldList(List listFields, String selection) throws ForceConnectionException, ForceRemoteException {
if (project == null) {
logger.warn("Unable to initialize controller - project is null");
return;
}
listFields.removeAll();
Hashtable<String, String> mergeFieldObjects = componentTypes.get(selection);
if (Utils.isEmpty(mergeFieldObjects)) {
DescribeSObjectResult describeSObjectResult =
getDescribeObjectRegistry().getCachedDescribe(project, selection);
mergeFieldObjects = new Hashtable<>(describeSObjectResult.getFields().length);
Field[] fields = describeSObjectResult.getFields();
if (Utils.isNotEmpty(fields)) {
Arrays.sort(fields, new Comparator<Field>() {
@Override
public int compare(Field o1, Field o2) {
String name1 = (o1).getLabel();
String name2 = (o2).getLabel();
return name1.compareTo(name2);
}
});
}
for (Field field : fields) {
mergeFieldObjects.put(field.getLabel(), field.getName());
}
componentTypes.put(selection, mergeFieldObjects);
}
Set<String> mergeFieldObjectKeys = mergeFieldObjects.keySet();
TreeSet<String> sortedMergeFieldObjectKeys = new TreeSet<>();
sortedMergeFieldObjectKeys.addAll(mergeFieldObjectKeys);
for (String sortedMergeFieldObjectKey : sortedMergeFieldObjectKeys) {
listFields.add(sortedMergeFieldObjectKey);
listFields.setData(sortedMergeFieldObjectKey, mergeFieldObjects.get(sortedMergeFieldObjectKey));
}
}
示例5: activeChangeCheck
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
* If the active set is different from widget set, then update the widget set
*/
private void activeChangeCheck() {
List myList = getListUnchecked();
if (myList != null) {
String[] items = myList.getItems();
if (active.size() != items.length && !active.equals(Arrays.asList(items))) {
myList.removeAll();
for (String item : active) {
myList.add(item);
}
setPresentsDefaultValue(checkDefaults(active));
super.selectionChanged();
}
}
}