From 7547bcc0495b8eae6dadfa8d611ed86d2b39f998 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Sat, 11 Jan 2025 10:10:08 +0100 Subject: [PATCH] Asynchronously decorate quick outline view via DecorationManager #1922 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 https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1922 --- .../ui/text/JavaOutlineInformationControl.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java index 30be2d503d0..b7ad0dd7834 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaOutlineInformationControl.java @@ -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; @@ -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; @@ -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; @@ -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);