Skip to content

Commit 8bb9be9

Browse files
committed
Refactor plugins - Create Core and UI plugins for base and LSP functionality. Fixes #143
Signed-off-by: Rastislav Wagner <rawagner@redhat.com>
1 parent 6fb8ca3 commit 8bb9be9

83 files changed

Lines changed: 1197 additions & 428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/.gitignore renamed to plugins/com.redhat.fabric8analytics.eclipse.core/.gitignore

File renamed without changes.

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/META-INF/MANIFEST.MF renamed to plugins/com.redhat.fabric8analytics.eclipse.core/META-INF/MANIFEST.MF

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
4-
Bundle-SymbolicName: com.redhat.fabric8analytics.lsp.eclipse.core;singleton:=true
4+
Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.core;singleton:=true
55
Bundle-Version: 0.0.1.qualifier
66
Bundle-Vendor: %Bundle-Vendor
77
Bundle-Localization: plugin
88
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
9-
Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0",
10-
org.eclipse.core.runtime,
9+
Require-Bundle: org.eclipse.core.runtime,
1110
org.eclipse.core.resources;bundle-version="3.12.0",
1211
org.apache.httpcomponents.httpclient;bundle-version="4.5.2",
1312
org.apache.httpcomponents.httpcore;bundle-version="4.4.6",
@@ -18,13 +17,13 @@ Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0",
1817
org.eclipse.m2e.core,
1918
org.eclipse.m2e.maven.runtime,
2019
org.jboss.tools.openshift.io.core
21-
Eclipse-BundleShape: dir
22-
Bundle-Activator: com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator
20+
Bundle-Activator: com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator
2321
Bundle-ActivationPolicy: lazy
2422
Bundle-ClassPath: .
25-
Export-Package: com.redhat.fabric8analytics.lsp.eclipse.core,
26-
com.redhat.fabric8analytics.lsp.eclipse.core.job,
27-
com.redhat.fabric8analytics.lsp.eclipse.core.data,
28-
com.redhat.fabric8analytics.lsp.eclipse.core.internal;x-friends:=com.redhat.fabric8analytics.lsp.eclipse.ui
23+
Export-Package: com.redhat.fabric8analytics.eclipse.core,
24+
com.redhat.fabric8analytics.eclipse.core.data,
25+
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",
26+
com.redhat.fabric8analytics.eclipse.core.job,
27+
com.redhat.fabric8analytics.eclipse.core.api
2928

3029

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/build.properties renamed to plugins/com.redhat.fabric8analytics.eclipse.core/build.properties

File renamed without changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Bundle-Name=Fabric8Analytics Core Plugin
2+
Bundle-Vendor=JBoss by Red Hat

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/pom.xml renamed to plugins/com.redhat.fabric8analytics.eclipse.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<version>0.0.1-SNAPSHOT</version>
77
</parent>
88

9-
<artifactId>com.redhat.fabric8analytics.lsp.eclipse.core</artifactId>
9+
<artifactId>com.redhat.fabric8analytics.eclipse.core</artifactId>
1010
<packaging>eclipse-plugin</packaging>
1111

1212
</project>

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisLSCoreActivator.java renamed to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisCoreActivator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core;
1313

