How to in designer?

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

How to in designer?

Postby bpetro » Fri Jun 19, 2009 9:30 am

?? Or perhaps - can this be done at all? I'm somewhat stumped so if you could pass on a crumb of your experience I'd much appreciate it.

Here's the need - on one line, I want three bits of String info, A,B,C and I want A left justified to the screen, B centered to the screen, and C right justified to the screen.
Question 1 might be - how can I do this when they may not be equal sizes? I have one thought ... which leads to...

Question 2 is a stab at how to do it but then logistically how to accomplish it - I do not know.
My stab approach would be to layer three label widgets on top of each other... the lowest could be 100% wide and show the centered info (B), then on top of that we could show a dynamic sized left justified label and a dynamically sized right justified label all with z-order above the first widget. We'll just have to ensure that the items on the sides will be short enough that they don't hide the center-justified string in the back.

Thoughts??? Can that idea be accomplished? and if so, how? and if not how could we accomplish what we want?
bpetro
 
Posts: 12
Joined: Mon Jun 01, 2009 1:32 pm

Re: How to in designer?

Postby Eric Clayberg » Fri Jun 19, 2009 10:51 am

Why not just use a Grid with three columns of equal width?

Code: Select all
      Grid grid = new Grid(1, 3);
      
      Label lblLeft = new Label("Left");
      grid.setWidget(0, 0, lblLeft);
      grid.getCellFormatter().setWidth(0, 0, "33%");
      
      Label lblCenter = new Label("Center");
      grid.setWidget(0, 1, lblCenter);
      grid.getCellFormatter().setWidth(0, 1, "33%");
      
      Label lblRight = new Label("Right");
      grid.setWidget(0, 2, lblRight);
      grid.getCellFormatter().setWidth(0, 2, "33%");
      grid.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
      grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: How to in designer?

Postby bpetro » Fri Jun 19, 2009 11:16 am

That will work sometimes, but there may be times when the center takes say, 75% of the screen - so yeah, I guess I could then make the center wider and use side columns that make themselves equal but smaller. So, I guess I can get by with that...

But I WAS really curious to know if GWT Designer can handle working with the z-order layers? CSS handles z-order so I would think GWT handles it. But not certain - can you confirm??

Thanks Eric!
bpetro
 
Posts: 12
Joined: Mon Jun 01, 2009 1:32 pm

Re: How to in designer?

Postby Eric Clayberg » Fri Jun 19, 2009 5:12 pm

bpetro wrote:But I WAS really curious to know if GWT Designer can handle working with the z-order layers?

I've never seen that done in GWT before, but it seems like you can use an AbsolutePanel with overlapping widgets...

Code: Select all
      AbsolutePanel absolutePanel = new AbsolutePanel();
      absolutePanel.setSize("100%", "100%");
      
      Label lblLeft = new Label("Left");
      absolutePanel.add(lblLeft, 0, 0);
      lblLeft.setWidth("100%");
      
      Label lblCenter = new Label("Center");
      lblCenter.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
      absolutePanel.add(lblCenter, 0, 0);
      lblCenter.setWidth("100%");
      
      Label lblRight = new Label("Right");
      lblRight.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
      absolutePanel.add(lblRight, 0, 0);
      lblRight.setWidth("100%");
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests