本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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");
}
示例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);
}
}
示例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");
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}