Skip to content

Commit

Permalink
Asynchronously decorate quick outline view via DecorationManager #1922
Browse files Browse the repository at this point in the history
The Quick Outline View currently applies (i.e., calculates and draws)
decorations for override indicators synchronously. In case the
calculation of the indicator takes long, it blocks the UI.
The ordinary Outline View defers the responsibility of calculating and
applying decorations to the DecorationManager. This ensures that (1)
that task is performed asynchronously via a dedicated job and (2) that
the decoration manager takes care of the current user configuration
(i.e., whether those indicators shall be shown or not), which the Quick
Outline View currently replicates.

With this change, the Quick Outline View uses the same label decorator
as the ordinary Outline View, which makes the DecorationManager
process the override label decorator asynchronously instead of applying
it synchronously.

Contributes to #1922
  • Loading branch information
HeikoKlare authored and jukzi committed Jan 14, 2025
1 parent 0f60ce5 commit 42dc611
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import org.eclipse.ui.IDecoratorManager;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
Expand All @@ -73,7 +72,6 @@
import org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache;

import org.eclipse.jdt.ui.JavaElementLabels;
import org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator;
import org.eclipse.jdt.ui.ProblemsLabelDecorator;
import org.eclipse.jdt.ui.StandardJavaElementContentProvider;

Expand All @@ -85,7 +83,7 @@
import org.eclipse.jdt.internal.ui.typehierarchy.AbstractHierarchyViewerSorter;
import org.eclipse.jdt.internal.ui.viewsupport.AppearanceAwareLabelProvider;
import org.eclipse.jdt.internal.ui.viewsupport.ColoredViewersManager;
import org.eclipse.jdt.internal.ui.viewsupport.ColoringLabelProvider;
import org.eclipse.jdt.internal.ui.viewsupport.DecoratingJavaLabelProvider;
import org.eclipse.jdt.internal.ui.viewsupport.FocusDescriptor;
import org.eclipse.jdt.internal.ui.viewsupport.MemberFilter;

Expand Down Expand Up @@ -584,11 +582,7 @@ protected TreeViewer createTreeViewer(Composite parent, int style) {

fInnerLabelProvider= new OutlineLabelProvider();
fInnerLabelProvider.addLabelDecorator(new ProblemsLabelDecorator(null));
IDecoratorManager decoratorMgr= PlatformUI.getWorkbench().getDecoratorManager();
if (decoratorMgr.getEnabled("org.eclipse.jdt.ui.override.decorator")) //$NON-NLS-1$
fInnerLabelProvider.addLabelDecorator(new OverrideIndicatorLabelDecorator(null));

treeViewer.setLabelProvider(new ColoringLabelProvider(fInnerLabelProvider));
treeViewer.setLabelProvider(new DecoratingJavaLabelProvider(fInnerLabelProvider));

fLexicalSortingAction= new LexicalSortingAction(treeViewer);
fSortByDefiningTypeAction= new SortByDefiningTypeAction(treeViewer);
Expand Down

0 comments on commit 42dc611

Please sign in to comment.