Bug 42883 - 'Welcome' and 'Drag & Drop' panels can't be hidden or shown
Summary: 'Welcome' and 'Drag & Drop' panels can't be hidden or shown
Status: REOPENED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: chainsaw (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-12 20:04 UTC by Isuru Suriarachchi
Modified: 2007-08-23 20:59 UTC (History)
0 users



Attachments
Adding ability to hide 'Welcome' and 'Drag & Drop' panels (6.25 KB, patch)
2007-07-12 20:09 UTC, Isuru Suriarachchi
Details | Diff
New version of the previous patch with no comments (5.54 KB, patch)
2007-07-12 20:46 UTC, Isuru Suriarachchi
Details | Diff
Adding ability to remember previous tab settings after restarts (7.78 KB, patch)
2007-08-14 06:46 UTC, Isuru Suriarachchi
Details | Diff
Adding ability to remember tab settings improved version (7.79 KB, patch)
2007-08-22 04:36 UTC, Isuru Suriarachchi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Isuru Suriarachchi 2007-07-12 20:04:48 UTC
Normal Chainsaw log panels can be hidden or shown as the user needs. But this
feature is not working with 'Welcome' and 'Drag & Drop' panels. Hiding these
panels also can be useful for some users to concentrate only one one panel.
Comment 1 Isuru Suriarachchi 2007-07-12 20:09:13 UTC
Created attachment 20501 [details]
Adding ability to hide 'Welcome' and 'Drag & Drop' panels

This patch contains the modifications in LogUI to hide and show 'Welcome' and
'Drag & Drop' panels panels whenever needed.
Comment 2 Isuru Suriarachchi 2007-07-12 20:46:40 UTC
Created attachment 20502 [details]
New version of the previous patch with no comments

Commented lines are removed in this patch
Comment 3 Scott Deboy 2007-08-09 23:12:57 UTC
This patch has already been applied, but it would be nice if this feature could
be enhanced to remember if these tabs were hidden on app exit and hide them if
appropriate (with menu options to view them again?)

This is also serving as a reminder to myself if you don't get to it.
Comment 4 Isuru Suriarachchi 2007-08-14 06:46:04 UTC
Created attachment 20661 [details]
Adding ability to remember previous tab settings after restarts

In this patch, I have implemented the feature of saving the tab setting (what
are hidden and what are shown) at closing and loading it back at restarting
Chainsaw. I used an XML file to save the setting. Methods to save and load this
setting is included in the "ChainsawTabbedPane" class. I wonder whether it is
the correct place to include that code. But I couldn't fine somewhere more
suitable.
I have used a separate class called "SavableTabSetting" to represent the tab
setting that should saved. "Welcome", "Drag & Drop" and "chainsaw-log" are the
main log panels which are always running in Chainsaw. Existence of other log
panels depends on the situation. For example, the user may load a receiver once
and close Chainsaw and later restart and load some other receiver. I think
saving the state of such panels will be useless. So I have made Chainsaw
remember only the state of the above mentioned main log panels.
There may be some adjustments to be done. Hope this will help as an initial
work to get the job done.So please check this and comment...
Comment 5 Paul Smith 2007-08-20 18:24:25 UTC

1) SavableTabSetting - Can this be a normal Java bean with getters/settings? 
It's stylistic, and I know this is a simple class but I'd prefer it with
getters/setters
2) ChainsawTabbedPane - Can this implement the SettingsListener interface and
use the standard save/load call backs that provides?
3) This patch might now be slightly out of date, it's not applying cleanly at
all.  The LogUI file has 2 patch chunks that don't apply cleanly:


