List of usage examples for com.google.gwt.user.client.ui CellPanel setCellHorizontalAlignment
protected void setCellHorizontalAlignment(Element td, HorizontalAlignmentConstant align)
From source file:com.mj.jqplot.sampling.client.utils.Utils.java
License:Open Source License
public static void alignLeft(CellPanel table, Widget w) { table.setCellHorizontalAlignment(w, HasAlignment.ALIGN_LEFT); }
From source file:com.mj.jqplot.sampling.client.utils.Utils.java
License:Open Source License
public static void alignRight(CellPanel table, Widget w) { table.setCellHorizontalAlignment(w, HasAlignment.ALIGN_RIGHT); }
From source file:com.mj.jqplot.sampling.client.utils.Utils.java
License:Open Source License
public static void alignCenter(CellPanel table, Widget w) { table.setCellHorizontalAlignment(w, HasAlignment.ALIGN_CENTER); }
From source file:de.eckhartarnold.client.TiledLayout.java
License:Apache License
private int createTiles(CellPanel parent, ImageCollectionInfo info, String config, int i) { while (i < config.length()) { switch (config.charAt(i)) { case ('C'): { parent.add(caption);//from ww w .ja v a 2 s . c o m caption.addStyleDependentName("tiled"); parent.setCellVerticalAlignment(caption, HasVerticalAlignment.ALIGN_MIDDLE); parent.setCellHorizontalAlignment(caption, HasHorizontalAlignment.ALIGN_CENTER); parent.setCellWidth(caption, "100%"); break; } case ('O'): { overlay = new CaptionOverlay(caption, imagePanel, slideshow, info.getInfo().get(CaptionOverlay.KEY_CAPTION_POSITION)); } case ('I'): { parent.add(imagePanel); parent.setCellVerticalAlignment(imagePanel, HasVerticalAlignment.ALIGN_MIDDLE); parent.setCellHorizontalAlignment(imagePanel, HasHorizontalAlignment.ALIGN_CENTER); parent.setCellWidth(imagePanel, "100%"); parent.setCellHeight(imagePanel, "100%"); break; } case ('P'): case ('F'): { assert control instanceof Widget; parent.add((Widget) control); ((Widget) control).addStyleDependentName("tiled"); parent.setCellVerticalAlignment(((Widget) control), HasVerticalAlignment.ALIGN_MIDDLE); if (parent instanceof HorizontalPanel && parent.getWidgetCount() == 1) { parent.setCellHorizontalAlignment(((Widget) control), HasHorizontalAlignment.ALIGN_RIGHT); } else { parent.setCellHorizontalAlignment(((Widget) control), HasHorizontalAlignment.ALIGN_CENTER); } break; } case ('-'): { HTML horizLine = new HTML("<hr class=\"tiledSeparator\" />"); panel.add(horizLine); break; } case (']'): { return i; } case ('['): { CellPanel panel; if (parent instanceof VerticalPanel) { panel = new HorizontalPanel(); panel.setStyleName("tiled"); } else { panel = new VerticalPanel(); panel.setStyleName("tiled"); } i = createTiles(panel, info, config, i + 1); parent.add(panel); break; } default: assert false : "Illegal token '" + config.charAt(i) + "' in config string"; } i++; } return i; }
From source file:gov.nih.nci.ncicb.tcgaportal.level4.gwt.anomalysearch.client.results.PagingHelper.java
public PagingHelper(CellPanel forPageInfo, CellPanel forRowInfo) { HorizontalPanel pagingControls = new HorizontalPanel(); HTML pageHtml = new HTML("Page "); currentPageTb = WidgetHelper.getTextBoxWithValidator(); currentPageTb.addStyleName(StyleConstants.TEXTBOX_WIDTH); //add style elements firstPageButton.addStyleName(StyleConstants.PAGING_BUTTON); previousPageButton.addStyleName(StyleConstants.PAGING_BUTTON); nextPageButton.addStyleName(StyleConstants.PAGING_BUTTON); lastPageButton.addStyleName(StyleConstants.PAGING_BUTTON); WidgetHelper.setDomId(lastPageButton, SeleniumTags.LASTPAGE_BUTTON); WidgetHelper.setDomId(nextPageButton, SeleniumTags.NEXTPAGE_BUTTON); WidgetHelper.setDomId(previousPageButton, SeleniumTags.PREVPAGE_BUTTON); WidgetHelper.setDomId(firstPageButton, SeleniumTags.FIRSTPAGE_BUTTON); totalRowDisplay.addStyleName("resultsInfoLabel"); //add the buttons to the panel pagingControls.add(firstPageButton); pagingControls.add(previousPageButton); pagingControls.add(pageHtml);//from w ww. j ava2 s . c om pagingControls.add(currentPageTb); pagingControls.add(totalPagesHtml); pagingControls.add(nextPageButton); pagingControls.add(lastPageButton); pagingControls.setSpacing(5); pagingControls.setCellVerticalAlignment(pageHtml, HasVerticalAlignment.ALIGN_MIDDLE); pagingControls.setCellVerticalAlignment(totalPagesHtml, HasVerticalAlignment.ALIGN_MIDDLE); forPageInfo.add(pagingControls); forRowInfo.add(totalRowDisplay); forPageInfo.setCellHorizontalAlignment(pagingControls, HasHorizontalAlignment.ALIGN_RIGHT); forRowInfo.setCellHorizontalAlignment(totalRowDisplay, HasHorizontalAlignment.ALIGN_RIGHT); }