Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-10-20 11:07:00 +0000
committerLars Vogel2020-10-20 11:07:00 +0000
commita65e4561cb976450a9143634b5c0fd67c19f84b9 (patch)
treec25feea4dca8ef478971b964ca859e2d6c505def
parentb74f7528de85755033a3a40f0a70439287c61f39 (diff)
downloadeclipse.platform.team-master.tar.gz
eclipse.platform.team-master.tar.xz
eclipse.platform.team-master.zip
Change-Id: Iad08bbf575d5de507c24361dbee055c773167639 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/CompareSettings.java (renamed from bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java)28
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java2
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java4
7 files changed, 18 insertions, 31 deletions
diff --git a/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
index 750221f32..7ae79e06e 100644
--- a/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.compare.core/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare.core
Bundle-Version: 3.6.1000.qualifier
-Bundle-Activator: org.eclipse.compare.internal.core.ComparePlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/CompareSettings.java
index 77856016e..444b32270 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/CompareSettings.java
@@ -13,48 +13,36 @@
*******************************************************************************/
package org.eclipse.compare.internal.core;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
/**
* The activator class controls the plug-in life cycle
*/
-public class ComparePlugin extends Plugin {
+public class CompareSettings {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.compare.core"; //$NON-NLS-1$
// The shared instance
- private static ComparePlugin plugin;
+ private static CompareSettings compareSettings;
private boolean cappingDisabled;
/**
* The constructor
*/
- public ComparePlugin() {
+ private CompareSettings() {
// nothing to do
}
- @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 ComparePlugin getDefault() {
- return plugin;
+ public static CompareSettings getDefault() {
+ if (compareSettings == null) {
+ compareSettings = new CompareSettings();
+ }
+ return compareSettings;
}
public void setCappingDisabled(boolean disable) {
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java
index c528589a0..d8090cb13 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/LCS.java
@@ -98,7 +98,7 @@ public abstract class LCS {
}
private boolean isCappingDisabled() {
- return ComparePlugin.getDefault().isCappingDisabled();
+ return CompareSettings.getDefault().isCappingDisabled();
}
/**
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java
index c648b5692..f342fa585 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchParser.java
@@ -16,7 +16,7 @@ package org.eclipse.compare.patch;
import java.io.BufferedReader;
import java.io.IOException;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.internal.core.patch.PatchReader;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
@@ -48,7 +48,7 @@ public class PatchParser {
return patchReader.getAdjustedDiffs();
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR,
- ComparePlugin.PLUGIN_ID, 0, e.getMessage(), e));
+ CompareSettings.PLUGIN_ID, 0, e.getMessage(), e));
} finally {
try {
reader.close();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java
index 684f1d542..66b55ea0a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java
@@ -22,7 +22,7 @@ import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.CompareViewerSwitchingPane;
import org.eclipse.compare.Splitter;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.Viewer;
@@ -161,13 +161,13 @@ public class CompareContentViewerSwitchingPane extends CompareViewerSwitchingPan
*/
IPreferenceStore preferenceStore = CompareUIPlugin.getDefault().getPreferenceStore();
boolean wasDisabled = preferenceStore.getBoolean(ComparePreferencePage.CAPPING_DISABLED);
- ComparePlugin.getDefault().setCappingDisabled(true);
+ CompareSettings.getDefault().setCappingDisabled(true);
preferenceStore.setValue(ComparePreferencePage.CAPPING_DISABLED, true);
try {
getCompareConfiguration().setProperty(DISABLE_CAPPING_TEMPORARILY, Boolean.TRUE);
} finally {
if (!wasDisabled) {
- ComparePlugin.getDefault().setCappingDisabled(false);
+ CompareSettings.getDefault().setCappingDisabled(false);
preferenceStore.setValue(ComparePreferencePage.CAPPING_DISABLED, false);
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
index caa454ed1..a0e0e9452 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
@@ -27,7 +27,7 @@ import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.IEncodedStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.jface.dialogs.Dialog;
@@ -207,7 +207,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
editors.forEach(FieldEditor::store);
fOverlayStore.propagate();
- ComparePlugin.getDefault().setCappingDisabled(
+ CompareSettings.getDefault().setCappingDisabled(
getPreferenceStore().getBoolean(
ComparePreferencePage.CAPPING_DISABLED));
return true;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
index 384504d9d..3456ad142 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
@@ -42,7 +42,7 @@ import org.eclipse.compare.IResourceProvider;
import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.IStreamMerger;
import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.internal.core.ComparePlugin;
+import org.eclipse.compare.internal.core.CompareSettings;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.IStructureCreator;
import org.eclipse.compare.structuremergeviewer.StructureDiffViewer;
@@ -285,7 +285,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER,
properties);
- ComparePlugin.getDefault().setCappingDisabled(
+ CompareSettings.getDefault().setCappingDisabled(
getPreferenceStore().getBoolean(
ComparePreferencePage.CAPPING_DISABLED));
}

Back to the top