当前位置: 首页>>代码示例>>Java>>正文


Java TextAlign类代码示例

本文整理汇总了Java中com.google.gwt.dom.client.Style.TextAlign的典型用法代码示例。如果您正苦于以下问题:Java TextAlign类的具体用法?Java TextAlign怎么用?Java TextAlign使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TextAlign类属于com.google.gwt.dom.client.Style包,在下文中一共展示了TextAlign类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setHorizontalAlignment

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
private void setHorizontalAlignment(TextAlign align)
{
   horizontalAlignment = HasHorizontalAlignment.class.getName();
   switch (align)
   {
      case CENTER:
         horizontalAlignment += ".ALIGN_CENTER";
         break;
      case JUSTIFY:
         horizontalAlignment += ".ALIGN_JUSTIFY";
         break;
      case LEFT:
         horizontalAlignment += ".ALIGN_LEFT";
         break;
      case RIGHT:
         horizontalAlignment += ".ALIGN_RIGHT";
         break;
   }
}
 
开发者ID:symulakr,项目名称:gwt-generators,代码行数:20,代码来源:ColumnAlignmentContext.java

示例2: FAIcon

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
public FAIcon(EIcon icon) {
    if (icon == null) {
        throw new NullPointerException("The icon parameter can not be null.");
    }

    this.widthProperty().bind(size);
    this.heightProperty().bind(size);
    this.getElement().getStyle().setTextAlign(TextAlign.CENTER);
    this.icon.set(icon);

    iElement = DOM.createElement("i");
    this.getElement().appendChild(iElement);

    size.addChangeListener(changeListener);
    foreColor.addChangeListener(changeListener);
    spin.addChangeListener(changeListener);
    this.icon.addChangeListener(changeListener);

    refreshStyle();
}
 
开发者ID:EagerLogic,项目名称:Cubee,代码行数:21,代码来源:FAIcon.java

