public HorizontalAlignmentConstant getColumnAlignment(CurriculumColumn column) { switch (column) { case SELECT: return HasHorizontalAlignment.ALIGN_CENTER; case LAST_LIKE: case PROJECTION: case REQUESTED: case ENROLLED: case SNAPSHOT_REQUESTED: case SNAPSHOT_PROJECTION: case REGISTERED: return HasHorizontalAlignment.ALIGN_RIGHT; default: return HasHorizontalAlignment.ALIGN_LEFT; } }
private static SafeHtml getSafeHtml(final String text, final HorizontalAlignmentConstant alignment) { SafeHtmlBuilder safeBuilder = new SafeHtmlBuilder(); boolean needCloseTag = false; if (HasHorizontalAlignment.ALIGN_RIGHT.equals(alignment)) { safeBuilder.appendHtmlConstant("<p style=\"text-align:right;\">"); needCloseTag = true; } else if (HasHorizontalAlignment.ALIGN_CENTER.equals(alignment)) { safeBuilder.appendHtmlConstant("<p style=\"text-align:center;\">"); needCloseTag = true; } safeBuilder.appendEscaped(text); if (needCloseTag) { safeBuilder.appendHtmlConstant("</p>"); } return safeBuilder.toSafeHtml(); }
@Override public HorizontalAlignmentConstant getCellAlignment() { switch (iField.getType()) { case toggle: return HasHorizontalAlignment.ALIGN_CENTER; case students: return HasHorizontalAlignment.ALIGN_RIGHT; default: return HasHorizontalAlignment.ALIGN_LEFT; } }
protected HorizontalAlignmentConstant getColumnAlignment(RoomsColumn column, int idx) { switch (column) { case CAPACITY: case EXAM_CAPACITY: case AREA: return HasHorizontalAlignment.ALIGN_RIGHT; default: return HasHorizontalAlignment.ALIGN_LEFT; } }
@Override public HorizontalAlignmentConstant getCellAlignment() { if (iHeader == null || iHeader.getAlignment() == null) return HasHorizontalAlignment.ALIGN_LEFT; switch (iHeader.getAlignment()) { case CENTER: return HasHorizontalAlignment.ALIGN_CENTER; case LEFT: return HasHorizontalAlignment.ALIGN_LEFT; case RIGHT: return HasHorizontalAlignment.ALIGN_RIGHT; default: return HasHorizontalAlignment.ALIGN_LEFT; } }
public HorizontalAlignmentConstant getHorizontalAlignment() { if( SiteManager.isUserLoggedIn() ) { return HasHorizontalAlignment.ALIGN_CENTER; } else { return HasHorizontalAlignment.ALIGN_LEFT; } }
/** * Sets the horizontal alignment of all cells of the specified table. * @param table table whose cells to be aligned * @param hAlignment horizontal alignment to be set */ public static void alignTableCells( final HTMLTable table, final HorizontalAlignmentConstant hAlignment ) { final CellFormatter cellFormatter = table.getCellFormatter(); for ( int i = table.getRowCount() - 1; i >= 0; i-- ) for ( int j = table.getCellCount( i ) - 1; j >= 0; j-- ) cellFormatter.setHorizontalAlignment( i, j, hAlignment ); }
/** * Sets the horizontal alignment for a widget collection * @param align * @param widgets */ public static void setHorizontalAlignment(final HorizontalAlignmentConstant align,final HasHorizontalAlignment... widgets) { if (widgets != null && widgets.length > 0) { for (HasHorizontalAlignment w : widgets) { if (w != null) w.setHorizontalAlignment(align); } } }
public void setHorizontalAlignmentForFlexCellFormatter(int row, int column, HorizontalAlignmentConstant horizontalAlignmentConstant) { getFlexCellFormatter().setHorizontalAlignment(row, column, horizontalAlignmentConstant); }
/** * Sets the horizontal alignment of the given widget within its cell. * * @param w the widget whose horizontal alignment is to be set * @param align the widget's horizontal alignment, as defined in * {@link HasHorizontalAlignment}. */ public void setCellHorizontalAlignment(Widget w, HorizontalAlignmentConstant align) { Element td = getWidgetTd(w); if (td != null) { setCellHorizontalAlignment(td, align); } }
protected HorizontalAlignmentConstant getColumnAlignment(AttributesColumn column, int idx) { switch (column) { default: return HasHorizontalAlignment.ALIGN_LEFT; } }
protected HorizontalAlignmentConstant getColumnAlignment(InstructorsColumn column, int idx) { switch (column) { default: return HasHorizontalAlignment.ALIGN_LEFT; } }
@Override public HorizontalAlignmentConstant getCellAlignment() { return HasHorizontalAlignment.ALIGN_RIGHT; }
protected HorizontalAlignmentConstant getColumnAlignment(RoomGroupsColumn column, int idx) { switch (column) { default: return HasHorizontalAlignment.ALIGN_LEFT; } }
protected HorizontalAlignmentConstant getColumnAlignment(RoomFeaturesColumn column, int idx) { switch (column) { default: return HasHorizontalAlignment.ALIGN_LEFT; } }
@Override public HorizontalAlignmentConstant getCellAlignment() { return HasHorizontalAlignment.ALIGN_CENTER; }
/** * setCellHorizontalAlignment */ public void setCellHorizontalAlignment(Widget w, HorizontalAlignmentConstant align) { vPanel.setCellHorizontalAlignment(w, align); }
public HorizontalAlignmentConstant getHorizontalAlignment() { return HasHorizontalAlignment.ALIGN_RIGHT; }
@Override public HorizontalAlignmentConstant getHorizontalAlignment() { return HasHorizontalAlignment.ALIGN_CENTER; }
public void setColumnHorizontalAlignments( HorizontalAlignmentConstant... columnHorizontalAlignments ) { this.columnHorizontalAlignments = columnHorizontalAlignments; }
public HorizontalAlignmentConstant[] getColumnHorizontalAlignments() { return columnHorizontalAlignments; }
@SuppressWarnings("deprecation") protected void setCellHorizontalAlignment(Element td, HorizontalAlignmentConstant align) { setCellHorizontalAlignment(DOM.asOld(td), align); }