1414
import org.eclipse.core.runtime.IStatus;
1515
import org.eclipse.core.runtime.Plugin;
@@ -19,17 +19,17 @@
1919
/**
2020
* The activator class controls the plug-in life cycle
2121
*/
22-
public class Fabric8AnalysisLSCoreActivator extends Plugin {
22+
public class Fabric8AnalysisCoreActivator extends Plugin {
2323

24-
public static final String PLUGIN_ID = "com.redhat.fabric8analytics.lsp.eclipse.core";
24+
public static final String PLUGIN_ID = "com.redhat.fabric8analytics.eclipse.core";
2525

2626
// The shared instance
27-
private static Fabric8AnalysisLSCoreActivator plugin;
27+
private static Fabric8AnalysisCoreActivator plugin;
2828

2929
/**
3030
* The constructor
3131
*/
32-
public Fabric8AnalysisLSCoreActivator() {
32+
public Fabric8AnalysisCoreActivator() {
3333
}
3434

3535
@Override
@@ -49,7 +49,7 @@ public void stop(BundleContext context) throws Exception {
4949
*
5050
* @return the shared instance
5151
*/
52-
public static Fabric8AnalysisLSCoreActivator getDefault() {
52+
public static Fabric8AnalysisCoreActivator getDefault() {
5353
return plugin;
5454
}
5555

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/Fabric8AnalysisPreferences.java renamed to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/Fabric8AnalysisPreferences.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@
88
* Contributors:
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
11-
package com.redhat.fabric8analytics.lsp.eclipse.core;
11+
package com.redhat.fabric8analytics.eclipse.core;
1212

1313
import org.eclipse.core.runtime.preferences.InstanceScope;
1414
import org.eclipse.equinox.security.storage.ISecurePreferences;
1515
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
1616
import org.eclipse.equinox.security.storage.StorageException;
1717

18-
import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData;
18+
import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData;
1919

2020
public class Fabric8AnalysisPreferences {
2121

22-
public static final String LSP_SERVER_ENABLED = "fabric8AnalysisPreferences.LSP_ENABLED";
2322
public static final String PROD_URL = "fabric8AnalysisPreferences.PROD_URL";
2423
public static final String STAGE_URL = "fabric8AnalysisPreferences.STAGE_URL";
2524
public static final String USER_KEY = "fabric8AnalysisPreferences.USER_KEY";
@@ -39,28 +38,20 @@ public static Fabric8AnalysisPreferences getInstance() {
3938
return instance;
4039
}
4140

42-
public boolean isLSPServerEnabled() {
43-
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).getBoolean(LSP_SERVER_ENABLED, false);
44-
}
45-
46-
public void setLSPServerEnabled(boolean enabled) {
47-
InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).putBoolean(LSP_SERVER_ENABLED, enabled);
48-
}
49-
5041
public String getProdURL() {
51-
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).get(PROD_URL, null);
42+
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).get(PROD_URL, null);
5243
}
5344

5445
public void setProdURL(String prodURL) {
55-
InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).put(PROD_URL, prodURL);
46+
InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).put(PROD_URL, prodURL);
5647
}
5748

5849
public String getStageURL() {
59-
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).get(STAGE_URL, null);
50+
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).get(STAGE_URL, null);
6051
}
6152

6253
public void setStageURL(String stageURL) {
63-
InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).put(STAGE_URL, stageURL);
54+
InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).put(STAGE_URL, stageURL);
6455
}
6556

6657
public String getUserKey() throws StorageException {

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIException.java renamed to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core.api;
1313

1414
import org.json.JSONObject;
1515

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/RecommenderAPIProvider.java renamed to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/RecommenderAPIProvider.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core.api;
1313

1414

1515
import java.io.File;
@@ -31,8 +31,9 @@
3131
import org.json.JSONException;
3232
import org.json.JSONObject;
3333

34-
import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData;
35-
import com.redhat.fabric8analytics.lsp.eclipse.core.internal.PomContentBody;
34+
import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator;
35+
import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData;
36+
import com.redhat.fabric8analytics.eclipse.core.internal.PomContentBody;
3637

3738
/**
3839
* Provides access to Recommender API server
@@ -132,7 +133,7 @@ public boolean analysesFinished(String jobId) throws RecommenderAPIException {
132133
int responseCode = response.getStatusLine().getStatusCode();
133134

134135
// TODO - for debug purposes - should be removed later
135-
Fabric8AnalysisLSCoreActivator.getDefault().logInfo("F8 server response code: " + responseCode);
136+
Fabric8AnalysisCoreActivator.getDefault().logInfo("F8 server response code: " + responseCode);
136137

137138
if (responseCode == HttpStatus.SC_OK) {
138139
return true;

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/src/com/redhat/fabric8analytics/lsp/eclipse/core/ThreeScaleAPIException.java renamed to plugins/com.redhat.fabric8analytics.eclipse.core/src/com/redhat/fabric8analytics/eclipse/core/api/ThreeScaleAPIException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core.api;
1313

1414
import org.json.JSONObject;
1515

0 commit comments

Comments
 (0)