/** * {@inheritDoc} */ public void setSelection(ISelection selection) { setSelection(((StructuredSelection)selection).toList()); }
@Override public void run() { List<?> selectedElements = ((StructuredSelection) list.getSelection()).toList(); removeSelectedItems(selectedElements); } }
@Override public void setSelection(ISelection selection) { setSelection(((StructuredSelection)selection).toList()); }
@Override public void setSelection(ISelection selection) { setSelection(((StructuredSelection)selection).toList()); }
/** * Internal method which returns a string representation of this * selection suitable for debug purposes only. * * @return debug string */ @Override public String toString() { return isEmpty() ? JFaceResources.getString("<empty_selection>") : toList().toString(); //$NON-NLS-1$ } }
/** * Internal method which returns a string representation of this * selection suitable for debug purposes only. * * @return debug string */ @Override public String toString() { return isEmpty() ? JFaceResources.getString("<empty_selection>") : toList().toString(); //$NON-NLS-1$ } }
/** * Internal method which returns a string representation of this * selection suitable for debug purposes only. * * @return debug string */ public String toString() { return isEmpty() ? JFaceResources.getString("<empty_selection>") : toList().toString(); //$NON-NLS-1$ } }
@Override protected void selectAndReveal(ISelection selection) { fProvider.handleFolderCreation(((StructuredSelection)selection).toList()); super.selectAndReveal(selection); } }
private String noAction(ISelection selection) { if (selection instanceof StructuredSelection) { return noAction(((StructuredSelection)selection).toList()); } else { return noAction(Collections.EMPTY_LIST); } }
@Override protected void selectAndReveal(ISelection selection) { fProvider.handleFolderCreation(((StructuredSelection)selection).toList()); super.selectAndReveal(selection); } }
/** * {@inheritDoc} */ protected void selectAndReveal(ISelection selection) { fProvider.handleFolderCreation(((StructuredSelection)selection).toList()); super.selectAndReveal(selection); } }
private String noAction(ISelection selection) { if (selection instanceof StructuredSelection) { return noAction(((StructuredSelection)selection).toList()); } else { return noAction(Collections.EMPTY_LIST); } }
@Override protected void selectAndReveal(ISelection selection) { fProvider.handleFolderCreation(((StructuredSelection)selection).toList()); super.selectAndReveal(selection); } }
private String noAction(ISelection selection) { if (selection instanceof StructuredSelection) { return noAction(((StructuredSelection)selection).toList()); } else { return noAction(Collections.EMPTY_LIST); } }
/** * {@inheritDoc} */ protected void selectAndReveal(ISelection selection) { fProvider.handleFolderCreation(((StructuredSelection)selection).toList()); super.selectAndReveal(selection); } }
@Override protected void selectAndReveal(ISelection selection) { fProvider.handleFolderCreation(((StructuredSelection)selection).toList()); super.selectAndReveal(selection); } }
/** * Returns the current selection. * * @return the current selection */ protected StructuredSelection getSelectedItems() { StructuredSelection selection = (StructuredSelection) list.getStructuredSelection(); List<?> selectedItems = selection.toList(); Object itemToRemove = null; for (Iterator<?> it = selection.iterator(); it.hasNext();) { Object item = it.next(); if (item instanceof ItemsListSeparator) { itemToRemove = item; break; } } if (itemToRemove == null) return new StructuredSelection(selectedItems); // Create a new selection without the collision List<?> newItems = new ArrayList<>(selectedItems); newItems.remove(itemToRemove); return new StructuredSelection(newItems); }
public List getSelection() { List selectedList= new ArrayList(); IJavaProject project= fJavaProject; try { List list= ((StructuredSelection)fPackageExplorer.getSelection()).toList(); List existingEntries= ClasspathModifier.getExistingEntries(project); for(int i= 0; i < list.size(); i++) { Object obj= list.get(i); if (obj instanceof IPackageFragmentRoot) { IPackageFragmentRoot element= (IPackageFragmentRoot)obj; CPListElement cpElement= ClasspathModifier.getClasspathEntry(existingEntries, element); selectedList.add(cpElement); } else if (obj instanceof IJavaProject) { IClasspathEntry entry= ClasspathModifier.getClasspathEntryFor(project.getPath(), project, IClasspathEntry.CPE_SOURCE); if (entry == null) continue; CPListElement cpElement= CPListElement.createFromExisting(entry, project); selectedList.add(cpElement); } } } catch (JavaModelException e) { return new ArrayList(); } return selectedList; }
/** * Remove the current selection of the {@link #tableViewer}. */ private void fireRemove() { StructuredSelection selection = (StructuredSelection) tableViewer.getSelection(); if (selection.isEmpty()) { // no action if selection is empty return; } for (Object selectedObject : selection.toArray()) { if (selectedObject instanceof JmxBeanSensorAssignment) { JmxBeanSensorAssignment assignment = (JmxBeanSensorAssignment) selectedObject; jmxAssignments.remove(assignment); validationManager.validationStatesRemoved(assignment); } } // inform details page about removal RemoveSelection removeSelection = new RemoveSelection(selection.toList()); fireEdit(removeSelection); // Refresh and deal with the possible changes in the table row structure, so re-check error // descriptors tableViewer.setSelection(StructuredSelection.EMPTY); tableViewer.refresh(); validationManager.checkTableControlDecorations(); markDirty(); showHideFormMessage(); }
/** * Deletes selected business transaction definitions from the table. */ private void deleteSelectedBusinessTransactions() { ISelection selection = tableViewer.getSelection(); if ((selection instanceof StructuredSelection) && !selection.isEmpty()) { boolean itemsDeleted = false; for (Object selectedElement : ((StructuredSelection) selection).toList()) { BusinessTransactionDefinition businessTxDefinition = (BusinessTransactionDefinition) selectedElement; if (businessTxDefinition.getId() != BusinessTransactionDefinition.DEFAULT_ID) { getApplication().deleteBusinessTransactionDefinition(businessTxDefinition); validationManager.validationStatesRemoved(businessTxDefinition); itemsDeleted = true; } } if (itemsDeleted) { updateContent(StructuredSelection.EMPTY); managedForm.fireSelectionChanged(BusinessTransactionMasterBlock.this, StructuredSelection.EMPTY); markDirty(); } } }