-
Notifications
You must be signed in to change notification settings - Fork 148
Synchronize Console view icon with selected console #2418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cd3f2a3 to
392461d
Compare
|
Interesting idea. I remember there was a time the default JDT Java Console page had no icon at all. What would happen in such a case? |
368d108 to
8e16e01
Compare
If no icon, then default |
|
@iloveeclipse Build looks good now, could you please merge this change ? |
iloveeclipse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are 2 or 3 issues with image handling.
I've got as well as errors about leaked images and about already disposed images.
- This one happens if you open Console, opens few pages, close Console & trigger GC:
java.lang.Error: SWT Resource was not properly disposed
at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:191)
at org.eclipse.swt.graphics.Resource.<init>(Resource.java:124)
at org.eclipse.swt.graphics.Image.<init>(Image.java:635)
at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:300)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:331)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:309)
at org.eclipse.ui.internal.console.ConsoleView.updateIcon(ConsoleView.java:285)
at org.eclipse.ui.internal.console.ConsoleView.showPageRec(ConsoleView.java:190)
at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:698)
at org.eclipse.ui.internal.console.ConsoleView.display(ConsoleView.java:538)
at org.eclipse.ui.internal.console.ConsoleDropDownAction.run(ConsoleDropDownAction.java:132)
at org.eclipse.ui.internal.console.ConsoleDropDownAction.runWithEvent(ConsoleDropDownAction.java:153)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:581)
at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:454)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5895)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1656)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5110)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4545)
- I can't reproduce yet this one but I saw few of them in my log
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:220)
at org.eclipse.jface.resource.CompositeImageDescriptor$CachedDescriptorImageDataProvider.<init>(CompositeImageDescriptor.java:126)
at org.eclipse.jface.resource.CompositeImageDescriptor.createCachedImageDataProvider(CompositeImageDescriptor.java:551)
at org.eclipse.jface.viewers.DecorationOverlayIcon.<init>(DecorationOverlayIcon.java:121)
at org.eclipse.debug.internal.ui.quickaccess.LaunchQuickAccessElement.getImageDescriptor(LaunchQuickAccessElement.java:81)
at org.eclipse.ui.internal.quickaccess.QuickAccessEntry.getImage(QuickAccessEntry.java:120)
at org.eclipse.ui.internal.quickaccess.QuickAccessEntry.paint(QuickAccessEntry.java:224)
at org.eclipse.ui.internal.quickaccess.QuickAccessContents.lambda$11(QuickAccessContents.java:857)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5895)
- Beside this, closing all pages leaves last selected page icon on the console.
debug/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
Outdated
Show resolved
Hide resolved
|
I would probably manage images created for console pages with a map and probably update it in doCreatePage / doDestroyPage, but I havent looked deep enough into the ode to be sure. |
laeubi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should likely use a LocalResourceManager for images.
8e16e01 to
55678ee
Compare
|
I have applied |
55678ee to
506d17c
Compare
iloveeclipse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better now, resources problem seem to be fixed, beside small code change left is only this one:
closing all pages leaves last selected page icon on the console.
debug/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
Outdated
Show resolved
Hide resolved
The Console view icon now reflects the currently selected console. This helps users quickly identify different consoles when multiple consoles are present, without having to inspect each one.
506d17c to
659e494
Compare
Fixed remaining issues with 659e494 & rebased on master. |
|
@SougandhS : thanks for the idea, I really like it. |
|
Thank you @iloveeclipse @laeubi for the review
Sure 👍 |


The Console view icon now reflects the currently selected console. This helps users quickly identify different consoles when multiple consoles are present, without having to inspect each one.
Before :
After :