本文整理汇总了Java中com.google.gwt.dom.client.Style.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java Style.setVisibility方法的具体用法?Java Style.setVisibility怎么用?Java Style.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.Style
的用法示例。
在下文中一共展示了Style.setVisibility方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: downloadFileById
import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public void downloadFileById(String resourceId) {
final String url = getResourceUrl(resourceId);
if (url != null && !url.isEmpty()) {
final IFrameElement iframe = Document.get().createIFrameElement();
Style style = iframe.getStyle();
style.setVisibility(Style.Visibility.HIDDEN);
style.setHeight(0, Style.Unit.PX);
style.setWidth(0, Style.Unit.PX);
iframe.setFrameBorder(0);
iframe.setTabIndex(-1);
iframe.setSrc(url);
RootPanel.getBodyElement().appendChild(iframe);
Timer removeTimer = new Timer() {
@Override
public void run() {
iframe.removeFromParent();
}
};
removeTimer.schedule(60 * 1000);
}
}
示例2: setThumb
import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public void setThumb(double center, double width) {
Style style = getElement().getStyle();
if (width >= 1) {
style.setVisibility(Visibility.HIDDEN);
return;
} else {
style.setVisibility(Visibility.VISIBLE);
}
if (isHorizontal) {
style.setLeft(100 * (center - width / 2), Unit.PCT);
style.setRight(100 * (1 - center - width / 2), Unit.PCT);
} else {
style.setTop(100.0 * (center - width / 2), Unit.PCT);
style.setBottom(100 * (1 - center - width / 2), Unit.PCT);
}
}
示例3: setPopupPositionAndMakeVisible
import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Override
public void setPopupPositionAndMakeVisible(Element reference, final Element popup) {
Style popupStyle = popup.getStyle();
// TODO(danilatos): Do something more intelligent than arbitrary constants (which might be
// susceptible to font size changes, etc)
popupStyle.setLeft(popupAnchor.getAbsoluteLeft() - popup.getOffsetWidth() + 26, Unit.PX);
popupStyle.setTop(popupAnchor.getAbsoluteBottom() + 5, Unit.PX);
popupStyle.setVisibility(Visibility.VISIBLE);
}