本文整理匯總了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);
}