-
Notifications
You must be signed in to change notification settings - Fork 149
Console view bug fixes and improvements #2461
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
Open
iloveeclipse
wants to merge
8
commits into
eclipse-platform:master
Choose a base branch
from
iloveeclipse:issue_2460
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1de591c
Manual code cleanup & fixes in ConsoleManager
iloveeclipse 4477d7e
Fix link redraw issues with secondary consoles
iloveeclipse e22266f
Fix console content notifications
iloveeclipse 4630924
Manual code cleanup ConsoleView
iloveeclipse 4accaf9
Manual code cleanup for base Console classes
iloveeclipse 174da5c
ProcessConsole.computeName() refactoring and smaller fixes
iloveeclipse 280174f
Don't use display thread for scheduling console update tasks
iloveeclipse 1f8136b
Don't update hidden consoles every second
iloveeclipse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleMock.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| /******************************************************************************* | ||
| * Copyright (c) 2026 Andrey Loskutov and others. | ||
| * | ||
| * This program and the accompanying materials | ||
| * are made available under the terms of the Eclipse Public License 2.0 | ||
| * which accompanies this distribution, and is available at | ||
| * https://www.eclipse.org/legal/epl-2.0/ | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| * | ||
| * Contributors: | ||
| * Andrey Loskutov <loskutov@gmx.de> - initial API and implementation | ||
| *******************************************************************************/ | ||
| package org.eclipse.debug.tests.console; | ||
|
|
||
| import java.util.concurrent.atomic.AtomicInteger; | ||
|
|
||
| import org.eclipse.jface.resource.ImageDescriptor; | ||
| import org.eclipse.jface.util.IPropertyChangeListener; | ||
| import org.eclipse.swt.SWT; | ||
| import org.eclipse.swt.widgets.Composite; | ||
| import org.eclipse.ui.console.IConsole; | ||
| import org.eclipse.ui.console.IConsoleView; | ||
| import org.eclipse.ui.part.IPageBookViewPage; | ||
| import org.eclipse.ui.part.MessagePage; | ||
|
|
||
| /** | ||
| * Dummy console page showing mock number and counting the numbers its | ||
| * control was shown in the console view. | ||
| */ | ||
| final class ConsoleMock implements IConsole { | ||
| MessagePage page; | ||
| final AtomicInteger showCalled; | ||
| final AtomicInteger pageShownCalled; | ||
| final AtomicInteger pageHiddenCalled; | ||
| final int number; | ||
| final static AtomicInteger allShownConsoles = new AtomicInteger(); | ||
|
|
||
| public ConsoleMock(int number) { | ||
| this.number = number; | ||
| showCalled = new AtomicInteger(); | ||
| pageShownCalled = new AtomicInteger(); | ||
| pageHiddenCalled = new AtomicInteger(); | ||
| } | ||
|
|
||
| @Override | ||
| public void pageShown() { | ||
| pageShownCalled.incrementAndGet(); | ||
| } | ||
|
|
||
| @Override | ||
| public void pageHidden() { | ||
| pageHiddenCalled.incrementAndGet(); | ||
| } | ||
|
|
||
| @Override | ||
| public void removePropertyChangeListener(IPropertyChangeListener listener) { | ||
| } | ||
|
|
||
| @Override | ||
| public String getType() { | ||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return toString(); | ||
| } | ||
|
|
||
| @Override | ||
| public ImageDescriptor getImageDescriptor() { | ||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
| public void addPropertyChangeListener(IPropertyChangeListener listener) { | ||
| } | ||
|
|
||
| /** | ||
| * Just a page showing the mock console name | ||
| */ | ||
| @Override | ||
| public IPageBookViewPage createPage(IConsoleView view) { | ||
| page = new MessagePage() { | ||
| @Override | ||
| public void createControl(Composite parent) { | ||
| super.createControl(parent); | ||
| // This listener is get called if the page is really shown | ||
| // in the console view | ||
| getControl().addListener(SWT.Show, event -> { | ||
| int count = showCalled.incrementAndGet(); | ||
| if (count == 1) { | ||
| count = allShownConsoles.incrementAndGet(); | ||
| System.out.println("Shown: " + ConsoleMock.this + ", overall: " + count); //$NON-NLS-1$ //$NON-NLS-2$ | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| }; | ||
| page.setMessage(toString()); | ||
| return page; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "mock #" + number; //$NON-NLS-1$ | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.