diff --git a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java
index 861226b0fb1..6f6c2b6565d 100644
--- a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java
+++ b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java
@@ -28,9 +28,8 @@
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -56,10 +55,6 @@
import org.eclipse.jface.text.source.ISourceViewerExtension3;
import org.eclipse.jface.text.source.ISourceViewerExtension5;
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
-import org.eclipse.ui.editors.text.EditorsUI;
-
/**
* Shows info, warning, and error Annotations as line header code minings.
*
@@ -320,7 +315,7 @@ private List createCodeMinings(Stream annotation
final String message= quickAssistAssistant.showPossibleQuickAssists();
if (message != null) {
- EditorsPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, message));
+ ILog.of(AnnotationCodeMiningProvider.class).error(message);
}
});
diff --git a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderDescriptor.java b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderDescriptor.java
index 751927d6b9e..aa17e2c44d4 100644
--- a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderDescriptor.java
+++ b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderDescriptor.java
@@ -22,13 +22,12 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.stickyscroll.IStickyLinesProvider;
@@ -122,13 +121,11 @@ public IStickyLinesProvider createStickyLinesProvider() {
} else {
String message= "Invalid extension to stickyLinesProvider. Must extends IStickyLinesProvider: " //$NON-NLS-1$
+ getId();
- EditorsPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, message));
+ ILog.of(StickyLinesProviderDescriptor.class).error(message);
return null;
}
} catch (CoreException e) {
- EditorsPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID,
- "Error while creating stickyLinesProvider: " + getId(), e)); //$NON-NLS-1$
+ ILog.of(StickyLinesProviderDescriptor.class).error("Error while creating stickyLinesProvider: " + getId(), e); //$NON-NLS-1$
return null;
}
}
@@ -154,8 +151,7 @@ public boolean matches(ISourceViewer viewer, ITextEditor editor) {
try {
return enabledWhen.evaluate(context) == EvaluationResult.TRUE;
} catch (CoreException e) {
- EditorsPlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, "Error while 'enabledWhen' evaluation", e)); //$NON-NLS-1$
+ ILog.of(StickyLinesProviderDescriptor.class).error("Error while 'enabledWhen' evaluation", e); //$NON-NLS-1$
return false;
}
}
diff --git a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderRegistry.java b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderRegistry.java
index 4d036827487..b45c61898b7 100644
--- a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderRegistry.java
+++ b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLinesProviderRegistry.java
@@ -21,14 +21,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.stickyscroll.IStickyLinesProvider;
@@ -109,7 +108,7 @@ public synchronized void reloadExtensions() {
StickyLinesProviderDescriptor descriptor = descriptorFactory.create(element);
descriptors.add(descriptor);
} catch (CoreException e) {
- EditorsPlugin.getDefault().getLog()
+ ILog.of(StickyLinesProviderRegistry.class)
.log(new Status(IStatus.ERROR, element.getNamespaceIdentifier(), e.getMessage()));
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/AutoEditStrategyRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/AutoEditStrategyRegistry.java
index 0cba87160c0..d727ca4cd17 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/AutoEditStrategyRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/AutoEditStrategyRegistry.java
@@ -21,9 +21,8 @@
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -83,8 +82,7 @@ private void sync() {
try {
this.extensions.put(extension, new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(AutoEditStrategyRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/CharacterPairMatcherRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/CharacterPairMatcherRegistry.java
index 08658ffdbf9..cb1c8db8031 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/CharacterPairMatcherRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/CharacterPairMatcherRegistry.java
@@ -18,9 +18,8 @@
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.text.source.ICharacterPairMatcher;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -79,8 +78,7 @@ private void sync() {
this.extensions.put(extension,
new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(CharacterPairMatcherRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ContentAssistProcessorRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ContentAssistProcessorRegistry.java
index 2239bb989ff..bc381f05e45 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ContentAssistProcessorRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ContentAssistProcessorRegistry.java
@@ -22,10 +22,9 @@
import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.jface.text.ITextViewer;
@@ -166,7 +165,7 @@ private void sync() {
try {
this.extensions.put(extension, new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(ContentAssistProcessorRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java
index c76ed1482ed..a3f21560675 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java
@@ -41,10 +41,9 @@
import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.AbstractReusableInformationControlCreator;
@@ -127,8 +126,7 @@ public Set getContentTypes(IDocument documentParam) {
this.resolvedContentTypes.add(contentType);
}
} catch (CoreException ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(ExtensionBasedTextViewerConfiguration.class).error(ex.getMessage(), ex);
}
}
String fileName = getCurrentFileName(documentParam);
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericContentTypeRelatedExtension.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericContentTypeRelatedExtension.java
index 17b23cfce15..9ddcd3116ca 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericContentTypeRelatedExtension.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericContentTypeRelatedExtension.java
@@ -21,6 +21,7 @@
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
@@ -63,8 +64,7 @@ public E createDelegateWithoutTypeCheck() {
try {
return (E) extension.createExecutableExtension(CLASS_ATTRIBUTE);
} catch (CoreException e) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, e.getMessage(), e));
+ ILog.of(GenericContentTypeRelatedExtension.class).error(e.getMessage(), e);
}
return null;
}
@@ -121,8 +121,7 @@ public boolean matches(ISourceViewer viewer, ITextEditor editor) {
try {
return enabledWhen.evaluate(context) == EvaluationResult.TRUE;
} catch (CoreException e) {
- GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID,
- "Error while 'enabledWhen' evaluation", e)); //$NON-NLS-1$
+ ILog.of(GenericContentTypeRelatedExtension.class).error("Error while 'enabledWhen' evaluation", e); //$NON-NLS-1$
return false;
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithContentTypeIcon.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithContentTypeIcon.java
index 237632ada44..589fc0d872f 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithContentTypeIcon.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithContentTypeIcon.java
@@ -13,9 +13,8 @@
package org.eclipse.ui.internal.genericeditor;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorMatchingStrategy;
@@ -49,8 +48,7 @@ public ImageDescriptor getImageDescriptor() {
return image;
}
} catch (Exception e) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, e.getMessage(), e));
+ ILog.of(GenericEditorWithContentTypeIcon.class).error(e.getMessage(), e);
}
return this.editorDescriptor.getImageDescriptor();
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/IconsRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/IconsRegistry.java
index 539581c6e2a..a260650d2df 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/IconsRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/IconsRegistry.java
@@ -22,9 +22,8 @@
import java.util.Set;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ResourceLocator;
@@ -68,7 +67,7 @@ private void sync() {
ResourceLocator.imageDescriptorFromBundle(extension.getNamespaceIdentifier(), icon).ifPresent(imageDescriptor -> this.extensions.put(contentType, imageDescriptor));
}
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(IconsRegistry.class).error(ex.getMessage(), ex);
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/PresentationReconcilerRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/PresentationReconcilerRegistry.java
index 904e4492308..43245546743 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/PresentationReconcilerRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/PresentationReconcilerRegistry.java
@@ -21,9 +21,8 @@
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -78,7 +77,7 @@ private void sync() {
try {
this.extensions.put(extension, new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(PresentationReconcilerRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/QuickAssistProcessorRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/QuickAssistProcessorRegistry.java
index 23a1d8c0457..3a7b3784b12 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/QuickAssistProcessorRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/QuickAssistProcessorRegistry.java
@@ -21,9 +21,8 @@
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -71,8 +70,7 @@ private void sync() {
this.extensions.put(extension,
new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(QuickAssistProcessorRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ReconcilerRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ReconcilerRegistry.java
index 10fc06217db..55dc7b5e1d9 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ReconcilerRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ReconcilerRegistry.java
@@ -22,9 +22,8 @@
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.text.reconciler.IReconciler;
import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
@@ -157,8 +156,7 @@ private void sync() {
try {
this.extensions.put(extension, new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(ReconcilerRegistry.class).error(ex.getMessage(), ex);
}
}
}
@@ -177,8 +175,7 @@ private void syncHighlight() {
try {
this.highlightExtensions.put(extension, new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(ReconcilerRegistry.class).error(ex.getMessage(), ex);
}
}
}
@@ -197,8 +194,7 @@ private void syncFolding() {
try {
this.foldingExtensions.put(extension, new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(ReconcilerRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/TextDoubleClickStrategyRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/TextDoubleClickStrategyRegistry.java
index 3fd10030fb9..4f9628b16ba 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/TextDoubleClickStrategyRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/TextDoubleClickStrategyRegistry.java
@@ -19,9 +19,8 @@
import java.util.Set;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.text.ITextDoubleClickStrategy;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -72,8 +71,7 @@ private void sync() {
this.extensions.put(extension,
new GenericContentTypeRelatedExtension<>(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(TextDoubleClickStrategyRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/compare/GenericEditorViewer.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/compare/GenericEditorViewer.java
index 08cd25d7d05..c1708c85cb8 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/compare/GenericEditorViewer.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/compare/GenericEditorViewer.java
@@ -22,10 +22,9 @@
import org.eclipse.core.resources.IEncodedStorage;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
@@ -96,8 +95,7 @@ public void setInput(Object input) {
try {
documentProvider.connect(editorInput);
} catch (CoreException ex) {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(GenericEditorViewer.class).error(ex.getMessage(), ex);
}
sourceViewer.setDocument(documentProvider.getDocument(editorInput));
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
index 0799f2b6fbb..2b811c86fa8 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
@@ -23,8 +23,7 @@
import java.util.function.Supplier;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.text.AbstractInformationControl;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlCreator;
@@ -38,7 +37,6 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.internal.genericeditor.GenericEditorPlugin;
public class CompositeInformationControl extends AbstractInformationControl implements IInformationControlExtension2 {
@@ -112,10 +110,9 @@ public void createContent(Composite parent) {
}
controls.put(hoverControlCreator.getKey(), abstractInformationControl);
} else {
- GenericEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.WARNING, GenericEditorPlugin.BUNDLE_ID,
- "Only text hovers producing an AbstractInformationControl can be aggregated; got a " //$NON-NLS-1$
- + informationControl.getClass().getSimpleName()));
+ ILog.of(CompositeInformationControl.class).warn(
+ "Only text hovers producing an AbstractInformationControl can be aggregated; got a " //$NON-NLS-1$
+ + informationControl.getClass().getSimpleName());
informationControl.dispose();
}
}
diff --git a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/TextHoverRegistry.java b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/TextHoverRegistry.java
index 39c6ee294d2..fb064f127ad 100644
--- a/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/TextHoverRegistry.java
+++ b/bundles/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/TextHoverRegistry.java
@@ -24,9 +24,8 @@
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.ITextHover;
@@ -114,7 +113,7 @@ private void sync() {
try {
ext.put(extension, new TextHoverExtension(extension));
} catch (Exception ex) {
- GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
+ ILog.of(TextHoverRegistry.class).error(ex.getMessage(), ex);
}
}
}
diff --git a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java
index 352de2e7d8e..d554c3bcd5d 100644
--- a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java
+++ b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java
@@ -25,14 +25,12 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.internal.navigator.resources.nested.PathComparator;
-import org.eclipse.ui.internal.navigator.resources.plugin.WorkbenchNavigatorPlugin;
import org.eclipse.ui.model.WorkbenchContentProvider;
/**
@@ -70,8 +68,7 @@ public boolean hasChildren(Object element) {
return c.members().length > 0;
}
} catch (CoreException ex) {
- WorkbenchNavigatorPlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, 0, ex.getMessage(), ex));
+ ILog.of(ResourceExtensionContentProvider.class).error(ex.getMessage(), ex);
return false;
}
diff --git a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ProjectExplorer.java b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ProjectExplorer.java
index 1e26743bd6e..ecab000fad4 100644
--- a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ProjectExplorer.java
+++ b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ProjectExplorer.java
@@ -25,6 +25,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Adapters;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.SafeRunner;
@@ -324,7 +325,7 @@ protected void handleDoubleClick(DoubleClickEvent anEvent) {
openProjectCommand.executeWithChecks(new ExecutionEvent());
} catch (CommandException ex) {
IStatus status = WorkbenchNavigatorPlugin.createErrorStatus("'Open Project' failed", ex); //$NON-NLS-1$
- WorkbenchNavigatorPlugin.getDefault().getLog().log(status);
+ ILog.of(ProjectExplorer.class).log(status);
}
return;
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlay.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlay.java
index 17435e4677e..ed8ae54e416 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlay.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/overlay/FindReplaceOverlay.java
@@ -46,7 +46,7 @@
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Widget;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.bindings.keys.KeyStroke;
@@ -72,7 +72,6 @@
import org.eclipse.ui.internal.findandreplace.FindReplaceMessages;
import org.eclipse.ui.internal.findandreplace.HistoryStore;
import org.eclipse.ui.internal.findandreplace.SearchOptions;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
import org.eclipse.ui.part.MultiPageEditorSite;
import org.eclipse.ui.texteditor.AbstractTextEditor;
@@ -189,8 +188,7 @@ private void setTextEditorActionsActivated(boolean state) {
method.setAccessible(true);
method.invoke(targetPart, Boolean.valueOf(state));
} catch (IllegalArgumentException | ReflectiveOperationException ex) {
- TextEditorPlugin.getDefault().getLog()
- .log(Status.error("cannot (de-)activate actions for text editor", ex)); //$NON-NLS-1$
+ ILog.of(FindReplaceOverlay.class).error("cannot (de-)activate actions for text editor", ex); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/CompoundEditExitStrategy.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/CompoundEditExitStrategy.java
index 95aaad6b8f3..79170eb3515 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/CompoundEditExitStrategy.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/CompoundEditExitStrategy.java
@@ -28,9 +28,8 @@
import org.eclipse.core.commands.IExecutionListener;
import org.eclipse.core.commands.NotHandledException;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.ITextViewer;
@@ -222,8 +221,7 @@ private void fireEndCompoundEdit() {
try {
listener.endCompoundEdit();
} catch (Exception e) {
- IStatus status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, "listener notification failed", e); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(CompoundEditExitStrategy.class).error("listener notification failed", e); //$NON-NLS-1$
}
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/HippieCompletionEngine.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/HippieCompletionEngine.java
index fd5e9b2c990..8f084b13722 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/HippieCompletionEngine.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/HippieCompletionEngine.java
@@ -23,8 +23,7 @@
import java.util.regex.Pattern;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
@@ -817,7 +816,7 @@ private void log(BadLocationException e) {
if (msg == null) {
msg= "unable to access the document"; //$NON-NLS-1$
}
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, msg, e));
+ ILog.of(HippieCompletionEngine.class).error(msg, e);
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java
index 67684cef9cc..036735d0516 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -154,13 +155,11 @@ protected ICodeMiningProvider createCodeMiningProvider(ITextEditor editor) {
} else {
String message = "Invalid extension to codeMiningProviders. Must extends ICodeMiningProvider: " //$NON-NLS-1$
+ getId();
- TextEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, message));
+ ILog.of(CodeMiningProviderDescriptor.class).error(message);
return null;
}
} catch (CoreException e) {
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID,
- "Error while creating codeMiningProvider: " + getId(), e)); //$NON-NLS-1$
+ ILog.of(CodeMiningProviderDescriptor.class).error("Error while creating codeMiningProvider: " + getId(), e); //$NON-NLS-1$
return null;
}
}
@@ -188,8 +187,7 @@ public boolean matches(ISourceViewer viewer, ITextEditor editor) {
try {
return fEnabledWhen.evaluate(context) == EvaluationResult.TRUE;
} catch (CoreException e) {
- TextEditorPlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, "Error while 'enabledWhen' evaluation", e)); //$NON-NLS-1$
+ ILog.of(CodeMiningProviderDescriptor.class).error("Error while 'enabledWhen' evaluation", e); //$NON-NLS-1$
return false;
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderRegistry.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderRegistry.java
index 9dd0746d2f7..7caeeb74611 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderRegistry.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderRegistry.java
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
@@ -77,7 +78,7 @@ public synchronized void reloadExtensions() {
CodeMiningProviderDescriptor descriptor = new CodeMiningProviderDescriptor(element);
descriptors.add(descriptor);
} catch (CoreException e) {
- TextEditorPlugin.getDefault().getLog()
+ ILog.of(CodeMiningProviderRegistry.class)
.log(new Status(IStatus.ERROR, element.getNamespaceIdentifier(), e.getMessage()));
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/views/minimap/MinimapWidget.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/views/minimap/MinimapWidget.java
index 5786d32cf12..a1d161b881c 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/views/minimap/MinimapWidget.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/views/minimap/MinimapWidget.java
@@ -45,8 +45,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
@@ -61,8 +60,6 @@
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jface.text.TextViewer;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
-
/**
* Minimap widget which displays scaled content of the given text editor.
*/
@@ -93,9 +90,7 @@ public void textChanging(TextChangingEvent event) {
try {
fMinimapTracker.replaceTextRange(event);
} catch (Exception e) {
- IStatus status = new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK,
- "Minimap text content synchronization failed", e); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(MinimapWidget.class).error("Minimap text content synchronization failed", e); //$NON-NLS-1$
synchText();
}
}
@@ -111,9 +106,7 @@ public void applyTextPresentation(TextPresentation presentation) {
addPresentation(presentation);
} catch (Exception e) {
synchTextAndStyles();
- IStatus status = new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK,
- "Minimap styles synchronization failed", e); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(MinimapWidget.class).error("Minimap styles synchronization failed", e); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
index 39c7da82985..6c5b7fc9254 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
@@ -22,12 +22,11 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
-
/**
* An annotation preference provides all the information required for handing
@@ -1007,7 +1006,7 @@ public IAnnotationImageProvider getAnnotationImageProvider() {
try {
fAnnotationImageProvider= (IAnnotationImageProvider) fConfigurationElement.createExecutableExtension(fAnnotationImageProviderAttribute);
} catch (CoreException x) {
- TextEditorPlugin.getDefault().getLog().log(x.getStatus());
+ ILog.of(AnnotationPreference.class).log(x.getStatus());
}
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/CaseAction.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/CaseAction.java
index eeea01a57df..83f54ecb4dc 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/CaseAction.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/CaseAction.java
@@ -21,8 +21,7 @@
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IBlockTextSelection;
@@ -35,7 +34,6 @@
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
/**
* Action that converts the current selection to lower case or upper case.
@@ -131,8 +129,7 @@ public void run() {
// don't use the viewer's reveal feature in order to avoid jumping around
st.showSelection();
} catch (BadLocationException x) {
- TextEditorPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, x.getMessage(), x));
+ ILog.of(CaseAction.class).error(x.getMessage(), x);
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java
index 2c24db87031..a5d3a94713b 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java
@@ -34,11 +34,8 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
/**
* Allows to sort an array based on their elements' configuration elements
@@ -157,8 +154,7 @@ private void initialize(Object[] elements) {
} catch (BundleException e) {
String uid= getExtensionPointUniqueIdentifier(bundle);
String message= "ConfigurationElementSorter for '" + uid + "': getting required plug-ins for '" + bundle.getSymbolicName() + "' failed"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Status status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, message, e);
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(ConfigurationElementSorter.class).error(message, e);
continue;
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLastEditPositionAction.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLastEditPositionAction.java
index 665f23e60bd..16c24b2a51e 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLastEditPositionAction.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLastEditPositionAction.java
@@ -13,8 +13,7 @@
*******************************************************************************/
package org.eclipse.ui.texteditor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -96,9 +95,7 @@ public void run() {
try {
editor = page.openEditor(editPosition.getEditorInput(), editPosition.getEditorId());
} catch (PartInitException ex) {
- IStatus status = new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK,
- "Go to Previous Edit Location failed", ex); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(GotoLastEditPositionAction.class).error("Go to Previous Edit Location failed", ex); //$NON-NLS-1$
return;
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLineAction.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLineAction.java
index 631c53ee645..04af54eb80e 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLineAction.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLineAction.java
@@ -23,8 +23,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IInputValidator;
@@ -39,7 +38,6 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.texteditor.NLSUtility;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
/**
@@ -215,8 +213,7 @@ public void run() {
try {
fLastLine= document.getLineOfOffset(document.getLength()) + 1;
} catch (BadLocationException ex) {
- IStatus status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, "Go to Line failed", ex); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(GotoLineAction.class).error("Go to Line failed", ex); //$NON-NLS-1$
return;
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoNextEditPositionAction.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoNextEditPositionAction.java
index cb23a2500c4..c7bbb115412 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoNextEditPositionAction.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoNextEditPositionAction.java
@@ -13,8 +13,7 @@
*******************************************************************************/
package org.eclipse.ui.texteditor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -99,9 +98,7 @@ public void run() {
try {
editor = page.openEditor(editPosition.getEditorInput(), editPosition.getEditorId());
} catch (PartInitException ex) {
- IStatus status = new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK,
- "Go to Next Edit Location failed", ex); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(GotoNextEditPositionAction.class).error("Go to Next Edit Location failed", ex); //$NON-NLS-1$
return;
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieCompleteAction.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieCompleteAction.java
index 9dbafbc9eb7..09bb337560e 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieCompleteAction.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieCompleteAction.java
@@ -21,8 +21,7 @@
import java.util.ResourceBundle;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -32,7 +31,6 @@
import org.eclipse.ui.internal.texteditor.CompoundEditExitStrategy;
import org.eclipse.ui.internal.texteditor.HippieCompletionEngine;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
/**
@@ -408,6 +406,6 @@ private void log(BadLocationException e) {
if (msg == null) {
msg= "unable to access the document"; //$NON-NLS-1$
}
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, msg, e));
+ ILog.of(HippieCompleteAction.class).error(msg, e);
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorDescriptor.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorDescriptor.java
index c68f9d09649..bda60fafa2f 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorDescriptor.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorDescriptor.java
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
@@ -237,11 +238,11 @@ private static HyperlinkDetectorDescriptor[] createDescriptors(IConfigurationEle
result.add(desc);
} else {
String message= NLSUtility.format(EditorMessages.Editor_error_HyperlinkDetector_invalidExtension_message, new String[] {desc.getId(), element.getContributor().getName()});
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, message, null));
+ ILog.of(HyperlinkDetectorDescriptor.class).error(message);
}
} else {
String message= NLSUtility.format(EditorMessages.Editor_error_HyperlinkDetector_invalidElementName_message, new String[] { element.getContributor().getName(), element.getName() });
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, message, null));
+ ILog.of(HyperlinkDetectorDescriptor.class).error(message);
}
}
return result.toArray(new HyperlinkDetectorDescriptor[result.size()]);
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorTargetDescriptor.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorTargetDescriptor.java
index e49cea7dee3..fdcf3e3d1ca 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorTargetDescriptor.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HyperlinkDetectorTargetDescriptor.java
@@ -19,12 +19,10 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.ui.internal.texteditor.NLSUtility;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
/**
@@ -136,11 +134,11 @@ private static HyperlinkDetectorTargetDescriptor[] createDescriptors(IConfigurat
result.add(desc);
} else {
String message= NLSUtility.format(EditorMessages.Editor_error_HyperlinkDetectorTarget_invalidExtension_message, new String[] {desc.getId(), element.getContributor().getName()});
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, message, null));
+ ILog.of(HyperlinkDetectorTargetDescriptor.class).error(message);
}
} else {
String message= NLSUtility.format(EditorMessages.Editor_error_HyperlinkDetectorTarget_invalidElementName_message, new String[] { element.getContributor().getName(), element.getName() });
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, message, null));
+ ILog.of(HyperlinkDetectorTargetDescriptor.class).error(message);
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextViewerDeleteLineTarget.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextViewerDeleteLineTarget.java
index e451ad033ae..1b54c98efff 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextViewerDeleteLineTarget.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextViewerDeleteLineTarget.java
@@ -29,6 +29,7 @@
import org.eclipse.swt.events.MouseListener;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -375,7 +376,7 @@ public void deleteLine(IDocument document, ITextSelection selection, int type, b
// log
Status status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, e.code, EditorMessages.Editor_error_clipboard_copy_failed_message, e);
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(TextViewerDeleteLineTarget.class).log(status);
fClipboard.uninstall();
return; // don't delete
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java
index 5ff4d90ff01..295c419c09e 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java
@@ -28,6 +28,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.InvalidRegistryObjectException;
import org.eclipse.core.runtime.Platform;
@@ -291,6 +292,6 @@ private void warnUser(String message, Exception exception) {
}
private void warnUser(IStatus status) {
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(RulerColumnRegistry.class).log(status);
}
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingService.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingService.java
index ddbc2152bc4..147791a1c8d 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingService.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingService.java
@@ -15,6 +15,7 @@
package org.eclipse.ui.texteditor.spelling;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.SafeRunner;
@@ -114,7 +115,7 @@ public void handleException(Throwable x) {
SafeRunner.run(runnable);
}
} catch (CoreException x) {
- TextEditorPlugin.getDefault().getLog().log(x.getStatus());
+ ILog.of(SpellingService.class).log(x.getStatus());
}
}
} finally {
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
index 18a68477951..67beb5c4ac4 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
@@ -52,8 +52,7 @@
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -1381,8 +1380,7 @@ private void saveTemplateStore() {
try {
getTemplateStore().save();
} catch (IOException e) {
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID,
- TemplatesMessages.TemplatesPage_save_error_message, e));
+ ILog.of(AbstractTemplatesPage.class).error(TemplatesMessages.TemplatesPage_save_error_message, e);
MessageDialog.openError(getShell(),
TemplatesMessages.TemplatesPage_save_error_message, e.getMessage());
}
diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
index 587a53a8319..407c510ef09 100644
--- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
+++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
@@ -63,8 +63,7 @@
import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.text.templates.TemplatePersistenceData;
import org.eclipse.text.templates.TemplateReaderWriter;
@@ -125,7 +124,6 @@
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.internal.texteditor.NLSUtility;
import org.eclipse.ui.internal.texteditor.SWTUtil;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
import org.eclipse.ui.internal.texteditor.templates.TextViewerAction;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
@@ -1491,8 +1489,7 @@ public boolean performCancel() {
* @since 3.2
*/
private void openReadErrorDialog(IOException ex) {
- IStatus status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, "Failed to read templates.", ex); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(TemplatePreferencePage.class).error("Failed to read templates.", ex); //$NON-NLS-1$
String title= TemplatesMessages.TemplatePreferencePage_error_read_title;
String message= TemplatesMessages.TemplatePreferencePage_error_read_message;
MessageDialog.openError(getShell(), title, message);
@@ -1502,8 +1499,7 @@ private void openReadErrorDialog(IOException ex) {
* @since 3.2
*/
private void openWriteErrorDialog(IOException ex) {
- IStatus status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, "Failed to write templates.", ex); //$NON-NLS-1$
- TextEditorPlugin.getDefault().getLog().log(status);
+ ILog.of(TemplatePreferencePage.class).error("Failed to write templates.", ex); //$NON-NLS-1$
String title= TemplatesMessages.TemplatePreferencePage_error_write_title;
String message= TemplatesMessages.TemplatePreferencePage_error_write_message;
MessageDialog.openError(getShell(), title, message);