public DialogPackageExplorer() { fActionGroup= null; fCurrJProject= null; fCurrentSelection= new StructuredSelection(); }
private boolean doOpen(ISelection selection) { if (!(selection instanceof StructuredSelection)) return false; StructuredSelection structuredSelection= (StructuredSelection) selection; if (structuredSelection.isEmpty()) return false; return open(structuredSelection.getFirstElement()); }
public void selectionChanged(SelectionChangedEvent event) { StructuredSelection selection = (StructuredSelection) DriverPreferences.this.mTreeViewer .getSelection(); if (selection != null && selection.size() > 0 && selection.getFirstElement() != null) updateButtons (selection.getFirstElement()); else updateButtons ( null ); }
IViewPart [] parts = MyPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getViews(); IProject activeProject = null; for(int i=0;i<parts.length;i++) { if(parts[i] instanceof ResourceNavigator) { ResourceNavigator navigator = (ResourceNavigator)parts[i]; StructuredSelection sel = (StructuredSelection)navigator.getTreeViewer().getSelection(); IResource resource = (IResource)sel.getFirstElement(); activeProject = resource.getProject(); break; } } String activeProjectName = activeProject .getName();
@Override protected void updateButtonsEnableState(IStatus status) { super.updateButtonsEnableState(status); if (showInButton != null && !showInButton.isDisposed() && openWithButton != null && !openWithButton.isDisposed()) { openWithButton.setEnabled(!status.matches(IStatus.ERROR) && getSelectedItems().size() == 1); showInButton.setEnabled(!status.matches(IStatus.ERROR) && getSelectedItems().size() > 0); } }
/** * {@inheritDoc} */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; StructuredSelection structuredSelection = (StructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof ICmrRepositoryProvider) { cmrRepositoryDefinition = ((ICmrRepositoryProvider) structuredSelection.getFirstElement()).getCmrRepositoryDefinition(); } }
private static ISelection createCompatibilitySelection(Object selection) { if (selection instanceof ISelection) { return (ISelection) selection; } return selection == null ? StructuredSelection.EMPTY : new StructuredSelection( selection); }
/** * {@inheritDoc} */ protected void okPressed() { StructuredSelection selection = ( StructuredSelection ) extendedOperationsTableViewer.getSelection(); if ( !selection.isEmpty() ) { selectedExtendedOperation = ( ExtendedOperationEnum ) selection.getFirstElement(); } super.okPressed(); }
/** * {@inheritDoc} */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { StructuredSelection structuredSelection = (StructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof ICmrRepositoryProvider) { cmrRepositoryDefinition = ((ICmrRepositoryProvider) structuredSelection.getFirstElement()).getCmrRepositoryDefinition(); } }
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { List<IJavaElement> result= addExternalJars(selected, javaProject, monitor); if (result.size() > 0) selectAndReveal(new StructuredSelection(result)); } catch (CoreException e) { throw new InvocationTargetException(e); } } };
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection(); if ( !selection.isEmpty() ) { String saslRealm = ( String ) selection.getFirstElement(); saslRealms.remove( saslRealm ); saslRealmsTableViewer.refresh(); setEditorDirty(); } } } );
/** * {@inheritDoc} */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { StructuredSelection structuredSelection = (StructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof ICmrRepositoryProvider) { cmrRepositoryDefinition = ((ICmrRepositoryProvider) structuredSelection.getFirstElement()).getCmrRepositoryDefinition(); } }
/** * Perform organize import on multiple compilation units. No editors are opened. * @param cus The compilation units to run on */ public void runOnMultiple(final ICompilationUnit[] cus) { if (cus.length == 0) return; fCleanUpDelegate.run(new StructuredSelection(cus)); }
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection(); if ( !selection.isEmpty() ) { String saslRealm = ( String ) selection.getFirstElement(); saslRealms.remove( saslRealm ); saslRealmsTableViewer.refresh(); setEditorDirty(); } } } );
/** * {@inheritDoc} */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; StructuredSelection structuredSelection = (StructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof ICmrRepositoryProvider) { cmrRepositoryDefinition = ((ICmrRepositoryProvider) structuredSelection.getFirstElement()).getCmrRepositoryDefinition(); } }
@Override public ISelection getSelection() { return new StructuredSelection(getEditorInput()); } @Override
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) binaryAttributesTableViewer.getSelection(); if ( !selection.isEmpty() ) { String attribute = ( String ) selection.getFirstElement(); binaryAttributes.remove( attribute ); binaryAttributesTableViewer.refresh(); setEditorDirty(); } } };
/** * {@inheritDoc} */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; StructuredSelection structuredSelection = (StructuredSelection) selection; if (structuredSelection.getFirstElement() instanceof ICmrRepositoryProvider) { cmrRepositoryDefinition = ((ICmrRepositoryProvider) structuredSelection.getFirstElement()).getCmrRepositoryDefinition(); } }
@Override public boolean setFormInput(Object object) { if (object instanceof IPluginExtensionPoint) { pointTable.setSelection(new StructuredSelection(object), true); return true; } return false; }
/** * {@inheritDoc} */ protected void okPressed() { StructuredSelection selection = ( StructuredSelection ) extendedOperationsTableViewer.getSelection(); if ( !selection.isEmpty() ) { selectedExtendedOperation = ( ExtendedOperationEnum ) selection.getFirstElement(); } super.okPressed(); }