X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2Fpreferences%2FPreferenceInitializer.java;h=526081ec66bcaccd49893e613273de3856c2fb45;hb=d9d830062a16b727c65d9bbd04f519235c5ece01;hp=28a845b26e58d0b4e7dc2f4d824c3672af7fab9f;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/preferences/PreferenceInitializer.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/preferences/PreferenceInitializer.java index 28a845b26..526081ec6 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/preferences/PreferenceInitializer.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/preferences/PreferenceInitializer.java @@ -1,43 +1,43 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.modeling.ui.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.core.runtime.preferences.DefaultScope; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.osgi.service.prefs.Preferences; -import org.simantics.modeling.ui.Activator; -import org.simantics.utils.page.PageDesc; - -public class PreferenceInitializer extends AbstractPreferenceInitializer { - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - @Override - public void initializeDefaultPreferences() { - IScopeContext context = DefaultScope.INSTANCE; - Preferences node = context.getNode(Activator.PLUGIN_ID); - - node.putDouble(DiagramPreferences.P_SNAP_GRID_SIZE, DiagramPreferences.DEFAULT_SNAP_GRID_SIZE); - node.put(DiagramPreferences.P_DEFAULT_PAGE_SIZE, PageDesc.serialize(DiagramPreferences.DEFAULT_PAGE_SIZE)); -// node.put(DiagramPreferences.P_DEFAULT_PAGE_ORIENTATION, DiagramPreferences.DEFAULT_PAGE_ORIENTATION.toString()); -// node.put(DiagramPreferences.P_DEFAULT_PAGE_MARGINS, PageDesc.serialize(DiagramPreferences.DEFAULT_PAGE_MARGINS)); - node.putBoolean(DiagramPreferences.P_DISPLAY_PAGE_SIZE, DiagramPreferences.DEFAULT_DISPLAY_PAGE_SIZE); - node.putBoolean(DiagramPreferences.P_DISPLAY_MARGINS, DiagramPreferences.DEFAULT_DISPLAY_MARGINS); - node.putBoolean(DiagramPreferences.P_DISPLAY_GRID, DiagramPreferences.DEFAULT_DISPLAY_GRID); - node.putBoolean(DiagramPreferences.P_DISPLAY_RULER, DiagramPreferences.DEFAULT_DISPLAY_RULER); - - node.put(ModelingPreferences.P_PROPERTY_PIN_MODE, ModelingPreferences.DEFAULT_PIN_MODE.name()); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.modeling.ui.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.core.runtime.preferences.DefaultScope; +import org.eclipse.core.runtime.preferences.IScopeContext; +import org.osgi.service.prefs.Preferences; +import org.simantics.modeling.ui.Activator; +import org.simantics.utils.page.PageDesc; + +public class PreferenceInitializer extends AbstractPreferenceInitializer { + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + @Override + public void initializeDefaultPreferences() { + IScopeContext context = DefaultScope.INSTANCE; + Preferences node = context.getNode(Activator.PLUGIN_ID); + + node.putDouble(DiagramPreferences.P_SNAP_GRID_SIZE, DiagramPreferences.DEFAULT_SNAP_GRID_SIZE); + node.put(DiagramPreferences.P_DEFAULT_PAGE_SIZE, PageDesc.serialize(DiagramPreferences.DEFAULT_PAGE_SIZE)); +// node.put(DiagramPreferences.P_DEFAULT_PAGE_ORIENTATION, DiagramPreferences.DEFAULT_PAGE_ORIENTATION.toString()); +// node.put(DiagramPreferences.P_DEFAULT_PAGE_MARGINS, PageDesc.serialize(DiagramPreferences.DEFAULT_PAGE_MARGINS)); + node.putBoolean(DiagramPreferences.P_DISPLAY_PAGE_SIZE, DiagramPreferences.DEFAULT_DISPLAY_PAGE_SIZE); + node.putBoolean(DiagramPreferences.P_DISPLAY_MARGINS, DiagramPreferences.DEFAULT_DISPLAY_MARGINS); + node.putBoolean(DiagramPreferences.P_DISPLAY_GRID, DiagramPreferences.DEFAULT_DISPLAY_GRID); + node.putBoolean(DiagramPreferences.P_DISPLAY_RULER, DiagramPreferences.DEFAULT_DISPLAY_RULER); + + node.put(ModelingPreferences.P_PROPERTY_PIN_MODE, ModelingPreferences.DEFAULT_PIN_MODE.name()); + } + +}