public void configureProject(String wizardCmdArgs) throws CoreException { pm.beginTask(SConsI18N.SConsProjectConfigureHandler_ConvertingInProgress, 10); try { configureCDTProject(); pm.worked(1); saveProjectSettings(wizardCmdArgs); pm.worked(1); extractProjectInformation(); pm.worked(7); removeMakeBuilder(); addSConsNature(); } catch (Exception e) { SConsPlugin.log(e); IStatus status = new Status( IStatus.ERROR, SConsPlugin.PLUGIN_ID, 0, SConsI18N.SConsProjectConfigureHandler_ConfiguringFailedErrorMessage, e); throw new CoreException(status); } finally { pm.done(); } }
private void saveProjectSettings(String wizardCmdOptions) { String workspaceOptions = SConsPlugin.getWorkspacePreferenceStore() .getString(PreferenceConstants.ADDITIONAL_COMMANDLINE_OPTIONS); if (wizardCmdOptions == null || workspaceOptions.equals(wizardCmdOptions)) return; // user has chosen his own SCons options and decided to take these // instead of workspace settings; therefore we store them in the // newly created project IPersistentPreferenceStore projectOptions = SConsPlugin.getProjectPreferenceStore(project); projectOptions.setValue(PreferenceConstants.ADDITIONAL_COMMANDLINE_OPTIONS, wizardCmdOptions); projectOptions.setValue( PreferenceConstants.BUILD_SETTINGS_PAGE_ID + PreferenceConstants.USE_PARENT_SUFFIX, false); try { projectOptions.save(); } catch (Exception e) { // ignore because user then already has SCons settings } }
public void deconfigureProject() throws CoreException { try { removeSConsNature(); removeManagedBuildNatures(); } catch (Exception e) { SConsPlugin.log(e); IStatus status = new Status( IStatus.ERROR, SConsPlugin.PLUGIN_ID, 0, SConsI18N.SConsProjectConfigureHandler_DeconfiguringFailedErrorMessage, e); throw new CoreException(status); } }
@Override protected IStatus run(IProgressMonitor pm) { pm.beginTask(DependencyVisualization18N.DepTreeVizView_SearchingDependenciesInProgress, 3); try { String asciiTree = collectDependencies(targetInfos); if (pm.isCanceled()) return Status.CANCEL_STATUS; pm.worked(1); Collection<DependencyTreeNode> tree = analyze(asciiTree); pm.worked(1); callback.apply(tree); } catch (Exception e) { SConsPlugin.showExceptionInDisplayThread(e); } finally { pm.done(); } return Status.OK_STATUS; }