示例3: NumberBox

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
public NumberBox() {
	setStyleName("gwt-SuggestBox");
	setWidth("100px");
	getElement().getStyle().setTextAlign(TextAlign.RIGHT);
	addKeyPressHandler(new KeyPressHandler() {
		@Override
		public void onKeyPress(KeyPressEvent event) {
			if (!isEnabled() || isReadOnly()) return;
			
			int keyCode = event.getNativeEvent().getKeyCode();
			
			switch (keyCode) {
			case KeyCodes.KEY_BACKSPACE:
			case KeyCodes.KEY_DELETE:
			case KeyCodes.KEY_ESCAPE:
			case KeyCodes.KEY_RIGHT:
			case KeyCodes.KEY_LEFT:
			case KeyCodes.KEY_TAB:
				return;
			}

            if (isDecimal() && event.getCharCode() == '.' && !getValue().contains(".")) return;
            if (isNegative() && event.getCharCode() == '-' && !getValue().contains("-") && (getCursorPos() == 0 || getSelectionLength() == getValue().length()))
            	return;

            if (Character.isDigit(event.getCharCode()))
                return;

            cancelKey( );
        }
    } );
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:33,代码来源:NumberBox.java

示例4: setSeparatorStyle

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
private void setSeparatorStyle(Widget separator, boolean invisible) {
	separator.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
	separator.getElement().getStyle().setWidth(separatorWidth, Style.Unit.PCT);
	separator.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	separator.getElement().setInnerText(":");
	separator.setStyleName("time-picker-separator");
	if (invisible) {
		separator.getElement().getStyle().setVisibility(Visibility.HIDDEN);
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:11,代码来源:TimePicker.java

示例5: setSeparatorStyleRelative

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
private void setSeparatorStyleRelative(Widget separator, boolean invisible) {
	separator.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
	separator.getElement().getStyle().setWidth(separatorWidthRelative, Style.Unit.PX);
	separator.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	separator.getElement().setInnerText(":");
	separator.setStyleName("time-picker-separator");
	if (invisible) {
		separator.getElement().getStyle().setVisibility(Visibility.HIDDEN);
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:11,代码来源:TimePicker.java

示例6: setAbsolute

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
public void setAbsolute() {
	timePickerContainer.getElement().getStyle().setPosition(Position.ABSOLUTE);
	timePickerContainer.getElement().getStyle().setHeight(0, Style.Unit.PX);
	timePickerContainer.getElement().getStyle().setProperty("width", "auto");
	timePickerContainer.getElement().getStyle().setBottom(0, Style.Unit.PCT);
	timePickerContainer.getElement().getStyle().setOverflow(Overflow.HIDDEN);

	setStyleName(timePickerContainer.getElement(), "time-picker");

	verticalAlign.getElement().getStyle().setHeight(100, Style.Unit.PCT);
	verticalAlign.getElement().getStyle().setWidth(0, Style.Unit.PCT);

	widgetContainer.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
	verticalAlign.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);

	dateBlock.getElement().getStyle().setDisplay(Display.BLOCK);
	dateBlock.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	dateBlock.getElement().getStyle().setMarginBottom(10, Style.Unit.PCT);

	txtHour.getElement().getStyle().setWidth(componentWidth, Style.Unit.PCT);
	txtHour.getElement().getStyle().setMarginLeft(marginLeft, Style.Unit.PX);
	txtHour.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	txtHour.setStyleName("time-picker-text");
	txtMinute.getElement().getStyle().setWidth(componentWidth, Style.Unit.PCT);
	txtMinute.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	txtMinute.setStyleName("time-picker-text");
	txtSecond.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	txtSecond.getElement().getStyle().setWidth(componentWidth, Style.Unit.PCT);
	txtSecond.setStyleName("time-picker-text");
	txtSecond.getElement().getStyle().setMarginRight(marginRight, Style.Unit.PX);

	widgetContainer.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
	verticalAlign.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

	hCenter.getElement().getStyle().setHeight(100, Style.Unit.PCT);
	hCenter.getElement().getStyle().setDisplay(Display.BLOCK);
	hCenter.getElement().getStyle().setProperty("marginLeft", "auto");
	hCenter.getElement().getStyle().setProperty("marginRight", "auto");

	setButtonStyleAbsolute(btnUpHour, "time-picker-up");
	btnUpHour.getElement().getStyle().setMarginLeft(marginLeft, Style.Unit.PX);
	setButtonStyleAbsolute(btnUpMinute, "time-picker-up");
	setButtonStyleAbsolute(btnUpSecond, "time-picker-up");
	btnUpSecond.getElement().getStyle().setMarginRight(marginRight, Style.Unit.PX);

	setButtonStyleAbsolute(btnDownHour, "time-picker-down");
	btnDownHour.getElement().getStyle().setMarginLeft(marginLeft, Style.Unit.PX);
	setButtonStyleAbsolute(btnDownMinute, "time-picker-down");
	setButtonStyleAbsolute(btnDownSecond, "time-picker-down");
	btnDownSecond.getElement().getStyle().setMarginRight(marginRight, Style.Unit.PX);

	setSeparatorStyle(separatorUp1, true);
	setSeparatorStyle(separatorUp2, true);
	setSeparatorStyle(separatorTime1, false);
	setSeparatorStyle(separatorTime2, false);
	setSeparatorStyle(separatorDown1, true);
	setSeparatorStyle(separatorDown2, true);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:59,代码来源:TimePicker.java

示例7: setRelative

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
public void setRelative() {
	timePickerContainer.getElement().getStyle().setPosition(Position.RELATIVE);
	timePickerContainer.getElement().getStyle().setHeight(0, Style.Unit.PX);
	timePickerContainer.getElement().getStyle().setBottom(0, Style.Unit.PCT);
	timePickerContainer.getElement().getStyle().setOverflow(Overflow.HIDDEN);

	setStyleName(timePickerContainer.getElement(), "time-picker");
	timePickerContainer.getElement().getStyle().setWidth(relativeWidth, Style.Unit.PX);

	verticalAlign.getElement().getStyle().setHeight(100, Style.Unit.PCT);
	verticalAlign.getElement().getStyle().setWidth(0, Style.Unit.PCT);
	widgetContainer.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
	verticalAlign.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);

	dateBlock.getElement().getStyle().setDisplay(Display.NONE);

	txtHour.getElement().getStyle().setWidth(componentWidthRelative, Style.Unit.PX);
	txtHour.getElement().getStyle().setMarginLeft(marginLeft, Style.Unit.PX);
	txtHour.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	txtHour.setStyleName("time-picker-text");
	txtMinute.getElement().getStyle().setWidth(componentWidthRelative, Style.Unit.PX);
	txtMinute.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	txtMinute.setStyleName("time-picker-text");
	txtSecond.getElement().getStyle().setTextAlign(TextAlign.CENTER);
	txtSecond.getElement().getStyle().setWidth(componentWidthRelative, Style.Unit.PX);
	txtSecond.setStyleName("time-picker-text");
	txtSecond.getElement().getStyle().setMarginRight(marginRight, Style.Unit.PX);

	widgetContainer.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
	verticalAlign.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

	hCenter.getElement().getStyle().setHeight(100, Style.Unit.PCT);
	hCenter.getElement().getStyle().setDisplay(Display.BLOCK);
	hCenter.getElement().getStyle().setProperty("marginLeft", "auto");
	hCenter.getElement().getStyle().setProperty("marginRight", "auto");

	setButtonStyleRelative(btnUpHour, "time-picker-up");
	btnUpHour.getElement().getStyle().setMarginLeft(marginLeft, Style.Unit.PX);
	setButtonStyleRelative(btnUpMinute, "time-picker-up");
	setButtonStyleRelative(btnUpSecond, "time-picker-up");
	btnUpSecond.getElement().getStyle().setMarginRight(marginRight, Style.Unit.PX);

	setButtonStyleRelative(btnDownHour, "time-picker-down");
	btnDownHour.getElement().getStyle().setMarginLeft(marginLeft, Style.Unit.PX);
	setButtonStyleRelative(btnDownMinute, "time-picker-down");
	setButtonStyleRelative(btnDownSecond, "time-picker-down");
	btnDownSecond.getElement().getStyle().setMarginRight(marginRight, Style.Unit.PX);

	setSeparatorStyleRelative(separatorUp1, true);
	setSeparatorStyleRelative(separatorUp2, true);
	setSeparatorStyleRelative(separatorTime1, false);
	setSeparatorStyleRelative(separatorTime2, false);
	setSeparatorStyleRelative(separatorDown1, true);
	setSeparatorStyleRelative(separatorDown2, true);
	setHeight(100, Style.Unit.PCT);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:57,代码来源:TimePicker.java

示例8: FeatureInfoControlViewImpl

import com.google.gwt.dom.client.Style.TextAlign; //导入依赖的package包/类
public FeatureInfoControlViewImpl() {
	UI_BINDER.createAndBindUi(this);

	button.getElement().getStyle().setWidth(25, Unit.PX);
	button.getElement().getStyle().setTextAlign(TextAlign.CENTER);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:7,代码来源:FeatureInfoControlViewImpl.java


注:本文中的com.google.gwt.dom.client.Style.TextAlign类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。