congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
com.google.gwt.user.client
Code IndexAdd Tabnine to your IDE (free)

How to use com.google.gwt.user.client

Best Java code snippets using com.google.gwt.user.client (Showing top 20 results out of 2,268)

origin: libgdx/libgdx

@Override
public boolean openURI (String URI) {
  if (config.openURLInNewWindow) {
    Window.open(URI, "_blank", null);
  } else {
    Window.Location.assign(URI);
  }
  return true;
}
origin: libgdx/libgdx

  private void updateTextStyle (int percent) {
    // Set the style depending on the size of the bar
    if (percent < 50) {
      DOM.setElementProperty(textElement, "className", textClassName + " " + textFirstHalfClassName);
    } else {
      DOM.setElementProperty(textElement, "className", textClassName + " " + textSecondHalfClassName);
    }
  }
}
origin: libgdx/libgdx

/** This method is called when the dimensions of the parent element change. Subclasses should override this method as needed.
 * 
 * Move the text to the center of the progress bar.
 * 
 * @param width the new client width of the element
 * @param height the new client height of the element */
public void onResize (int width, int height) {
  if (textVisible) {
    int textWidth = DOM.getElementPropertyInt(textElement, "offsetWidth");
    int left = (width / 2) - (textWidth / 2);
    DOM.setStyleAttribute(textElement, "left", left + "px");
  }
}
origin: libgdx/libgdx

/** Set whether or not resize checking is enabled. If disabled, elements will still be resized on window events, but the timer
 * will not check their dimensions periodically.
 * 
 * @param enabled true to enable the resize checking timer */
public void setResizeCheckingEnabled (boolean enabled) {
  if (enabled && !resizeCheckingEnabled) {
    resizeCheckingEnabled = true;
    if (windowHandler == null) {
      windowHandler = Window.addResizeHandler(this);
    }
    resizeCheckTimer.schedule(resizeCheckDelay);
  } else if (!enabled && resizeCheckingEnabled) {
    resizeCheckingEnabled = false;
    if (windowHandler != null) {
      windowHandler.removeHandler();
      windowHandler = null;
    }
    resizeCheckTimer.cancel();
  }
}
origin: libgdx/libgdx

/** Set the current progress.
 * 
 * @param curProgress the current progress */
public void setProgress (double curProgress) {
  this.curProgress = Math.max(minProgress, Math.min(maxProgress, curProgress));
  // Calculate percent complete
  int percent = (int)(100 * getPercent());
  DOM.setStyleAttribute(barElement, "width", percent + "%");
  DOM.setElementProperty(textElement, "innerHTML", generateText(curProgress));
  updateTextStyle(percent);
  // Realign the text
  redraw();
}
origin: libgdx/libgdx

/** Sets whether the text is visible over the bar.
 * 
 * @param textVisible True to show text, false to hide it */
public void setTextVisible (boolean textVisible) {
  this.textVisible = textVisible;
  if (this.textVisible) {
    DOM.setStyleAttribute(textElement, "display", "");
    redraw();
  } else {
    DOM.setStyleAttribute(textElement, "display", "none");
  }
}
origin: libgdx/libgdx

  /** Sets the placeholder text displayed in the text box.
   * 
   * @param text the placeholder text */
  public void setPlaceholder (String text) {
    placeholder = (text != null ? text : "");
    getElement().setPropertyString("placeholder", placeholder);
  }
}
origin: libgdx/libgdx

/** Redraw the progress bar when something changes the layout. */
public void redraw () {
  if (isAttached()) {
    int width = DOM.getElementPropertyInt(getElement(), "clientWidth");
    int height = DOM.getElementPropertyInt(getElement(), "clientHeight");
    onResize(width, height);
  }
}
origin: libgdx/libgdx

/** Set whether or not resize checking is enabled. If disabled, elements will still be resized on window events, but the timer
 * will not check their dimensions periodically.
 * 
 * @param enabled true to enable the resize checking timer */
public void setResizeCheckingEnabled (boolean enabled) {
  if (enabled && !resizeCheckingEnabled) {
    resizeCheckingEnabled = true;
    if (windowHandler == null) {
      windowHandler = Window.addResizeHandler(this);
    }
    resizeCheckTimer.schedule(resizeCheckDelay);
  } else if (!enabled && resizeCheckingEnabled) {
    resizeCheckingEnabled = false;
    if (windowHandler != null) {
      windowHandler.removeHandler();
      windowHandler = null;
    }
    resizeCheckTimer.cancel();
  }
}
origin: libgdx/libgdx

