Java Code Examples for com.google.gwt.dom.client.Style.setBorderWidth()

The following are Jave code examples for showing how to use setBorderWidth() of the com.google.gwt.dom.client.Style class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: che   File: Tree.java   Source Code and License Vote up 6 votes
private void ensureFocusElement() {
  if (focusEl != null) {
    focusEl.removeFromParent();
  }
  focusEl = getElement().appendChild(focusImpl.createFocusable());
  focusEl.addClassName(treeStyles.styles().noFocusOutline());
  if (focusEl.hasChildNodes()) {
    focusEl.getFirstChildElement().addClassName(treeStyles.styles().noFocusOutline());
    Style focusElStyle = focusEl.getFirstChildElement().getStyle();
    focusElStyle.setBorderWidth(0, Style.Unit.PX);
    focusElStyle.setFontSize(1, Style.Unit.PX);
    focusElStyle.setPropertyPx("lineHeight", 1);
  }
  focusEl.getStyle().setLeft(0, Style.Unit.PX);
  focusEl.getStyle().setTop(0, Style.Unit.PX);
  focusEl.getStyle().setPosition(Style.Position.ABSOLUTE);

  // subscribe for Event.FOCUSEVENTS
  int bits =
      DOM.getEventsSunk(
          (Element) focusEl.cast()); // do not remove redundant cast, GWT tests will fail
  DOM.sinkEvents((Element) focusEl.cast(), bits | Event.FOCUSEVENTS);
}
 
Example 2
Project: che   File: SpeedSearch.java   Source Code and License Vote up 5 votes
private void initSearchPopUp() {
  this.searchPopUp = new SearchPopUp();
  Style style = this.searchPopUp.getElement().getStyle();

  style.setBackgroundColor("grey");
  style.setBorderStyle(Style.BorderStyle.SOLID);
  style.setBorderColor("#dbdbdb");
  style.setBorderWidth(1, Style.Unit.PX);
  style.setPadding(2, Style.Unit.PX);
  style.setPosition(Style.Position.FIXED);
  style.setTop(100, Style.Unit.PX);
  style.setLeft(20, Style.Unit.PX);
}