Java Reference
In-Depth Information
separator.setStyleName("separator");
userPanel.add(new Label(" jeffdonthemic@gmail.c om"));
userPanel.add(separator);
userPanel.add(logOutLink);
topPanel.setWidth("1000px");
topPanel.add(logo);
topPanel.add(userPanel);
topPanel.setCellHorizontalAlignment(userPanel,
HasHorizontalAlignment.ALIGN_RIGHT);
Add your next HorizontalPanel to hold the date picker and the Action button. You'll
also do some alignment to get the UI to look the way you want using a DockPanel .
// set up a horizontal panel to hold the date picker
HorizontalPanel leftNav = new HorizontalPanel();
leftNav.setSpacing(5);
leftNav.add(new Label("Week Start Date"));
DateBox dateBox = new DateBox();
dateBox.setWidth("100px");
dateBox.setFormat(new
DateBox.DefaultFormat(DateTimeFormat.getFormat("M/d/yyyy")));
leftNav.add(dateBox);
// set up a horizontal panel to hold the Add and Save buttons
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setSpacing(5);
Button addRowButton = new Button("Add Row");
Button saveButton = new Button("Save");
buttonPanel.add(addRowButton);
buttonPanel.add(saveButton);
// set up another horizontal panel to dock all of the buttons to the right
final HorizontalPanel rightNav = new HorizontalPanel();
rightNav.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
rightNav.setWidth("100%");
rightNav.add(buttonPanel);
// add all of the navigation panels to the dock panel
navPanel.setWidth("1000px");
navPanel.add(leftNav, DockPanel.WEST);
navPanel.add(rightNav, DockPanel.EAST);
103
 
Search WWH ::




Custom Search