Minor reformatting DecorationScheduler
Change-Id: Ibac32963a2d87ef88268e1717b828acbe547debb
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
index 86de96c..ba7d89d 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,7 +20,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -70,8 +69,7 @@
UIJob updateJob;
- private Collection removedListeners = Collections
- .synchronizedSet(new HashSet());
+ private Collection removedListeners = Collections.synchronizedSet(new HashSet());
private Job clearJob;
@@ -105,11 +103,9 @@
* the decoration context
*/
- public String decorateWithText(String text, Object element,
- Object adaptedElement, IDecorationContext context) {
+ public String decorateWithText(String text, Object element, Object adaptedElement, IDecorationContext context) {
- DecorationResult decoration = getResult(element, adaptedElement,
- context);
+ DecorationResult decoration = getResult(element, adaptedElement, context);
if (decoration == null) {
return text;
@@ -134,21 +130,18 @@
* The decoration context
*/
- synchronized void queueForDecoration(Object element, Object adaptedElement,
- boolean forceUpdate, String undecoratedText,
- IDecorationContext context) {
+ synchronized void queueForDecoration(Object element, Object adaptedElement, boolean forceUpdate,
+ String undecoratedText, IDecorationContext context) {
Assert.isNotNull(context);
- DecorationReference reference = (DecorationReference) awaitingDecorationValues
- .get(element);
+ DecorationReference reference = (DecorationReference) awaitingDecorationValues.get(element);
if (reference != null) {
if (forceUpdate) {// Make sure we don't loose a force
reference.setForceUpdate(forceUpdate);
}
reference.addContext(context);
} else {
- reference = new DecorationReference(element, adaptedElement,
- context);
+ reference = new DecorationReference(element, adaptedElement, context);
reference.setForceUpdate(forceUpdate);
reference.setUndecoratedText(undecoratedText);
awaitingDecorationValues.put(element, reference);
@@ -174,11 +167,10 @@
* @param manager
*
*/
- public Image decorateWithOverlays(Image image, Object element,
- Object adaptedElement, IDecorationContext context, ResourceManager manager) {
+ public Image decorateWithOverlays(Image image, Object element, Object adaptedElement, IDecorationContext context,
+ ResourceManager manager) {
- DecorationResult decoration = getResult(element, adaptedElement,
- context);
+ DecorationResult decoration = getResult(element, adaptedElement, context);
if (decoration == null) {
return image;
@@ -199,8 +191,7 @@
* The deocration context
* @return DecorationResult or <code>null</code>
*/
- private DecorationResult getResult(Object element, Object adaptedElement,
- IDecorationContext context) {
+ private DecorationResult getResult(Object element, Object adaptedElement, IDecorationContext context) {
// We do not support decoration of null
if (element == null) {
@@ -281,8 +272,7 @@
* Create the Thread used for running decoration.
*/
private void createDecorationJob() {
- decorationJob = new Job(
- WorkbenchMessages.DecorationScheduler_CalculationJobName) {
+ decorationJob = new Job(WorkbenchMessages.DecorationScheduler_CalculationJobName) {
@Override
public IStatus run(IProgressMonitor monitor) {
@@ -303,9 +293,7 @@
}
}
- monitor.beginTask(
- WorkbenchMessages.DecorationScheduler_CalculatingTask,
- 100);
+ monitor.beginTask(WorkbenchMessages.DecorationScheduler_CalculatingTask, 100);
// will block if there are no resources to be decorated
DecorationReference reference;
monitor.worked(5);
@@ -361,11 +349,9 @@
}
if (!elementIsCached) {
- DecorationBuilder cacheResult = new DecorationBuilder(
- context);
+ DecorationBuilder cacheResult = new DecorationBuilder(context);
// Calculate the decoration
- decoratorManager.getLightweightManager().getDecorations(
- element, cacheResult);
+ decoratorManager.getLightweightManager().getDecorations(element, cacheResult);
// If we should update regardless then put a result
// anyways
@@ -380,8 +366,7 @@
// Add the decoration even if it's empty in
// order to indicate that the decoration is
// ready
- internalPutResult(element, context, cacheResult
- .createResult());
+ internalPutResult(element, context, cacheResult.createResult());
// Add an update for only the original element
// to
@@ -438,8 +423,7 @@
}
private Job getClearJob() {
- Job clear = new Job(
- WorkbenchMessages.DecorationScheduler_ClearResultsJob) {
+ Job clear = new Job(WorkbenchMessages.DecorationScheduler_ClearResultsJob) {
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -464,8 +448,7 @@
* @return WorkbenchJob
*/
private WorkbenchJob getUpdateJob() {
- WorkbenchJob job = new WorkbenchJob(
- WorkbenchMessages.DecorationScheduler_UpdateJobName) {
+ WorkbenchJob job = new WorkbenchJob(WorkbenchMessages.DecorationScheduler_UpdateJobName) {
int currentIndex = NEEDS_INIT;
@@ -497,9 +480,7 @@
return Status.OK_STATUS;
}
- monitor.beginTask(
- WorkbenchMessages.DecorationScheduler_UpdatingTask,
- IProgressMonitor.UNKNOWN);
+ monitor.beginTask(WorkbenchMessages.DecorationScheduler_UpdatingTask, IProgressMonitor.UNKNOWN);
long startTime = System.currentTimeMillis();
while (currentIndex < listeners.length) {
@@ -513,8 +494,7 @@
}
// If it is taking long enough for the user to notice then
- // cancel the
- // updates.
+ // cancel the updates.
if ((System.currentTimeMillis() - startTime) >= UPDATE_DELAY / 2) {
break;
}
@@ -555,11 +535,9 @@
removedListeners.clear();
currentIndex = 0;
synchronized (pendingKey) {
- Object[] elements = pendingUpdate
- .toArray(new Object[pendingUpdate.size()]);
+ Object[] elements = pendingUpdate.toArray(new Object[pendingUpdate.size()]);
pendingUpdate.clear();
- labelProviderChangedEvent = new LabelProviderChangedEvent(
- decoratorManager, elements);
+ labelProviderChangedEvent = new LabelProviderChangedEvent(decoratorManager, elements);
}
listeners = decoratorManager.getListeners();
}
@@ -602,8 +580,7 @@
* not been decorated yet.
*/
public Color getBackgroundColor(Object element, Object adaptedElement) {
- DecorationResult decoration = getResult(element, adaptedElement,
- DecorationContext.DEFAULT_CONTEXT);
+ DecorationResult decoration = getResult(element, adaptedElement, DecorationContext.DEFAULT_CONTEXT);
if (decoration == null) {
return null;
@@ -622,8 +599,7 @@
* not been decorated yet.
*/
public Font getFont(Object element, Object adaptedElement) {
- DecorationResult decoration = getResult(element, adaptedElement,
- DecorationContext.DEFAULT_CONTEXT);
+ DecorationResult decoration = getResult(element, adaptedElement, DecorationContext.DEFAULT_CONTEXT);
if (decoration == null) {
return null;
@@ -642,8 +618,7 @@
* not been decorated yet.
*/
public Color getForegroundColor(Object element, Object adaptedElement) {
- DecorationResult decoration = getResult(element, adaptedElement,
- DecorationContext.DEFAULT_CONTEXT);
+ DecorationResult decoration = getResult(element, adaptedElement, DecorationContext.DEFAULT_CONTEXT);
if (decoration == null) {
return null;