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


Java Style.setProperty方法代码示例

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


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

示例1: drawTagCloud

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
/**
 * Draws a tag cloud
 */
private void drawTagCloud(Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard
				.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:25,代码来源:KeywordsPopup.java

示例2: drawTagCloud

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
/**
 * Draws a tag cloud
 */
private void drawTagCloud(Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:24,代码来源:KeywordsWidget.java

示例3: drawTagCloud

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
/**
 * Draws a tag cloud
 */
public static void drawTagCloud(final TagCloud keywordsCloud, Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:24,代码来源:WidgetUtil.java

示例4: reassignHeaderCellWidth

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public void reassignHeaderCellWidth(int colIndex, VScrollTable.HeaderCell hcell, int minWidth) {
    if (tableWidget.isCustomColumn(colIndex)) {
        return;
    }

    for (Widget rowWidget : (tableWidget).getRenderedRows()) {
        if (tableWidget.isGenericRow(rowWidget)) {
            VScrollTable.VScrollTableBody.VScrollTableRow row = (VScrollTable.VScrollTableBody.VScrollTableRow) rowWidget;

            double realColWidth = row.getRealCellWidth(colIndex);
            if (realColWidth > 0) {
                if (realColWidth > minWidth) {
                    Style hStyle = hcell.getElement().getStyle();

                    hStyle.setProperty("width", realColWidth + "px");
                    hStyle.setProperty("minWidth", realColWidth + "px");
                    hStyle.setProperty("maxWidth", realColWidth + "px");
                }

                break;
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:25,代码来源:TableWidgetDelegate.java

示例5: attach

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
/**
 * Attach the DOMElement to the GWT container, if not already attached.
 */
public void attach() {
    final Iterator<Widget> itr = domElementContainer.iterator();
    while (itr.hasNext()) {
        if (itr.next().equals(widgetContainer)) {
            return;
        }
    }
    //When an Element is detached it's Position configuration is cleared, so reset it
    final Style style = widgetContainer.getElement().getStyle();
    style.setPosition(Style.Position.ABSOLUTE);
    style.setProperty("WebkitUserSelect",
                      "none");
    style.setProperty("MozUserSelect",
                      "none");
    style.setProperty("MsUserSelect",
                      "none");

    domElementContainer.add(widgetContainer);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:BaseDOMElement.java

示例6: restore

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
/**
 * Restores to {@code w} all style values to those most recently set on this instance.
 * @param w the widget to restore styles on.
 */
public void restore(final Widget w) {
    final Style style = w.getElement().getStyle();
    style.setProperty("position",
                      position);
    style.setProperty("top",
                      top);
    style.setProperty("left",
                      left);
    style.setProperty("width",
                      width);
    style.setProperty("height",
                      height);
    style.setProperty("zIndex",
                      zIndex);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:WorkbenchLayoutImpl.java

示例7: setBackgroundImage

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Override
public void setBackgroundImage(String src, Size size) {
    Style style = content.getElement().getStyle();
    String srcWithUrlInside = "url(" + src + ")";
    style.setBackgroundImage(srcWithUrlInside);
    style.setProperty("backgroundPosition", 0 + DIMENSIONS_UNIT);

    setSizeOfContent(size);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:10,代码来源:TutorViewImpl.java

示例8: setAfterButtonPositionAndStyle

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void setAfterButtonPositionAndStyle(final int leftOffsetForProgressButton) {
    Style afterButtonStyle = afterButton.getElement().getStyle();

    double percentWidth = positionCalculator.getPercentWidth(leftOffsetForProgressButton);
    afterButtonStyle.setWidth(100 - percentWidth, Unit.PCT);

    afterButtonStyle.setProperty(positionCalculator.getPositionPropertyForAfterProgressElement(), "0px");
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:MediaProgressBarImpl.java

示例9: setBeforeButtonPositionAndStyle

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void setBeforeButtonPositionAndStyle(final int leftOffsetForProgressButton) {
    Style beforeButtonStyle = beforeButton.getElement().getStyle();

    double percentWidth = positionCalculator.getPercentWidth(leftOffsetForProgressButton);
    beforeButtonStyle.setWidth(percentWidth, Unit.PCT);

    beforeButtonStyle.setProperty(positionCalculator.getPositionPropertyForBeforeProgressElement(), "0px");
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:MediaProgressBarImpl.java

示例10: kickWebkit

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private static void kickWebkit(Element element) {
  if (UserAgent.isWebkit()) {

    Style style = element.getStyle();
    String oldDisplay = style.getDisplay();

    // Erase layout. Querying getOffsetParent() forces layout.
    style.setDisplay(Display.NONE);
    element.getOffsetParent();

    // Restore layout.
    style.setProperty("display", oldDisplay);
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:15,代码来源:FullStructure.java

示例11: applyBackgroundSize

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void applyBackgroundSize() {
  Style style = element().getStyle();

  // Set background-repeat to get the right repeating behavior.
  String repeat = repeatX ? "repeat-x " : "";
  repeat += repeatY ? "repeat-y" : "";
  style.setProperty("backgroundRepeat", repeat);

  // Set background-size to get the right pinning behavior.
  if (sourceRectSet) {
    float wratio = widthSet ? (width / sw) : (image().width() / sw);
    float hratio = heightSet ? (height / sh) : (image().height() / sh);
    if (wratio == 0) {
      wratio = 1;
    }
    if (hratio == 0) {
      hratio = 1;
    }
    float backWidth = image().width() * wratio;
    float backHeight = image().height() * hratio;

    style.setProperty("backgroundSize", backWidth + "px " + backHeight + "px");
    style.setProperty("backgroundPosition", (-sx * wratio) + "px " + (-sy * hratio) + "px");
  } else {
    String size = repeatX ? image().width() + "px " : "100% ";
    size += repeatY ? image().height() + "px" : "100%";
    style.setProperty("backgroundSize", size);
    style.clearProperty("backgroundPosition");
  }
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:31,代码来源:HtmlImageLayerDom.java

示例12: QuickDocViewImpl

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Inject
public QuickDocViewImpl() {
  super(true, true);
  addCloseHandler(
      new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
          if (delegate != null) {
            delegate.onCloseView();
          }
        }
      });

  setSize("400px", "200px");
  Style style = getElement().getStyle();
  style.setProperty("resize", "both");
  style.setPaddingBottom(0, Style.Unit.PX);
  style.setPaddingTop(3, Style.Unit.PX);
  style.setPaddingLeft(3, Style.Unit.PX);
  style.setPaddingRight(3, Style.Unit.PX);
  createFrame();
  add(frame);
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:QuickDocViewImpl.java

示例13: TextBoxDOMElement

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public TextBoxDOMElement(final TextBox widget,
                         final GridLayer gridLayer,
                         final GridWidget gridWidget) {
    super(widget,
          gridLayer,
          gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setWidth(100,
                   Style.Unit.PCT);
    style.setHeight(HEIGHT,
                    Style.Unit.PX);
    style.setPaddingLeft(2,
                         Style.Unit.PX);
    style.setPaddingRight(2,
                          Style.Unit.PX);
    style.setFontSize(10,
                      Style.Unit.PX);

    // --- Workaround for BS2 ---
    style.setPosition(Style.Position.RELATIVE);
    style.setPaddingTop(0,
                        Style.Unit.PX);
    style.setPaddingBottom(0,
                           Style.Unit.PX);
    style.setProperty("WebkitBoxSizing",
                      "border-box");
    style.setProperty("MozBoxSizing",
                      "border-box");
    style.setProperty("boxSizing",
                      "border-box");
    style.setProperty("lineHeight",
                      "normal");
    // --- End workaround ---

    getContainer().getElement().getStyle().setPaddingLeft(5,
                                                          Style.Unit.PX);
    getContainer().getElement().getStyle().setPaddingRight(5,
                                                           Style.Unit.PX);
    getContainer().setWidget(widget);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:41,代码来源:TextBoxDOMElement.java

示例14: CheckBoxDOMElement

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public CheckBoxDOMElement(final CheckBox widget,
                          final GridLayer gridLayer,
                          final GridWidget gridWidget) {
    super(widget,
          gridLayer,
          gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setMarginTop(0,
                       Style.Unit.PX);
    style.setMarginLeft(2,
                        Style.Unit.PX);
    style.setWidth(SIZE,
                   Style.Unit.PX);
    style.setHeight(SIZE,
                    Style.Unit.PX);

    // --- Workaround for BS2 ---
    style.setPosition(Style.Position.RELATIVE);
    style.setPaddingTop(0,
                        Style.Unit.PX);
    style.setPaddingBottom(0,
                           Style.Unit.PX);
    style.setProperty("WebkitBoxSizing",
                      "border-box");
    style.setProperty("MozBoxSizing",
                      "border-box");
    style.setProperty("boxSizing",
                      "border-box");
    style.setProperty("lineHeight",
                      "normal");
    // --- End workaround ---

    getContainer().setWidget(widget);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:35,代码来源:CheckBoxDOMElement.java

示例15: ListBoxDOMElement

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public ListBoxDOMElement(final ListBox widget,
                         final GridLayer gridLayer,
                         final GridWidget gridWidget) {
    super(widget,
          gridLayer,
          gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setWidth(100,
                   Style.Unit.PCT);
    style.setHeight(HEIGHT,
                    Style.Unit.PX);
    style.setPaddingLeft(2,
                         Style.Unit.PX);
    style.setPaddingRight(2,
                          Style.Unit.PX);
    style.setFontSize(10,
                      Style.Unit.PX);

    // --- Workaround for BS2 ---
    style.setPosition(Style.Position.RELATIVE);
    style.setPaddingTop(0,
                        Style.Unit.PX);
    style.setPaddingBottom(0,
                           Style.Unit.PX);
    style.setProperty("WebkitBoxSizing",
                      "border-box");
    style.setProperty("MozBoxSizing",
                      "border-box");
    style.setProperty("boxSizing",
                      "border-box");
    style.setProperty("lineHeight",
                      "normal");
    // --- End workaround ---

    getContainer().getElement().getStyle().setPaddingLeft(5,
                                                          Style.Unit.PX);
    getContainer().getElement().getStyle().setPaddingRight(5,
                                                           Style.Unit.PX);
    getContainer().setWidget(widget);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:41,代码来源:ListBoxDOMElement.java


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