Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.core.filebuffers/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java3
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java2
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java4
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java33
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java7
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java6
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java6
8 files changed, 15 insertions, 48 deletions
diff --git a/org.eclipse.core.filebuffers/META-INF/MANIFEST.MF b/org.eclipse.core.filebuffers/META-INF/MANIFEST.MF
index 1ef96fc5504..25e350d6875 100644
--- a/org.eclipse.core.filebuffers/META-INF/MANIFEST.MF
+++ b/org.eclipse.core.filebuffers/META-INF/MANIFEST.MF
@@ -3,8 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.filebuffers; singleton:=true
Bundle-Version: 3.6.1100.qualifier
-Bundle-Activator: org.eclipse.core.internal.filebuffers.FileBuffersPlugin
-Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package:
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
index ec5443023fd..fe52256fe93 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
@@ -82,8 +82,7 @@ public final class FileBuffers {
* @return the text file buffer manager or <code>null</code>
*/
public static ITextFileBufferManager getTextFileBufferManager() {
- FileBuffersPlugin plugin= FileBuffersPlugin.getDefault();
- return plugin != null ? plugin.getFileBufferManager() : null;
+ return FileBuffersPlugin.getFileBufferManager();
}
/**
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java
index 0fa233ce548..0edb7c4dc5f 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java
@@ -40,7 +40,7 @@ public interface ITextFileBufferManager extends IFileBufferManager {
* The default text file buffer manager.
* @since 3.3
*/
- ITextFileBufferManager DEFAULT= FileBuffersPlugin.getDefault().getFileBufferManager();
+ ITextFileBufferManager DEFAULT= FileBuffersPlugin.getFileBufferManager();
/**
* Returns the text file buffer managed for the file at the given location
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
index c23158ed4cb..6a9c4608521 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
@@ -26,7 +26,6 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
@@ -176,8 +175,7 @@ public class ExtensionsRegistry {
* @param status the status to log
*/
private void log(IStatus status) {
- ILog log= FileBuffersPlugin.getDefault().getLog();
- log.log(status);
+ Platform.getLog(ExtensionsRegistry.class).log(status);
}
/**
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java
index affccbe7429..890c7362b11 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java
@@ -15,51 +15,24 @@ package org.eclipse.core.internal.filebuffers;
import org.osgi.framework.Bundle;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.filebuffers.ITextFileBufferManager;
-/**
- * The plug-in runtime class for the file buffers plug-in (id <code>"org.eclipse.core.filebuffers"</code>).
- *
- * @since 3.0
- */
-public class FileBuffersPlugin extends Plugin {
+public class FileBuffersPlugin {
public static final String PLUGIN_ID= "org.eclipse.core.filebuffers"; //$NON-NLS-1$
- /** The shared plug-in instance */
- private static FileBuffersPlugin fgPlugin;
- /** The file buffer manager */
- private ITextFileBufferManager fTextFileBufferManager;
-
- /**
- * Creates a plug-in instance.
- */
- public FileBuffersPlugin() {
- Assert.isTrue(fgPlugin == null);
- fgPlugin= this;
- }
-
- /**
- * Returns the shared instance.
- *
- * @return the default plug-in instance
- */
- public static FileBuffersPlugin getDefault() {
- return fgPlugin;
- }
+ private static ITextFileBufferManager fTextFileBufferManager;
/**
* Returns the text file buffer manager of this plug-in.
*
* @return the text file buffer manager of this plug-in
*/
- public synchronized ITextFileBufferManager getFileBufferManager() {
+ public static synchronized ITextFileBufferManager getFileBufferManager() {
if (fTextFileBufferManager == null) {
Bundle resourcesBundle= Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
if (resourcesBundle != null)
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java
index 49371841ee6..ca6eaa48227 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java
@@ -19,12 +19,12 @@ import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -85,7 +85,7 @@ public abstract class ResourceFileBuffer extends AbstractFileBuffer {
try {
execute();
} catch (Exception x) {
- FileBuffersPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, "Exception when synchronizing", x)); //$NON-NLS-1$
+ Platform.getLog(ResourceFileBuffer.class).error("Exception when synchronizing", x); //$NON-NLS-1$
fManager.fireStateChangeFailed(ResourceFileBuffer.this);
}
}
@@ -451,8 +451,7 @@ public abstract class ResourceFileBuffer extends AbstractFileBuffer {
* @param exception the exception to be logged
*/
protected void handleCoreException(CoreException exception) {
- ILog log= FileBuffersPlugin.getDefault().getLog();
- log.log(exception.getStatus());
+ Platform.getLog(ResourceFileBuffer.class).log(exception.getStatus());
}
@Override
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java
index 0e74e44c63a..c4822424fbf 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java
@@ -152,13 +152,13 @@ public class ResourceTextFileBufferManager extends TextFileBufferManager {
if (document.getDocumentPartitioner() != null) {
String message= NLSUtility.format(FileBuffersMessages.TextFileBufferManager_warning_documentSetupInstallsDefaultPartitioner, participant.getClass());
IStatus status= new Status(IStatus.WARNING, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, message, null);
- FileBuffersPlugin.getDefault().getLog().log(status);
+ Platform.getLog(ResourceTextFileBufferManager.class).log(status);
}
}
@Override
public void handleException(Throwable t) {
IStatus status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentSetupFailed, t);
- FileBuffersPlugin.getDefault().getLog().log(status);
+ Platform.getLog(ResourceTextFileBufferManager.class).log(status);
}
};
SafeRunner.run(runnable);
@@ -189,7 +189,7 @@ public class ResourceTextFileBufferManager extends TextFileBufferManager {
@Override
public void handleException(Throwable t) {
IStatus status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentFactoryFailed, t);
- FileBuffersPlugin.getDefault().getLog().log(status);
+ Platform.getLog(ResourceTextFileBufferManager.class).log(status);
}
};
SafeRunner.run(runnable);
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
index 885f9cbd45d..25b2af21530 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
@@ -463,13 +463,13 @@ public class TextFileBufferManager implements ITextFileBufferManager {
if (document.getDocumentPartitioner() != null) {
String message= NLSUtility.format(FileBuffersMessages.TextFileBufferManager_warning_documentSetupInstallsDefaultPartitioner, participant.getClass());
IStatus status= new Status(IStatus.WARNING, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, message, null);
- FileBuffersPlugin.getDefault().getLog().log(status);
+ Platform.getLog(ResourceTextFileBufferManager.class).log(status);
}
}
@Override
public void handleException(Throwable t) {
IStatus status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentSetupFailed, t);
- FileBuffersPlugin.getDefault().getLog().log(status);
+ Platform.getLog(ResourceTextFileBufferManager.class).log(status);
}
};
SafeRunner.run(runnable);
@@ -502,7 +502,7 @@ public class TextFileBufferManager implements ITextFileBufferManager {
@Override
public void handleException(Throwable t) {
IStatus status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentFactoryFailed, t);
- FileBuffersPlugin.getDefault().getLog().log(status);
+ Platform.getLog(ResourceTextFileBufferManager.class).log(status);
}
};
SafeRunner.run(runnable);

Back to the top