@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = (IFile) i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { boolean correctSelection = false; if (receiver instanceof StructuredSelection) { Iterator<Object> it = ((StructuredSelection) receiver).iterator(); while (it.hasNext()) { Object nextObject = it.next(); if (nextObject instanceof MethodSensorData) { if (nextObject instanceof HttpTimerData) { continue; } else { correctSelection = true; break; } } } } return correctSelection == ((Boolean) expectedValue).booleanValue(); }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = (IFile) i.next(); } return result; } return null; }
@SuppressWarnings("unchecked") IFile[] getLocations(ISelection selection) { if (selection != null && (selection instanceof StructuredSelection)) { StructuredSelection ss = (StructuredSelection) selection; IFile[] result = new IFile[ss.size()]; int n = 0; for (Iterator<IFile> i = ss.iterator(); i.hasNext();) { result[n++] = i.next(); } return result; } return null; }
private Collection computeSelectedResources(StructuredSelection selection) { List result = new ArrayList(); for (Iterator iter = selection.iterator(); iter.hasNext();) { Object element = iter.next(); ResourceMapping mapping = Utils.getResourceMapping(element); if (mapping != null && scopeContainsMapping(mapping)) { result.add(element); } } return result; }
private Collection computeSelectedResources(StructuredSelection selection) { List result = new ArrayList(); for (Iterator iter = selection.iterator(); iter.hasNext();) { Object element = iter.next(); ResourceMapping mapping = Utils.getResourceMapping(element); if (mapping != null && scopeContainsMapping(mapping)) { result.add(element); } } return result; }
/** * @return the indices of one or more selected items. Indices * are always returned in ascending order */ private int[] getMultiSelectionIndices() { StructuredSelection sel = (StructuredSelection) treeViewer.getSelection(); List<Integer> indices = new ArrayList<>(); for (Iterator<?> iter = sel.iterator(); iter.hasNext(); ) { GroupLaunchElement el = (GroupLaunchElement) iter.next(); indices.add(input.indexOf(el)); } int[] result = new int[indices.size()]; for (int i = 0; i < result.length; i++) { result[i] = indices.get(i); } return result; }
/** * Deletes selected labels. */ private void deleteSelectedlabels() { StructuredSelection structuredSelection = (StructuredSelection) labelsTableViewer.getSelection(); if (!structuredSelection.isEmpty()) { for (Iterator<?> it = structuredSelection.iterator(); it.hasNext();) { labelsToAdd.remove(it.next()); } labelsTableViewer.refresh(); setPageComplete(isPageComplete()); } }
/** * {@inheritDoc} */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); if (selection instanceof StructuredSelection) { List<IStorageDataProvider> storageDataProviders = new ArrayList<>(); for (Iterator<?> it = ((StructuredSelection) selection).iterator(); it.hasNext();) { IStorageDataProvider storageDataProvider = (IStorageDataProvider) it.next(); storageDataProviders.add(storageDataProvider); } if (CollectionUtils.isNotEmpty(storageDataProviders)) { WizardDialog wizardDialog = new WizardDialog(HandlerUtil.getActiveShell(event), new DownloadStorageWizard(storageDataProviders)); wizardDialog.open(); } } return null; } }
public void toggleExpandState(int state, StructuredSelection selection) { TreeItem[] items = fExtensionTree.getTree().getSelection(); if (state == NEEDS_EXPAND) { // expand sub tree traverseChildrenAndSetExpanded(items); // load non-expanded children fExtensionTree.refresh(); expandChildrenElements(selection.toArray(), true); fExtensionTree.setSelection(selection, false); } else { // collapse sub tree for (Iterator<?> iterator = selection.iterator(); iterator.hasNext();) { fExtensionTree.setExpandedState(iterator.next(), false); } } }
private void addSelectedInterfaces() { StructuredSelection selection= getSelectedItems(); if (selection == null) return; for (Iterator iter= selection.iterator(); iter.hasNext();) { Object obj= iter.next(); if (obj instanceof TypeNameMatch) { accessedHistoryItem(obj); TypeNameMatch type= (TypeNameMatch) obj; String qualifiedName= JavaModelUtil.getFullyQualifiedName(type.getType()); String message; if (fTypeWizardPage.addSuperInterface(qualifiedName)) { message= Messages.format(NewWizardMessages.SuperInterfaceSelectionDialog_interfaceadded_info, qualifiedName); } else { message= Messages.format(NewWizardMessages.SuperInterfaceSelectionDialog_interfacealreadyadded_info, qualifiedName); } updateStatus(new StatusInfo(IStatus.INFO, message)); } } }
private void addSelectedInterfaces() { StructuredSelection selection= getSelectedItems(); if (selection == null) return; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { Object obj= iter.next(); if (obj instanceof TypeNameMatch) { accessedHistoryItem(obj); TypeNameMatch type= (TypeNameMatch) obj; String qualifiedName= getNameWithTypeParameters(type.getType()); String message; if (fTypeWizardPage.addSuperInterface(qualifiedName)) { message= Messages.format(NewWizardMessages.SuperInterfaceSelectionDialog_interfaceadded_info, BasicElementLabels.getJavaElementName(qualifiedName)); } else { message= Messages.format(NewWizardMessages.SuperInterfaceSelectionDialog_interfacealreadyadded_info, BasicElementLabels.getJavaElementName(qualifiedName)); } updateStatus(new StatusInfo(IStatus.INFO, message)); } } }
private void addSelectedInterfaces() { StructuredSelection selection= getSelectedItems(); if (selection == null) return; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { Object obj= iter.next(); if (obj instanceof TypeNameMatch) { accessedHistoryItem(obj); TypeNameMatch type= (TypeNameMatch) obj; String qualifiedName= getNameWithTypeParameters(type.getType()); String message; if (fTypeWizardPage.addSuperInterface(qualifiedName)) { message= Messages.format(NewWizardMessages.SuperInterfaceSelectionDialog_interfaceadded_info, BasicElementLabels.getJavaElementName(qualifiedName)); } else { message= Messages.format(NewWizardMessages.SuperInterfaceSelectionDialog_interfacealreadyadded_info, BasicElementLabels.getJavaElementName(qualifiedName)); } updateStatus(new StatusInfo(IStatus.INFO, message)); } } }