private static boolean containsTopLevelTypes(IStructuredSelection selection) { for (Iterator<?> iter = selection.iterator(); iter.hasNext();) { Object each= iter.next(); if (each instanceof IType && ((IType)each).getDeclaringType() == null) return true; } return false; }
private boolean containsOnlyElementsOfSameState(int state, IStructuredSelection selection) { for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { NLSSubstitution substitution= (NLSSubstitution) iter.next(); if (substitution.getState() != state) { return false; } } return true; }
private static boolean containsOnlyElementsInsideCompilationUnits(IStructuredSelection selection) { for (Iterator<?> iter = selection.iterator(); iter.hasNext();) { Object object= iter.next(); if (! (object instanceof IJavaElement && ReorgUtils.isInsideCompilationUnit((IJavaElement)object))) return false; } return true; }
private boolean containsOnlyElementsOfSameState(int state, IStructuredSelection selection) { for (Iterator iter= selection.iterator(); iter.hasNext();) { NLSSubstitution substitution= (NLSSubstitution) iter.next(); if (substitution.getState() != state) { return false; } } return true; }
private static boolean checkEnabled(IStructuredSelection selection) { if (selection.isEmpty()) return false; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { if (! canRemove(iter.next())) return false; } return true; }
private boolean containsElementsWithChange(IStructuredSelection selection) { for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { NLSSubstitution substitution= (NLSSubstitution) iter.next(); if (substitution.hasPropertyFileChange() || substitution.hasSourceChange()) { return true; } } return false; }
/** * Reset the selected properties to their default values. */ public void resetProperties() { // Determine the selection IStructuredSelection selection = (IStructuredSelection) getSelection(); // Iterate over entries and reset them Iterator<IPropertySheetEntry> itr = selection.iterator(); while (itr.hasNext()) { itr.next().resetPropertyValue(); } }
private static boolean checkEnabled(IStructuredSelection selection) throws JavaModelException { if (selection.isEmpty()) return false; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { if (! canBeAddedToBuildPath(iter.next())) return false; } return true; }
private static boolean checkEnabled(IStructuredSelection selection) { if (selection.isEmpty()) return false; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { if (! canRemove(iter.next())) return false; } return true; }
@Override public void run() { final ISelection s = getSelection(); if (s.isEmpty() || !(s instanceof IStructuredSelection)) return; final IStructuredSelection iss = (IStructuredSelection) s; for (Iterator<FileDiff> it = iss.iterator(); it.hasNext();) showAnnotations(it.next()); } };
/** * Reset the selected properties to their default values. */ public void resetProperties() { // Determine the selection IStructuredSelection selection = (IStructuredSelection) getSelection(); // Iterate over entries and reset them Iterator itr = selection.iterator(); while (itr.hasNext()) { ((IPropertySheetEntry) itr.next()).resetPropertyValue(); } }
private void remove() { IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); Iterator elements= selection.iterator(); while (elements.hasNext()) { TemplatePersistenceData data= (TemplatePersistenceData) elements.next(); fTemplateStore.delete(data); } fTableViewer.refresh(); }
public void run() { if (!isEnabled()) { return; } for (Iterator it = getStructuredSelection().iterator(); it.hasNext();) { ((IConnectionProfile) it.next()).saveWorkOfflineData(null); } }
protected boolean isSelectionSomeJ2EE() { IStructuredSelection sel = (StructuredSelection) getSelection(); Iterator it = sel.iterator(); while (it.hasNext()) { Object o = it.next(); if (isJ2EEModule(o) || isApplication(o)) return true; } return false; }
public void run(IStructuredSelection selection) { if (!checkEnabled(selection)) { return; } for (Iterator iter= selection.iterator(); iter.hasNext();) { boolean noError= CallHierarchyUI.openInEditor(iter.next(), getShell(), getDialogTitle()); if (! noError) return; } }
@Override protected void open(ISelection selection, boolean activate) { if (selection instanceof IStructuredSelection) { for (Iterator<?> iter= ((IStructuredSelection)selection).iterator(); iter.hasNext();) { boolean noError= CallHierarchyUI.openInEditor(iter.next(), getSite().getShell(), OpenStrategy.activateOnOpen()); if (!noError) return; } } }
@Override protected void open(ISelection selection, boolean activate) { if (selection instanceof IStructuredSelection) { for (Iterator<?> iter= ((IStructuredSelection)selection).iterator(); iter.hasNext();) { boolean noError= CallHierarchyUI.openInEditor(iter.next(), getSite().getShell(), OpenStrategy.activateOnOpen()); if (!noError) return; } } }
@Override public void run(IStructuredSelection selection) { if (!checkEnabled(selection)) return; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { boolean noError= CallHierarchyUI.openInEditor(iter.next(), getShell(), OpenStrategy.activateOnOpen()); if (! noError) return; } } }
/** * The 'remove favorites' button has been pressed */ protected void removeSelectedFavorites() { IStructuredSelection sel = getFavoritesTable().getStructuredSelection(); Iterator<?> iter = sel.iterator(); while (iter.hasNext()) { Object config = iter.next(); getFavorites().remove(config); } getFavoritesTable().refresh(); }
public ReplaceAction2(FileSearchPage page, IStructuredSelection selection) { fSite= page.getSite(); fPage= page; setText(SearchMessages.ReplaceAction_label_selected); fElements= collectFiles(selection.iterator()); setEnabled(!(fElements.length == 0)); }