// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String AUTO_FORMAT_ON_SAVE =  "autoFormatOnSave"; //$NON-NLS-1$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String EDITOR_MATCHING_BRACKETS = "matchingBrackets"; //$NON-NLS-1l$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String EDITOR_MATCHING_BRACKETS_COLOR =  "matchingBracketsColor"; //$NON-NLS-1$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String EDITOR_TRAILING_NEWLINE = "trailingNewline"; //$NON-NLS-1$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/JsonCorePlugin.java
// public class JsonCorePlugin extends AbstractUIPlugin {
// 
//     /**
//      * The plug-in ID
//      */
// //    public static final String PLUGIN_ID = "com.boothen.jsonedit.core";
//     public static final String PLUGIN_ID = "jsonedit-core";
// 
//     private static final JsonColorProvider colorProvider = new JsonColorProvider();
// 
//     private static JsonCorePlugin plugin;
// 
//     @Override
//     public void start(BundleContext context) throws Exception {
//         super.start(context);
//         plugin = this;
//     }
// 
//     @Override
//     public void stop(BundleContext context) throws Exception {
//         super.stop(context);
//         colorProvider.purge();
//         plugin = null;
//     }
// 
//     /**
//      * Returns the shared instance
//      * @return the shared instance
//      */
//     public static JsonCorePlugin getDefault() {
//         return plugin;
//     }
// 
//     /**
//      * Returns an image descriptor for the image file at the given plug-in relative path
//      * @param path the path
//      * @return the image descriptor
//      */
//     public static ImageDescriptor getImageDescriptor(String path) {
//         return imageDescriptorFromPlugin(PLUGIN_ID, path);
//     }
// 
//     /**
//      * @return the color manager/provider
//      */
//     public static JsonColorProvider getColorProvider() {
//         return colorProvider;
//     }
// }


import static com.boothen.jsonedit.core.preferences.JsonPreferences.AUTO_FORMAT_ON_SAVE;
import static com.boothen.jsonedit.core.preferences.JsonPreferences.EDITOR_MATCHING_BRACKETS;
import static com.boothen.jsonedit.core.preferences.JsonPreferences.EDITOR_MATCHING_BRACKETS_COLOR;
import static com.boothen.jsonedit.core.preferences.JsonPreferences.EDITOR_TRAILING_NEWLINE;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.swt.graphics.RGB;
import com.boothen.jsonedit.core.JsonCorePlugin;
/*******************************************************************************
 * Copyright 2014 Boothen Technology Ltd.
 *
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://eclipse.org/org/documents/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package com.boothen.jsonedit.core.preferences;




/**
 *
 * @author Matt Garner
 *
 */
public class JsonPreferenceInitializer extends AbstractPreferenceInitializer {

    @Override
    public void initializeDefaultPreferences() {
//        IEclipsePreferences node = DefaultScope.INSTANCE.getNode(JsonPreferencesPlugin.PLUGIN_ID);
        IPreferenceStore node = JsonCorePlugin.getDefault().getPreferenceStore();

        node.setDefault(AUTO_FORMAT_ON_SAVE, false);
        node.setDefault(EDITOR_TRAILING_NEWLINE, true);
        node.setDefault(EDITOR_MATCHING_BRACKETS, true);
        node.setDefault(EDITOR_MATCHING_BRACKETS_COLOR, colorToString(0, 128, 0));

        // See com.boothen.jsonedit.preferences.format.JsonFormatter.Affix for valid values
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String AUTO_FORMAT_ON_SAVE =  "autoFormatOnSave"; //$NON-NLS-1$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String EDITOR_MATCHING_BRACKETS = "matchingBrackets"; //$NON-NLS-1l$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String EDITOR_MATCHING_BRACKETS_COLOR =  "matchingBracketsColor"; //$NON-NLS-1$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferences.java
// public static final String EDITOR_TRAILING_NEWLINE = "trailingNewline"; //$NON-NLS-1$
// 
// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/JsonCorePlugin.java
// public class JsonCorePlugin extends AbstractUIPlugin {
// 
//     /**
//      * The plug-in ID
//      */
// //    public static final String PLUGIN_ID = "com.boothen.jsonedit.core";
//     public static final String PLUGIN_ID = "jsonedit-core";
// 
//     private static final JsonColorProvider colorProvider = new JsonColorProvider();
// 
//     private static JsonCorePlugin plugin;
// 
//     @Override
//     public void start(BundleContext context) throws Exception {
//         super.start(context);
//         plugin = this;
//     }
// 
//     @Override
//     public void stop(BundleContext context) throws Exception {
//         super.stop(context);
//         colorProvider.purge();
//         plugin = null;
//     }
// 
//     /**
//      * Returns the shared instance
//      * @return the shared instance
//      */
//     public static JsonCorePlugin getDefault() {
//         return plugin;
//     }
// 
//     /**
//      * Returns an image descriptor for the image file at the given plug-in relative path
//      * @param path the path
//      * @return the image descriptor
//      */
//     public static ImageDescriptor getImageDescriptor(String path) {
//         return imageDescriptorFromPlugin(PLUGIN_ID, path);
//     }
// 
//     /**
//      * @return the color manager/provider
//      */
//     public static JsonColorProvider getColorProvider() {
//         return colorProvider;
//     }
// }


// Path: jsonedit-core/src/main/java/com/boothen/jsonedit/core/preferences/JsonPreferenceInitializer.java
import static com.boothen.jsonedit.core.preferences.JsonPreferences.AUTO_FORMAT_ON_SAVE;
import static com.boothen.jsonedit.core.preferences.JsonPreferences.EDITOR_MATCHING_BRACKETS;
import static com.boothen.jsonedit.core.preferences.JsonPreferences.EDITOR_MATCHING_BRACKETS_COLOR;
import static com.boothen.jsonedit.core.preferences.JsonPreferences.EDITOR_TRAILING_NEWLINE;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.swt.graphics.RGB;
import com.boothen.jsonedit.core.JsonCorePlugin;

/*******************************************************************************
 * Copyright 2014 Boothen Technology Ltd.
 *
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://eclipse.org/org/documents/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package com.boothen.jsonedit.core.preferences;




/**
 *
 * @author Matt Garner
 *
 */
public class JsonPreferenceInitializer extends AbstractPreferenceInitializer {

    @Override
    public void initializeDefaultPreferences() {
//        IEclipsePreferences node = DefaultScope.INSTANCE.getNode(JsonPreferencesPlugin.PLUGIN_ID);
        IPreferenceStore node = JsonCorePlugin.getDefault().getPreferenceStore();

        node.setDefault(AUTO_FORMAT_ON_SAVE, false);
        node.setDefault(EDITOR_TRAILING_NEWLINE, true);
        node.setDefault(EDITOR_MATCHING_BRACKETS, true);
        node.setDefault(EDITOR_MATCHING_BRACKETS_COLOR, colorToString(0, 128, 0));

        // See com.boothen.jsonedit.preferences.format.JsonFormatter.Affix for valid values
        node.setDefault("BEGIN_ARRAY.suffix", "NEWLINE");