/* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#performFinish() */ @Override public boolean performFinish() { for (IServiceConfiguration config : mainPage.getServiceConfigurations()) { fModelManager.addConfiguration(config); } return true; }
public void run(IAction action) { ElementSelectionDialog dialog = new ElementSelectionDialog(getShell()); configureDialog(dialog); int result = dialog.open(); if (result != IDialogConstants.OK_ID) return; ITypeInfo info = (ITypeInfo) dialog.getFirstResult(); if (info == null) return; ICElement[] elements = null; ITypeReference location = info.getResolvedReference(); if (location != null) { elements = location.getCElements(); } if (elements == null || elements.length == 0) { String title = Messages.OpenTypeInHierarchyAction_errorTitle; String message = NLS.bind( Messages.OpenTypeInHierarchyAction_errorNoDefinition, info.getQualifiedTypeName().toString()); MessageDialog.openError(getShell(), title, message); } else { IProject project = elements[0].getCProject().getProject(); IServiceModelManager smm = ServiceModelManager.getInstance(); IServiceConfiguration serviceConfig = smm.getActiveConfiguration(project); IService indexingService = smm.getService(IRDTServiceConstants.SERVICE_C_INDEX); IServiceProvider serviceProvider = serviceConfig.getServiceProvider(indexingService); if (serviceProvider instanceof IIndexServiceProvider) { ITypeHierarchyService service = ((IIndexServiceProvider) serviceProvider).getTypeHierarchyService(); TypeHierarchyUtil.open(service, elements[0], fWorkbenchWindow); } } }