From 57eee2bd7329c183751da201e28c69854fceddf2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 22 Dec 2016 19:46:41 -0300 Subject: [PATCH] Unused files removed --- .gitignore | 3 +- .idea/compiler.xml | 22 - .idea/copyright/profiles_settings.xml | 3 - .idea/libraries/cglib_2_2_0_b14.xml | 9 - .idea/libraries/guava_14_0_1.xml | 9 - .idea/libraries/hk2_api_2_2_0_b14.xml | 9 - .idea/libraries/hk2_locator_2_2_0_b14.xml | 9 - .idea/libraries/hk2_utils_2_2_0_b14.xml | 9 - .idea/libraries/httpclient_4_3_1.xml | 9 - .idea/libraries/httpcore_4_3.xml | 9 - .idea/libraries/jackson_annotations_2_2_3.xml | 9 - .idea/libraries/jackson_core_2_2_3.xml | 9 - .idea/libraries/jackson_databind_2_2_3.xml | 9 - .idea/libraries/javax_inject_2_2_0_b14.xml | 9 - .idea/libraries/javax_ws_rs_api_2_0.xml | 9 - .idea/libraries/jersey_bundle_1_19_1.xml | 9 - .idea/libraries/jersey_client.xml | 9 - .idea/libraries/jersey_common.xml | 9 - .idea/libraries/joda_time_2_3.xml | 9 - .idea/libraries/log4j_1_2_17.xml | 9 - .idea/misc.xml | 57 - .idea/modules.xml | 8 - .idea/uiDesigner.xml | 124 -- .idea/vcs.xml | 6 - .idea/workspace.xml | 1675 ----------------- .../client/core/CodealikeTrackerPlugin.java | 167 -- .../client/core/codealike.properties | 6 - .../client/core/codealike.properties.dev | 6 - .../internal/startup/codealike.properties | 6 - .../internal/startup/codealike.properties.dev | 6 - .../tracking/build/ResourceDeltaVisitor.java | 80 - .../workspace/WorkspaceChangesListener.java | 74 - .../core/internal/utils/EditorUtils.java | 124 -- .../core/internal/utils/WorkbenchUtils.java | 121 -- 34 files changed, 2 insertions(+), 2639 deletions(-) delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/libraries/cglib_2_2_0_b14.xml delete mode 100644 .idea/libraries/guava_14_0_1.xml delete mode 100644 .idea/libraries/hk2_api_2_2_0_b14.xml delete mode 100644 .idea/libraries/hk2_locator_2_2_0_b14.xml delete mode 100644 .idea/libraries/hk2_utils_2_2_0_b14.xml delete mode 100644 .idea/libraries/httpclient_4_3_1.xml delete mode 100644 .idea/libraries/httpcore_4_3.xml delete mode 100644 .idea/libraries/jackson_annotations_2_2_3.xml delete mode 100644 .idea/libraries/jackson_core_2_2_3.xml delete mode 100644 .idea/libraries/jackson_databind_2_2_3.xml delete mode 100644 .idea/libraries/javax_inject_2_2_0_b14.xml delete mode 100644 .idea/libraries/javax_ws_rs_api_2_0.xml delete mode 100644 .idea/libraries/jersey_bundle_1_19_1.xml delete mode 100644 .idea/libraries/jersey_client.xml delete mode 100644 .idea/libraries/jersey_common.xml delete mode 100644 .idea/libraries/joda_time_2_3.xml delete mode 100644 .idea/libraries/log4j_1_2_17.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/uiDesigner.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml delete mode 100644 src/com/codealike/client/core/CodealikeTrackerPlugin.java delete mode 100644 src/com/codealike/client/core/codealike.properties delete mode 100644 src/com/codealike/client/core/codealike.properties.dev delete mode 100644 src/com/codealike/client/core/internal/startup/codealike.properties delete mode 100644 src/com/codealike/client/core/internal/startup/codealike.properties.dev delete mode 100644 src/com/codealike/client/core/internal/tracking/build/ResourceDeltaVisitor.java delete mode 100644 src/com/codealike/client/core/internal/tracking/workspace/WorkspaceChangesListener.java delete mode 100644 src/com/codealike/client/core/internal/utils/EditorUtils.java delete mode 100644 src/com/codealike/client/core/internal/utils/WorkbenchUtils.java diff --git a/.gitignore b/.gitignore index 4166ff1..6b55e98 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -out \ No newline at end of file +out +.idea/ diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 96cc43e..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/libraries/cglib_2_2_0_b14.xml b/.idea/libraries/cglib_2_2_0_b14.xml deleted file mode 100644 index cea3f55..0000000 --- a/.idea/libraries/cglib_2_2_0_b14.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/guava_14_0_1.xml b/.idea/libraries/guava_14_0_1.xml deleted file mode 100644 index b34e57b..0000000 --- a/.idea/libraries/guava_14_0_1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/hk2_api_2_2_0_b14.xml b/.idea/libraries/hk2_api_2_2_0_b14.xml deleted file mode 100644 index a6d30a4..0000000 --- a/.idea/libraries/hk2_api_2_2_0_b14.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/hk2_locator_2_2_0_b14.xml b/.idea/libraries/hk2_locator_2_2_0_b14.xml deleted file mode 100644 index 9ec1ce9..0000000 --- a/.idea/libraries/hk2_locator_2_2_0_b14.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/hk2_utils_2_2_0_b14.xml b/.idea/libraries/hk2_utils_2_2_0_b14.xml deleted file mode 100644 index 360b5d5..0000000 --- a/.idea/libraries/hk2_utils_2_2_0_b14.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/httpclient_4_3_1.xml b/.idea/libraries/httpclient_4_3_1.xml deleted file mode 100644 index c896abf..0000000 --- a/.idea/libraries/httpclient_4_3_1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/httpcore_4_3.xml b/.idea/libraries/httpcore_4_3.xml deleted file mode 100644 index fc8887a..0000000 --- a/.idea/libraries/httpcore_4_3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/jackson_annotations_2_2_3.xml b/.idea/libraries/jackson_annotations_2_2_3.xml deleted file mode 100644 index 55b56c1..0000000 --- a/.idea/libraries/jackson_annotations_2_2_3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/jackson_core_2_2_3.xml b/.idea/libraries/jackson_core_2_2_3.xml deleted file mode 100644 index ad35fb7..0000000 --- a/.idea/libraries/jackson_core_2_2_3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/jackson_databind_2_2_3.xml b/.idea/libraries/jackson_databind_2_2_3.xml deleted file mode 100644 index f91c344..0000000 --- a/.idea/libraries/jackson_databind_2_2_3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/javax_inject_2_2_0_b14.xml b/.idea/libraries/javax_inject_2_2_0_b14.xml deleted file mode 100644 index 713bf56..0000000 --- a/.idea/libraries/javax_inject_2_2_0_b14.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/javax_ws_rs_api_2_0.xml b/.idea/libraries/javax_ws_rs_api_2_0.xml deleted file mode 100644 index 079e6a3..0000000 --- a/.idea/libraries/javax_ws_rs_api_2_0.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/jersey_bundle_1_19_1.xml b/.idea/libraries/jersey_bundle_1_19_1.xml deleted file mode 100644 index 6a78c15..0000000 --- a/.idea/libraries/jersey_bundle_1_19_1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/jersey_client.xml b/.idea/libraries/jersey_client.xml deleted file mode 100644 index 2368f5a..0000000 --- a/.idea/libraries/jersey_client.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/jersey_common.xml b/.idea/libraries/jersey_common.xml deleted file mode 100644 index d3bf636..0000000 --- a/.idea/libraries/jersey_common.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/joda_time_2_3.xml b/.idea/libraries/joda_time_2_3.xml deleted file mode 100644 index 10bbcdf..0000000 --- a/.idea/libraries/joda_time_2_3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/log4j_1_2_17.xml b/.idea/libraries/log4j_1_2_17.xml deleted file mode 100644 index da93061..0000000 --- a/.idea/libraries/log4j_1_2_17.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 6755e21..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 3b87238..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index e96534f..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 587775d..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,1675 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Java - - - Probable bugsJava - - - - - MalformedRegex - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1478296027067 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - file://$PROJECT_DIR$/src/com/codealike/client/intellij/ui/AuthenticationDialog.java - 38 - - - - file://$PROJECT_DIR$/src/com/codealike/client/intellij/EventListeners/CustomCaretListener.java - 26 - - - - file://$PROJECT_DIR$/src/com/codealike/client/intellij/EventListeners/CustomCaretListener.java - 33 - - - - file://$PROJECT_DIR$/src/com/codealike/client/core/internal/tracking/ActivitiesRecorder.java - 267 - - - - file://$PROJECT_DIR$/src/com/codealike/client/core/internal/tracking/ActivitiesRecorder.java - 244 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No facets are configured - - - - - - - - - - - - - - - IntelliJ IDEA Community Edition IC-162.2228.15 - - - - - - - - com.codealike.client.intellij - - - - - - - - 1.8 - - - - - - - - cglib-2.2.0-b14 - - - - - - - - \ No newline at end of file diff --git a/src/com/codealike/client/core/CodealikeTrackerPlugin.java b/src/com/codealike/client/core/CodealikeTrackerPlugin.java deleted file mode 100644 index dc6f8dd..0000000 --- a/src/com/codealike/client/core/CodealikeTrackerPlugin.java +++ /dev/null @@ -1,167 +0,0 @@ -/*package com.codealike.client.core; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Observable; -import java.util.Observer; -import java.util.Properties; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -import com.codealike.client.core.api.ApiClient; -import com.codealike.client.core.internal.dto.HealthInfo; -import com.codealike.client.core.internal.dto.HealthInfo.HealthInfoType; -import com.codealike.client.core.internal.services.IdentityService; -import com.codealike.client.core.internal.services.TrackingService; -import com.codealike.client.core.internal.startup.PluginContext; -import com.codealike.client.core.internal.utils.LogManager; -import com.codealike.client.core.internal.utils.WorkbenchUtils; -import com.codealike.client.core.views.AuthenticationBrowserView; -*/ -/** - * The activator class controls the plug-in life cycle - */ -/*public class CodealikeTrackerPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "com.codealike.client.eclipse"; //$NON-NLS-1$ - private static final String CODEALIKE_PROPERTIES_FILE = "codealike.properties"; - - // The shared instance - private static CodealikeTrackerPlugin plugin; - private PluginContext pluginContext; - private Observer loginObserver = new Observer() { - - @Override - public void update(Observable o, Object arg1) { - - if (o == pluginContext.getIdentityService()) { - TrackingService trackingService = pluginContext.getTrackingService(); - IdentityService identityService = pluginContext.getIdentityService(); - if (identityService.isAuthenticated()) { - switch(identityService.getTrackActivity()) { - case Always: - { - trackingService.enableTracking(); - break; - } - case AskEveryTime: - //WorkbenchUtils.addMessageToStatusBar("CodealikeApplicationComponent is not tracking your projects"); - break; - case Never: - //WorkbenchUtils.addMessageToStatusBar("CodealikeApplicationComponent is not tracking your projects"); - break; - - } - } - else { - trackingService.disableTracking(); - } - } - } - }; - */ - /** - * The constructor - */ - /*public CodealikeTrackerPlugin() { - } -*/ - - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - /*public void start(BundleContext context) throws Exception { - plugin = this; - this.pluginContext = PluginContext.getInstance(loadPluginProperties()); - - try { - pluginContext.initializeContext(); - super.start(context); - - if (!pluginContext.checkVersion()) { - throw new Exception(); - } - - pluginContext.getTrackingService().setBeforeOpenProjectDate(); - pluginContext.getIdentityService().addObserver(loginObserver); - if (!pluginContext.getIdentityService().tryLoginWithStoredCredentials()) { - PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { - - @Override - public void run() { - authenticate(); - } - }); - } - else { - startTracker(); - } - } - catch (Exception e) - { - ApiClient client = ApiClient.tryCreateNew(); - client.logHealth(new HealthInfo(e, "Plugin could not start.", "eclipse", HealthInfoType.Error, pluginContext.getIdentityService().getIdentity())); - LogManager.INSTANCE.logError(e, "Couldn't start plugin."); - } - } - - protected Properties loadPluginProperties() throws IOException { - Properties properties = new Properties(); - InputStream in = CodealikeTrackerPlugin.class.getResourceAsStream(CODEALIKE_PROPERTIES_FILE); - properties.load(in); - in.close(); - - return properties; - } - - protected void startTracker() { - pluginContext.getTrackingService().startTracking(); - } - - private void authenticate() { - - AuthenticationBrowserView view = new AuthenticationBrowserView(); - view.showLogin(false); - } -*/ - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - /*public void stop(BundleContext context) throws Exception { - - if (pluginContext != null && pluginContext.getTrackingService() != null) { - pluginContext.getTrackingService().stopTracking(false); - } - - plugin = null; - super.stop(context); - }*/ - - /** - * Returns the shared instance - * - * @return the shared instance - */ - /*public static CodealikeTrackerPlugin getDefault() { - return plugin; - }*/ - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - /*public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} -*/ \ No newline at end of file diff --git a/src/com/codealike/client/core/codealike.properties b/src/com/codealike/client/core/codealike.properties deleted file mode 100644 index 8942400..0000000 --- a/src/com/codealike/client/core/codealike.properties +++ /dev/null @@ -1,6 +0,0 @@ -codealike.server.url = https://codealike.com -activity-log.path = Codealike.Eclipse.TrackerCache -activity-log.extension = .data -activity-log.trace-sent = false -activity-log.interval.secs = 180 -tracking-console.enabled = false \ No newline at end of file diff --git a/src/com/codealike/client/core/codealike.properties.dev b/src/com/codealike/client/core/codealike.properties.dev deleted file mode 100644 index 984768a..0000000 --- a/src/com/codealike/client/core/codealike.properties.dev +++ /dev/null @@ -1,6 +0,0 @@ -codealike.server.url = http://dev.codealike.com:4051 -activity-log.path = Codealike.Eclipse.TrackerCacheDev -activity-log.extension = .data -activity-log.trace-sent = true -activity-log.interval.secs = 30 -tracking-console.enabled = true \ No newline at end of file diff --git a/src/com/codealike/client/core/internal/startup/codealike.properties b/src/com/codealike/client/core/internal/startup/codealike.properties deleted file mode 100644 index 8942400..0000000 --- a/src/com/codealike/client/core/internal/startup/codealike.properties +++ /dev/null @@ -1,6 +0,0 @@ -codealike.server.url = https://codealike.com -activity-log.path = Codealike.Eclipse.TrackerCache -activity-log.extension = .data -activity-log.trace-sent = false -activity-log.interval.secs = 180 -tracking-console.enabled = false \ No newline at end of file diff --git a/src/com/codealike/client/core/internal/startup/codealike.properties.dev b/src/com/codealike/client/core/internal/startup/codealike.properties.dev deleted file mode 100644 index 984768a..0000000 --- a/src/com/codealike/client/core/internal/startup/codealike.properties.dev +++ /dev/null @@ -1,6 +0,0 @@ -codealike.server.url = http://dev.codealike.com:4051 -activity-log.path = Codealike.Eclipse.TrackerCacheDev -activity-log.extension = .data -activity-log.trace-sent = true -activity-log.interval.secs = 30 -tracking-console.enabled = true \ No newline at end of file diff --git a/src/com/codealike/client/core/internal/tracking/build/ResourceDeltaVisitor.java b/src/com/codealike/client/core/internal/tracking/build/ResourceDeltaVisitor.java deleted file mode 100644 index 297cc84..0000000 --- a/src/com/codealike/client/core/internal/tracking/build/ResourceDeltaVisitor.java +++ /dev/null @@ -1,80 +0,0 @@ -/*package com.codealike.client.core.internal.tracking.build; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.runtime.CoreException; -*/ -/** - * Tracks projects affected by changes over the workspace. - * @author jesica.fera - * - */ -/*public class ResourceDeltaVisitor implements IResourceDeltaVisitor{ - - private List projects; - private int trackOnly; - private int changedFlags; - - public ResourceDeltaVisitor() { - this.projects = new LinkedList(); - this.trackOnly = IResourceDelta.ALL_WITH_PHANTOMS; - this.changedFlags = IResourceDelta.CONTENT | IResourceDelta.MOVED_FROM | IResourceDelta.MOVED_TO | IResourceDelta.COPIED_FROM - | IResourceDelta.OPEN | IResourceDelta.TYPE | IResourceDelta.SYNC | IResourceDelta.MARKERS | IResourceDelta.REPLACED - | IResourceDelta.DESCRIPTION | IResourceDelta.ENCODING | IResourceDelta.LOCAL_CHANGED | IResourceDelta.DERIVED_CHANGED; - } - - public ResourceDeltaVisitor(int trackOnly) { - this(); - this.trackOnly = trackOnly; - } - */ - /** - * - * @param trackOnly specific type of deltas to track (bitmask). Default value: IResourceDelta.ALL_WITH_PHANTOMS. - * @param changedFlags specific changed flags to track. - * @see #IResourceDelta - */ - /*public ResourceDeltaVisitor(int trackOnly, int changedFlags) { - this(); - this.trackOnly = trackOnly; - this.changedFlags = changedFlags; - } - - @Override - public boolean visit(IResourceDelta delta) throws CoreException { - - if ((delta.getKind() & trackOnly) != 0) { - IResource res = delta.getResource(); - if (res == null || res.getType() != IResource.PROJECT) { - return res.getType() == IResource.ROOT; - } - - if (delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.NO_CHANGE - && (delta.getFlags() & this.changedFlags) == 0) { - return true; - } - - IProject project = res.getProject(); - if ( project != null) { - if (!projects.contains(project)) { - projects.add(project); - } - return false; - } - } - return true; - - } - - public List getAffectedProjects() - { - return this.projects; - } - -} -*/ \ No newline at end of file diff --git a/src/com/codealike/client/core/internal/tracking/workspace/WorkspaceChangesListener.java b/src/com/codealike/client/core/internal/tracking/workspace/WorkspaceChangesListener.java deleted file mode 100644 index 570669e..0000000 --- a/src/com/codealike/client/core/internal/tracking/workspace/WorkspaceChangesListener.java +++ /dev/null @@ -1,74 +0,0 @@ -/*package com.codealike.client.eclipse.internal.tracking.workspace; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.WorkspaceJob; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -import com.codealike.client.eclipse.internal.startup.PluginContext; -import com.codealike.client.eclipse.internal.tracking.build.ResourceDeltaVisitor; -import com.codealike.client.eclipse.internal.utils.LogManager; - -public class WorkspaceChangesListener implements IResourceChangeListener { - - @Override - public void resourceChanged(IResourceChangeEvent event) { - switch (event.getType()) { - case IResourceChangeEvent.POST_CHANGE : { - try { - ResourceDeltaVisitor deltaVisitor = new ResourceDeltaVisitor(IResourceDelta.ADDED | IResourceDelta.CHANGED, IResourceDelta.OPEN); - event.getDelta().accept(deltaVisitor); - for (IProject project : deltaVisitor.getAffectedProjects()) { - new StartTrackingJob(project).schedule(); - } - } - catch (Exception e) { - LogManager.INSTANCE.logError(e, "Could not start tracking new projects."); - } - } - case IResourceChangeEvent.PRE_DELETE : { - stopTrackingIfProject(event); - } - case IResourceChangeEvent.PRE_CLOSE : { - stopTrackingIfProject(event); - } - } - } - - private void stopTrackingIfProject(IResourceChangeEvent event) { - try { - if (event.getResource() != null && event.getResource().getType() == IResource.PROJECT) { - PluginContext.getInstance().getTrackingService().stopTracking(event.getResource().getProject()); - } - } - catch (Exception e) { - LogManager.INSTANCE.logError(e, "Could not stop tracking project: "+event.getResource().getProject().getName()); - } - } - - public class StartTrackingJob extends WorkspaceJob { - - private IProject project; - private PluginContext context; - - public StartTrackingJob(IProject project) { - super("Start tracking job"); - this.project = project; - this.context = PluginContext.getInstance(); - this.context.getTrackingService().setBeforeOpenProjectDate(); - } - - public IStatus runInWorkspace(IProgressMonitor monitor) { - context.getTrackingService().startTracking(project); - return Status.OK_STATUS; - } - - } - -} -*/ \ No newline at end of file diff --git a/src/com/codealike/client/core/internal/utils/EditorUtils.java b/src/com/codealike/client/core/internal/utils/EditorUtils.java deleted file mode 100644 index e5b4374..0000000 --- a/src/com/codealike/client/core/internal/utils/EditorUtils.java +++ /dev/null @@ -1,124 +0,0 @@ -/*package com.codealike.client.core.internal.utils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; -import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.internal.editors.text.NonExistingFileEditorInput; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.eclipse.ui.texteditor.ITextEditor; - -import com.codealike.client.eclipse.internal.model.exception.NonExistingResourceException; -import com.google.common.base.Predicate; -import com.google.common.collect.Collections2; - -@SuppressWarnings("restriction") -public class EditorUtils { - - public static IJavaElement getJavaSelectedElement(JavaEditor editor) throws JavaModelException - { - ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection(); - - ICompilationUnit focusedUnit = (ICompilationUnit) EditorUtility.getEditorInputJavaElement(editor, false); - IJavaElement element = null; - element = focusedUnit.getElementAt(selection.getOffset()); - - if (element == null) - { - element = focusedUnit; - } - - return element; - } - - public static IResource getActiveResource(IEditorPart editor) throws NonExistingResourceException { - IEditorInput input = editor.getEditorInput(); - if (input instanceof NonExistingFileEditorInput) { - throw new NonExistingResourceException(); - } - else if (!(input instanceof IFileEditorInput)) - return null; - return ((IFileEditorInput)input).getFile(); - } - - public static IProject getActiveProject(IEditorPart editor) throws NonExistingResourceException { - IResource activeResource = getActiveResource(editor); - if (activeResource != null) { - return activeResource.getProject(); - } - - return null; - } - - public static IDocument getActiveDocument(IEditorPart editor) { - if (editor instanceof ITextEditor) { - return getDocumentFromTextEditor(editor); - } - else if (editor instanceof MultiPageEditorPart) { - MultiPageEditorPart multipageEditor = (MultiPageEditorPart)editor; - if (multipageEditor.getSelectedPage() instanceof ITextEditor) { - return getDocumentFromTextEditor((ITextEditor)multipageEditor.getSelectedPage()); - } - } - return null; - } - - private static IDocument getDocumentFromTextEditor(IEditorPart editor) { - ITextEditor textEditor = (ITextEditor)editor; - return textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()); - } - - - public static List getCompilationErrors(IProject project) throws CoreException { - if (project == null) { - throw new IllegalArgumentException("Project is null."); - } - - IEditorPart activeEditor = WorkbenchUtils.getActiveEditor(); - Predicate errorsFilter = new Predicate() { - - @Override - public boolean apply(IMarker marker) { - try { - return ((Integer)marker.getAttribute(IMarker.SEVERITY)) == IMarker.SEVERITY_ERROR; - } catch (CoreException e) { - // swallow Exception - LogManager.INSTANCE.logWarn("Trying to parse build results, but an error occurred"); - return false; - } - } - }; - try { - if (activeEditor != null && EditorUtils.getActiveProject(activeEditor) == project) { - - IResource resource = getActiveResource(activeEditor); - if (resource != null) { - - List markersList = Arrays.asList(resource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)); - return new ArrayList(Collections2.filter(markersList, errorsFilter)); - } - } - } catch (NonExistingResourceException e) { - LogManager.INSTANCE.logError(e, "Trying to find unexisting resource."); - } - - List projectMarkersList = Arrays.asList(project.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)); - return new ArrayList(Collections2.filter(projectMarkersList, errorsFilter)); - } - -} -*/ \ No newline at end of file diff --git a/src/com/codealike/client/core/internal/utils/WorkbenchUtils.java b/src/com/codealike/client/core/internal/utils/WorkbenchUtils.java deleted file mode 100644 index 68beef7..0000000 --- a/src/com/codealike/client/core/internal/utils/WorkbenchUtils.java +++ /dev/null @@ -1,121 +0,0 @@ -/*package com.codealike.client.core.internal.utils; - -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewSite; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchSite; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.internal.PartSite; - -import com.codealike.client.eclipse.views.CodealikeDashboard; - -@SuppressWarnings("restriction") -public class WorkbenchUtils { - - public static IWorkbenchWindow getActiveWindow() { - final IWorkbenchWindow[] win = new IWorkbenchWindow[1]; - - Runnable r = new Runnable(){ - @Override - public void run() { - win[0] = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - } - }; - - if ( Display.getCurrent() != null ) - r.run(); - else - Display.getDefault().asyncExec(r); - - return win[0]; - } - - public static boolean isActiveShell(IWorkbenchWindow win) { - final Shell shell = win.getShell(); - final boolean[] result = new boolean[1]; - - Runnable r = new Runnable() { - @Override - public void run() { - result[0] = shell.getDisplay().getActiveShell() == shell - && !shell.getMinimized(); - } - }; - - if ( Display.getCurrent() != null ) - r.run(); - else - Display.getDefault().asyncExec(r); - - return result[0]; - } - - public static IEditorPart getActiveEditor() { - final IEditorPart[] result = new IEditorPart[1]; - - Runnable r = new Runnable() { - @Override - public void run() { - IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (activeWindow != null) { - IWorkbenchPage page = activeWindow.getActivePage(); - result[0] = page.getActiveEditor(); - } - } - }; - - if ( Display.getCurrent() != null ) - r.run(); - else - Display.getDefault().asyncExec(r); - - return result[0]; - } - - public static void addMessageToStatusBar(final String message) { - new Thread() { - public void run() { - - Runnable r = new Runnable() { - @Override - public void run() { - - try{ - IWorkbenchSite site = WorkbenchUtils.getActiveWindow().getActivePage().getActivePart().getSite(); - - // Setting message in status bar if we are outside of CodealikeDashboard view - if (site instanceof IViewSite) { - IViewSite vSite = (IViewSite)site; - vSite.getActionBars().getStatusLineManager().setMessage(message); - } - else if (site instanceof PartSite) { - PartSite pSite = (PartSite)site; - pSite.getActionBars().getStatusLineManager().setMessage(message); - } - - - if (WorkbenchUtils.getActiveWindow().getActivePage().findView(CodealikeDashboard.ID) != null) { - WorkbenchUtils.getActiveWindow().getActivePage().findView(CodealikeDashboard.ID).getViewSite(). - getActionBars().getStatusLineManager().setMessage(message); - } - - } - catch ( Exception e ){ - // Avoid failing if for some reason we cannot write the message synchronously. - } - } - }; - - if ( Display.getCurrent() != null ) - r.run(); - else - Display.getDefault().asyncExec(r); - } - }.start(); - } - -} -*/ \ No newline at end of file