Fix bugs with the new lightweight decorator for RepositoryTreeNodes
commit735b606577bf28d74873454428b06322b4dad100
authorThomas Wolf <thomas.wolf@paranor.ch>
Tue, 14 Aug 2018 08:24:43 +0000 (14 10:24 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Tue, 14 Aug 2018 09:14:41 +0000 (14 11:14 +0200)
treef4aa902b0e38aca74b0c79e9f7e1794dae5e6a83
parentc46fd0d57551b7099ad089149fa018a8aaf4be3b
Fix bugs with the new lightweight decorator for RepositoryTreeNodes

1. The flickering of image decorations was too annoying. Move it
   back from the asynchronous decorator to the synchronous label
   provider. This means image decorations are computed on the UI
   thread again, but since we only decorate ref and tag icons and
   these nodes are initially not expanded, it will at least not
   have an impact during Eclipse startup. (And in any case it won't
   be worse than with the old label provider.)
2. Fix the update of undecorated labels. The caching logic added
   for text labels works only if a decorated label is always
   different from an undecorated one, even when there are no
   decorations. Otherwise we end up mistakenly showing a previously
   decorated label. (User-visible effect: toggling off the display
   of latest branch commits in the repositories view didn't work.)
   Fix this by making our asynchronous decorator always add
   something: when there's no decoration, append a single blank.
   That's a bit hacky, but works.

Change-Id: Ie00596edd4c39aa976db3543b7219889bd5cbcd3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeWorkbenchAdapter.java