diff --git a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/.gitignore b/features/com.redhat.fabric8analytics.eclipse.feature/.gitignore similarity index 100% rename from features/com.redhat.fabric8analytics.lsp.eclipse.feature/.gitignore rename to features/com.redhat.fabric8analytics.eclipse.feature/.gitignore diff --git a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/build.properties b/features/com.redhat.fabric8analytics.eclipse.feature/build.properties similarity index 100% rename from features/com.redhat.fabric8analytics.lsp.eclipse.feature/build.properties rename to features/com.redhat.fabric8analytics.eclipse.feature/build.properties diff --git a/features/com.redhat.fabric8analytics.eclipse.feature/feature.properties b/features/com.redhat.fabric8analytics.eclipse.feature/feature.properties new file mode 100644 index 0000000..4da17e8 --- /dev/null +++ b/features/com.redhat.fabric8analytics.eclipse.feature/feature.properties @@ -0,0 +1,36 @@ +############################################################################### +# Copyright (c) 2017 Red Hat, Inc. and others. +# 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: +# Red Hat, Inc. - Initial implementation. +############################################################################## +# feature.properties +# contains externalized strings for feature.xml +# "%foo" in feature.xml corresponds to the key "foo" in this file +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file should be translated. + +# "featureName" property - name of the feature +featureName=Fabric8Analytics Integration (Technology Preview) + +# "providerName" property - name of the company that provides the feature +providerName=JBoss by Red Hat + +# "description" property - description of the feature +description=Fabric8Analytics Integration Feature (Technology Preview) + +# "copyright" property - text of the "Feature Update Copyright" +copyright=Copyright (c) 2017 Red Hat, Inc. and others.\nAll rights reserved. This program and the accompanying materials\n +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http\://www.eclipse.org/legal/epl-v10.html\n\ +\n\ +Contributors\:\n\ +Red Hat, Inc. - Initial implementation.\n + ############### end of copyright property #################################### + +licenseURL=license.html diff --git a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/feature.xml b/features/com.redhat.fabric8analytics.eclipse.feature/feature.xml similarity index 59% rename from features/com.redhat.fabric8analytics.lsp.eclipse.feature/feature.xml rename to features/com.redhat.fabric8analytics.eclipse.feature/feature.xml index 83a1f00..ef5bf25 100644 --- a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/feature.xml +++ b/features/com.redhat.fabric8analytics.eclipse.feature/feature.xml @@ -1,12 +1,12 @@ + plugin="com.redhat.fabric8analytics.eclipse"> %description @@ -20,7 +20,7 @@ %license - - + + diff --git a/features/com.redhat.fabric8analytics.eclipse.feature/pom.xml b/features/com.redhat.fabric8analytics.eclipse.feature/pom.xml new file mode 100644 index 0000000..c03193f --- /dev/null +++ b/features/com.redhat.fabric8analytics.eclipse.feature/pom.xml @@ -0,0 +1,53 @@ + + 4.0.0 + + com.redhat.fabric8analytics.eclipse + features + 0.0.1-SNAPSHOT + + com.redhat.fabric8analytics.eclipse + com.redhat.fabric8analytics.eclipse.feature + eclipse-feature + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + ${tychoExtrasVersion} + + + source-feature + package + + source-feature + + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tychoVersion} + + + attached-p2-metadata + package + + p2-metadata + + + + + + + diff --git a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/sourceTemplateFeature/.gitkeep b/features/com.redhat.fabric8analytics.eclipse.feature/sourceTemplateFeature/.gitkeep similarity index 100% rename from features/com.redhat.fabric8analytics.lsp.eclipse.feature/sourceTemplateFeature/.gitkeep rename to features/com.redhat.fabric8analytics.eclipse.feature/sourceTemplateFeature/.gitkeep diff --git a/features/com.redhat.fabric8analytics.eclipse.lsp.feature/.gitignore b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/.gitignore new file mode 100644 index 0000000..ec39c9e --- /dev/null +++ b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/.gitignore @@ -0,0 +1,5 @@ +/bin/ +/.settings/ +/.project +/.classpath +target/ \ No newline at end of file diff --git a/features/com.redhat.fabric8analytics.eclipse.lsp.feature/build.properties b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/build.properties new file mode 100644 index 0000000..a54095f --- /dev/null +++ b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/build.properties @@ -0,0 +1,5 @@ +bin.includes = feature.xml,\ + feature.properties +src.includes = feature.xml,\ + feature.properties,\ + build.properties diff --git a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/feature.properties b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/feature.properties similarity index 100% rename from features/com.redhat.fabric8analytics.lsp.eclipse.feature/feature.properties rename to features/com.redhat.fabric8analytics.eclipse.lsp.feature/feature.properties diff --git a/features/com.redhat.fabric8analytics.eclipse.lsp.feature/feature.xml b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/feature.xml new file mode 100644 index 0000000..2a646a2 --- /dev/null +++ b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/feature.xml @@ -0,0 +1,28 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + + diff --git a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/pom.xml b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/pom.xml similarity index 97% rename from features/com.redhat.fabric8analytics.lsp.eclipse.feature/pom.xml rename to features/com.redhat.fabric8analytics.eclipse.lsp.feature/pom.xml index d358ed0..75545ad 100644 --- a/features/com.redhat.fabric8analytics.lsp.eclipse.feature/pom.xml +++ b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/pom.xml @@ -8,7 +8,7 @@ 0.0.1-SNAPSHOT com.redhat.fabric8analytics.eclipse - com.redhat.fabric8analytics.lsp.eclipse.feature + com.redhat.fabric8analytics.eclipse.lsp.feature eclipse-feature diff --git a/features/com.redhat.fabric8analytics.eclipse.lsp.feature/sourceTemplateFeature/.gitkeep b/features/com.redhat.fabric8analytics.eclipse.lsp.feature/sourceTemplateFeature/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/features/pom.xml b/features/pom.xml index 66604de..e02155b 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -7,12 +7,12 @@ com.redhat.fabric8analytics.parent 0.0.1-SNAPSHOT - com.redhat.fabric8analytics.eclipse features com.redhat.fabric8analytics.eclipse features pom - com.redhat.fabric8analytics.lsp.eclipse.feature + com.redhat.fabric8analytics.eclipse.feature + com.redhat.fabric8analytics.eclipse.lsp.feature diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/.gitignore b/plugins/com.redhat.fabric8analytics.eclipse.core/.gitignore similarity index 100% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/.gitignore rename to plugins/com.redhat.fabric8analytics.eclipse.core/.gitignore diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/META-INF/MANIFEST.MF b/plugins/com.redhat.fabric8analytics.eclipse.core/META-INF/MANIFEST.MF similarity index 53% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/META-INF/MANIFEST.MF rename to plugins/com.redhat.fabric8analytics.eclipse.core/META-INF/MANIFEST.MF index 61abbcb..b6e10e6 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/META-INF/MANIFEST.MF +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/META-INF/MANIFEST.MF @@ -1,13 +1,12 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name -Bundle-SymbolicName: com.redhat.fabric8analytics.lsp.eclipse.core;singleton:=true +Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.core;singleton:=true Bundle-Version: 0.0.1.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0", - org.eclipse.core.runtime, +Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources;bundle-version="3.12.0", org.apache.httpcomponents.httpclient;bundle-version="4.5.2", org.apache.httpcomponents.httpcore;bundle-version="4.4.6", @@ -18,13 +17,13 @@ Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0", org.eclipse.m2e.core, org.eclipse.m2e.maven.runtime, org.jboss.tools.openshift.io.core -Eclipse-BundleShape: dir -Bundle-Activator: com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator +Bundle-Activator: com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator Bundle-ActivationPolicy: lazy Bundle-ClassPath: . -Export-Package: com.redhat.fabric8analytics.lsp.eclipse.core, - com.redhat.fabric8analytics.lsp.eclipse.core.job, - com.redhat.fabric8analytics.lsp.eclipse.core.data, - com.redhat.fabric8analytics.lsp.eclipse.core.internal;x-friends:=com.redhat.fabric8analytics.lsp.eclipse.ui +Export-Package: com.redhat.fabric8analytics.eclipse.core, + com.redhat.fabric8analytics.eclipse.core.data, + com.redhat.fabric8analytics.eclipse.core.internal;x-friends:="com.redhat.fabric8analytics.eclipse.lsp.core, com.redhat.fabric8analytics.eclipse.ui, com.redhat.fabric8analytics.eclipse.lsp.ui", + com.redhat.fabric8analytics.eclipse.core.job, + com.redhat.fabric8analytics.eclipse.core.api diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/build.properties b/plugins/com.redhat.fabric8analytics.eclipse.core/build.properties similarity index 100% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/build.properties rename to plugins/com.redhat.fabric8analytics.eclipse.core/build.properties diff --git a/plugins/com.redhat.fabric8analytics.eclipse.core/plugin.properties b/plugins/com.redhat.fabric8analytics.eclipse.core/plugin.properties new file mode 100644 index 0000000..3a72a5e --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/plugin.properties @@ -0,0 +1,2 @@ +Bundle-Name=Fabric8Analytics Core Plugin +Bundle-Vendor=JBoss by Red Hat \ No newline at end of file diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/pom.xml b/plugins/com.redhat.fabric8analytics.eclipse.core/pom.xml similarity index 86% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/pom.xml rename to plugins/com.redhat.fabric8analytics.eclipse.core/pom.xml index 990d179..b223fb6 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/pom.xml +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/pom.xml @@ -6,7 +6,7 @@ 0.0.1-SNAPSHOT - com.redhat.fabric8analytics.lsp.eclipse.core + com.redhat.fabric8analytics.eclipse.core eclipse-plugin diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisLSCoreActivator.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisCoreActivator.java similarity index 83% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisLSCoreActivator.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisCoreActivator.java index da542d2..49080ba 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisLSCoreActivator.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisCoreActivator.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core; +package com.redhat.fabric8analytics.eclipse.core; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; @@ -19,17 +19,17 @@ /** * The activator class controls the plug-in life cycle */ -public class Fabric8AnalysisLSCoreActivator extends Plugin { +public class Fabric8AnalysisCoreActivator extends Plugin { - public static final String PLUGIN_ID = "com.redhat.fabric8analytics.lsp.eclipse.core"; + public static final String PLUGIN_ID = "com.redhat.fabric8analytics.eclipse.core"; // The shared instance - private static Fabric8AnalysisLSCoreActivator plugin; + private static Fabric8AnalysisCoreActivator plugin; /** * The constructor */ - public Fabric8AnalysisLSCoreActivator() { + public Fabric8AnalysisCoreActivator() { } @Override @@ -49,7 +49,7 @@ public void stop(BundleContext context) throws Exception { * * @return the shared instance */ - public static Fabric8AnalysisLSCoreActivator getDefault() { + public static Fabric8AnalysisCoreActivator getDefault() { return plugin; } diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisPreferences.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisPreferences.java similarity index 68% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisPreferences.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisPreferences.java index 34bac55..863be41 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisPreferences.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisPreferences.java @@ -8,18 +8,17 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core; +package com.redhat.fabric8analytics.eclipse.core; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.equinox.security.storage.ISecurePreferences; import org.eclipse.equinox.security.storage.SecurePreferencesFactory; import org.eclipse.equinox.security.storage.StorageException; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData; +import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData; public class Fabric8AnalysisPreferences { - public static final String LSP_SERVER_ENABLED = "fabric8AnalysisPreferences.LSP_ENABLED"; public static final String PROD_URL = "fabric8AnalysisPreferences.PROD_URL"; public static final String STAGE_URL = "fabric8AnalysisPreferences.STAGE_URL"; public static final String USER_KEY = "fabric8AnalysisPreferences.USER_KEY"; @@ -39,28 +38,20 @@ public static Fabric8AnalysisPreferences getInstance() { return instance; } - public boolean isLSPServerEnabled() { - return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).getBoolean(LSP_SERVER_ENABLED, false); - } - - public void setLSPServerEnabled(boolean enabled) { - InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).putBoolean(LSP_SERVER_ENABLED, enabled); - } - public String getProdURL() { - return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).get(PROD_URL, null); + return InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).get(PROD_URL, null); } public void setProdURL(String prodURL) { - InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).put(PROD_URL, prodURL); + InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).put(PROD_URL, prodURL); } public String getStageURL() { - return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).get(STAGE_URL, null); + return InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).get(STAGE_URL, null); } public void setStageURL(String stageURL) { - InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).put(STAGE_URL, stageURL); + InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).put(STAGE_URL, stageURL); } public String getUserKey() throws StorageException { diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIException.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIException.java similarity index 95% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIException.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIException.java index b985309..2f449d5 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIException.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIException.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core; +package com.redhat.fabric8analytics.eclipse.core.api; import org.json.JSONObject; diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIProvider.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIProvider.java similarity index 94% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIProvider.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIProvider.java index ec78357..5d6b52a 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIProvider.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIProvider.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core; +package com.redhat.fabric8analytics.eclipse.core.api; import java.io.File; @@ -31,8 +31,9 @@ import org.json.JSONException; import org.json.JSONObject; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.PomContentBody; +import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.internal.PomContentBody; /** * Provides access to Recommender API server @@ -132,7 +133,7 @@ public boolean analysesFinished(String jobId) throws RecommenderAPIException { int responseCode = response.getStatusLine().getStatusCode(); // TODO - for debug purposes - should be removed later - Fabric8AnalysisLSCoreActivator.getDefault().logInfo("F8 server response code: " + responseCode); + Fabric8AnalysisCoreActivator.getDefault().logInfo("F8 server response code: " + responseCode); if (responseCode == HttpStatus.SC_OK) { return true; diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/ThreeScaleAPIException.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/ThreeScaleAPIException.java similarity index 95% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/ThreeScaleAPIException.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/ThreeScaleAPIException.java index bfe7522..fbd5ab4 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/ThreeScaleAPIException.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/ThreeScaleAPIException.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core; +package com.redhat.fabric8analytics.eclipse.core.api; import org.json.JSONObject; diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/ThreeScaleAPIProvider.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/ThreeScaleAPIProvider.java similarity index 95% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/ThreeScaleAPIProvider.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/ThreeScaleAPIProvider.java index fb91720..0646b4f 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/ThreeScaleAPIProvider.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/ThreeScaleAPIProvider.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core; +package com.redhat.fabric8analytics.eclipse.core.api; import java.io.IOException; @@ -22,7 +22,7 @@ import org.json.JSONException; import org.json.JSONObject; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData; +import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData; /** * Provides access to 3scale service diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/data/AnalyticsAuthData.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/data/AnalyticsAuthData.java similarity index 95% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/data/AnalyticsAuthData.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/data/AnalyticsAuthData.java index 46ed2f5..891788b 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/data/AnalyticsAuthData.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/data/AnalyticsAuthData.java @@ -8,7 +8,7 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core.data; +package com.redhat.fabric8analytics.eclipse.core.data; public class AnalyticsAuthData { diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/data/ThreeScaleData.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/data/ThreeScaleData.java similarity index 92% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/data/ThreeScaleData.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/data/ThreeScaleData.java index 0d5778b..8347c67 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/data/ThreeScaleData.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/data/ThreeScaleData.java @@ -1,4 +1,4 @@ -package com.redhat.fabric8analytics.lsp.eclipse.core.data; +package com.redhat.fabric8analytics.eclipse.core.data; /** * Stores 3scale data. diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/internal/AnalyticsAuthService.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/internal/AnalyticsAuthService.java similarity index 85% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/internal/AnalyticsAuthService.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/internal/AnalyticsAuthService.java index 8941ca0..5b6b174 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/internal/AnalyticsAuthService.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/internal/AnalyticsAuthService.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core.internal; +package com.redhat.fabric8analytics.eclipse.core.internal; import java.util.List; @@ -21,12 +21,12 @@ import org.jboss.tools.openshift.io.core.AccountStatus; import org.jboss.tools.openshift.io.core.model.IAccount; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisPreferences; -import com.redhat.fabric8analytics.lsp.eclipse.core.ThreeScaleAPIException; -import com.redhat.fabric8analytics.lsp.eclipse.core.ThreeScaleAPIProvider; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData; +import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator; +import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisPreferences; +import com.redhat.fabric8analytics.eclipse.core.api.ThreeScaleAPIException; +import com.redhat.fabric8analytics.eclipse.core.api.ThreeScaleAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData; public class AnalyticsAuthService { @@ -78,7 +78,7 @@ public AnalyticsAuthData getAnalyticsAuthData(IProgressMonitor progressMonitor) try { threeScaleData = registerThreeScale(monitor, token); } catch (ThreeScaleAPIException e) { - Fabric8AnalysisLSCoreActivator.getDefault().logError("Unable to get data from 3scale", e); + Fabric8AnalysisCoreActivator.getDefault().logError("Unable to get data from 3scale", e); return null; } } @@ -101,7 +101,7 @@ public AnalyticsAuthData login(IProgressMonitor progressMonitor) throws StorageE try { threeScaleData = registerThreeScale(monitor, token); } catch (ThreeScaleAPIException e) { - Fabric8AnalysisLSCoreActivator.getDefault().logError("Unable to get data from 3scale", e); + Fabric8AnalysisCoreActivator.getDefault().logError("Unable to get data from 3scale", e); return null; } } diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/internal/PomContentBody.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/internal/PomContentBody.java similarity index 95% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/internal/PomContentBody.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/internal/PomContentBody.java index a547bf9..9bd4d79 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/internal/PomContentBody.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/internal/PomContentBody.java @@ -8,7 +8,7 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core.internal; +package com.redhat.fabric8analytics.eclipse.core.internal; import java.io.IOException; import java.io.OutputStream; diff --git a/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/LoginToOSIOJob.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/LoginToOSIOJob.java new file mode 100644 index 0000000..8f72b3b --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/LoginToOSIOJob.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2018 Red Hat Inc.. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ +package com.redhat.fabric8analytics.eclipse.core.job; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.equinox.security.storage.StorageException; + +import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.internal.AnalyticsAuthService; + +public class LoginToOSIOJob extends Job { + + private AnalyticsAuthData analyticsAuthData; + + public LoginToOSIOJob() { + super("Login to Openshift.io"); + } + + @Override + protected IStatus run(IProgressMonitor progressMonitor) { + try { + analyticsAuthData = AnalyticsAuthService.getInstance().login(progressMonitor); + } catch (StorageException e) { + return new Status(IStatus.ERROR, Fabric8AnalysisCoreActivator.PLUGIN_ID, "Error occured while storing Fabric8Analytics data", e); + } + return Status.OK_STATUS; + } + + public AnalyticsAuthData getAnalyticsAuthData() { + return analyticsAuthData; + } + + } \ No newline at end of file diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/job/RetrieveResultsJob.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/RetrieveResultsJob.java similarity index 75% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/job/RetrieveResultsJob.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/RetrieveResultsJob.java index 3372dcd..54d07e2 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/job/RetrieveResultsJob.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/RetrieveResultsJob.java @@ -8,16 +8,16 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core.job; +package com.redhat.fabric8analytics.eclipse.core.job; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIException; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIException; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIProvider; public class RetrieveResultsJob extends Job { @@ -35,10 +35,10 @@ public RetrieveResultsJob(RecommenderAPIProvider provider, String jobID) { protected IStatus run(IProgressMonitor monitor) { try { if (!provider.analysesFinished(jobID)) { - return new Status(IStatus.INFO, Fabric8AnalysisLSCoreActivator.PLUGIN_ID, "Analysis is not ready yet"); + return new Status(IStatus.INFO, Fabric8AnalysisCoreActivator.PLUGIN_ID, "Analysis is not ready yet"); } } catch (RecommenderAPIException e) { - return new Status(IStatus.ERROR, Fabric8AnalysisLSCoreActivator.PLUGIN_ID, + return new Status(IStatus.ERROR, Fabric8AnalysisCoreActivator.PLUGIN_ID, "Error during communication with analytics server", e); } diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/job/SendToFabric8AnalysisJob.java b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/SendToFabric8AnalysisJob.java similarity index 87% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/job/SendToFabric8AnalysisJob.java rename to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/SendToFabric8AnalysisJob.java index 8834137..ce91940 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/job/SendToFabric8AnalysisJob.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/job/SendToFabric8AnalysisJob.java @@ -8,7 +8,7 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core.job; +package com.redhat.fabric8analytics.eclipse.core.job; import java.io.StringWriter; import java.util.HashMap; @@ -26,8 +26,8 @@ import org.eclipse.m2e.core.project.IMavenProjectFacade; import org.eclipse.m2e.core.project.IMavenProjectRegistry; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIProvider; public class SendToFabric8AnalysisJob extends Job { @@ -61,7 +61,7 @@ protected IStatus run(IProgressMonitor monitor) { jobID = provider.requestAnalyses(effectivePomFiles, license); } catch (Exception e) { - return new Status(Status.ERROR, Fabric8AnalysisLSCoreActivator.PLUGIN_ID, "Error during communication with server", e); + return new Status(Status.ERROR, Fabric8AnalysisCoreActivator.PLUGIN_ID, "Error during communication with server", e); } return Status.OK_STATUS; } diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/.gitignore b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/.gitignore new file mode 100644 index 0000000..aa623da --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/.gitignore @@ -0,0 +1,7 @@ +/bin/ +/.settings/ +/.project +/.classpath +target/ +server* +**/.DS_Store diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/META-INF/MANIFEST.MF b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/META-INF/MANIFEST.MF new file mode 100644 index 0000000..97ebc72 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.lsp.core;singleton:=true +Bundle-Version: 0.0.1.qualifier +Bundle-Vendor: %Bundle-Vendor +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0", + org.eclipse.core.runtime, + org.eclipse.core.resources;bundle-version="3.12.0", + org.apache.commons.io;bundle-version="2.2.0", + org.eclipse.equinox.security, + com.redhat.fabric8analytics.eclipse.core +Eclipse-BundleShape: dir +Bundle-ActivationPolicy: lazy +Bundle-Activator: com.redhat.fabric8analytics.eclipse.lsp.core.Fabric8AnalysisLSPCoreActivator +Bundle-ClassPath: . +Export-Package: com.redhat.fabric8analytics.eclipse.lsp.core + + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/build.properties b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/build.properties new file mode 100644 index 0000000..cddd92f --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + plugin.properties,\ + .,\ +src.includes = * +src.excludes = src diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.core/plugin.properties b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/plugin.properties similarity index 100% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.core/plugin.properties rename to plugins/com.redhat.fabric8analytics.eclipse.lsp.core/plugin.properties diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/plugin.xml b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/plugin.xml new file mode 100644 index 0000000..f786541 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/plugin.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/pom.xml b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/pom.xml similarity index 85% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/pom.xml rename to plugins/com.redhat.fabric8analytics.eclipse.lsp.core/pom.xml index ddf3e56..6769ab9 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/pom.xml +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/pom.xml @@ -1,5 +1,4 @@ - + 4.0.0 com.redhat.fabric8analytics.eclipse @@ -7,10 +6,10 @@ 0.0.1-SNAPSHOT - com.redhat.fabric8analytics.lsp.eclipse.ui + com.redhat.fabric8analytics.eclipse.lsp.core eclipse-plugin - - + + org.eclipse.tycho @@ -47,4 +46,4 @@ - \ No newline at end of file + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalysisLSPCoreActivator.java b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalysisLSPCoreActivator.java new file mode 100644 index 0000000..7179eb8 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalysisLSPCoreActivator.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2017 Red Hat Inc.. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ + +package com.redhat.fabric8analytics.eclipse.lsp.core; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Fabric8AnalysisLSPCoreActivator extends Plugin { + + public static final String PLUGIN_ID = "com.redhat.fabric8analytics.eclipse.lsp.core"; + + // The shared instance + private static Fabric8AnalysisLSPCoreActivator plugin; + + /** + * The constructor + */ + public Fabric8AnalysisLSPCoreActivator() { + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Fabric8AnalysisLSPCoreActivator getDefault() { + return plugin; + } + + public void logInfo(String msg) { + IStatus status = new Status(Status.INFO, PLUGIN_ID, msg); + getLog().log(status); + } + + public void logError(String msg) { + IStatus status = new Status(Status.ERROR, PLUGIN_ID, msg); + getLog().log(status); + } + + public void logError(String msg, Throwable t) { + IStatus status = new Status(Status.ERROR, PLUGIN_ID, msg, t); + getLog().log(status); + } +} diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalysisLSPPreferences.java b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalysisLSPPreferences.java new file mode 100644 index 0000000..05d95a4 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalysisLSPPreferences.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2018 Red Hat Inc. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ +package com.redhat.fabric8analytics.eclipse.lsp.core; + +import org.eclipse.core.runtime.preferences.InstanceScope; + +public class Fabric8AnalysisLSPPreferences { + + public static final String LSP_SERVER_ENABLED = "fabric8AnalysisPreferences.LSP_ENABLED"; + + private static Fabric8AnalysisLSPPreferences instance; + + private Fabric8AnalysisLSPPreferences() { + } + + public static Fabric8AnalysisLSPPreferences getInstance() { + if(instance == null) { + instance = new Fabric8AnalysisLSPPreferences(); + } + return instance; + } + + public boolean isLSPServerEnabled() { + return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSPCoreActivator.PLUGIN_ID).getBoolean(LSP_SERVER_ENABLED, false); + } + + public void setLSPServerEnabled(boolean enabled) { + InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSPCoreActivator.PLUGIN_ID).putBoolean(LSP_SERVER_ENABLED, enabled); + } + +} diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalyticsStreamConnectionProvider.java b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalyticsStreamConnectionProvider.java similarity index 82% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalyticsStreamConnectionProvider.java rename to plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalyticsStreamConnectionProvider.java index 310bb07..5b8fe3e 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalyticsStreamConnectionProvider.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.core/src/com/redhat/fabric8analytics/eclipse/lsp/core/Fabric8AnalyticsStreamConnectionProvider.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui; +package com.redhat.fabric8analytics.eclipse.lsp.core; import java.io.BufferedReader; import java.io.File; @@ -41,16 +41,13 @@ import org.eclipse.lsp4e.server.StreamConnectionProvider; import org.osgi.framework.Bundle; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisPreferences; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.AnalyticsAuthService; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.MessageDialogUtils; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.internal.AnalyticsAuthService; public class Fabric8AnalyticsStreamConnectionProvider extends ProcessStreamConnectionProvider implements StreamConnectionProvider { - public static final String SERVER_ID = "com.redhat.fabric8analytics.lsp.eclipse.server"; + public static final String SERVER_ID = "com.redhat.fabric8analytics.eclipse.lsp.server"; private static final String LSP_SERVER_ID_ATTRIBUTE = "languageServerId"; @@ -80,7 +77,7 @@ public Fabric8AnalyticsStreamConnectionProvider(AnalyticsAuthService tokenCheck) } File serverLocation = getServerLocation(); - Fabric8AnalysisLSUIActivator.getDefault().logInfo("server location" + serverLocation); + Fabric8AnalysisLSPCoreActivator.getDefault().logInfo("server location" + serverLocation); if (serverLocation == null) { return; } @@ -94,7 +91,7 @@ public Fabric8AnalyticsStreamConnectionProvider(AnalyticsAuthService tokenCheck) @Override public void start() throws IOException { - if (!Fabric8AnalysisPreferences.getInstance().isLSPServerEnabled()) { + if (!Fabric8AnalysisLSPPreferences.getInstance().isLSPServerEnabled()) { throw new IOException("Fabric8Analytics LSP Server is not enabled"); } @@ -109,14 +106,14 @@ public void start() throws IOException { super.start(); // if super.start() does not throw exception, we're started - Fabric8AnalysisLSUIActivator.getDefault().logInfo("The Fabric8 analyses server is started "); + Fabric8AnalysisLSPCoreActivator.getDefault().logInfo("The Fabric8 analyses server is started "); } @Override public void stop() { super.stop(); removeMarkers(); - Fabric8AnalysisLSUIActivator.getDefault().logInfo("The Fabric8 analyses server is stopped"); + Fabric8AnalysisLSPCoreActivator.getDefault().logInfo("The Fabric8 analyses server is stopped"); } private void removeMarkers() { @@ -137,7 +134,7 @@ private void removeMarkers() { ResourcesPlugin.getWorkspace() .deleteMarkers(markersToDelete.toArray(new IMarker[markersToDelete.size()])); } catch (CoreException e) { - Fabric8AnalysisLSUIActivator.getDefault().logError("Error occured while removing LSP markers", e); + Fabric8AnalysisLSPCoreActivator.getDefault().logError("Error occured while removing LSP markers", e); } } } @@ -153,13 +150,13 @@ protected ProcessBuilder createProcessBuilder() { } private void addPreferencesListener() { - InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID) + InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSPCoreActivator.PLUGIN_ID) .addPreferenceChangeListener(new IPreferenceChangeListener() { @Override public void preferenceChange(PreferenceChangeEvent event) { - if (Fabric8AnalysisPreferences.LSP_SERVER_ENABLED.equals(event.getKey())) { - if(Fabric8AnalysisPreferences.getInstance().isLSPServerEnabled()) { + if (Fabric8AnalysisLSPPreferences.LSP_SERVER_ENABLED.equals(event.getKey())) { + if(Fabric8AnalysisLSPPreferences.getInstance().isLSPServerEnabled()) { try { // not sure if this actually works start(); @@ -176,10 +173,10 @@ public void preferenceChange(PreferenceChangeEvent event) { private static File getServerLocation() { try { - Bundle bundle = Platform.getBundle(Fabric8AnalysisLSUIActivator.PLUGIN_ID); + Bundle bundle = Platform.getBundle(Fabric8AnalysisLSPCoreActivator.PLUGIN_ID); return new File(FileLocator.getBundleFile(bundle), "server/server.js"); } catch (IOException e) { - Fabric8AnalysisLSUIActivator.getDefault().logError("Cannot find the Fabric8 analyses server location", e); + Fabric8AnalysisLSPCoreActivator.getDefault().logError("Cannot find the Fabric8 analyses server location", e); return null; } } @@ -213,7 +210,7 @@ private static File getNodeJsLocation() { String message = "`node` is missing in your PATH, Fabric8 Fabric8 analyses server won't work.\n" + "Please install `node` and make it available in your PATH"; - MessageDialogUtils.displayErrorMessage(message); + Fabric8AnalysisLSPCoreActivator.getDefault().logError(message); return null; } diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/.gitignore b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/.gitignore new file mode 100644 index 0000000..0138dc4 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/.gitignore @@ -0,0 +1,7 @@ +/bin/ +.classpath/ +.project/ +.settings/ +target/ +**/.DS_Store + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/META-INF/MANIFEST.MF b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000..f75e6cd --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.lsp.ui;singleton:=true +Bundle-Version: 0.0.1.qualifier +Bundle-Vendor: %Bundle-Vendor +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.ui, + org.eclipse.swt, + org.eclipse.core.runtime, + com.redhat.fabric8analytics.eclipse.ui, + com.redhat.fabric8analytics.eclipse.lsp.core, + com.redhat.fabric8analytics.eclipse.core, + org.eclipse.equinox.security +Bundle-Activator: com.redhat.fabric8analytics.eclipse.lsp.ui.Fabric8AnalysisLSPUIActivator +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Export-Package: com.redhat.fabric8analytics.eclipse.lsp.ui + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/build.properties b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/build.properties new file mode 100644 index 0000000..0318a5f --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties +src.includes = * +src.excludes = src diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/plugin.properties b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/plugin.properties similarity index 100% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/plugin.properties rename to plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/plugin.properties diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/plugin.xml b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/plugin.xml new file mode 100644 index 0000000..ab557db --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/plugin.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/pom.xml b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/pom.xml new file mode 100644 index 0000000..01e20f8 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + + com.redhat.fabric8analytics.eclipse + plugins + 0.0.1-SNAPSHOT + + + com.redhat.fabric8analytics.eclipse.lsp.ui + eclipse-plugin + + diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalysisLSUIActivator.java b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/Fabric8AnalysisLSPUIActivator.java similarity index 82% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalysisLSUIActivator.java rename to plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/Fabric8AnalysisLSPUIActivator.java index 9534c48..1746558 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalysisLSUIActivator.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/Fabric8AnalysisLSPUIActivator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017 Red Hat Inc.. + * Copyright (c) 2018 Red Hat Inc.. * 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 @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui; +package com.redhat.fabric8analytics.eclipse.lsp.ui; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -19,17 +19,17 @@ /** * The activator class controls the plug-in life cycle */ -public class Fabric8AnalysisLSUIActivator extends AbstractUIPlugin { +public class Fabric8AnalysisLSPUIActivator extends AbstractUIPlugin { - public static final String PLUGIN_ID = "com.redhat.fabric8analytics.lsp.eclipse.ui"; + public static final String PLUGIN_ID = "com.redhat.fabric8analytics.eclipse.lsp.ui"; // The shared instance - private static Fabric8AnalysisLSUIActivator plugin; + private static Fabric8AnalysisLSPUIActivator plugin; /** * The constructor */ - public Fabric8AnalysisLSUIActivator() { + public Fabric8AnalysisLSPUIActivator() { } @Override @@ -49,7 +49,7 @@ public void stop(BundleContext context) throws Exception { * * @return the shared instance */ - public static Fabric8AnalysisLSUIActivator getDefault() { + public static Fabric8AnalysisLSPUIActivator getDefault() { return plugin; } @@ -67,4 +67,6 @@ public void logError(String msg, Throwable t) { IStatus status = new Status(Status.ERROR, PLUGIN_ID, msg, t); getLog().log(status); } + + } diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/LSPService.java b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/LSPService.java new file mode 100644 index 0000000..99d12c7 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/LSPService.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2018 Red Hat Inc.. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ +package com.redhat.fabric8analytics.eclipse.lsp.ui; + +import org.eclipse.core.runtime.NullProgressMonitor; + +import com.redhat.fabric8analytics.eclipse.core.internal.AnalyticsAuthService; +import com.redhat.fabric8analytics.eclipse.lsp.core.Fabric8AnalysisLSPPreferences; +import com.redhat.fabric8analytics.eclipse.ui.OSIOService; +import com.redhat.fabric8analytics.eclipse.ui.ServiceEnablementException; + +public class LSPService implements OSIOService{ + + @Override + public String getServiceName() { + return "&Fabric8 Analytics LSP Server"; + } + + @Override + public void enable(boolean enable) throws ServiceEnablementException{ + if(enable) { + try { + AnalyticsAuthService.getInstance().login(new NullProgressMonitor()); + } catch (Exception e) { + throw new ServiceEnablementException("Error while logging to openshift.io", e); + } + } + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(enable); + } + + @Override + public boolean isEnabled() { + return Fabric8AnalysisLSPPreferences.getInstance().isLSPServerEnabled(); + } + +} diff --git a/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/LoginListener.java b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/LoginListener.java new file mode 100644 index 0000000..11aa4f4 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.lsp.ui/src/com/redhat/fabric8analytics/eclipse/lsp/ui/LoginListener.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2018 Red Hat Inc.. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ +package com.redhat.fabric8analytics.eclipse.lsp.ui; + +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.dialogs.PreferencesUtil; + +import com.redhat.fabric8analytics.eclipse.lsp.core.Fabric8AnalysisLSPPreferences; +import com.redhat.fabric8analytics.eclipse.ui.OSIOLoginListener; + +public class LoginListener implements OSIOLoginListener { + + @Override + public void loggedIn(boolean successfull) { + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(successfull); + if (successfull) { + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + PreferencesUtil + .createPreferenceDialogOn(shell, "com.redhat.fabric8analytics.eclipse.ui.preferences", + new String[] { "com.redhat.fabric8analytics.eclipse.ui.preferences" }, null) + .open(); + + } + }); + } + } + +} diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/.gitignore b/plugins/com.redhat.fabric8analytics.eclipse.ui/.gitignore similarity index 100% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/.gitignore rename to plugins/com.redhat.fabric8analytics.eclipse.ui/.gitignore diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/META-INF/MANIFEST.MF b/plugins/com.redhat.fabric8analytics.eclipse.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000..49c2a42 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/META-INF/MANIFEST.MF @@ -0,0 +1,27 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.ui;singleton:=true +Bundle-Version: 0.0.1.qualifier +Bundle-Vendor: %Bundle-Vendor +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.ui, + org.eclipse.swt, + org.eclipse.core.runtime, + org.eclipse.core.resources;bundle-version="3.12.0", + com.redhat.fabric8analytics.eclipse.core;bundle-version="0.0.1", + org.jboss.tools.openshift.io.ui;bundle-version="3.4.1", + org.eclipse.m2e.core, + org.eclipse.m2e.editor, + org.eclipse.ui.forms, + org.eclipse.ui.ide, + org.jboss.tools.openshift.io.core, + org.eclipse.equinox.security +Eclipse-BundleShape: dir +Bundle-Activator: com.redhat.fabric8analytics.eclipse.ui.Fabric8AnalysisUIActivator +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Export-Package: com.redhat.fabric8analytics.eclipse.ui, + com.redhat.fabric8analytics.eclipse.ui.internal;x-friends:="com.redhat.fabric8analytics.lsp.eclipse.ui.tests" + diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/build.properties b/plugins/com.redhat.fabric8analytics.eclipse.ui/build.properties similarity index 91% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/build.properties rename to plugins/com.redhat.fabric8analytics.eclipse.ui/build.properties index bde91b5..6ff4c19 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/build.properties +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/build.properties @@ -6,7 +6,6 @@ bin.includes = META-INF/,\ plugin.properties,\ templates/index.html,\ templates/,\ - server/,\ icons/ src.includes = * src.excludes = src diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/icons/osio-16x16.png b/plugins/com.redhat.fabric8analytics.eclipse.ui/icons/osio-16x16.png similarity index 100% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/icons/osio-16x16.png rename to plugins/com.redhat.fabric8analytics.eclipse.ui/icons/osio-16x16.png diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/plugin.properties b/plugins/com.redhat.fabric8analytics.eclipse.ui/plugin.properties new file mode 100644 index 0000000..82b50a6 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/plugin.properties @@ -0,0 +1,3 @@ +Bundle-Name=Fabric8Analytics UI Plugin +F8Analytics.command.authorize=Enable Fabric8 Analytics +Bundle-Vendor=JBoss by Red Hat \ No newline at end of file diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/plugin.xml b/plugins/com.redhat.fabric8analytics.eclipse.ui/plugin.xml similarity index 62% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/plugin.xml rename to plugins/com.redhat.fabric8analytics.eclipse.ui/plugin.xml index 91c66a7..a315ee9 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/plugin.xml +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/plugin.xml @@ -1,52 +1,38 @@ - - - - - - - - + + + defaultHandler="com.redhat.fabric8analytics.eclipse.ui.internal.view.StackAnalysisHandler" + id="com.redhat.fabric8analytics.eclipse.ui.StackAnalysisHandler" + name="StackAnalysisHandler"> @@ -55,7 +41,7 @@ @@ -80,9 +66,9 @@ allPopups="false" locationURI="toolbar:org.eclipse.ui.main.toolbar?after=org.eclipse.ui.workbench.help"> + id="com.redhat.fabric8analytics.eclipse.ui.Authorize"> @@ -95,7 +81,7 @@ @@ -116,6 +102,6 @@ - + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/pom.xml b/plugins/com.redhat.fabric8analytics.eclipse.ui/pom.xml new file mode 100644 index 0000000..a175e11 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + + com.redhat.fabric8analytics.eclipse + plugins + 0.0.1-SNAPSHOT + + + com.redhat.fabric8analytics.eclipse.ui + eclipse-plugin + + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/schema/com.redhat.fabric8analytics.eclipse.ui.login.listener.exsd b/plugins/com.redhat.fabric8analytics.eclipse.ui/schema/com.redhat.fabric8analytics.eclipse.ui.login.listener.exsd new file mode 100644 index 0000000..017a2ac --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/schema/com.redhat.fabric8analytics.eclipse.ui.login.listener.exsd @@ -0,0 +1,102 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/schema/com.redhat.fabric8analytics.eclipse.ui.service.preference.exsd b/plugins/com.redhat.fabric8analytics.eclipse.ui/schema/com.redhat.fabric8analytics.eclipse.ui.service.preference.exsd new file mode 100644 index 0000000..657d41d --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/schema/com.redhat.fabric8analytics.eclipse.ui.service.preference.exsd @@ -0,0 +1,85 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/Fabric8AnalysisUIActivator.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/Fabric8AnalysisUIActivator.java new file mode 100644 index 0000000..198666a --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/Fabric8AnalysisUIActivator.java @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright (c) 2017 Red Hat Inc. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ + +package com.redhat.fabric8analytics.eclipse.ui; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Fabric8AnalysisUIActivator extends AbstractUIPlugin { + + public static final String PLUGIN_ID = "com.redhat.fabric8analytics.eclipse.ui"; + + public static final String SERVICES_EXTENSION_POINT_ID = "com.redhat.fabric8analytics.eclipse.ui.service.preference"; + public static final String LISTENERS_EXTENSION_POINT_ID = "com.redhat.fabric8analytics.eclipse.ui.login.listener"; + + private static List loginListeners; + private static List services; + + // The shared instance + private static Fabric8AnalysisUIActivator plugin; + + /** + * The constructor + */ + public Fabric8AnalysisUIActivator() { + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Fabric8AnalysisUIActivator getDefault() { + return plugin; + } + + public void logInfo(String msg) { + IStatus status = new Status(Status.INFO, PLUGIN_ID, msg); + getLog().log(status); + } + + public void logError(String msg) { + IStatus status = new Status(Status.ERROR, PLUGIN_ID, msg); + getLog().log(status); + } + + public void logError(String msg, Throwable t) { + IStatus status = new Status(Status.ERROR, PLUGIN_ID, msg, t); + getLog().log(status); + } + + public List getOSIOLoginListeners() { + if (loginListeners == null) { + loginListeners = new ArrayList<>(); + for (IConfigurationElement element : Platform.getExtensionRegistry() + .getConfigurationElementsFor(LISTENERS_EXTENSION_POINT_ID)) { + try { + if (element.getName().equals("listener")) { + OSIOLoginListener osioService = (OSIOLoginListener) element.createExecutableExtension("class"); + loginListeners.add(osioService); + } + } catch (CoreException e) { + logError("Error occured while retrieving osio login listeners", e); + } + } + } + return loginListeners; + } + + public List getOSIOServices() { + if (services == null) { + services = new ArrayList<>(); + for (IConfigurationElement element : Platform.getExtensionRegistry() + .getConfigurationElementsFor(SERVICES_EXTENSION_POINT_ID)) { + try { + if (element.getName().equals("service")) { + OSIOService osioService = (OSIOService) element.createExecutableExtension("class"); + services.add(osioService); + } + } catch (CoreException e) { + logError("Error occured while retrieving osio services", e); + } + } + } + return services; + } + +} diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/OSIOLoginListener.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/OSIOLoginListener.java new file mode 100644 index 0000000..2834565 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/OSIOLoginListener.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright (c) 2018 Red Hat Inc. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ +package com.redhat.fabric8analytics.eclipse.ui; + +public interface OSIOLoginListener { + + public void loggedIn(boolean successfull); + +} diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/OSIOService.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/OSIOService.java new file mode 100644 index 0000000..a173680 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/OSIOService.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2018 Red Hat Inc. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ +package com.redhat.fabric8analytics.eclipse.ui; + +public interface OSIOService { + + public String getServiceName(); + + public boolean isEnabled(); + + public void enable(boolean enabled) throws ServiceEnablementException; + +} diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/ServiceEnablementException.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/ServiceEnablementException.java new file mode 100644 index 0000000..9d88670 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/ServiceEnablementException.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2018 Red Hat Inc. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ + +package com.redhat.fabric8analytics.eclipse.ui; + +public class ServiceEnablementException extends Exception { + + private static final long serialVersionUID = -3361522461631654408L; + + public ServiceEnablementException(Exception e) { + super(e); + } + + public ServiceEnablementException(String msg, Exception e) { + super(msg,e ); + } +} diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/AnalysesJobHandler.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/AnalysesJobHandler.java similarity index 76% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/AnalysesJobHandler.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/AnalysesJobHandler.java index 1337d9c..6ceee68 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/AnalysesJobHandler.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/AnalysesJobHandler.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui.internal; +package com.redhat.fabric8analytics.eclipse.ui.internal; import java.io.IOException; import java.net.URL; @@ -23,13 +23,13 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IViewPart; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIProvider; -import com.redhat.fabric8analytics.lsp.eclipse.core.job.RetrieveResultsJob; -import com.redhat.fabric8analytics.lsp.eclipse.core.job.SendToFabric8AnalysisJob; -import com.redhat.fabric8analytics.lsp.eclipse.ui.EditorComposite; -import com.redhat.fabric8analytics.lsp.eclipse.ui.ExitHandler; -import com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalysisLSUIActivator; -import com.redhat.fabric8analytics.lsp.eclipse.ui.StackAnalysesView; +import com.redhat.fabric8analytics.eclipse.ui.internal.pom.EditorComposite; +import com.redhat.fabric8analytics.eclipse.ui.internal.view.StackAnalysesView; +import com.redhat.fabric8analytics.eclipse.ui.internal.view.StackAnalysisHandler; +import com.redhat.fabric8analytics.eclipse.ui.Fabric8AnalysisUIActivator; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.job.RetrieveResultsJob; +import com.redhat.fabric8analytics.eclipse.core.job.SendToFabric8AnalysisJob; public class AnalysesJobHandler { @@ -53,14 +53,14 @@ public AnalysesJobHandler(RecommenderAPIProvider provider, Set pomFiles, public void analyze() { URL url; try { - url = new URL("platform:/plugin/com.redhat.fabric8analytics.lsp.eclipse.ui/templates/index.html"); + url = new URL("platform:/plugin/"+Fabric8AnalysisUIActivator.PLUGIN_ID+"/templates/index.html"); url = FileLocator.toFileURL(url); } catch (IOException e ) { - Fabric8AnalysisLSUIActivator.getDefault().logError("Error while retrieving browser template", e); + Fabric8AnalysisUIActivator.getDefault().logError("Error while retrieving browser template", e); return; } if (editorComposite == null) { - IViewPart mainView = ExitHandler.getView(); + IViewPart mainView = StackAnalysisHandler.getView(); ((StackAnalysesView) mainView).updatebrowserUrl(url.toString()); } else { editorComposite.updateBrowser(url.toString()); @@ -106,7 +106,7 @@ private void syncWithUi(String analysisURL) { Display.getDefault().asyncExec(new Runnable() { public void run() { if (editorComposite == null) { - ((StackAnalysesView) ExitHandler.getView()).updatebrowserUrl(analysisURL); + ((StackAnalysesView) StackAnalysisHandler.getView()).updatebrowserUrl(analysisURL); } else { editorComposite.updateBrowser(analysisURL); } @@ -119,7 +119,7 @@ private void disposeBrowsers() { Display.getDefault().syncExec(new Runnable () { public void run() { if(editorComposite == null) { - ((StackAnalysesView) ExitHandler.getView()).disposebrowserUrl(); + ((StackAnalysesView) StackAnalysisHandler.getView()).disposebrowserUrl(); } else { editorComposite.disposeBrowser(); } diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/MessageDialogUtils.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/MessageDialogUtils.java similarity index 79% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/MessageDialogUtils.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/MessageDialogUtils.java index 475f84c..9f403de 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/MessageDialogUtils.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/MessageDialogUtils.java @@ -8,7 +8,7 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui.internal; +package com.redhat.fabric8analytics.eclipse.ui.internal; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.security.storage.StorageException; @@ -17,9 +17,9 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.ui.PlatformUI; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.AnalyticsAuthService; -import com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalysisLSUIActivator; +import com.redhat.fabric8analytics.eclipse.ui.Fabric8AnalysisUIActivator; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.internal.AnalyticsAuthService; public class MessageDialogUtils { @@ -38,14 +38,14 @@ public static AnalyticsAuthData proptForLogin(IProgressMonitor monitor) { try { return AnalyticsAuthService.getInstance().login(monitor); } catch (StorageException e) { - Fabric8AnalysisLSUIActivator.getDefault().logError("Error while storing Fabric8Analytics data", e); + Fabric8AnalysisUIActivator.getDefault().logError("Error while storing Fabric8Analytics data", e); } } return null; } public static void displayErrorMessage(String message) { - Fabric8AnalysisLSUIActivator.getDefault().logError(message); + Fabric8AnalysisUIActivator.getDefault().logError(message); Display.getDefault().asyncExec(new Runnable() { public void run() { MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Fabric8 error message", message); @@ -54,7 +54,7 @@ public void run() { } public static void displayErrorMessage(String message, Throwable t) { - Fabric8AnalysisLSUIActivator.getDefault().logError(message, t); + Fabric8AnalysisUIActivator.getDefault().logError(message, t); Display.getDefault().asyncExec(new Runnable() { public void run() { MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Fabric8 error message", message); diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/WorkspaceFilesFinder.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/WorkspaceFilesFinder.java similarity index 97% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/WorkspaceFilesFinder.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/WorkspaceFilesFinder.java index d777332..6107bcb 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/WorkspaceFilesFinder.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/WorkspaceFilesFinder.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui.internal; +package com.redhat.fabric8analytics.eclipse.ui.internal; import java.util.Collections; import java.util.HashSet; @@ -153,13 +153,10 @@ public IFile findLicense() throws CoreException { * @throws CoreException */ public IFile findLicense(IStructuredSelection selection) throws CoreException { - Set files = new HashSet(); if(selection instanceof IStructuredSelection) { IStructuredSelection structurredSelection = (IStructuredSelection)selection; Object firstSeleciton = structurredSelection.getFirstElement(); - IProject selectedProject = null; - if (firstSeleciton instanceof IProject) { // selectedProject = (IProject) firstSeleciton; for (Object o : selection.toList()) { diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/auth/AuthorizeHandler.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/auth/AuthorizeHandler.java new file mode 100644 index 0000000..6fa5540 --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/auth/AuthorizeHandler.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (c) 2017 Red Hat Inc.. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ + +package com.redhat.fabric8analytics.eclipse.ui.internal.auth; + +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.jobs.IJobChangeEvent; +import org.eclipse.core.runtime.jobs.JobChangeAdapter; + +import com.redhat.fabric8analytics.eclipse.ui.Fabric8AnalysisUIActivator; +import com.redhat.fabric8analytics.eclipse.ui.OSIOLoginListener; +import com.redhat.fabric8analytics.eclipse.ui.internal.MessageDialogUtils; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.job.LoginToOSIOJob; + +/** + * Handler for menu item "Enable Fabric8 Analyses". + * + * @author Geetika Batra + * + */ +public class AuthorizeHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + LoginToOSIOJob authJob = new LoginToOSIOJob(); + + authJob.addJobChangeListener(new JobChangeAdapter() { + + @Override + public void done(IJobChangeEvent event) { + AnalyticsAuthData analyticsAuthData = authJob.getAnalyticsAuthData(); + if (analyticsAuthData == null) { + List listeners = Fabric8AnalysisUIActivator.getDefault().getOSIOLoginListeners(); + if (listeners != null) { + listeners.stream().forEach(l -> l.loggedIn(false)); + } + MessageDialogUtils.displayInfoMessage("Authorization to Openshift.io was not successful"); + } else { + List listeners = Fabric8AnalysisUIActivator.getDefault().getOSIOLoginListeners(); + if (listeners != null) { + listeners.stream().forEach(l -> l.loggedIn(true)); + } + } + } + }); + + authJob.schedule(); + return null; + } +} diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/GetAnalyticsAuthDataJob.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/auth/GetAnalyticsAuthDataJob.java similarity index 77% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/GetAnalyticsAuthDataJob.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/auth/GetAnalyticsAuthDataJob.java index 1a7be20..d91a912 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/internal/GetAnalyticsAuthDataJob.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/auth/GetAnalyticsAuthDataJob.java @@ -8,7 +8,7 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui.internal; +package com.redhat.fabric8analytics.eclipse.ui.internal.auth; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; @@ -18,9 +18,10 @@ import org.eclipse.equinox.security.storage.StorageException; import org.eclipse.swt.widgets.Display; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.AnalyticsAuthService; -import com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalysisLSUIActivator; +import com.redhat.fabric8analytics.eclipse.ui.Fabric8AnalysisUIActivator; +import com.redhat.fabric8analytics.eclipse.ui.internal.MessageDialogUtils; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.internal.AnalyticsAuthService; public class GetAnalyticsAuthDataJob extends Job { @@ -40,8 +41,8 @@ protected IStatus run(IProgressMonitor progressMonitor) { } return Status.OK_STATUS; } catch (StorageException e) { - Fabric8AnalysisLSUIActivator.getDefault().logError("Error while retrieving stored data", e); - return new Status(IStatus.ERROR, Fabric8AnalysisLSUIActivator.PLUGIN_ID, + Fabric8AnalysisUIActivator.getDefault().logError("Error while retrieving stored data", e); + return new Status(IStatus.ERROR, Fabric8AnalysisUIActivator.PLUGIN_ID, "Error while retrieving Fabric8Analytics auth data", e); } } diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/EditorComposite.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/EditorComposite.java similarity index 89% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/EditorComposite.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/EditorComposite.java index 2e111f8..a4c8165 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/EditorComposite.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/EditorComposite.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui; +package com.redhat.fabric8analytics.eclipse.ui.internal.pom; import java.util.Collections; @@ -30,11 +30,11 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.ui.forms.widgets.FormToolkit; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIProvider; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.AnalysesJobHandler; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.MessageDialogUtils; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.GetAnalyticsAuthDataJob; +import com.redhat.fabric8analytics.eclipse.ui.internal.AnalysesJobHandler; +import com.redhat.fabric8analytics.eclipse.ui.internal.MessageDialogUtils; +import com.redhat.fabric8analytics.eclipse.ui.internal.auth.GetAnalyticsAuthDataJob; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; /** * Class to create composite for page Fabric8Analyses. diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8FormPage.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/Fabric8FormPage.java similarity index 97% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8FormPage.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/Fabric8FormPage.java index dab6eef..18a63b3 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8FormPage.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/Fabric8FormPage.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui; +package com.redhat.fabric8analytics.eclipse.ui.internal.pom; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.m2e.core.project.IMavenProjectChangedListener; diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8PomEditorFactory.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/Fabric8PomEditorFactory.java similarity index 78% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8PomEditorFactory.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/Fabric8PomEditorFactory.java index 2df1a0c..99fb23a 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8PomEditorFactory.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/pom/Fabric8PomEditorFactory.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui; +package com.redhat.fabric8analytics.eclipse.ui.internal.pom; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -18,6 +18,8 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.forms.editor.IFormPage; +import com.redhat.fabric8analytics.eclipse.ui.Fabric8AnalysisUIActivator; + /** * Class to create add a page with pom editor. * @@ -32,7 +34,7 @@ public void addPages(MavenPomEditor pomEditor) { try { pomEditor.addPage(page); } catch (PartInitException e) { - Fabric8AnalysisLSUIActivator.getDefault().getLog().log(new Status(IStatus.ERROR, Fabric8AnalysisLSUIActivator.getDefault().getBundle().getSymbolicName(), e.getLocalizedMessage(), e)); + Fabric8AnalysisUIActivator.getDefault().getLog().log(new Status(IStatus.ERROR, Fabric8AnalysisUIActivator.getDefault().getBundle().getSymbolicName(), e.getLocalizedMessage(), e)); } } diff --git a/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/preferences/Fabric8AnalysisPreferencePage.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/preferences/Fabric8AnalysisPreferencePage.java new file mode 100644 index 0000000..fbf861a --- /dev/null +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/preferences/Fabric8AnalysisPreferencePage.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2017 Red Hat Inc.. + * 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: + * Red Hat Incorporated - initial API and implementation + *******************************************************************************/ + +package com.redhat.fabric8analytics.eclipse.ui.internal.preferences; + +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +import com.redhat.fabric8analytics.eclipse.ui.Fabric8AnalysisUIActivator; +import com.redhat.fabric8analytics.eclipse.ui.OSIOService; +import com.redhat.fabric8analytics.eclipse.ui.ServiceEnablementException; +import com.redhat.fabric8analytics.eclipse.ui.internal.MessageDialogUtils; + +public class Fabric8AnalysisPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { + + public static final String EXTENSION_POINT_ID = "com.redhat.fabric8analytics.eclipse.ui.service.preference"; + + @Override + public void init(IWorkbench workbench) { + setTitle("Fabric8"); + setDescription("Following services will be enabled"); + } + + @Override + protected void performApply() { + super.performApply(); + } + + @Override + protected Control createContents(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + GridLayoutFactory.fillDefaults().applyTo(composite); + composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + for (OSIOService service : Fabric8AnalysisUIActivator.getDefault().getOSIOServices()) { + Button button = new Button(composite, SWT.CHECK); + button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); + button.setText(service.getServiceName()); + button.setSelection(service.isEnabled()); + button.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + try { + service.enable(button.getSelection()); + } catch (ServiceEnablementException e1) { + button.setSelection(!button.getSelection()); + MessageDialogUtils.displayErrorMessage("Error occured while enabling osio service", e1); + } + } + }); + } + return composite; + + } +} diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/StackAnalysesView.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/view/StackAnalysesView.java similarity index 94% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/StackAnalysesView.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/view/StackAnalysesView.java index 24bf691..dd661fd 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/StackAnalysesView.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/view/StackAnalysesView.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui; +package com.redhat.fabric8analytics.eclipse.ui.internal.view; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.swt.SWT; @@ -20,7 +20,7 @@ public class StackAnalysesView extends ViewPart { - public static final String NAME = "com.redhat.fabric8analytics.lsp.eclipse.ui.StackAnalysesView"; + public static final String NAME = "com.redhat.fabric8analytics.eclipse.ui.StackAnalysesView"; private static Browser browser = null; diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/ExitHandler.java b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/view/StackAnalysisHandler.java similarity index 80% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/ExitHandler.java rename to plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/view/StackAnalysisHandler.java index 266eb83..aa83e62 100644 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/ExitHandler.java +++ b/plugins/com.redhat.fabric8analytics.eclipse.ui/src/com/redhat/fabric8analytics/eclipse/ui/internal/view/StackAnalysisHandler.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui; +package com.redhat.fabric8analytics.eclipse.ui.internal.view; import java.util.Set; @@ -25,14 +25,14 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIProvider; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.AnalysesJobHandler; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.MessageDialogUtils; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.GetAnalyticsAuthDataJob; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.WorkspaceFilesFinder; +import com.redhat.fabric8analytics.eclipse.ui.internal.AnalysesJobHandler; +import com.redhat.fabric8analytics.eclipse.ui.internal.MessageDialogUtils; +import com.redhat.fabric8analytics.eclipse.ui.internal.WorkspaceFilesFinder; +import com.redhat.fabric8analytics.eclipse.ui.internal.auth.GetAnalyticsAuthDataJob; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; -public class ExitHandler extends AbstractHandler { +public class StackAnalysisHandler extends AbstractHandler { static String jobId; static IViewPart mainView = null; @@ -85,15 +85,15 @@ public void run() { } public static void setJobId(String jobId) { - ExitHandler.jobId = jobId; + StackAnalysisHandler.jobId = jobId; } public static String getJobId() { - return ExitHandler.jobId; + return StackAnalysisHandler.jobId; } public static void setView(IViewPart mainView) { - ExitHandler.mainView = mainView; + StackAnalysisHandler.mainView = mainView; } public static IViewPart getView() { diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/templates/index.html b/plugins/com.redhat.fabric8analytics.eclipse.ui/templates/index.html similarity index 100% rename from plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/templates/index.html rename to plugins/com.redhat.fabric8analytics.eclipse.ui/templates/index.html diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/META-INF/MANIFEST.MF b/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/META-INF/MANIFEST.MF deleted file mode 100644 index f49b4b1..0000000 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-SymbolicName: com.redhat.fabric8analytics.lsp.eclipse.ui;singleton:=true -Bundle-Version: 0.0.1.qualifier -Bundle-Vendor: %Bundle-Vendor -Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0", - org.eclipse.ui, - org.eclipse.swt, - org.eclipse.core.runtime, - org.eclipse.core.resources;bundle-version="3.12.0", - org.json;bundle-version="1.0.0", - org.apache.commons.io;bundle-version="2.2.0", - com.redhat.fabric8analytics.lsp.eclipse.core;bundle-version="0.0.1", - org.jboss.tools.openshift.io.ui;bundle-version="3.4.1", - org.eclipse.m2e.core, - org.eclipse.m2e.editor, - org.eclipse.ui.forms, - org.eclipse.ui.ide, - org.eclipse.m2e.maven.runtime, - org.jboss.tools.openshift.io.core, - org.eclipse.equinox.security -Eclipse-BundleShape: dir -Bundle-Activator: com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalysisLSUIActivator -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Export-Package: com.redhat.fabric8analytics.lsp.eclipse.ui, - com.redhat.fabric8analytics.lsp.eclipse.ui.internal;x-friends:="com.redhat.fabric8analytics.lsp.eclipse.ui.tests" - diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/AuthorizeHandler.java b/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/AuthorizeHandler.java deleted file mode 100644 index a297394..0000000 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/AuthorizeHandler.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Red Hat Inc.. - * 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: - * Red Hat Incorporated - initial API and implementation - *******************************************************************************/ - -package com.redhat.fabric8analytics.lsp.eclipse.ui; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.IJobChangeEvent; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.core.runtime.jobs.JobChangeAdapter; -import org.eclipse.equinox.security.storage.StorageException; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.PreferencesUtil; - -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisPreferences; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.AnalyticsAuthService; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.MessageDialogUtils; - -/** - * Handler for menu item "Enable Fabric8 Analyses". - * - * @author Geetika Batra - * - */ -public class AuthorizeHandler extends AbstractHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - - LoginToOSIOJob authJob = new LoginToOSIOJob(); - - authJob.addJobChangeListener(new JobChangeAdapter() { - - @Override - public void done(IJobChangeEvent event) { - AnalyticsAuthData analyticsAuthData = authJob.getAnalyticsAuthData(); - if (analyticsAuthData == null) { - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(false); - MessageDialogUtils.displayInfoMessage("Authorization to Openshift.io was not successful"); - return; - } - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(true); - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - PreferencesUtil - .createPreferenceDialogOn(shell, "com.redhat.fabric8analytics.lsp.eclipse.preferences", - new String[] { "com.redhat.fabric8analytics.lsp.eclipse.preferences" }, null) - .open(); - - } - }); - } - }); - - authJob.schedule(); - return null; - } - - class LoginToOSIOJob extends Job { - - private AnalyticsAuthData analyticsAuthData; - - public LoginToOSIOJob() { - super("Login to Openshift.io"); - } - - @Override - protected IStatus run(IProgressMonitor progressMonitor) { - try { - analyticsAuthData = AnalyticsAuthService.getInstance().login(progressMonitor); - } catch (StorageException e) { - return new Status(IStatus.ERROR, Fabric8AnalysisLSUIActivator.PLUGIN_ID, "Error occured while storing Fabric8Analytics data", e); - } - return Status.OK_STATUS; - } - - public AnalyticsAuthData getAnalyticsAuthData() { - return analyticsAuthData; - } - - } -} diff --git a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalysisPreferencePage.java b/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalysisPreferencePage.java deleted file mode 100644 index 4c83bc2..0000000 --- a/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalysisPreferencePage.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Red Hat Inc.. - * 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: - * Red Hat Incorporated - initial API and implementation - *******************************************************************************/ - -package com.redhat.fabric8analytics.lsp.eclipse.ui; - -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.equinox.security.storage.StorageException; -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.preferences.ScopedPreferenceStore; - -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisPreferences; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.AnalyticsAuthService; - -public class Fabric8AnalysisPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - static final String PREFERENCE_PAGE_ID = Fabric8AnalysisLSUIActivator.getDefault().getBundle().getSymbolicName() - + ".preferences"; //$NON-NLS-1$ - - private BooleanFieldEditor enableLSPField; - - public Fabric8AnalysisPreferencePage() { - - } - - @Override - public void init(IWorkbench workbench) { - setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, Fabric8AnalysisLSCoreActivator.PLUGIN_ID)); - setTitle("Fabric8"); - setDescription("Following services will be enabled"); - } - - @Override - protected void createFieldEditors() { - enableLSPField = new BooleanFieldEditor(Fabric8AnalysisPreferences.LSP_SERVER_ENABLED, - "&Fabric8 Analytics LSP Server", getFieldEditorParent()); - addField(enableLSPField); - } - - @Override - protected void performApply() { - super.performApply(); - if (enableLSPField != null) { - enableLSPField.load(); - } - } - - @Override - public void propertyChange(PropertyChangeEvent event) { - if(enableLSPField.equals(event.getSource()) && (Boolean)event.getNewValue()) { - // login - try { - AnalyticsAuthService.getInstance().login(new NullProgressMonitor()); - } catch (StorageException e) { - Fabric8AnalysisLSUIActivator.getDefault().logError("Error while logging to openshift.io", e); - } - } - super.propertyChange(event); - } -} diff --git a/plugins/pom.xml b/plugins/pom.xml index b0bc989..84ad343 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -7,13 +7,14 @@ com.redhat.fabric8analytics.parent 0.0.1-SNAPSHOT - com.redhat.fabric8analytics.eclipse plugins com.redhat.fabric8analytics.eclipse plugins pom - com.redhat.fabric8analytics.lsp.eclipse.core - com.redhat.fabric8analytics.lsp.eclipse.ui + com.redhat.fabric8analytics.eclipse.core + com.redhat.fabric8analytics.eclipse.ui + com.redhat.fabric8analytics.eclipse.lsp.core + com.redhat.fabric8analytics.eclipse.lsp.ui diff --git a/site/category.xml b/site/category.xml index fd91e12..735d4d0 100644 --- a/site/category.xml +++ b/site/category.xml @@ -1,17 +1,19 @@ -Fabric8Analytics Language Server Integration +Fabric8Analytics Integration - - Fabric8Analytics Language Server Integration + + Fabric8Analytics Integration - - + + + + diff --git a/site/pom.xml b/site/pom.xml index 2b2c386..3cf2132 100644 --- a/site/pom.xml +++ b/site/pom.xml @@ -11,7 +11,7 @@ com.redhat.fabric8analytics.eclipse site - Fabric8Analytics Language Server integration update site + Fabric8Analytics integration update site eclipse-repository ${project.name} diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/META-INF/MANIFEST.MF b/tests/com.redhat.fabric8analytics.eclipse.core.tests/META-INF/MANIFEST.MF similarity index 61% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/META-INF/MANIFEST.MF rename to tests/com.redhat.fabric8analytics.eclipse.core.tests/META-INF/MANIFEST.MF index 7aaaec6..cec2e68 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/META-INF/MANIFEST.MF +++ b/tests/com.redhat.fabric8analytics.eclipse.core.tests/META-INF/MANIFEST.MF @@ -1,20 +1,20 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: Fabricate8analysis Core Tests -Bundle-SymbolicName: com.redhat.fabric8analytics.lsp.eclipse.core.tests;singleton:=true +Bundle-Name: Fabric8Analysis Core Tests +Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.core.tests;singleton:=true Bundle-Version: 0.0.1.qualifier Bundle-ActivationPolicy: lazy Bundle-Vendor: JBoss by Red Hat Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.eclipse.reddeer.go;bundle-version="2.0.0", - org.junit;bundle-version="4.8.2", - com.redhat.fabric8analytics.lsp.eclipse.core;bundle-version="0.0.1", +Require-Bundle: org.junit;bundle-version="4.8.2", + com.redhat.fabric8analytics.eclipse.core;bundle-version="0.0.1", org.mockito;bundle-version="1.9.5", org.hamcrest.library;bundle-version="1.3.0", org.apache.httpcomponents.httpclient;bundle-version="4.5.2", org.apache.httpcomponents.httpcore;bundle-version="4.4.6", org.eclipse.core.resources;bundle-version="3.12.0", org.apache.commons.io;bundle-version="2.2.0", - org.json + org.json, + org.eclipse.core.runtime diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/build.properties b/tests/com.redhat.fabric8analytics.eclipse.core.tests/build.properties similarity index 100% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/build.properties rename to tests/com.redhat.fabric8analytics.eclipse.core.tests/build.properties diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/pom.xml b/tests/com.redhat.fabric8analytics.eclipse.core.tests/pom.xml similarity index 89% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/pom.xml rename to tests/com.redhat.fabric8analytics.eclipse.core.tests/pom.xml index a62b853..30e0676 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/pom.xml +++ b/tests/com.redhat.fabric8analytics.eclipse.core.tests/pom.xml @@ -7,8 +7,7 @@ tests 0.0.1-SNAPSHOT - com.redhat.fabric8analytics.lsp.eclipse.core.tests - com.redhat.fabric8analytics.lsp.eclipse.core.tests + com.redhat.fabric8analytics.eclipse.core.tests eclipse-test-plugin diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/src/com/redhat/fabric8analytics/lsp/eclipse/core/tests/RecommenderAPIProviderTest.java b/tests/com.redhat.fabric8analytics.eclipse.core.tests/src/com/redhat/fabric8analytics/eclipse/core/tests/RecommenderAPIProviderTest.java similarity index 97% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/src/com/redhat/fabric8analytics/lsp/eclipse/core/tests/RecommenderAPIProviderTest.java rename to tests/com.redhat.fabric8analytics.eclipse.core.tests/src/com/redhat/fabric8analytics/eclipse/core/tests/RecommenderAPIProviderTest.java index 162b878..6712919 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/src/com/redhat/fabric8analytics/lsp/eclipse/core/tests/RecommenderAPIProviderTest.java +++ b/tests/com.redhat.fabric8analytics.eclipse.core.tests/src/com/redhat/fabric8analytics/eclipse/core/tests/RecommenderAPIProviderTest.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core.tests; +package com.redhat.fabric8analytics.eclipse.core.tests; import static org.hamcrest.CoreMatchers.containsString; @@ -51,10 +51,10 @@ import org.junit.Test; import org.mockito.ArgumentCaptor; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIException; -import com.redhat.fabric8analytics.lsp.eclipse.core.RecommenderAPIProvider; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIException; +import com.redhat.fabric8analytics.eclipse.core.api.RecommenderAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData; public class RecommenderAPIProviderTest { diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/src/com/redhat/fabric8analytics/lsp/eclipse/core/tests/ThreeScaleAPIProviderTest.java b/tests/com.redhat.fabric8analytics.eclipse.core.tests/src/com/redhat/fabric8analytics/eclipse/core/tests/ThreeScaleAPIProviderTest.java similarity index 95% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/src/com/redhat/fabric8analytics/lsp/eclipse/core/tests/ThreeScaleAPIProviderTest.java rename to tests/com.redhat.fabric8analytics.eclipse.core.tests/src/com/redhat/fabric8analytics/eclipse/core/tests/ThreeScaleAPIProviderTest.java index 8272bab..8f27cfc 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.core.tests/src/com/redhat/fabric8analytics/lsp/eclipse/core/tests/ThreeScaleAPIProviderTest.java +++ b/tests/com.redhat.fabric8analytics.eclipse.core.tests/src/com/redhat/fabric8analytics/eclipse/core/tests/ThreeScaleAPIProviderTest.java @@ -9,7 +9,7 @@ * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.core.tests; +package com.redhat.fabric8analytics.eclipse.core.tests; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertThat; @@ -34,9 +34,9 @@ import org.junit.Test; import org.mockito.ArgumentCaptor; -import com.redhat.fabric8analytics.lsp.eclipse.core.ThreeScaleAPIException; -import com.redhat.fabric8analytics.lsp.eclipse.core.ThreeScaleAPIProvider; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData; +import com.redhat.fabric8analytics.eclipse.core.api.ThreeScaleAPIException; +import com.redhat.fabric8analytics.eclipse.core.api.ThreeScaleAPIProvider; +import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData; public class ThreeScaleAPIProviderTest { diff --git a/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/META-INF/MANIFEST.MF b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8d57aaa --- /dev/null +++ b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,23 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Fabricate8analysis UI Tests +Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.lsp.core.tests;singleton:=true +Bundle-Version: 0.0.1.qualifier +Bundle-ActivationPolicy: lazy +Bundle-Vendor: JBoss by Red Hat +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.junit;bundle-version="4.8.2", + org.eclipse.core.resources, + org.eclipse.m2e.core.ui, + org.eclipse.m2e.lifecyclemapping.defaults, + org.mockito;bundle-version="1.9.5", + org.hamcrest.library;bundle-version="1.3.0", + com.redhat.fabric8analytics.eclipse.core;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.ui;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.lsp.core;bundle-version="0.0.1", + org.eclipse.equinox.security, + org.eclipse.lsp4e, + org.eclipse.lsp4j.jsonrpc, + org.eclipse.lsp4j, + org.eclipse.core.runtime, + org.eclipse.jface diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/build.properties b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/build.properties similarity index 100% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/build.properties rename to tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/build.properties diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/pom.xml b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/pom.xml similarity index 92% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/pom.xml rename to tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/pom.xml index 70daf77..bb471ce 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/pom.xml +++ b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/pom.xml @@ -7,8 +7,7 @@ tests 0.0.1-SNAPSHOT - com.redhat.fabric8analytics.lsp.eclipse.ui.tests - com.redhat.fabric8analytics.lsp.eclipse.ui.tests + com.redhat.fabric8analytics.eclipse.lsp.core.tests eclipse-test-plugin diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/resources/securepass b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/resources/securepass similarity index 100% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/resources/securepass rename to tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/resources/securepass diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/Fabric8AnalyticsStreamConnectionProviderTest.java b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/src/com/redhat/fabric8analytics/eclipse/lsp/core/tests/Fabric8AnalyticsStreamConnectionProviderTest.java similarity index 83% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/Fabric8AnalyticsStreamConnectionProviderTest.java rename to tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/src/com/redhat/fabric8analytics/eclipse/lsp/core/tests/Fabric8AnalyticsStreamConnectionProviderTest.java index b4836f1..56f7d16 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/Fabric8AnalyticsStreamConnectionProviderTest.java +++ b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/src/com/redhat/fabric8analytics/eclipse/lsp/core/tests/Fabric8AnalyticsStreamConnectionProviderTest.java @@ -8,7 +8,7 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui.tests; +package com.redhat.fabric8analytics.eclipse.lsp.core.tests; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; @@ -34,11 +34,11 @@ import org.junit.Before; import org.junit.Test; -import com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisPreferences; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData; -import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.AnalyticsAuthService; -import com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalyticsStreamConnectionProvider; +import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData; +import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData; +import com.redhat.fabric8analytics.eclipse.core.internal.AnalyticsAuthService; +import com.redhat.fabric8analytics.eclipse.lsp.core.Fabric8AnalysisLSPPreferences; +import com.redhat.fabric8analytics.eclipse.lsp.core.Fabric8AnalyticsStreamConnectionProvider; public class Fabric8AnalyticsStreamConnectionProviderTest { @@ -50,7 +50,7 @@ public class Fabric8AnalyticsStreamConnectionProviderTest { @Before public void setup() throws StorageException { - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(true); + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(true); ThreeScaleData scaleData = new ThreeScaleData("www.myurl.com", "www.myurl.com", "userKey"); AnalyticsAuthData data = new AnalyticsAuthData(scaleData, TOKEN); @@ -63,7 +63,7 @@ public void setup() throws StorageException { @After public void after() { - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(true); + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(true); } @Test @@ -102,7 +102,7 @@ public void start_noToken() throws IOException, StorageException { @Test(expected=IOException.class) public void start_analysesDisabled() throws IOException { - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(false); + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(false); provider.start(); } @@ -131,12 +131,12 @@ public void startAndStop() throws IOException { @Test public void propertyEnabled() throws IOException { - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(false); + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(false); assertThat(provider.getInputStream(), is(nullValue())); assertThat(provider.getOutputStream(), is(nullValue())); - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(true); + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(true); assertThat(provider.getInputStream(), is(not(nullValue()))); assertThat(provider.getOutputStream(), is(not(nullValue()))); @@ -144,7 +144,7 @@ public void propertyEnabled() throws IOException { @Test public void propertyDisabled() throws IOException { - Fabric8AnalysisPreferences.getInstance().setLSPServerEnabled(false); + Fabric8AnalysisLSPPreferences.getInstance().setLSPServerEnabled(false); assertTrue("No exception expected", true); // there is no way of knowing if the server is stopped diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/Fabric8AnalyticsStreamConnectionProviderWrapper.java b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/src/com/redhat/fabric8analytics/eclipse/lsp/core/tests/Fabric8AnalyticsStreamConnectionProviderWrapper.java similarity index 81% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/Fabric8AnalyticsStreamConnectionProviderWrapper.java rename to tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/src/com/redhat/fabric8analytics/eclipse/lsp/core/tests/Fabric8AnalyticsStreamConnectionProviderWrapper.java index 85757c8..064c466 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/Fabric8AnalyticsStreamConnectionProviderWrapper.java +++ b/tests/com.redhat.fabric8analytics.eclipse.lsp.core.tests/src/com/redhat/fabric8analytics/eclipse/lsp/core/tests/Fabric8AnalyticsStreamConnectionProviderWrapper.java @@ -8,10 +8,10 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui.tests; +package com.redhat.fabric8analytics.eclipse.lsp.core.tests; -import com.redhat.fabric8analytics.lsp.eclipse.core.internal.AnalyticsAuthService; -import com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalyticsStreamConnectionProvider; +import com.redhat.fabric8analytics.eclipse.core.internal.AnalyticsAuthService; +import com.redhat.fabric8analytics.eclipse.lsp.core.Fabric8AnalyticsStreamConnectionProvider; //wrapper class for Fabric8AnalyticsStreamConnectionProvider to be able to access protected methods public class Fabric8AnalyticsStreamConnectionProviderWrapper extends Fabric8AnalyticsStreamConnectionProvider{ diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/META-INF/MANIFEST.MF b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/META-INF/MANIFEST.MF similarity index 55% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/META-INF/MANIFEST.MF rename to tests/com.redhat.fabric8analytics.eclipse.ui.tests/META-INF/MANIFEST.MF index 760262b..e54f6b1 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/META-INF/MANIFEST.MF +++ b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/META-INF/MANIFEST.MF @@ -1,21 +1,23 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Fabricate8analysis UI Tests -Bundle-SymbolicName: com.redhat.fabric8analytics.lsp.eclipse.ui.tests;singleton:=true +Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.ui.tests;singleton:=true Bundle-Version: 0.0.1.qualifier Bundle-ActivationPolicy: lazy Bundle-Vendor: JBoss by Red Hat Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.eclipse.reddeer.go;bundle-version="2.0.0", - org.junit;bundle-version="4.8.2", +Require-Bundle: org.junit;bundle-version="4.8.2", org.eclipse.core.resources, org.eclipse.m2e.core.ui, org.eclipse.m2e.lifecyclemapping.defaults, org.mockito;bundle-version="1.9.5", org.hamcrest.library;bundle-version="1.3.0", - com.redhat.fabric8analytics.lsp.eclipse.core;bundle-version="0.0.1", - com.redhat.fabric8analytics.lsp.eclipse.ui;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.core;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.ui;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.lsp.core;bundle-version="0.0.1", org.eclipse.equinox.security, org.eclipse.lsp4e, org.eclipse.lsp4j.jsonrpc, - org.eclipse.lsp4j + org.eclipse.lsp4j, + org.eclipse.core.runtime, + org.eclipse.jface diff --git a/tests/com.redhat.fabric8analytics.eclipse.ui.tests/build.properties b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/build.properties new file mode 100644 index 0000000..34d2e4d --- /dev/null +++ b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/tests/com.redhat.fabric8analytics.eclipse.ui.tests/pom.xml b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/pom.xml new file mode 100644 index 0000000..6b4cb86 --- /dev/null +++ b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + com.redhat.fabric8analytics.tests + tests + 0.0.1-SNAPSHOT + + com.redhat.fabric8analytics.eclipse.ui.tests + eclipse-test-plugin + + + + + org.eclipse.tycho + tycho-surefire-plugin + + -eclipse.password ${project.basedir}/resources/securepass + + **/*Test.class + + + **/Abstract*.class + + + + p2-installable-unit + org.mockito + 1.9.5 + + + p2-installable-unit + org.hamcrest + 0.0.0 + + + + + + org.eclipse.tycho + target-platform-configuration + + p2 + consider + true + + + + p2-installable-unit + org.eclipse.equinox.p2.core.feature.feature.group + 0.0.0 + + + + + + + + diff --git a/tests/com.redhat.fabric8analytics.eclipse.ui.tests/resources/securepass b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/resources/securepass new file mode 100644 index 0000000..b7e5ff7 --- /dev/null +++ b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/resources/securepass @@ -0,0 +1 @@ +masterpassword \ No newline at end of file diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/WorkspaceFilesFinderTest.java b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/src/com/redhat/fabric8analytics/eclipse/ui/tests/WorkspaceFilesFinderTest.java similarity index 98% rename from tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/WorkspaceFilesFinderTest.java rename to tests/com.redhat.fabric8analytics.eclipse.ui.tests/src/com/redhat/fabric8analytics/eclipse/ui/tests/WorkspaceFilesFinderTest.java index 44d9a9d..5f49abb 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.tests/src/com/redhat/fabric8analytics/lsp/eclipse/ui/tests/WorkspaceFilesFinderTest.java +++ b/tests/com.redhat.fabric8analytics.eclipse.ui.tests/src/com/redhat/fabric8analytics/eclipse/ui/tests/WorkspaceFilesFinderTest.java @@ -8,7 +8,7 @@ * Contributors: * Red Hat Incorporated - initial API and implementation *******************************************************************************/ -package com.redhat.fabric8analytics.lsp.eclipse.ui.tests; +package com.redhat.fabric8analytics.eclipse.ui.tests; import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.is; @@ -36,7 +36,7 @@ import org.junit.After; import org.junit.Test; -import com.redhat.fabric8analytics.lsp.eclipse.ui.internal.WorkspaceFilesFinder; +import com.redhat.fabric8analytics.eclipse.ui.internal.WorkspaceFilesFinder; public class WorkspaceFilesFinderTest { diff --git a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.itests/META-INF/MANIFEST.MF b/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.itests/META-INF/MANIFEST.MF index 7e44bfc..b90f21e 100644 --- a/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.itests/META-INF/MANIFEST.MF +++ b/tests/com.redhat.fabric8analytics.lsp.eclipse.ui.itests/META-INF/MANIFEST.MF @@ -12,7 +12,9 @@ Require-Bundle: org.eclipse.reddeer.go;bundle-version="2.0.0", org.eclipse.core.resources, org.eclipse.m2e.core.ui, org.eclipse.m2e.lifecyclemapping.defaults, - com.redhat.fabric8analytics.lsp.eclipse.core;bundle-version="0.0.1", - com.redhat.fabric8analytics.lsp.eclipse.ui;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.core;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.ui;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.lsp.core;bundle-version="0.0.1", + com.redhat.fabric8analytics.eclipse.lsp.ui;bundle-version="0.0.1", org.jboss.tools.openshift.common.ui;bundle-version="3.4.2", org.jboss.tools.openshift.reddeer;bundle-version="3.4.2" diff --git a/tests/pom.xml b/tests/pom.xml index dc1eb32..4184221 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -17,7 +17,8 @@ - com.redhat.fabric8analytics.lsp.eclipse.core.tests - com.redhat.fabric8analytics.lsp.eclipse.ui.tests + com.redhat.fabric8analytics.eclipse.core.tests + com.redhat.fabric8analytics.eclipse.ui.tests + com.redhat.fabric8analytics.eclipse.lsp.core.tests