本文整理汇总了Java中com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant类的典型用法代码示例。如果您正苦于以下问题:Java HorizontalAlignmentConstant类的具体用法?Java HorizontalAlignmentConstant怎么用?Java HorizontalAlignmentConstant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HorizontalAlignmentConstant类属于com.google.gwt.user.client.ui.HasHorizontalAlignment包,在下文中一共展示了HorizontalAlignmentConstant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColumnAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
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;
}
}
示例2: getSafeHtml
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
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();
}
示例3: getCellAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
@Override
public HorizontalAlignmentConstant getCellAlignment() {
switch (iField.getType()) {
case toggle:
return HasHorizontalAlignment.ALIGN_CENTER;
case students:
return HasHorizontalAlignment.ALIGN_RIGHT;
default:
return HasHorizontalAlignment.ALIGN_LEFT;
}
}
示例4: getColumnAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
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;
}
}
示例5: getCellAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
@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;
}
}
示例6: getHorizontalAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
public HorizontalAlignmentConstant getHorizontalAlignment() {
if( SiteManager.isUserLoggedIn() ) {
return HasHorizontalAlignment.ALIGN_CENTER;
} else {
return HasHorizontalAlignment.ALIGN_LEFT;
}
}
示例7: alignTableCells
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
/**
* 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 );
}
示例8: setHorizontalAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
/**
* 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);
}
}
}
示例9: setHorizontalAlignmentForFlexCellFormatter
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
public void setHorizontalAlignmentForFlexCellFormatter(int row,
int column,
HorizontalAlignmentConstant horizontalAlignmentConstant) {
getFlexCellFormatter().setHorizontalAlignment(row,
column,
horizontalAlignmentConstant);
}
示例10: setCellHorizontalAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
/**
* 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);
}
}
示例11: getColumnAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
protected HorizontalAlignmentConstant getColumnAlignment(AttributesColumn column, int idx) {
switch (column) {
default:
return HasHorizontalAlignment.ALIGN_LEFT;
}
}
示例12: getColumnAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
protected HorizontalAlignmentConstant getColumnAlignment(InstructorsColumn column, int idx) {
switch (column) {
default:
return HasHorizontalAlignment.ALIGN_LEFT;
}
}
示例13: getCellAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
@Override
public HorizontalAlignmentConstant getCellAlignment() {
return HasHorizontalAlignment.ALIGN_RIGHT;
}
示例14: getColumnAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
protected HorizontalAlignmentConstant getColumnAlignment(RoomGroupsColumn column, int idx) {
switch (column) {
default:
return HasHorizontalAlignment.ALIGN_LEFT;
}
}
示例15: getColumnAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant; //导入依赖的package包/类
protected HorizontalAlignmentConstant getColumnAlignment(RoomFeaturesColumn column, int idx) {
switch (column) {
default:
return HasHorizontalAlignment.ALIGN_LEFT;
}
}