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 113298

Summary: Group Api is too restrictive
Product: platform Reporter: _ theanuradha <theanuradha>
Component: Window SystemAssignee: issues@platform <issues>
Status: NEW ---    
Severity: blocker CC: dsimonek, ivan, mslama
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Patchs

Description _ theanuradha 2007-08-21 10:16:16 UTC
Group Api is too restrictive

1.No way to obtain  all groups in system.(like WindowManger.getModes())
2.No way to listen  opening and closing group.
3.No way to reset   group 
4.No way to specify  deferent  mode  to  TopComponent.(other than default one).
Comment 1 mslama 2007-08-21 10:55:39 UTC
Of course we can imagine a lot of new methods. Question is if there is any real use case for them. So please give us
real use case where you would use suggested new methods. I have also some questions: What do you mean by 'reset group'?
What is 'deferent mode'? 
Comment 2 _ theanuradha 2007-08-21 11:22:37 UTC
What do you mean by 'reset group'?
 A:When closing  group automatically track closed TC's and remove from group.thats fine 
   but we need a method like "group.reset()" to reset to default state.

What is 'deferent mode'? 
 A:for example Tc default mode is "explorer" .But in special group  Tc must open in "properties" mode .

No way to listen  opening and closing group.
 A:When  group opening or closing we need to listen  and do additional task like 

  java.​awt.​Component public synchronized void addComponentListener(ComponentListener l) methods

   component.addComponentListener(new java.awt.event.ComponentAdapter() {

            @Override
            public void componentResized(java.awt.event.ComponentEvent evt) {
                //do Some thing
            }
        });

Comment 3 emi 2007-08-21 12:01:50 UTC
Being able to reset a window group is important for me as I basically need a fixed set of windows open at a time. I
don't actually need for the window system to remember what was close by the user, etc.

That's a nice feature and it can remain in place, but it's also important to be able to "reset" and see all the windows
in the group (basically delete somehow what the window system saved about the user-settings).

This inability to "reset" (ie. forget the user changes) was the reason I don't actually use the groups API and relly on
componentActive() and such methods to programatically open the other topcomponents I need.
Comment 4 mslama 2007-08-21 13:03:29 UTC
Sorry I do not understand:
>When closing  group automatically track closed TC's and remove from group.

Group consists of set of TCs. TC is never removed from group ie. group population is fixed. If TC in group is opened by
user  before group is opened AND TC should be closed when group is closed then TC is NOT closed when group is closed.
There is flag "was-opened" in XML to save this state.

What is default state? Do you mean group definition in module layer? Or some other state? Or is it enough just to set
all flags "was-opened" for all TCs in group to false for given group?

>A:for example Tc default mode is "explorer" .But in special group  Tc must open in "properties" mode .
This is not possible. Group does not know anything about mode for given TCs. Mode and group is independent. Group cannot
control in which mode will be TCs opened (in which mode is TC docked into).
Comment 5 _ theanuradha 2007-08-21 13:09:17 UTC
What is default state? Do you mean group definition in module layer? Yes
Comment 6 mslama 2007-08-21 13:17:30 UTC
Ok:
1.Resetting group should be possible.
2.Adding events for closing/opening group should be possible.

Why do you need to get list of all defined groups?
Comment 7 _ theanuradha 2007-08-21 14:36:07 UTC
Why do you need to get list of all defined groups? My Perspective
[http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=3273] Module use WindowManger.getModes()
for track Modes

likewise 
I need to track all groups opening or closing   and do additional tasks 
Comment 8 ivan 2007-08-21 19:29:19 UTC
See
http://www.netbeans.org/servlets/ReadMsg?listName=nbdev&msgNo=37154
for a use-case of how group opening and closing events might come in handy.
Comment 9 _ theanuradha 2007-08-27 06:49:43 UTC
I add following features  to group api
  *Adding events for closing/opening group should be possible.
  *obtain  all groups in system
 I don't know specific way of reset group so I just leave it to expert  
  
Comment 10 _ theanuradha 2007-08-27 06:50:38 UTC
Created attachment 47433 [details]
Patchs