private void toggleAutobuild(final boolean enable) { if (isWorkbenchRunning()) { final IWorkspaceDescription workspaceDescription = getWorkspace().getDescription(); if (null != workspaceDescription) { if (workspaceDescription.isAutoBuilding() != enable) { workspaceDescription.setAutoBuilding(enable); try { getWorkspace().setDescription(workspaceDescription); } catch (final CoreException e) { throw new IllegalStateException("Error while trying to turn workspace autobuild " + (enable ? "on" : "off") + ".", e); } } } } }
/** {@inheritDoc} */ @Override public boolean setAutobuild(final boolean autoBuildStatus) { synchronized (autoBuildMutex) { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); boolean oldAutoBuildStatus = description.isAutoBuilding(); if (oldAutoBuildStatus != autoBuildStatus) { description.setAutoBuilding(autoBuildStatus); try { workspace.setDescription(description); } catch (CoreException e) { throw new WrappedException("Failed to set workspace description", e); } } return oldAutoBuildStatus; } }
/** * Sets the value of the workspace auto-build to the module auto-build */ private void setAutoBuilding() { boolean autoBuildModule = getPreferenceStore().getBoolean(IPreferenceConstants.I_PARSE_MODULE_ON_MODIFY); // set the workspace auto-build flag IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription(); if (autoBuildModule != ResourcesPlugin.getWorkspace().isAutoBuilding()) { try { description.setAutoBuilding(autoBuildModule); ResourcesPlugin.getWorkspace().setDescription(description); } catch (CoreException e) { // TODO e.printStackTrace(); } } }
@Override public void setUpSuite() throws Exception { // ensure auto-building is turned off IWorkspaceDescription descr = getWorkspace().getDescription(); if (descr.isAutoBuilding()) { descr.setAutoBuilding(false); getWorkspace().setDescription(descr); } try { if (testProjects != null) { for (String curPrj : testProjects) { setUpJavaProject(curPrj); } } } catch (NullPointerException ex) { throw new IllegalStateException("Test project has not been set properly!"); } super.setUpSuite(); }
private static void toggleAutobuild(final boolean enabled) { final IWorkspace workspace = getWorkspace(); final IWorkspaceDescription description = workspace.getDescription(); description.setAutoBuilding(enabled); try { LOGGER.info("Turning auto-build " + (enabled ? "on" : "off") + "..."); workspace.setDescription(description); LOGGER.info("Auto-build was successfully turned " + (enabled ? "on" : "off") + "."); } catch (final CoreException e) { throw new RuntimeException("Error while toggling auto-build", e); } }
/** Sets workspace auto-build according to the provided flag. Thrown exceptions are handled by logging. */ private static void setAutobuild(boolean on) { try { final IWorkspace workspace = getWorkspace(); final IWorkspaceDescription description = workspace.getDescription(); description.setAutoBuilding(on); workspace.setDescription(description); } catch (CoreException e) { LOGGER.debug("Organize imports cannot set auto build to " + on + "."); } }
/** * @param value */ public static void setAutoBuilding(boolean value) { IWorkspace workspace = ResourcesPlugin.getWorkspace(); if (workspace.isAutoBuilding() == value) return; IWorkspaceDescription desc = workspace.getDescription(); desc.setAutoBuilding(value); try { workspace.setDescription(desc); } catch (CoreException e) { ResourceManager.logException(e); } }
/** * @return */ public static boolean isAutoBuilding() { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription desc = workspace.getDescription(); return desc.isAutoBuilding(); }
private void configWorkspace(IWorkspace workspace) { IWorkspaceDescription workspaceDesc = workspace.getDescription(); workspaceDesc.setAutoBuilding(false); // we do not want the workspace to rebuild the project every time a new resource is added try { workspace.setDescription(workspaceDesc); } catch (CoreException exc) { Activator.log(IStatus.ERROR, "Error trying to set workspace description: " + exc.getMessage()); } }
/** * Turns off the automatic build feature of the workbench if it is currently switched on and * returns {@code true} when this was the case. * * @return whether autobuild was on * @throws CoreException * if the feature could not be set */ public static boolean turnOffAutoBuildIfOn() throws CoreException { final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IWorkspaceDescription description = workspace.getDescription(); if (description.isAutoBuilding()) { description.setAutoBuilding(false); workspace.setDescription(description); return true; } else { return false; } }
/** * Turns on the automatic build feature of the workbench. * * @throws CoreException * if the feature could not be set */ public static void turnOnAutoBuild() throws CoreException { final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IWorkspaceDescription description = workspace.getDescription(); if (!description.isAutoBuilding()) { description.setAutoBuilding(true); workspace.setDescription(description); } }
private void disableAutoBuild() throws CoreException { IWorkspaceDescription desc = workspace.getDescription(); if (desc.isAutoBuilding()) { isAutoBuildActivated = true; desc.setAutoBuilding(false); workspace.setDescription(desc); } }
private void restoreAutoBuild() throws CoreException { if (isAutoBuildActivated) { IWorkspaceDescription desc = workspace.getDescription(); desc.setAutoBuilding(true); workspace.setDescription(desc); } }
public boolean setAutoBuilding(boolean enable) throws CoreException { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); boolean changed = description.isAutoBuilding() != enable; if (changed) { description.setAutoBuilding(enable); workspace.setDescription(description); } return changed; }
public static void setAutoBuilding(boolean enabled) throws CoreException { IWorkspaceDescription wsd = getWorkspace().getDescription(); if (!wsd.isAutoBuilding() == enabled) { wsd.setAutoBuilding(enabled); getWorkspace().setDescription(wsd); } }
/** * Enables or disables automatic building of projects. */ public static void setAutoBuilding(boolean enable) throws CoreException { IWorkspaceDescription desc = ResourcesPlugin.getWorkspace().getDescription(); if (desc.isAutoBuilding() != enable) { desc.setAutoBuilding(enable); ResourcesPlugin.getWorkspace().setDescription(desc); } }
@SuppressWarnings("deprecation") @Before public void setUp() throws Exception { workspace = ResourcesPlugin.getWorkspace(); // Turn off auto building IWorkspaceDescription description = workspace.getDescription(); description.setAutoBuilding(false); workspace.setDescription(description); // Turn off index updating IEclipsePreferences store = new DefaultScope().getNode(IMavenConstants.PLUGIN_ID); store.putBoolean(MavenPreferenceConstants.P_UPDATE_INDEXES, false); mavenConfiguration = MavenPlugin.getMavenConfiguration(); if (settingsFile != null) { oldUserSettingsFile = mavenConfiguration.getUserSettingsFile(); File settings = new File(settingsFile).getCanonicalFile(); if (settings.canRead()) { String userSettingsFile = settings.getAbsolutePath(); System.out.println("Setting user settings file: " + userSettingsFile); mavenConfiguration.setUserSettingsFile(userSettingsFile); } else { fail("User settings file cannot be read: " + settings); } } cleanWorkspace(); waitForJobs(); }
/** * Sets whether building automatically is enabled in the workspace or not and returns the old * value. * * @param state <code>true</code> if automatically building is enabled, <code>false</code> * otherwise * @return the old state * @throws CoreException thrown if the operation failed */ public static boolean setAutoBuilding(boolean state) throws CoreException { IWorkspace workspace= ResourcesPlugin.getWorkspace(); IWorkspaceDescription desc= workspace.getDescription(); boolean isAutoBuilding= desc.isAutoBuilding(); if (isAutoBuilding != state) { desc.setAutoBuilding(state); workspace.setDescription(desc); } return isAutoBuilding; }
public static void enableAutobuild(boolean enable) throws CoreException { // disable auto build IWorkspace workspace= CTestPlugin.getWorkspace(); IWorkspaceDescription desc= workspace.getDescription(); desc.setAutoBuilding(enable); workspace.setDescription(desc); }
protected void switchAutoBuild(boolean bool) { IWorkspace ws = ResourcesPlugin.getWorkspace(); IWorkspaceDescription desc = ws.getDescription(); desc.setAutoBuilding(bool); try { ws.setDescription(desc); } catch (CoreException e) { System.err.println("Unable to disable auto building: " + e.getMessage()); e.printStackTrace(); } }
public void switchAutoBuild(boolean bool) throws IdeTestException { IWorkspace ws = ResourcesPlugin.getWorkspace(); IWorkspaceDescription desc = ws.getDescription(); desc.setAutoBuilding(bool); try { ws.setDescription(desc); } catch (CoreException e) { IdeTestException.wrapAndThrowException("Unable to disable auto building: " + e); } logger.debug((bool ? "Enabled" : "Disabled") + " autobuild"); }
@Override public void run(final IAction action) { if (selection == null || selection.isEmpty()) { return; } IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); if (!description.isAutoBuilding() && getClass().equals(FindBugsAction.class)) { boolean confirm = MessageDialog.openConfirm(null, "Project -> 'Build Automatically' disabled", "You are going to run FindBugs analysis on a not compiled or partially compiled project.\n\n" + "To get reliable analysis results, you should make sure that project is compiled first.\n\n" + "Continue with FindBugs analysis?"); if (!confirm) { return; } } if (selection instanceof IStructuredSelection) { IStructuredSelection sSelection = (IStructuredSelection) selection; dialogAlreadyShown = false; Map<IProject, List<WorkItem>> projectMap = ResourceUtils.getResourcesPerProject(sSelection); for (Map.Entry<IProject, List<WorkItem>> e : projectMap.entrySet()) { work(targetPart, e.getKey(), e.getValue()); } targetPart = null; selection = null; } }
protected static void disableAutoBuild() { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription desc= workspace.getDescription(); desc.setAutoBuilding(false); try { workspace.setDescription(desc); } catch (CoreException e) { throw melnorme.utilbox.core.ExceptionAdapter.unchecked(e); } }
@BeforeClass public static void init() throws CoreException { //TODO MMINT[TESTS] Run it just once //TODO MMINT[TESTS] Warm-up z3 IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); description.setAutoBuilding(false); workspace.setDescription(description); MMINT.setPreference(MMINTConstants.PREFERENCE_TESTS_ENABLED, "true"); }
public void setUpSuite() throws Exception { super.setUpSuite(); // ensure autobuilding is turned off IWorkspaceDescription description = getWorkspace().getDescription(); if (description.isAutoBuilding()) { description.setAutoBuilding(false); getWorkspace().setDescription(description); } }
public static void setWorkspaceAutoBuild(boolean flag) throws CoreException { IWorkspace workspace = getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); description.setAutoBuilding(flag); workspace.setDescription(description); }
public static boolean isWorkspaceAutoBuildEnabled() throws CoreException { IWorkspace workspace = getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); return description.isAutoBuilding(); }
@Override public IWorkspaceDescription getDescription() { WorkspaceDescription workingCopy = defaultWorkspaceDescription(); // description.copyTo(workingCopy); return workingCopy; }
@Override public void setDescription(IWorkspaceDescription iWorkspaceDescription) throws CoreException { throw new UnsupportedOperationException(); }
protected final void turnOffAutoBuild(IWorkspace workspace) throws CoreException { IWorkspaceDescription workspaceDesc = workspace.getDescription(); savedAutoBuildingValue = workspaceDesc.isAutoBuilding(); workspaceDesc.setAutoBuilding(false); workspace.setDescription(workspaceDesc); }