本文整理了Java中com.google.gwt.dom.client.Style.setDisplay()
方法的一些代码示例,展示了Style.setDisplay()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Style.setDisplay()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Style
类名称:Style
方法名:setDisplay
[英]Sets the display CSS property.
[中]设置显示CSS属性。
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public StylesBuilder display(Display value) {
delegate.assertCanAddStyleProperty().setDisplay(value);
return this;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* The default implementation will display, but not consume, received errors
* whose {@link EditorError#getEditor() getEditor()} method returns the Editor
* passed into {@link #setEditor}.
*
* @param errors a List of {@link EditorError} instances
*/
public void showErrors(List<EditorError> errors) {
StringBuilder sb = new StringBuilder();
for (EditorError error : errors) {
if (error.getEditor().equals(editor)) {
sb.append("\n").append(error.getMessage());
}
}
if (sb.length() == 0) {
errorLabel.setInnerText("");
errorLabel.getStyle().setDisplay(Display.NONE);
return;
}
errorLabel.setInnerText(sb.substring(1));
errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onComplete() {
if (endSize == 0) {
borderElement.getStyle().setDisplay(Display.NONE);
return;
}
borderElement.getStyle().setHeight(endSize, Unit.PX);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Show or hide an element.
*
* @param element the element to show or hide
* @param show true to show, false to hide
*/
private static void showOrHide(Element element, boolean show) {
if (show) {
element.getStyle().clearDisplay();
} else {
element.getStyle().setDisplay(Display.NONE);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public boolean remove(Widget w) {
// Validate.
if (w.getParent() != this) {
return false;
}
// Orphan.
try {
orphan(w);
} finally {
// Physical detach.
w.getElement().removeFromParent();
// Logical detach.
if (w == content) {
content = null;
contentContainer.getStyle().setDisplay(Display.NONE);
} else if (w == header) {
header = null;
headerContainer.getStyle().setDisplay(Display.NONE);
} else if (w == footer) {
footer = null;
footerContainer.getStyle().setDisplay(Display.NONE);
}
}
return true;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Show or hide an element.
*
* @param element the element
* @param show true to show, false to hide
*/
void showOrHide(Element element, boolean show) {
if (element == null) {
return;
}
if (show) {
element.getStyle().clearDisplay();
} else {
element.getStyle().setDisplay(Display.NONE);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void setClip(Element popup, String rect) {
super.setClip(popup, rect);
popup.getStyle().setDisplay(Display.NONE);
popup.getStyle().clearDisplay();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void onResize(ResizeEvent event) {
Style style = glass.getStyle();
int winWidth = Window.getClientWidth();
int winHeight = Window.getClientHeight();
// Hide the glass while checking the document size. Otherwise it would
// interfere with the measurement.
style.setDisplay(Display.NONE);
style.setWidth(0, Unit.PX);
style.setHeight(0, Unit.PX);
int width = Document.get().getScrollWidth();
int height = Document.get().getScrollHeight();
// Set the glass size to the larger of the window's client size or the
// document's scroll size.
style.setWidth(Math.max(width, winWidth), Unit.PX);
style.setHeight(Math.max(height, winHeight), Unit.PX);
// The size is set. Show the glass again.
style.setDisplay(Display.BLOCK);
}
};
代码示例来源:origin: com.google.gwt/gwt-servlet
private void showImpl() {
borderElement.getStyle().setDisplay(Display.BLOCK);
borderElement.getStyle().setWidth(notificationText.getOffsetWidth(),
Unit.PX);
animation.animateMole(0, heightMeasure.getOffsetHeight(), animationDuration);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Ensure that the animation frame exists and return it.
*
* @return the animation frame
*/
Element ensureAnimationFrame() {
if (animationFrame == null) {
animationFrame = Document.get().createDivElement();
animationFrame.getStyle().setOverflow(Overflow.HIDDEN);
animationFrame.getStyle().setDisplay(Display.NONE);
getElement().appendChild(animationFrame);
}
return animationFrame;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Put the node back into a clean state and clear fields.
*/
private void cleanup() {
if (opening) {
animFrame.getStyle().clearDisplay();
} else {
animFrame.getStyle().setDisplay(Display.NONE);
childContainer.setInnerHTML("");
}
animFrame.getStyle().clearHeight();
animFrame.getStyle().clearPosition();
this.contentContainer = null;
this.childContainer = null;
this.animFrame = null;
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private Element createContainer() {
Element container = Document.get().createDivElement().cast();
container.getStyle().setPosition(Position.ABSOLUTE);
container.getStyle().setDisplay(Display.NONE);
container.getStyle().setLeft(0.0, Unit.PX);
container.getStyle().setWidth(100.0, Unit.PCT);
return container;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
// The loading indicator can fire its own load or error event, so we check
// that the event actually occurred on the main image.
String type = event.getType();
if (BrowserEvents.LOAD.equals(type) && eventOccurredOnImage(event, parent)) {
// Remove the loading indicator.
parent.getFirstChildElement().getStyle().setDisplay(Display.NONE);
// Show the image.
Element imgWrapper = parent.getChild(1).cast();
imgWrapper.getStyle().setProperty("height", "auto");
imgWrapper.getStyle().setProperty("width", "auto");
imgWrapper.getStyle().setProperty("overflow", "auto");
} else if (BrowserEvents.ERROR.equals(type) && eventOccurredOnImage(event, parent)) {
// Replace the loading indicator with an error message.
parent.getFirstChildElement().setInnerSafeHtml(errorRenderer.render(value));
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void refreshColumnWidths() {
super.refreshColumnWidths();
/*
* Clear the display for all columns that appear in the table. And update or remove the cols of
* the colgroup that are no longer in the table according to the removeCOlumnsOnHide flag.
*/
if (colGroupEnabled) {
int colCount = colgroup.getChildCount();
int lastColumn = getRealColumnCount();
for (int i = 0; i < lastColumn; i++) {
ensureTableColElement(i).getStyle().clearDisplay();
}
for (int i = colCount - 1; i >= lastColumn; i--) {
if (removeColumnsOnHide) {
colgroup.removeChild(colgroup.getChild(i));
} else {
doSetColumnWidth(i, "0px");
ensureTableColElement(i).getStyle().setDisplay(Display.NONE);
}
}
}
}
代码示例来源:origin: gwtbootstrap3/gwtbootstrap3
public CustomSuggestionDisplay() {
super();
final PopupPanel popup = getPopupPanel();
popup.setStyleName(Styles.DROPDOWN_MENU);
popup.getElement().getStyle().setDisplay(Display.BLOCK);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
style.setDisplay(Display.NONE);
代码示例来源:origin: gwtbootstrap/gwt-bootstrap
public DropdownContainer(String caption) {
super(caption);
for (Widget widget : getChildren()) {
if (widget instanceof UnorderedList) {
menu = (UnorderedList) widget;
break;
}
}
menu.getElement().getStyle().clearDisplay();
menu.getElement().getStyle().setDisplay(Style.Display.NONE);
handlerManager = createHandlerManager();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
style.clearDisplay();
} else {
style.setDisplay(Display.NONE);
代码示例来源:origin: gwtbootstrap/gwt-bootstrap
public void hideContainer() {
menu.getElement().getStyle().setDisplay(Style.Display.NONE);
menuVisible = false;
for (int i = 0; i < handlerManager.getHandlerCount(HideEvent.getType()); i++) {
HideHandler hh = handlerManager.getHandler(HideEvent.getType(), i);
hh.onHide(new HideEvent(null));
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
tableDataContainer.getStyle().setDisplay(Display.BLOCK);
内容来源于网络,如有侵权,请联系作者删除!