@@ -2055,8 +2073,10 @@
               if (
                 getTabbedPane().getSelectedIndex() == getTabbedPane()
                                                           .indexOfTab(ident)) {
-                getTabbedPane().setIconAt(
-                  getTabbedPane().indexOfTab(ident), SELECTED);
+                if(getTabbedPane().indexOfTab(ident) > 0){
+                  getTabbedPane().setIconAt(
+                    getTabbedPane().indexOfTab(ident), SELECTED);
+                }
                 newEvents = false;
                 seenEvents = true;
               } else if (getTabbedPane().indexOfTab(ident) > -1) {

and 

@@ -2094,7 +2114,7 @@
 
     public void stateChanged(ChangeEvent event) {
       if (
-        getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex()) {
+        getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex()
&& getTabbedPane().indexOfTab(ident) > 0) {
         getTabbedPane().setIconAt(getTabbedPane().indexOfTab(ident), SELECTED);
       }
     }


I'm not really sure why.. Can you double check ?  Does it apply cleanly for you?
Comment 6 Isuru Suriarachchi 2007-08-22 04:36:11 UTC
Created attachment 20689 [details]
Adding ability to remember tab settings improved version

This patch includes all the improvements proposed by paul.
Comment 7 Isuru Suriarachchi 2007-08-22 04:47:43 UTC
(In reply to comment #5)
> 
> 1) SavableTabSetting - Can this be a normal Java bean with getters/settings? 
> It's stylistic, and I know this is a simple class but I'd prefer it with
> getters/setters
OK. Done in the new patch...
> 2) ChainsawTabbedPane - Can this implement the SettingsListener interface and
> use the standard save/load call backs that provides?
Yes. Done in the new patch..
> 3) This patch might now be slightly out of date, it's not applying cleanly at
> all.  The LogUI file has 2 patch chunks that don't apply cleanly:
> 
> 
> @@ -2055,8 +2073,10 @@
>                if (
>                  getTabbedPane().getSelectedIndex() == getTabbedPane()
>                                                            .indexOfTab(ident)) {
> -                getTabbedPane().setIconAt(
> -                  getTabbedPane().indexOfTab(ident), SELECTED);
> +                if(getTabbedPane().indexOfTab(ident) > 0){
> +                  getTabbedPane().setIconAt(
> +                    getTabbedPane().indexOfTab(ident), SELECTED);
> +                }
>                  newEvents = false;
>                  seenEvents = true;
>                } else if (getTabbedPane().indexOfTab(ident) > -1) {
> 
> and 
> 
> @@ -2094,7 +2114,7 @@
>  
>      public void stateChanged(ChangeEvent event) {
>        if (
> -        getTabbedPane().indexOfTab(ident) ==
getTabbedPane().getSelectedIndex()) {
> +        getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex()
> && getTabbedPane().indexOfTab(ident) > 0) {
>          getTabbedPane().setIconAt(getTabbedPane().indexOfTab(ident), SELECTED);
>        }
>      }
> 
> 
> I'm not really sure why.. Can you double check ?  Does it apply cleanly for you?

There was a bug in those two statements and I had fixed it in the previous
patch. But after that someone has committed that fix. So that why it was
conflicting. These two statements are not included in the new patch as it is
already fixed.
New patch applies without any problem. Please check it...

Comment 8 Isuru Suriarachchi 2007-08-22 04:50:14 UTC
(In reply to comment #5)
> 
> 1) SavableTabSetting - Can this be a normal Java bean with getters/settings? 
> It's stylistic, and I know this is a simple class but I'd prefer it with
> getters/setters
OK. Done in the new patch...
> 2) ChainsawTabbedPane - Can this implement the SettingsListener interface and
> use the standard save/load call backs that provides?
Yes. Done in the new patch..
> 3) This patch might now be slightly out of date, it's not applying cleanly at
> all.  The LogUI file has 2 patch chunks that don't apply cleanly:
> 
> 
> @@ -2055,8 +2073,10 @@
>                if (
>                  getTabbedPane().getSelectedIndex() == getTabbedPane()
>                                                            .indexOfTab(ident)) {
> -                getTabbedPane().setIconAt(
> -                  getTabbedPane().indexOfTab(ident), SELECTED);
> +                if(getTabbedPane().indexOfTab(ident) > 0){
> +                  getTabbedPane().setIconAt(
> +                    getTabbedPane().indexOfTab(ident), SELECTED);
> +                }
>                  newEvents = false;
>                  seenEvents = true;
>                } else if (getTabbedPane().indexOfTab(ident) > -1) {
> 
> and 
> 
> @@ -2094,7 +2114,7 @@
>  
>      public void stateChanged(ChangeEvent event) {
>        if (
> -        getTabbedPane().indexOfTab(ident) ==
getTabbedPane().getSelectedIndex()) {
> +        getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex()
> && getTabbedPane().indexOfTab(ident) > 0) {
>          getTabbedPane().setIconAt(getTabbedPane().indexOfTab(ident), SELECTED);
>        }
>      }
> 
> 
> I'm not really sure why.. Can you double check ?  Does it apply cleanly for you?

There was a bug in those two statements and I had fixed it in the previous
patch. But after that someone has committed that fix. So that why it was
conflicting. These two statements are not included in the new patch as it is
already fixed.
New patch applies without any problem. Please check it...

Comment 9 Paul Smith 2007-08-23 00:14:29 UTC
Fixed in revision 568858. THX
Comment 10 Paul Smith 2007-08-23 16:36:55 UTC
I'm seeing quite weird behaviour with this feature now. It did look ok when I
tested this yesterday but I tried the following:

1) Start Chainsaw, run the tutorial and get the 3 tabs from the generators
2) Hide all 3 of the generator tabs
3) exit and restart Chainsaw
5) Run the tutorial again with generators, they come back to life.

So, the restore logic does hide any hidden tab that appears at app startup time,
but does not hide any new tabs that turn up.
Comment 11 Isuru Suriarachchi 2007-08-23 20:59:28 UTC
(In reply to comment #10)
> I'm seeing quite weird behaviour with this feature now. It did look ok when I
> tested this yesterday but I tried the following:
> 1) Start Chainsaw, run the tutorial and get the 3 tabs from the generators
> 2) Hide all 3 of the generator tabs
> 3) exit and restart Chainsaw
> 5) Run the tutorial again with generators, they come back to life.
> So, the restore logic does hide any hidden tab that appears at app startup 
time,
> but does not hide any new tabs that turn up.
Yes. I didn't try to save the configuration of tabs other than Welcome, Drag 
and Drop and chainsaw-log. This is because we don't know whether the user will 
start exactly the same tabs when chainsaw is restarted. This was done as an 
intial step for this feature. We can work on saving any tab's setting in the 
future. But there will be some problems comming up. I'll try it..