This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 201626

Summary: Button to clear the output
Product: platform Reporter: beeman <beeman>
Component: Output WindowAssignee: Jaroslav Havlin <jhavlin>
Status: NEW ---    
Severity: normal CC: markiewb, mexer
Priority: P1    
Version: 7.2.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Prototype/example project

Description beeman 2011-09-05 11:01:07 UTC
It would be great to have a button that clears the content of the output window. 

Right now you can clear the content by right-clicking it and selecting "Clear" or clicking in the window and then press Ctrl-L.

My request is to have a Clear output button, just like the Clear Console button in Eclipse.
Comment 1 Jaroslav Havlin 2012-11-08 13:35:41 UTC
The buttons that are in output windows are added by clients that create that windows (ant process, maven process, ...). Having some default buttons would be quite significant UI change.

Can you please explain why you need it, or what is your use case?
Thank you.
Comment 2 mexer 2013-02-04 04:33:49 UTC
I also would like to  have  this button.
I've been using netbeans and intelliJ for a while, and in the version 12 this button has been implemented

When I'm debugging any application, sometimes the stacktrace is displayed in the output windows (e.j.due to an exception) without noticing it at the moment, when I  realize this output, I want to confirm what user action (submitting a form) cause the stacktrace in the output and identify easily where it start.
I know, I can determine this information using/checking the time, but is very useful for me clearing the output. I use a lot the method that beeman mentioned. Actually, I would like to participate adding this functionality. I've already downloaded all the code using mercurial, I appreciate if you o someone can give  me some advises to start working on it. I'm a experienced Java developer, and I want to start with the netbeans platform

Regards
Comment 3 Jaroslav Havlin 2013-02-11 15:37:25 UTC
(In reply to comment #2)
> I also would like to  have  this button.
> I've been using netbeans and intelliJ for a while, and in the version 12 this
> button has been implemented
> [...]
Thank you very much for the explanation.
I'm still afraid that adding this "Clear" button to the output window is not semantically correct, as the buttons there are related to the process that produces the output (Re-Run, Run Failed Tests, Configure, etc.). I guess that this button will be used by minority of users and it will make the effective width output window smaller (of course it could be configurable, but it increases complexity of Settings panel).

What about adding a button (that clears the currently selected output window) to the main toolbar? It's not also semantically ideal, but can be easily implemented and published as a plugin.

> Actually, I would like to participate adding this functionality.
> I've already downloaded all the code using mercurial, I appreciate if you o
> someone can give  me some advises to start working on it. I'm a experienced
> Java developer, and I want to start with the netbeans platform
Thank you for your effort.
I guess you already know http://wiki.netbeans.org/WorkingWithNetBeansSources
If you already have the sources, you can open folders in the repository in NetBeans as module projects.
Related modules are in folders core.output2, openide.io and core.io.ui.
You can build the individual modules from the IDE, e.g. with project right-click -> Build, or Shift+F11. Entire IDE can be built using "ant clean build" invoked from the repository directory.
Comment 4 kmranganathan 2013-09-21 11:56:22 UTC
I miss this feature too. Whenever I think of difference between Eclipse and NetBeans, this comes to the top of my mind.

Actually, we don't need a button, we need it in the toolbar (that appears on the left side in the output-window). This is particularly useful when working with a server where exception traces are long and we continuously run them. Clearing them frequently is very important to understand the current flow.
Comment 5 mexer 2013-11-12 22:03:22 UTC
(In reply to Jaroslav Havlin from comment #3)
> (In reply to comment #2)
> > I also would like to  have  this button.
> > I've been using netbeans and intelliJ for a while, and in the version 12 this
> > button has been implemented
> > [...]
> Thank you very much for the explanation.
> I'm still afraid that adding this "Clear" button to the output window is not
> semantically correct, as the buttons there are related to the process that
> produces the output (Re-Run, Run Failed Tests, Configure, etc.). I guess
> that this button will be used by minority of users and it will make the
> effective width output window smaller (of course it could be configurable,
> but it increases complexity of Settings panel).
> 
> What about adding a button (that clears the currently selected output
> window) to the main toolbar? It's not also semantically ideal, but can be
> easily implemented and published as a plugin.

I’m having a hard day trying both approaches
Is there any way to overwrite the current processes that produces the output window(Re-Run, Run Failed Tests, Configure, etc.) to customize them?
Comment 6 Jaroslav Havlin 2013-11-14 12:26:56 UTC
Created attachment 142181 [details]
Prototype/example project

> Actually, we don't need a button, we need it in the toolbar (that appears on
> the left side in the output-window). 
OK

> This is particularly useful when working with a server where exception traces 
> are long and we continuously run them. Clearing them frequently is very 
> important to understand the current flow.
Folding of exceptions in NetBeans 7.4 may help here.

> I’m having a hard day trying both approaches
> Is there any way to overwrite the current processes that produces the output 
> window(Re-Run, Run Failed Tests, Configure, etc.) to customize them?
See the attached example project. It contains a new IOProvider that uses the
original provider internally, but adds the "clear" action to every created
InputOutput instance.

Because there is no public API for Output Window tabs, the plugin needs to use
reflection to access private classes and methods, so it may be unstable and may
not work with future versions of Output Window. Use with caution.
Comment 7 Jaroslav Havlin 2013-11-18 07:38:31 UTC
I'm sorry, I've just noticed that user Mexer is not in the CC list.
Please see comment 6.
Comment 8 mexer 2013-11-27 03:17:51 UTC
So, what is left? WindowWithClearButtonProvider does everything that we need
Is this feature will be added to the Netbeans IDE or it's just a plugin?
Comment 9 Jaroslav Havlin 2013-11-27 15:17:38 UTC
If you want to create a custom plugin, you can use the sources in the attachment, and publish it on plugin portal (http://plugins.netbeans.org/).
I haven't tested it very well, and I'm not sure it will work correctly with e.g. C/C++ projects. So it may need some improvements and fixes.

If the example code works fine for you already, I will consider creating and publishing a plugin. But I think it is better if the plugin is maintained by someone who uses it regularly :-)