Can anyone help me on this?

I think its a general GWT question as opposed to one specific to
CellList...
When I was using a normal Tree i had the same alignment problems


Thanks
W
On Oct 19, 9:05 pm, Will <shatner.will...@gmail.com> wrote:
> Hi,
>
> I am having difficulty aligning my cell list correctly
>
> I have used the GWT show case and tutorials as base...
>
> I create my own cell class....extends AbstractCell <code pasted
> below...>
>
> I am using DockLayout.
> WestPanel is plain ScrollPanel
>
> I create the CellList.
> I add this as a widget to the ScrollPanel.
> I then add this scrollpanel to the dock...
>
> The elements in my Cell List however (similar to old version which was
> a tree) are not 'correctly' aligned and the appearance is quite poor.I
> think this is controlled by Parent Panels but despite numerous
> attempts ...how do I get my cell List left aligned ?
>
> Thanks,
> W
>
> private void createWestPanelCellList(DockPanel dock2) {
>
>                 //Tree tree = createTree();
>                 CellList cList = createCellList();
>
>                  westPanelScrollPane = WestPanelScrollPanel.getInstance();
>                  //((HasHorizontalAlignment)
> westPanelScrollPane).setHorizontalAlignment(dock.ALIGN_LEFT);
>                 westPanelScrollPane.setWidget(cList);
>                 westPanelScrollPane.setSize("175px", "450px");
>                 dock.add(westPanelScrollPane, DockPanel.WEST);
>                 
> //System.out.println("alignment:???>>>"+dock.getHorizontalAlignment());
>
>                 
> //dock.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
>
>         }
>
> public class UserCell extends AbstractCell<User> {
>
>          Resources IMAGEHANDLER = GWT.create(Resources.class);
>
>     private String imageHtml=null;
>
> @Override
>         public void render(User value, Object key, SafeHtmlBuilder sb) {
>                 // TODO Auto-generated method stub
>                 // Value can be null, so do a null check..
>               if (value == null) {
>                 return;
>               }
>
>               //ImageResource image = new ImageResource("war/resources/icons/
> user.png");
>
>              ImageResource image =IMAGEHANDLER.femaleUser();
>              imageHtml = AbstractImagePrototype.create(image).getHTML();
>
>               sb.appendHtmlConstant("<table>");
>
>               // Add the contact image.
>               sb.appendHtmlConstant("<tr><td rowspan='3'>");
>               sb.appendHtmlConstant(imageHtml);
>               sb.appendHtmlConstant("</td>");
>
>            // Add the name and address.
>               sb.appendHtmlConstant("<td style='font-size:95%;'>");
>               sb.appendEscaped(value.getFirstName());
>               sb.appendHtmlConstant("</td></tr><tr><td>");
>               sb.appendEscaped(" "+value.getLastName());
>               sb.appendHtmlConstant("</td></tr></table>");
>
>         }

-- 
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.

Reply via email to