use of org.eclipse.core.resources.IWorkspaceDescription in project eclipse.platform.text by eclipse.
the class SearchPlugin method setAutoBuilding.
static boolean setAutoBuilding(boolean state) {
IWorkspaceDescription workspaceDesc = getWorkspace().getDescription();
boolean isAutobuilding = workspaceDesc.isAutoBuilding();
if (isAutobuilding != state) {
workspaceDesc.setAutoBuilding(state);
try {
getWorkspace().setDescription(workspaceDesc);
} catch (CoreException ex) {
ExceptionHandler.handle(ex, SearchMessages.Search_Error_setDescription_title, SearchMessages.Search_Error_setDescription_message);
}
}
return isAutobuilding;
}
use of org.eclipse.core.resources.IWorkspaceDescription in project xtext-xtend by eclipse.
the class BuildAffectionTest method tearDownProject.
@AfterClass
public static void tearDownProject() throws Exception {
IResourcesSetupUtil.cleanWorkspace();
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IWorkspaceDescription description = workspace.getDescription();
description.setAutoBuilding(BuildAffectionTest.wasAutoBuilding);
workspace.setDescription(description);
}
use of org.eclipse.core.resources.IWorkspaceDescription in project xtext-xtend by eclipse.
the class BuildAffectionTest method setUpProject.
@BeforeClass
public static void setUpProject() throws Exception {
TargetPlatformUtil.setTargetPlatform(BuildAffectionTest.class);
IResourcesSetupUtil.cleanWorkspace();
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IWorkspaceDescription description = workspace.getDescription();
BuildAffectionTest.wasAutoBuilding = description.isAutoBuilding();
description.setAutoBuilding(false);
workspace.setDescription(description);
WorkbenchTestHelper.createPluginProject(WorkbenchTestHelper.TESTPROJECT_NAME);
}
use of org.eclipse.core.resources.IWorkspaceDescription in project linuxtools by eclipse.
the class AbstractTest method createProject.
protected ICProject createProject(Bundle bundle, String projname) throws CoreException, URISyntaxException, IOException, InvocationTargetException, InterruptedException {
// Turn off auto-building
IWorkspace wsp = ResourcesPlugin.getWorkspace();
IWorkspaceDescription desc = wsp.getDescription();
desc.setAutoBuilding(false);
wsp.setDescription(desc);
ICProject proj = CProjectHelper.createCProject(projname, BIN_DIR);
URL location = FileLocator.find(bundle, new Path("resources/" + projname), // $NON-NLS-1$
null);
File testDir = new File(FileLocator.toFileURL(location).toURI());
IProject project = proj.getProject();
// Add these natures before project is imported due to #273079
ManagedCProjectNature.addManagedNature(project, null);
ScannerConfigNature.addScannerConfigNature(project);
ImportOperation op = new ImportOperation(project.getFullPath(), testDir, FileSystemStructureProvider.INSTANCE, pathString -> IOverwriteQuery.ALL);
op.setCreateContainerStructure(false);
op.run(null);
IStatus status = op.getStatus();
if (!status.isOK()) {
throw new CoreException(status);
}
// Index the project
IIndexManager indexManager = CCorePlugin.getIndexManager();
indexManager.reindex(proj);
indexManager.joinIndexer(IIndexManager.FOREVER, new NullProgressMonitor());
// These natures must be enabled at this point to continue
assertTrue(project.isNatureEnabled(ScannerConfigNature.NATURE_ID));
assertTrue(project.isNatureEnabled(ManagedCProjectNature.MNG_NATURE_ID));
return proj;
}
use of org.eclipse.core.resources.IWorkspaceDescription in project linuxtools by eclipse.
the class PreferencesTest method setUpWorkbench.
@BeforeClass
public static void setUpWorkbench() throws Exception {
// Set up is based from from GcovTest{c,CPP}.
SWTWorkbenchBot bot = new SWTWorkbenchBot();
try {
// $NON-NLS-1$
bot.viewByTitle("Welcome").close();
// hide Subclipse Usage stats popup if present/installed
// $NON-NLS-1$
bot.shell("Subclipse Usage").activate();
// $NON-NLS-1$
bot.button("Cancel").click();
} catch (WidgetNotFoundException e) {
// ignore
}
// Set C/C++ perspective.
// $NON-NLS-1$
bot.perspectiveByLabel("C/C++").activate();
bot.sleep(500);
for (SWTBotShell sh : bot.shells()) {
if (sh.getText().startsWith("C/C++")) {
// $NON-NLS-1$
sh.activate();
bot.sleep(500);
break;
}
}
// Turn off automatic building by default to avoid timing issues
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription desc = workspace.getDescription();
boolean isAutoBuilding = desc.isAutoBuilding();
if (isAutoBuilding) {
desc.setAutoBuilding(false);
workspace.setDescription(desc);
}
}
Aggregations