@Override
public boolean openURI (String URI) {
  if (config.openURLInNewWindow) {
    Window.open(URI, "_blank", null);
  } else {
    Window.Location.assign(URI);
  }
  return true;
}
origin: libgdx/libgdx

/** Set the current progress.
 * 
 * @param curProgress the current progress */
public void setProgress (double curProgress) {
  this.curProgress = Math.max(minProgress, Math.min(maxProgress, curProgress));
  // Calculate percent complete
  int percent = (int)(100 * getPercent());
  DOM.setStyleAttribute(barElement, "width", percent + "%");
  DOM.setElementProperty(textElement, "innerHTML", generateText(curProgress));
  updateTextStyle(percent);
  // Realign the text
  redraw();
}
origin: libgdx/libgdx

/** Sets whether the text is visible over the bar.
 * 
 * @param textVisible True to show text, false to hide it */
public void setTextVisible (boolean textVisible) {
  this.textVisible = textVisible;
  if (this.textVisible) {
    DOM.setStyleAttribute(textElement, "display", "");
    redraw();
  } else {
    DOM.setStyleAttribute(textElement, "display", "none");
  }
}
origin: libgdx/libgdx

/** This method is called when the dimensions of the parent element change. Subclasses should override this method as needed.
 * 
 * Move the text to the center of the progress bar.
 * 
 * @param width the new client width of the element
 * @param height the new client height of the element */
public void onResize (int width, int height) {
  if (textVisible) {
    int textWidth = DOM.getElementPropertyInt(textElement, "offsetWidth");
    int left = (width / 2) - (textWidth / 2);
    DOM.setStyleAttribute(textElement, "left", left + "px");
  }
}
origin: libgdx/libgdx

  private void updateTextStyle (int percent) {
    // Set the style depending on the size of the bar
    if (percent < 50) {
      DOM.setElementProperty(textElement, "className", textClassName + " " + textFirstHalfClassName);
    } else {
      DOM.setElementProperty(textElement, "className", textClassName + " " + textSecondHalfClassName);
    }
  }
}
origin: libgdx/libgdx

  /** Sets the placeholder text displayed in the text box.
   * 
   * @param text the placeholder text */
  public void setPlaceholder (String text) {
    placeholder = (text != null ? text : "");
    getElement().setPropertyString("placeholder", placeholder);
  }
}
origin: libgdx/libgdx

/** Redraw the progress bar when something changes the layout. */
public void redraw () {
  if (isAttached()) {
    int width = DOM.getElementPropertyInt(getElement(), "clientWidth");
    int height = DOM.getElementPropertyInt(getElement(), "clientHeight");
    onResize(width, height);
  }
}
origin: libgdx/libgdx

/** This method is called immediately after a widget becomes attached to the browser's document. */
@Override
protected void onLoad () {
  // Reset the position attribute of the parent element
  DOM.setStyleAttribute(getElement(), "position", "relative");
  ResizableWidgetCollection.get().add(this);
  redraw();
}
origin: libgdx/libgdx

public void setBarStyleName (String barClassName) {
  DOM.setElementProperty(barElement, "className", barClassName);
}
origin: libgdx/libgdx

/** This method is called immediately after a widget becomes attached to the browser's document. */
@Override
protected void onLoad () {
  // Reset the position attribute of the parent element
  DOM.setStyleAttribute(getElement(), "position", "relative");
  ResizableWidgetCollection.get().add(this);
  redraw();
}
origin: libgdx/libgdx

public void setBarStyleName (String barClassName) {
  DOM.setElementProperty(barElement, "className", barClassName);
}
com.google.gwt.user.client

Most used classes

  • Element
    An opaque handle to a native DOM Element. An Element cannot be created directly. Instead, use the El
  • Widget
    The base class for the majority of user-interface objects. Widget adds support for receiving events
  • Window
    This class provides access to the browser window's methods, properties, and events.
  • FlowPanel
    A panel that formats its child widgets using the default HTML layout behavior.[doc-files/FlowPanel.p
  • Label
    A widget that contains arbitrary text, not interpreted as HTML. This widget uses a
    element, ca
  • RootPanel,
  • Image,
  • HTML,
  • SimplePanel,
  • VerticalPanel,
  • Timer,
  • HorizontalPanel,
  • TextBox,
  • Button,
  • Event,
  • Window$Location,
  • ListBox,
  • Panel,
  • AsyncCallback
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now