/** * Fires remove action. */ private void fireRemove() { StructuredSelection selection = (StructuredSelection) tableViewer.getSelection(); for (Object selectedObject : selection.toArray()) { if (selectedObject instanceof AgentMapping) { inputList.remove(selectedObject); } } updateInternal(true); }
/** * {@inheritDoc} */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { StructuredSelection structuredSelection = (StructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof ICmrRepositoryProvider) { cmrRepositoryDefinition = ((ICmrRepositoryProvider) structuredSelection.getFirstElement()).getCmrRepositoryDefinition(); environments = cmrRepositoryDefinition.getConfigurationInterfaceService().getAllEnvironments(); profiles = cmrRepositoryDefinition.getConfigurationInterfaceService().getAllProfiles(); // remove common profiles as they can not be exported for (Iterator<Profile> it = profiles.iterator(); it.hasNext();) { if (it.next().isCommonProfile()) { it.remove(); } } } for (Object selected : structuredSelection.toArray()) { if (selected instanceof IProfileProvider) { selectedProfilesIds.add(((IProfileProvider) selected).getProfile().getId()); } } for (Object selected : structuredSelection.toArray()) { if (selected instanceof IEnvironmentProvider) { selectedEnvironmentsIds.add(((IEnvironmentProvider) selected).getEnvironment().getId()); } } }
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); } } }
for (Object selected : selection.toArray()) { if (selected instanceof InvocationSequenceData) { InvocationSequenceData invocation = (InvocationSequenceData) selected;
currentSelection = selection.toArray();
IProject project = null; for (Object obj : ((StructuredSelection) selection).toArray()) { IJavaElement element= null;
/** * 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(); }
for (Object selectedObject : selection.toArray()) { if (selectedObject instanceof AbstractClassSensorAssignment) { AbstractClassSensorAssignment<?> assignment = (AbstractClassSensorAssignment<?>) selectedObject;