Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions debug/org.eclipse.ui.console/.settings/.api_filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.ui.console" version="2">
<resource path="src/org/eclipse/ui/console/IConsole.java" type="org.eclipse.ui.console.IConsole">
<filter id="404000815">
<message_arguments>
<message_argument value="org.eclipse.ui.console.IConsole"/>
<message_argument value="pageHidden()"/>
</message_arguments>
</filter>
<filter id="404000815">
<message_arguments>
<message_argument value="org.eclipse.ui.console.IConsole"/>
<message_argument value="pageShown()"/>
</message_arguments>
</filter>
</resource>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ public abstract class AbstractConsole implements IConsole {
/**
* Console name
*/
private String fName = null;
private String fName;

/**
* Console image descriptor
*/
private ImageDescriptor fImageDescriptor = null;
private ImageDescriptor fImageDescriptor;

/**
* Console type identifier
*/
private String fType = null;
private String fType;

/**
* Used to notify this console of lifecycle methods <code>init()</code>
Expand Down Expand Up @@ -316,4 +316,9 @@ public String getHelpContextId() {
return null;
}

@Override
public String toString() {
return "Console [" + fName + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,40 @@ public interface IConsole {
*/
String getType();

/**
* Notifies this console that its page has been shown in the UI. This method is
* called when this console page is shown on top of other console pages in at
* least one <b>visible</b> console view.
* <p>
* Default implementation does nothing.
* </p>
* <p>
* Subclasses may override this method to be notified when the console page for
* this console is visible to user.
* </p>
*
* @since 3.16
*/
default void pageShown() {
// Subclasses may override
}

/**
* Notifies this console that its page has been hidden in the UI. This method is
* called when this console page is not shown on top of other console pages in
* any of <b>visible</b> console views.
* <p>
* Default implementation does nothing.
* </p>
* <p>
* Subclasses may override this method to be notified when the console page for
* this console is not more visible to user.
* </p>
*
* @since 3.16
*/
default void pageHidden() {
// Subclasses may override
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,37 @@ public interface IConsoleManager {
*/
void refresh(IConsole console);

/**
* Notifies that given console has been shown in the UI (either the view with
* given console on top has been shown or the console has been switched to the
* top console in at least one view).
*
* <p>
* Note, there could be multiple views showing the same console, so the page
* with given console can be still hidden in some views.
* </p>
*
* @param console the top console from view that has been shown
*
* @since 3.16
*/
default void consoleShown(IConsole console) {
}

/**
* Notifies that given console that was on top of at least one view has been
* hidden in the UI (either the console is not the top page in the view or the
* view with given console on top has been hidden).
* <p>
* Note, there could be multiple views showing the same console, so the page
* with given console can be still shown in some views.
* </p>
*
* @param console the console that has been hidden
*
* @since 3.16
*/
default void consoleHidden(IConsole console) {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class IOConsole extends TextConsole {
/**
* A collection of open streams connected to this console.
*/
private final List<Closeable> openStreams = Collections.synchronizedList(new ArrayList<>());
private final List<Closeable> openStreams;

/**
* The encoding used to for displaying console output.
Expand Down Expand Up @@ -113,10 +113,9 @@ public IOConsole(String name, String consoleType, ImageDescriptor imageDescripto
public IOConsole(String name, String consoleType, ImageDescriptor imageDescriptor, Charset charset, boolean autoLifecycle) {
super(name, consoleType, imageDescriptor, autoLifecycle);
this.charset = charset;
synchronized (openStreams) {
inputStream = new IOConsoleInputStream(this);
openStreams.add(inputStream);
}
openStreams = Collections.synchronizedList(new ArrayList<>());
inputStream = new IOConsoleInputStream(this);
openStreams.add(inputStream);
partitioner = new IOConsolePartitioner(this);
final IDocument document = getDocument();
if (document != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,28 +83,27 @@ public abstract class TextConsole extends AbstractConsole {
/**
* indication that the console's partitioner is not expecting more input
*/
private volatile boolean fPartitionerFinished = false;
private volatile boolean fPartitionerFinished;

/**
* Indication that the console's pattern matcher has finished.
* (all matches have been found and all listeners notified)
*/
private volatile boolean fMatcherFinished = false;
private volatile boolean fMatcherFinished;

/**
* indication that the console output complete property has been fired
*/
private boolean fCompleteFired = false;

private volatile boolean fConsoleAutoScrollLock = true;
private boolean fCompleteFired;

private volatile boolean fConsoleAutoScrollLock;

/**
* Map of client defined attributes
*/
private final HashMap<String, Object> fAttributes = new HashMap<>();
private final HashMap<String, Object> fAttributes;

private final IConsoleManager fConsoleManager = ConsolePlugin.getDefault().getConsoleManager();
private final IConsoleManager fConsoleManager;
private ScopedPreferenceStore store;
private IPropertyChangeListener propListener;

Expand All @@ -119,6 +118,7 @@ protected void dispose() {
store.removePropertyChangeListener(propListener);
}
}

/**
* Constructs a console with the given name, image descriptor, and lifecycle
*
Expand All @@ -130,6 +130,9 @@ protected void dispose() {
*/
public TextConsole(String name, String consoleType, ImageDescriptor imageDescriptor, boolean autoLifecycle) {
super(name, consoleType, imageDescriptor, autoLifecycle);
fConsoleAutoScrollLock = true;
fAttributes = new HashMap<>();
fConsoleManager = ConsolePlugin.getDefault().getConsoleManager();
fDocument = new ConsoleDocument();
fDocument.addPositionCategory(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY);
fPatternMatcher = new ConsolePatternMatcher(this);
Expand Down
Loading
Loading