use of org.eclipse.core.resources.ProjectScope in project erlide_eclipse by erlang.
the class InternalProjectConfigurationTest method outputPathShouldFollowPropertyChange.
@Test
public void outputPathShouldFollowPropertyChange() throws BackingStoreException {
final String expected = "hello/world";
final IProject wproject = project.getWorkspaceProject();
final IEclipsePreferences node = new ProjectScope(wproject).getNode("org.erlide.core");
node.put(ProjectPreferencesConstants.OUTPUT_DIR, expected);
node.flush();
final ErlangProjectProperties pp = project.getProperties();
final String actual = pp.getOutputDir().toPortableString();
assertThat(actual).isEqualTo(expected);
}
use of org.eclipse.core.resources.ProjectScope in project jbosstools-hibernate by jbosstools.
the class ContentAssistTest method testEnableHibernateNature.
@Test
public void testEnableHibernateNature() throws BackingStoreException, CoreException {
IJavaProject prj = hcth.getProject().getIJavaProject();
IScopeContext scope = new ProjectScope(prj.getProject());
Preferences node = scope.getNode(HibernatePropertiesConstants.HIBERNATE_CONSOLE_NODE);
node.putBoolean(HibernatePropertiesConstants.HIBERNATE3_ENABLED, true);
// $NON-NLS-1$
node.put(HibernatePropertiesConstants.DEFAULT_CONFIGURATION, "testcfg");
node.flush();
ProjectUtils.addProjectNature(prj.getProject(), HibernatePropertiesConstants.HIBERNATE_NATURE, new NullProgressMonitor());
ProjectUtils.removeProjectNature(prj.getProject(), HibernatePropertiesConstants.HIBERNATE_NATURE, new NullProgressMonitor());
}
use of org.eclipse.core.resources.ProjectScope in project jbosstools-hibernate by jbosstools.
the class HibernateNature method getDefaultConsoleConfigurationName.
public String getDefaultConsoleConfigurationName() {
IJavaProject prj = JavaCore.create(project);
IScopeContext scope = new ProjectScope(prj.getProject());
Preferences node = scope.getNode(HibernatePropertiesConstants.HIBERNATE_CONSOLE_NODE);
if (node != null) {
String cfg = node.get(HibernatePropertiesConstants.DEFAULT_CONFIGURATION, prj.getProject().getName());
return cfg;
} else {
return null;
}
}
use of org.eclipse.core.resources.ProjectScope in project jbosstools-hibernate by jbosstools.
the class SimpleTestProjectWithMapping method setDefaultConsoleConfiguration.
public void setDefaultConsoleConfiguration(String ccName) throws BackingStoreException, CoreException {
IScopeContext scope = new ProjectScope(getIProject());
Preferences node = scope.getNode(HibernatePropertiesConstants.HIBERNATE_CONSOLE_NODE);
node.putBoolean(HibernatePropertiesConstants.HIBERNATE3_ENABLED, true);
// $NON-NLS-1$
node.put(HibernatePropertiesConstants.DEFAULT_CONFIGURATION, ccName);
node.flush();
addHibernateNature();
}
use of org.eclipse.core.resources.ProjectScope in project xtext-xtend by eclipse.
the class LineSeparatorConversionTest method testSeparator.
private void testSeparator(String separator) throws Exception {
IProject project = workbenchTestHelper.getProject();
ScopedPreferenceStore projectPreferenceStore = new ScopedPreferenceStore(new ProjectScope(project), Platform.PI_RUNTIME);
projectPreferenceStore.setValue(Platform.PREF_LINE_SEPARATOR, separator);
workbenchTestHelper.createFile("Foo.xtend", "class Foo {}");
waitForBuild();
IFile compiledFile = project.getFile("xtend-gen/Foo.java");
workbenchTestHelper.getFiles().add(compiledFile);
String contents = WorkbenchTestHelper.getContentsAsString(compiledFile);
List<String> expectedLines = ImmutableList.of("@SuppressWarnings(\"all\")", "public class Foo {", "}", "");
String expectedContent = Joiner.on(separator).join(expectedLines);
assertEquals(expectedContent, contents);
}
Aggregations