Hi Patrick!

Can you provide code for the java side?


It's a little bit difficult to extract the relevant code...

The root panel is a class called "Display" derived from DockLayoutPanel. 
There is one method called "setClient" that sets the current client panel. 
All client panels are derived from a class called "Pad":

public class Display extends DockLayoutPanel
{
 private ScrollPanel scp;

 ...
 public void setClient (Pad pad)
 {
  Widget w;
  
  w = scp.getWidget ();
  
  if (w != null)
   scp.remove(w);
  
  if (pad != null)
   scp.add (pad);

  if (pad != null)
   scheduleOnOpen ();
  
  return (true);
 }
} 


The class "Pad" is also derived from DockLayoutPanel. It provides a title 
bar (north) and a status/button bar (south), as well as a client area 
(center).

public class Pad extends DockLayoutPanel
{
 Widget wgt_Client;

...

 public void setClient (Widget wgt)
 {
  if (wgt_Client != null)
   this.remove (wgt_Client);
                
  wgt_Client = wgt;

  if (wgt_Client != null)
   this.add (wgt_Client);
 }
}


The main panel that contains the SplitLayoutPanel looks like this:

public class PortalPad extends Pad
{
 private PortalPanel pnl; // the UIBinder nested SplitLayoutPanel

 public PortalPad ()
 {
   pnl = new PortalPanel ();
  setClient (pnl);
 
 }
}


So when the user selects a menu command, a PortalPad is created and added 
to the display:

PortalPad p = new PortalPad ();
display.setClient (p);

I have attached the UIBinder code below.

Sorry that I cannot provide executable code.

Magnus



-----

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
 xmlns:g="urn:import:com.google.gwt.user.client.ui">
 <ui:style>
  
 </ui:style>

 <g:SplitLayoutPanel>

  <g:north size='150' unit='EM'>
   <g:SplitLayoutPanel>

    <g:west size='150' unit='EM'>
     <g:FlowPanel>
      <g:Label text="west" />
     </g:FlowPanel>

    </g:west>

    <g:center>
     <g:FlowPanel>
      <g:Label text="center" />
     </g:FlowPanel>
    </g:center>

   </g:SplitLayoutPanel>
  </g:north>

  <g:center>

   <g:FlowPanel>
    <g:Label text="main" />
   </g:FlowPanel>

  </g:center>

 </g:SplitLayoutPanel>

</ui:UiBinder> 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to