Package com.eclipsesource.jshint.ui.internal.preferences

Source Code of com.eclipsesource.jshint.ui.internal.preferences.PreferencesFactory

/*******************************************************************************
* Copyright (c) 2012 EclipseSource.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*    Ralf Sternberg - initial implementation and API
******************************************************************************/
package com.eclipsesource.jshint.ui.internal.preferences;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.service.prefs.Preferences;

import com.eclipsesource.jshint.ui.internal.Activator;


public class PreferencesFactory {

  public static Preferences getProjectPreferences( IProject project ) {
    return new ProjectScope( project ).getNode( Activator.PLUGIN_ID );
  }

  @SuppressWarnings( "deprecation" )
  public static Preferences getWorkspacePreferences() {
    // InstanceScope.INSTANCE does not yet exist in Eclipse 3.6
    return new InstanceScope().getNode( Activator.PLUGIN_ID );
  }

}
TOP

Related Classes of com.eclipsesource.jshint.ui.internal.preferences.PreferencesFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.