Re: DockPanel Question
Ah ok, It seems that is common practice then. I will do that, I was just wondering if there's a nicer way to do it. Thanks for your suggestions! On Jan 16, 4:28 am, Abdullah Shaikh wrote: > On Sat, Jan 16, 2010 at 9:57 AM, Sean wrote: > > So, I was working with a DockPanel, and I want to remove a Widget. > > Seems to only be two ways, remove teh Widget or remove the Widget by > > it's index. > > > Is there a way to remove Widgets by their Direction? I feel there > > should be a DockPanel.clear(DockPanel.NORTH) or something to that > > effect. > > > For example, I want to put GWT.Visualizations in the Center direction > > with the surrounding directions controlling which type of > > Visualization is in there. That means, I wont' know what is in there, > > it could be the default HTML giving directions for all I know. > > > What I do is, I have a panel in Center, which I clear before adding new > > widgets to it based on conditions. > > > What's the best way to clear the Center(or any) direction before > > adding to it? Seems like a pretty useful thing that's missing from the > > API. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to google-web-tool...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-web-toolkit+unsubscr...@googlegroups.com > > . > > For more options, visit this group at > >http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: DockPanel Question
Have you tried putting all the stuff you need to clear in a panel that you add/remove from the DockPanel areas? You could easily keep track of the one Panel in the area and might even be able to cache them. On Jan 15, 10:27 pm, Sean wrote: > So, I was working with a DockPanel, and I want to remove a Widget. > Seems to only be two ways, remove teh Widget or remove the Widget by > it's index. > > Is there a way to remove Widgets by their Direction? I feel there > should be a DockPanel.clear(DockPanel.NORTH) or something to that > effect. > > For example, I want to put GWT.Visualizations in the Center direction > with the surrounding directions controlling which type of > Visualization is in there. That means, I wont' know what is in there, > it could be the default HTML giving directions for all I know. > > What's the best way to clear the Center(or any) direction before > adding to it? Seems like a pretty useful thing that's missing from the > API. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
DockPanel Question
So, I was working with a DockPanel, and I want to remove a Widget. Seems to only be two ways, remove teh Widget or remove the Widget by it's index. Is there a way to remove Widgets by their Direction? I feel there should be a DockPanel.clear(DockPanel.NORTH) or something to that effect. For example, I want to put GWT.Visualizations in the Center direction with the surrounding directions controlling which type of Visualization is in there. That means, I wont' know what is in there, it could be the default HTML giving directions for all I know. What's the best way to clear the Center(or any) direction before adding to it? Seems like a pretty useful thing that's missing from the API. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Dockpanel question
The easiest way is to add a panel to the centre - just a SimplePanel will do - and clear() and then add() to that. Ian http://examples.roughian.com 2008/11/25 jake H <[EMAIL PROTECTED]> > > This seems to work fine!!! > ty gregor > > > One question about DockPanels. > > Is it possible to do sth like that? > > outer.remove(DockPanel.CENTER.widget) > in case u arent sure about the panel u set in the center. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Dockpanel question
This seems to work fine!!! ty gregor One question about DockPanels. Is it possible to do sth like that? outer.remove(DockPanel.CENTER.widget) in case u arent sure about the panel u set in the center. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Dockpanel question
Hi Jake, I think your problem is here: tree.addTreeListener(new TreeListener(){ public void onTreeItemSelected(TreeItem item) { ThirdMenu neo = new ThirdMenu(item.getText()); won't work } public void onTreeItemStateChanged(TreeItem item) { if (item.getState()){ // currChapter.setText(item.getText()); } } You have attached a first instance of ThirdMenu to outer where it remains. You have instantiated a second instance of ThirdMenu but you have not attached it to outer (or anything else), so it does not get displayed. When you write Widget.add(Widget someWidget) you are effectively attaching it to the DOM behind the scenes (starting off with RootPanel.get.add(..)). To make it do so you would need to write: public void onTreeItemSelected(TreeItem item) { ThirdMenu neo = new ThirdMenu(item.getText()); outer.remove(new1); outer.add(neo,DockPanel.CENTER); } Arguably a better strategy would be to make ThirdMenu a mutable and update the same instance from the listener. If ThirdMenu was a Tree, for example, you would probably have a method to build it in the first place from some parameter. Then you can call Tree.clear() followed by the build method when you need to update ThirdMenu. Also if you have ThirdMenu implement TreeListener then it can be registered with SecondMenu and therefore be notified of SecondMenu selections via the Event model which is generally the best way to do it as it decouples Second- and ThirdMenu. regards gregor On Nov 25, 10:07 am, jake H <[EMAIL PROTECTED]> wrote: > I m certain that is possible to do sth like that with Dockpanels. > Any one that can help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Dockpanel question
I m certain that is possible to do sth like that with Dockpanels. Any one that can help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Dockpanel question
I dont think that this is possible with DockPanel. You have to create a Vertical Panel , then calling Topmenu() and then a HorizontalPanel() with a Tree listner inside it so it will change the right side. If Dockpanel can do this , i m really curious to see how it is done. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Dockpanel question
Hello i m trying to make a page like the mail application. What i want look like this one --- |1 | |-| | || | || | 2 |3 | | || | || ||___| 1 and 2 are static but in 3 frame i want to be refreshed any time i m pressing a treeItem from 2 menu. This is how i m trying to make this happen. First.java private TopPanel topPanel = new TopPanel(); private SecondMenu new2 = new SecondMenu(); private ThirdMenu new1 = new ThirdMenu("example"); public void onModuleLoad() { topPanel.setWidth("100%"); new2.setWidth("100%"); new1.setWidth("100%"); DockPanel outer = new DockPanel(); outer.add(topPanel, DockPanel.NORTH); outer.add(new2, DockPanel.WEST); outer.add(new1, DockPanel.CENTER); outer.setWidth("100%"); outer.setSpacing(4); RootPanel.get().add(outer); By using this, it is created a page like the one i want Inside the SecondMenu i have made a TreeListener which force the ThirdMenu to be redisned again after a TreeItem is pressed. This the code SecondMenu.java tree.addTreeListener(new TreeListener(){ public void onTreeItemSelected(TreeItem item) { ThirdMenu neo = new ThirdMenu(item.getText()); } public void onTreeItemStateChanged(TreeItem item) { if (item.getState()){ // currChapter.setText(item.getText()); } } In the thirdmenu so far , i just print in the its region what user parses. However when i try to do that nothing happened. It seems that the menu i created is a static one and nothing changes. So indide the ThirdMenu i put this: RootPanel.get().clear(); and then printing the argument But the result is a blank page with no menus at all , neither Toppanel nor secondmenu. Any help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---