Search in sources :

Example 91 with ProjectScope

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();
}
Also used : ProjectScope(org.eclipse.core.resources.ProjectScope) IScopeContext(org.eclipse.core.runtime.preferences.IScopeContext) Preferences(org.osgi.service.prefs.Preferences)

Example 92 with ProjectScope

use of org.eclipse.core.resources.ProjectScope in project erlide_eclipse by erlang.

the class ProjectConfiguratorFactory method getConfig.

@Override
public IProjectConfigurator getConfig(final ProjectConfigType configType, final IErlProject project) {
    IProjectConfigurator result = null;
    switch(configType) {
        case INTERNAL:
            final String configName = configType.getConfigName();
            final IEclipsePreferences node = new ProjectScope(project.getWorkspaceProject()).getNode(configName);
            result = new PreferencesProjectConfigurator(node);
            break;
        case REBAR:
        case EMAKE:
            result = getConfig(configType, new File(project.getWorkspaceProject().getLocation().toPortableString()));
            break;
        default:
            break;
    }
    return result;
}
Also used : ProjectScope(org.eclipse.core.resources.ProjectScope) IEclipsePreferences(org.eclipse.core.runtime.preferences.IEclipsePreferences) File(java.io.File)

Aggregations

ProjectScope (org.eclipse.core.resources.ProjectScope)92 IScopeContext (org.eclipse.core.runtime.preferences.IScopeContext)42 InstanceScope (org.eclipse.core.runtime.preferences.InstanceScope)31 IProject (org.eclipse.core.resources.IProject)28 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)24 Preferences (org.osgi.service.prefs.Preferences)18 DefaultScope (org.eclipse.core.runtime.preferences.DefaultScope)17 BackingStoreException (org.osgi.service.prefs.BackingStoreException)17 ScopedPreferenceStore (org.eclipse.ui.preferences.ScopedPreferenceStore)11 IFile (org.eclipse.core.resources.IFile)9 IResource (org.eclipse.core.resources.IResource)9 CoreException (org.eclipse.core.runtime.CoreException)8 IAdaptable (org.eclipse.core.runtime.IAdaptable)5 IPath (org.eclipse.core.runtime.IPath)5 HashSet (java.util.HashSet)4 Set (java.util.Set)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)4 Path (org.eclipse.core.runtime.Path)4 Test (org.junit.Test)4 File (java.io.File)3