protected void removeSelectionElements(){ List<Object> toRemove = new ArrayList<>(); for (Object element : m_selection) { if (!m_viewer.setChecked(element.toString(), true)) { toRemove.add(element); } } m_selection.removeAll(toRemove); }
protected void populateList() { for (Iterator iter = referencedProjects.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); projectsList.add(entry.getKey()); boolean checked = ((Boolean) entry.getValue()).booleanValue(); projectsList.setChecked(entry.getKey(), checked); } }
private void checkInitialSelections() { Iterator<Object[]> itemsToCheck= getInitialElementSelections().iterator(); while (itemsToCheck.hasNext()) fCheckBoxList.setChecked(itemsToCheck.next(),true); }
private void checkInitialSelections() { Iterator<Object[]> itemsToCheck= getInitialElementSelections().iterator(); while (itemsToCheck.hasNext()) fCheckBoxList.setChecked(itemsToCheck.next(),true); }
private void checkInitialSelections() { Iterator itemsToCheck= getInitialElementSelections().iterator(); while (itemsToCheck.hasNext()) fCheckBoxList.setChecked(itemsToCheck.next(),true); }
/** * Visually checks the previously-specified elements in this dialog's list * viewer. */ private void checkInitialSelections() { Iterator itemsToCheck = getInitialElementSelections().iterator(); while (itemsToCheck.hasNext()) { listViewer.setChecked(itemsToCheck.next(), true); } }
private void textChanged() { patternFilter.setPattern(filterText.getText()); getTableViewer().refresh(); Set checkedItems = getCheckedItems(); for (Iterator iterator = checkedItems.iterator(); iterator.hasNext();) { getTableViewer().setChecked(iterator.next(), true); } }
private void initialize() { fViewer.setAllChecked(true); Preferences pref = getPreferences(getElement().getAdapter(IProject.class)); if (pref != null) { String binExcludes = pref.get(ICoreConstants.SELFHOSTING_BIN_EXCLUDES, ""); //$NON-NLS-1$ StringTokenizer tokenizer = new StringTokenizer(binExcludes, ","); //$NON-NLS-1$ while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken().trim(); fViewer.setChecked(token, false); } } }
/** * initializes the checked state of the filters when the dialog opens * @since 3.2 */ private void initTableState(boolean defaults) { Filter[] filters = getAllStoredFilters(defaults); for(int i = 0; i < filters.length; i++) { fTableViewer.add(filters[i]); fTableViewer.setChecked(filters[i], filters[i].isChecked()); } }
/** * Adds the given location to the table * @param location */ void addLocation(String location) { fLocationList.add(location); fTableViewer.refresh(); fTableViewer.setChecked(location, true); fTableViewer.setSelection(new StructuredSelection(location)); //do the whole pass in case you have more than one invalid location validateScans(); }
public void refreshCheckedItems() { if (getClasspathSelection() == null) return; java.util.List elements = getClasspathSelection().getClasspathElements(); for (int i = 0; i < elements.size(); i++) { ClasspathElement element = (ClasspathElement) elements.get(i); availableJARsViewer.setChecked(element, element.isSelected()); if (element.isClasspathDependency()) { availableJARsViewer.setGrayed(element, true); } } }
private void refreshWLPCheckedItems() { if (availableJARsViewer.getInput() != null) { java.util.List elements = ((ClassPathSelection) availableJARsViewer.getInput()).getClasspathElements(); for (int i = 0; i < elements.size(); i++) { ClasspathElement element = (ClasspathElement) elements.get(i); availableJARsViewer.setChecked(element, element.isSelected()); if (element.isClasspathDependency()) { availableJARsViewer.setGrayed(element, true); } } } }
private void revert() { IStructuredSelection selection = fTableViewer.getStructuredSelection(); Iterator<?> elements= selection.iterator(); while (elements.hasNext()) { TemplatePersistenceData data= (TemplatePersistenceData) elements.next(); data.revert(); fTableViewer.setChecked(data, data.isEnabled()); } selectionChanged1(); fTableViewer.refresh(); }
private void setAllChecked(boolean checked) { int count = checkList.getTable().getItemCount(); for (int i = 0; i < count; i++) { IProject project = (IProject) checkList.getElementAt(i); if (project.exists()) checkList.setChecked(project, checked); } }
@Override public void doubleClick(DoubleClickEvent event) { ISelection selection = event.getSelection(); if (!selection.isEmpty() && selection instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) selection; Object element = ss.getFirstElement(); boolean checked = !fTableViewer.getChecked(element); fTableViewer.setChecked(element, checked); updateOrderedTargets(element, checked); } } });
@Override protected void doUpdateItem(Widget widget, Object element, boolean fullMap) { super.doUpdateItem(widget, element, fullMap); if(!widget.isDisposed()) { if(checkStateProvider != null) { setChecked(element, checkStateProvider.isChecked(element)); setGrayed(element, checkStateProvider.isGrayed(element)); } } }
@Override protected void doUpdateItem(Widget widget, Object element, boolean fullMap) { super.doUpdateItem(widget, element, fullMap); if(!widget.isDisposed()) { if(checkStateProvider != null) { setChecked(element, checkStateProvider.isChecked(element)); setGrayed(element, checkStateProvider.isGrayed(element)); } } }
private void add() { RulePreferenceData data = new RulePreferenceData(); RuleDialog dialog = new RuleDialog(getShell(),data,false); if(dialog.open() == Window.OK) { store.add(data); tableViewer.refresh(); tableViewer.setChecked(data,data.isEnabled()); tableViewer.setSelection(new StructuredSelection(data)); return; } }
private void edit() { IStructuredSelection selection= (IStructuredSelection)tableViewer.getSelection(); RulePreferenceData data = (RulePreferenceData)selection.getFirstElement(); RuleDialog dialog = new RuleDialog(getShell(),data,true); if(dialog.open() == Window.OK) { tableViewer.refresh(); tableViewer.setChecked(data,data.isEnabled()); tableViewer.setSelection(new StructuredSelection(data)); return; } }
protected void availableJARCheckStateChanged(CheckStateChangedEvent event) { if (!J2EEProjectUtilities.isStandaloneProject(model.getComponent().getProject()) && (isReadOnly() || !validatateEdit() || (isMyClientJAR(event) && !event.getChecked()))) { availableJARsViewer.setChecked(event.getElement(), !event.getChecked()); return; } ClasspathElement element = (ClasspathElement) event.getElement(); model.setSelection(element, event.getChecked()); }