sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1766996 - in /sling/trunk/tooling/ide/eclipse-m2e-ui: ./ META-INF/ src/org/apache/sling/ide/eclipse/m2e/internal/ src/org/apache/sling/ide/eclipse/m2e/internal/preferences/
Date Fri, 28 Oct 2016 10:25:16 GMT
Author: kwin
Date: Fri Oct 28 10:25:16 2016
New Revision: 1766996

URL: http://svn.apache.org/viewvc?rev=1766996&view=rev
Log:
SLING-6175 allow to disable maven project configurators and more specifically adding wtp facets/natures
for content-packages through workspace preferences

Added:
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/SlingIdePreferencePage.java
  (with props)
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/Preferences.java
  (with props)
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/PreferencesInitializer.java
  (with props)
Modified:
    sling/trunk/tooling/ide/eclipse-m2e-ui/META-INF/MANIFEST.MF
    sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractBundleProjectConfigurator.java
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractProjectConfigurator.java
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/Activator.java
    sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/ContentPackageProjectConfigurator.java

Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/META-INF/MANIFEST.MF?rev=1766996&r1=1766995&r2=1766996&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/META-INF/MANIFEST.MF (original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/META-INF/MANIFEST.MF Fri Oct 28 10:25:16 2016
@@ -27,16 +27,20 @@ Import-Package: org.apache.commons.httpc
  org.apache.sling.ide.log,
  org.apache.sling.ide.osgi,
  org.apache.sling.ide.transport,
+ org.eclipse.core.commands.common,
  org.eclipse.core.resources,
  org.eclipse.core.runtime;version="3.4.0",
  org.eclipse.core.runtime.jobs,
+ org.eclipse.core.runtime.preferences;version="3.3.0",
  org.eclipse.debug.core,
  org.eclipse.debug.core.model,
  org.eclipse.debug.internal.ui,
  org.eclipse.jface.dialogs,
  org.eclipse.jface.layout,
  org.eclipse.jface.operation,
+ org.eclipse.jface.preference,
  org.eclipse.jface.resource,
+ org.eclipse.jface.util,
  org.eclipse.jface.viewers,
  org.eclipse.jface.wizard,
  org.eclipse.jst.common.project.facet.core,
@@ -52,6 +56,7 @@ Import-Package: org.apache.commons.httpc
  org.eclipse.ui.actions,
  org.eclipse.ui.browser,
  org.eclipse.ui.plugin,
+ org.eclipse.ui.preferences,
  org.eclipse.ui.progress,
  org.eclipse.wst.common.frameworks.datamodel,
  org.eclipse.wst.common.project.facet.core,

Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml?rev=1766996&r1=1766995&r2=1766996&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml (original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml Fri Oct 28 10:25:16 2016
@@ -106,5 +106,22 @@
 	<extension point="org.eclipse.m2e.core.archetypeCatalogs">
 		<remote url="http://repo1.maven.org/maven2/"
 			description="Maven Central"/>
-	</extension>    
+	</extension>
+	
+	<extension point="org.eclipse.ui.keywords">
+      <keyword id="org.apache.sling.ide.eclipse.m2e" label="%keyword.label"/>
+    </extension>
+    
+    <extension point="org.eclipse.core.runtime.preferences">
+      <initializer class="org.apache.sling.ide.eclipse.m2e.internal.preferences.PreferencesInitializer">
+      </initializer>
+    </extension>
+   
+    <extension point="org.eclipse.ui.preferencePages">
+      <page id="org.apache.sling.ide.eclipse.m2e.SlingIdePreferencePage"
+            class="org.apache.sling.ide.eclipse.m2e.internal.SlingIdePreferencePage"
+            name="Sling IDE">
+         <keywordReference id="org.apache.sling.ide.eclipse.m2e"/>
+      </page>
+    </extension>
 </plugin>

Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractBundleProjectConfigurator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractBundleProjectConfigurator.java?rev=1766996&r1=1766995&r2=1766996&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractBundleProjectConfigurator.java
(original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractBundleProjectConfigurator.java
Fri Oct 28 10:25:16 2016
@@ -45,23 +45,27 @@ public abstract class AbstractBundleProj
         
         // at this point the JDT project is already created by the tycho plugin
         // we just need to setup the appropriate facets
-        Logger logger = Activator.getDefault().getPluginLogger();
         IProject project = configRequest.getProject();
-        logger.trace("AbstractBundleProjectConfigurator called for POM {0} and project {1}",
+        trace("AbstractBundleProjectConfigurator called for POM {0} and project {1}",
                 configRequest.getPom().getFullPath(),
                 project.getName());
         // delete all previous markers on this pom.xml set by any project configurator
         deleteMarkers(configRequest.getPom());
+        
+        if (!getPreferences().isBundleProjectConfiguratorEnabled()) {
+            trace("m2e project configurator for bundles was disabled through preference.");
+            return;
+        }
 
         // check for maven-sling-plugin as well (to make sure this is a Sling project)
         MavenProject mavenProject = configRequest.getMavenProject();
         if (mavenProject.getPlugin(MAVEN_SLING_PLUGIN_KEY) != null) {
-            logger.trace("Found maven-sling-plugin in build plugins for project {0}, therefore
adding sling bundle facets!", project.getName());
+            trace("Found maven-sling-plugin in build plugins for project {0}, therefore adding
sling bundle facets!", project.getName());
             ConfigurationHelper.convertToBundleProject(project);
         } else {
-            logger.trace("Couldn't find maven-sling-plugin in build plugins for project {0},
therefore not adding the sling bundle facets!", project.getName());
+            trace("Couldn't find maven-sling-plugin in build plugins for project {0}, therefore
not adding the sling bundle facets!", project.getName());
         }
-        if (!isSupportingM2eIncrementalBuild(mavenProject, logger)) {
+        if (!isSupportingM2eIncrementalBuild(mavenProject, getLogger())) {
             markerManager.addMarker(configRequest.getPom(), MARKER_TYPE_BUNDLE_NOT_SUPPORTING_M2E,
"Missing m2e incremental support for generating the bundle manifest and service definitions",
-1,
                     IMarker.SEVERITY_ERROR);
         }

Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractProjectConfigurator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractProjectConfigurator.java?rev=1766996&r1=1766995&r2=1766996&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractProjectConfigurator.java
(original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/AbstractProjectConfigurator.java
Fri Oct 28 10:25:16 2016
@@ -16,6 +16,8 @@
  */
 package org.apache.sling.ide.eclipse.m2e.internal;
 
+import org.apache.sling.ide.eclipse.m2e.internal.preferences.Preferences;
+import org.apache.sling.ide.log.Logger;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
@@ -24,6 +26,31 @@ public abstract class AbstractProjectCon
 
     private static final String MARKER_TYPE_PROJECT_CONFIGURATOR = "org.apache.sling.ide.eclipse-m2e-ui.projectconfiguratorproblem";
 
+    private final Preferences preferences;
+
+    protected AbstractProjectConfigurator() {
+        preferences = new Preferences();
+    }
+
+    /**
+     * 
+     * @return the preferences bound to this plugin
+     */
+    protected Preferences getPreferences() {
+        return preferences;
+    }
+
+    protected static Logger getLogger() {
+        return Activator.getDefault().getPluginLogger();
+    }
+
+    /**
+     * @see Logger#trace(String, Object...)
+     */
+    protected static void trace(String format, Object... arguments) {
+        getLogger().trace(format, arguments);
+    }
+
     /**
      * Adds a marker with the default type to the given resource.
      * 
@@ -36,7 +63,7 @@ public abstract class AbstractProjectCon
      *            {@link IMarker#SEVERITY_INFO}
      */
     @SuppressWarnings("restriction")
-    public void addMarker(IResource resource, String message, int severity) {
+    protected void addMarker(IResource resource, String message, int severity) {
         markerManager.addMarker(resource, MARKER_TYPE_PROJECT_CONFIGURATOR, message, -1,
severity);
     }
 
@@ -48,7 +75,7 @@ public abstract class AbstractProjectCon
      * @throws CoreException
      */
     @SuppressWarnings("restriction")
-    public void deleteMarkers(IResource resource) throws CoreException {
+    protected void deleteMarkers(IResource resource) throws CoreException {
         markerManager.deleteMarkers(resource, true, MARKER_TYPE_PROJECT_CONFIGURATOR);
     }
 

Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/Activator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/Activator.java?rev=1766996&r1=1766995&r2=1766996&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/Activator.java
(original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/Activator.java
Fri Oct 28 10:25:16 2016
@@ -22,6 +22,9 @@ import org.apache.sling.ide.eclipse.core
 import org.apache.sling.ide.log.Logger;
 import org.apache.sling.ide.osgi.OsgiClientFactory;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.util.tracker.ServiceTracker;
@@ -37,6 +40,11 @@ public class Activator extends Plugin {
     private ServiceRegistration<Logger> tracerRegistration;
     private ServiceTracker<Logger, Logger> tracer;
 
+    /**
+     * Storage for preferences.
+     */
+    private ScopedPreferenceStore preferenceStore;
+
     public static Activator getDefault() {
         return INSTANCE;
     }
@@ -80,6 +88,15 @@ public class Activator extends Plugin {
     }
 
     public Logger getPluginLogger() {
-        return (Logger) ServiceUtil.getNotNull(tracer);
+        return ServiceUtil.getNotNull(tracer);
+    }
+
+    public IPreferenceStore getPreferenceStore() {
+        // Create the preference store lazily.
+        if (preferenceStore == null) {
+            preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, PLUGIN_ID);
+
+        }
+        return preferenceStore;
     }
 }

Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/ContentPackageProjectConfigurator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/ContentPackageProjectConfigurator.java?rev=1766996&r1=1766995&r2=1766996&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/ContentPackageProjectConfigurator.java
(original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/ContentPackageProjectConfigurator.java
Fri Oct 28 10:25:16 2016
@@ -25,7 +25,6 @@ import java.util.TreeSet;
 import org.apache.maven.model.Resource;
 import org.apache.maven.project.MavenProject;
 import org.apache.sling.ide.eclipse.core.ConfigurationHelper;
-import org.apache.sling.ide.log.Logger;
 import org.eclipse.aether.util.StringUtils;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IProject;
@@ -71,6 +70,12 @@ public class ContentPackageProjectConfig
         IProject project = configRequest.getProject();
         // delete all previous markers on this pom.xml set by any project configurator
         deleteMarkers(configRequest.getPom());
+
+        if (!getPreferences().isContentPackageProjectConfiguratorEnabled()) {
+            trace("M2E project configurator for packing type 'content-package' was disabled
through preference.");
+            return;
+        }
+
         MavenProject mavenProject = configRequest.getMavenProject();
         boolean active = !"false".equalsIgnoreCase(mavenProject.getProperties().getProperty(M2E_ACTIVE));
         if(!active) {
@@ -78,9 +83,7 @@ public class ContentPackageProjectConfig
             return;
         }
         
-        String mavenGav = mavenProject.getGroupId() + ":" + mavenProject.getArtifactId()
+ ":" + mavenProject.getVersion();
-       
-        trace("Configuring Maven project {0} with packaging 'content-package'...", mavenGav);
+        trace("Configuring {0} with packaging 'content-package'...", mavenProject);
         
         // core configuration for sling ide plugin
         
@@ -91,19 +94,17 @@ public class ContentPackageProjectConfig
         String jcrRootPath = contentSyncPath.toString();
         ConfigurationHelper.convertToContentPackageProject(project, progressMonitor, Path.fromOSString(jcrRootPath));
  
         
-        new WtpProjectConfigurer(configRequest, project, jcrRootPath).configure(progressMonitor);
+        if (getPreferences().isWtpFacetsEnabledInContentPackageProjectConfigurator()) {
+            new WtpProjectConfigurer(configRequest, project, jcrRootPath).configure(progressMonitor);
+            trace("WTP facets for {0} added", mavenProject);
+        } else {
+            trace("WTP facets for packing type 'content-package' are disabled through preferences.");
+        }
         
         trace("Done converting .");
     }
 
     /**
-     * @see Logger#trace(String, Object...)
-     */
-    private static void trace(String format, Object... arguments) {
-        Activator.getDefault().getPluginLogger().trace(format, arguments);
-    }
-
-    /**
      * Adds the given natures to the project
      * @param project
      * @param natureIdsToAdd

Added: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/SlingIdePreferencePage.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/SlingIdePreferencePage.java?rev=1766996&view=auto
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/SlingIdePreferencePage.java
(added)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/SlingIdePreferencePage.java
Fri Oct 28 10:25:16 2016
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 org.apache.sling.ide.eclipse.m2e.internal;
+
+import org.apache.sling.ide.eclipse.m2e.internal.preferences.Preferences;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class SlingIdePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage
{
+
+    private BooleanFieldEditor enableProjectConfiguratorEditor;
+    private BooleanFieldEditor enableExtendedProjectConfigurationEditor;
+    private Group m2eProjectConfiguratorsForContentPackagesGroup;
+    
+    public SlingIdePreferencePage() {
+        super(GRID);
+    }
+
+    @Override
+    protected void createFieldEditors() {
+        m2eProjectConfiguratorsForContentPackagesGroup = new Group(getFieldEditorParent(),
SWT.NONE);
+        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+        m2eProjectConfiguratorsForContentPackagesGroup.setLayoutData(gd);
+        m2eProjectConfiguratorsForContentPackagesGroup.setLayout(new GridLayout());
+        m2eProjectConfiguratorsForContentPackagesGroup.setText("Maven Project Configurator
for Content-Packages");
+        enableProjectConfiguratorEditor = new BooleanFieldEditor(Preferences.ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR,
"Enable",
+                m2eProjectConfiguratorsForContentPackagesGroup);
+        enableExtendedProjectConfigurationEditor = new BooleanFieldEditor(Preferences.ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR_ADDITIONAL_WTP_FACETS,
"Add additional WTP natures and facets",
+                m2eProjectConfiguratorsForContentPackagesGroup);
+
+        addField(enableProjectConfiguratorEditor);
+        addField(enableExtendedProjectConfigurationEditor);
+        addField(new BooleanFieldEditor(Preferences.ENABLE_BUNDLE_PROJECT_CONFIGURATOR, "Enable
Maven Project Configurator for Bundles", getFieldEditorParent()));
+    }
+
+    @Override
+    protected void initialize() {
+        super.initialize();
+        // make sure that the dependent boolean field is conditionally disabled (depending
on the initial value of the
+        // other field)
+        enableExtendedProjectConfigurationEditor.setEnabled(enableProjectConfiguratorEditor.getBooleanValue(),
+                m2eProjectConfiguratorsForContentPackagesGroup);
+    }
+
+    @Override
+    protected IPreferenceStore doGetPreferenceStore() {
+        return Activator.getDefault().getPreferenceStore();
+    }
+
+    @Override
+    public void init(IWorkbench workbench) {
+    }
+
+    @Override
+    public void propertyChange(PropertyChangeEvent event) {
+        // http://stackoverflow.com/questions/26909856/own-preferencepage-enable-and-disable-fieldeditor-by-booleanfieldeditor
+        if (event.getSource() == enableProjectConfiguratorEditor) {
+            Boolean enabled = (Boolean) event.getNewValue();
+            enableExtendedProjectConfigurationEditor.setEnabled(enabled,
+                    m2eProjectConfiguratorsForContentPackagesGroup);
+        }
+    }
+
+}

Propchange: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/SlingIdePreferencePage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/Preferences.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/Preferences.java?rev=1766996&view=auto
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/Preferences.java
(added)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/Preferences.java
Fri Oct 28 10:25:16 2016
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 org.apache.sling.ide.eclipse.m2e.internal.preferences;
+
+import org.apache.sling.ide.eclipse.m2e.internal.Activator;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * Exposes all preferences bound to this plugin's preference store.
+ * 
+ * @see Activator#getPreferenceStore()
+ */
+public class Preferences {
+
+    public static final String ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR = "enableContentPackageProjectConfigurator";
+    public static final String ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR_ADDITIONAL_WTP_FACETS
= "enableContentPackageProjectConfiguratorWtpFacets";
+    public static final String ENABLE_BUNDLE_PROJECT_CONFIGURATOR = "enableBundleProjectConfigurator";
+
+    private final IPreferenceStore preferenceStore;
+
+    public Preferences() {
+        preferenceStore = Activator.getDefault().getPreferenceStore();
+    }
+
+    public boolean isContentPackageProjectConfiguratorEnabled() {
+        return preferenceStore.getBoolean(ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR);
+    }
+
+    public boolean isWtpFacetsEnabledInContentPackageProjectConfigurator() {
+        return preferenceStore.getBoolean(ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR_ADDITIONAL_WTP_FACETS);
+    }
+
+    public boolean isBundleProjectConfiguratorEnabled() {
+        return preferenceStore.getBoolean(ENABLE_BUNDLE_PROJECT_CONFIGURATOR);
+    }
+}

Propchange: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/Preferences.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/PreferencesInitializer.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/PreferencesInitializer.java?rev=1766996&view=auto
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/PreferencesInitializer.java
(added)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/PreferencesInitializer.java
Fri Oct 28 10:25:16 2016
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 org.apache.sling.ide.eclipse.m2e.internal.preferences;
+
+import org.apache.sling.ide.eclipse.m2e.internal.Activator;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class PreferencesInitializer extends AbstractPreferenceInitializer {
+
+    @Override
+    public void initializeDefaultPreferences() {
+        IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
+        preferenceStore.setDefault(Preferences.ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR,
true);
+        preferenceStore.setDefault(Preferences.ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR_ADDITIONAL_WTP_FACETS,
true);
+        preferenceStore.setDefault(Preferences.ENABLE_BUNDLE_PROJECT_CONFIGURATOR, true);
+    }
+
+}

Propchange: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/preferences/PreferencesInitializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message