use of org.eclipse.core.runtime.preferences.IScopeContext in project jbosstools-hibernate by jbosstools.
the class HibernatePropertyPage method saveNamigStrategyChanges.
protected boolean saveNamigStrategyChanges() {
if (initNamingStrategy == enableNamingStrategy.getSelection())
return true;
IScopeContext scope = new ProjectScope(getProject());
Preferences node = scope.getNode(HibernatePropertiesConstants.HIBERNATE_CONSOLE_NODE);
if (node != null) {
node.putBoolean(HibernatePropertiesConstants.NAMING_STRATEGY_ENABLED, enableNamingStrategy.getSelection());
try {
node.flush();
return true;
} catch (BackingStoreException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.ProjectUtils_could_not_save_changes_to_preferences, e);
}
}
return false;
}
use of org.eclipse.core.runtime.preferences.IScopeContext 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.runtime.preferences.IScopeContext in project erlide_eclipse by erlang.
the class ErlangOutlinePage method getPrefsNode.
public static IEclipsePreferences getPrefsNode() {
final String qualifier = ErlideUIPlugin.PLUGIN_ID;
final IScopeContext context = InstanceScope.INSTANCE;
final IEclipsePreferences eclipsePreferences = context.getNode(qualifier);
return eclipsePreferences;
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project erlide_eclipse by erlang.
the class ErlideUIPlugin method getPrefsNode.
public static IEclipsePreferences getPrefsNode() {
final String qualifier = ErlideUIPlugin.PLUGIN_ID;
final IScopeContext context = InstanceScope.INSTANCE;
final IEclipsePreferences eclipsePreferences = context.getNode(qualifier);
return eclipsePreferences;
}
use of org.eclipse.core.runtime.preferences.IScopeContext in project erlide_eclipse by erlang.
the class PreferencesHelperTest method nextContexts_2.
@Test
public void nextContexts_2() {
final IScopeContext[] list = PreferencesHelperTest.ALL_SCOPE_CONTEXTS;
final IScopeContext item = DefaultScope.INSTANCE;
final IScopeContext[] val = PreferencesHelper.getNextContexts(list, item);
Assert.assertNotNull(val);
Assert.assertEquals(0, val.length);
}
Aggregations