Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.Style$HasCssName


    private HandlerManager textDoubleClickHandlerManager;

    public SimpleTree() {
        setElement(Document.get().createDivElement());
        Style style = getElement().getStyle();
        style.setProperty("whiteSpace", "nowrap");
        style.setPadding(3, Unit.PX);
        style.setPaddingLeft(12, Unit.PX);
        // handle styling
        style = handle.getStyle();
        style.setDisplay(Display.NONE);
        style.setTextAlign(TextAlign.CENTER);
        style.setWidth(0.5, Unit.EM);
        style.setHeight(0.5, Unit.EM);
        style.setCursor(Cursor.POINTER);
        style.setBackgroundColor("gray");
        style.setColor("white");
        style.setPadding(4, Unit.PX);
        style.setMarginRight(3, Unit.PX);
        style.setLineHeight(0.5, Unit.EM);
        handle.setInnerHTML("+");
        getElement().appendChild(handle);
        getElement().appendChild(text);
        // children styling
        style = children.getStyle();
        style.setPaddingLeft(1.5, Unit.EM);
        style.setDisplay(Display.NONE);

        getElement().appendChild(children);
        addDomHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
View Full Code Here


                }
            }

            protected void setCellWidth(int cellIx, int width) {
                final Element cell = DOM.getChild(getElement(), cellIx);
                Style wrapperStyle = cell.getFirstChildElement().getStyle();
                int wrapperWidth = width;
                if (BrowserInfo.get().isWebkit()
                        || BrowserInfo.get().isOpera10()) {
                    /*
                     * Some versions of Webkit and Opera ignore the width
                     * definition of zero width table cells. Instead, use 1px
                     * and compensate with a negative margin.
                     */
                    if (width == 0) {
                        wrapperWidth = 1;
                        wrapperStyle.setMarginRight(-1, Unit.PX);
                    } else {
                        wrapperStyle.clearMarginRight();
                    }
                }
                wrapperStyle.setPropertyPx("width", wrapperWidth);
                cell.getStyle().setPropertyPx("width", width);
            }
View Full Code Here

    Element tdElement = DOM.createTD();
    trElement.appendChild(tdElement);
    tdElement.setAttribute("height", "45");
    tdElement.setAttribute("width", "45");
    tdElement.setAttribute("align", "middle");
    Style style = tdElement.getStyle();
    style.setProperty("border", "1px solid black");
    style.setProperty("background-color", "white");
   
    Element imgElement = DOM.createImg();
    ImageElement imageElement = ImageElement.as(imgElement);
    tdElement.appendChild(imageElement);
    imageElement.setAttribute("height", "45");
View Full Code Here

    Element tdElement = DOM.createTD();
    trElement.appendChild(tdElement);
    tdElement.setAttribute("height", "45");
    tdElement.setAttribute("width", "45");
    tdElement.setAttribute("align", "middle");
    Style style = tdElement.getStyle();
    style.setProperty("border", "1px solid black");
    style.setProperty("background-color", "white");
   
    Element imgElement = DOM.createImg();
    ImageElement imageElement = ImageElement.as(imgElement);
    tdElement.appendChild(imageElement);
    imageElement.setAttribute("height", "45");
View Full Code Here

  public LeftTabPanel() {
    initWidget(main);
    main.add(left);
    left.add(leftTree);
    DecoratorPanel decorator = new DecoratorPanel();
    Style decoratorStyle = decorator.getElement().getStyle();
    decoratorStyle.setPropertyPx("marginLeft", 15);
    Style rightStyle = right.getElement().getStyle();
    rightStyle.setPropertyPx("margin", 5);
    decorator.add(right);

    main.add(decorator);
    leftTree.addSelectionHandler(new SelectionHandler<TreeItem>() {
      public void onSelection(SelectionEvent<TreeItem> event) {
View Full Code Here

  }

  private String getUrl(Widget cog) {
    Element div = cog.getElement();
    Element background = div.getElementsByTagName("div").getItem(2);
    Style style = background.getStyle();
    String styleUrl = style.getProperty("background");
    return styleUrl.split("\\(")[1].split("\\)")[0];
  }
View Full Code Here

      buttonPanel.add(closeButton);

      panel.add(buttonPanel);
      panel.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);

      Style s = panel.getElement().getStyle();

      s.setProperty("border", "1px");
      s.setProperty("borderStyle", "solid");
      s.setProperty("borderColor", "black");
      s.setProperty("backgroundColor", "lightgrey");


      scrollPanel = new ScrollPanel();
      scrollPanel.setWidth(Window.getClientWidth() * 0.80 + "px");
      scrollPanel.setHeight("500px");
View Full Code Here

      horizontalPanel.add(label);
      panel.add(horizontalPanel);
     
      // add include hidden option
      HorizontalPanel optionPanel = new HorizontalPanel();
      Style optionStyle = optionPanel.getElement().getStyle();
      optionStyle.setMarginLeft(image.getWidth(), Unit.PX);
      optionStyle.setMarginBottom(10, Unit.PX);
     
      chkIncludeHidden_ = new CheckBox("Include hidden objects");
      chkIncludeHidden_.setValue(prefs_.clearHidden().getValue());

      if (numObjects_ == 0)
View Full Code Here

* Utility class to select event names.
*/
class SupportDetector {

  public static String getEventNameForAnimationEnd() {
    Style style = Document.get().createDivElement().getStyle();
    // Test for webkit first since both are okay for chrome but
    // it only supports the prefixed version
    if ("".equals(style.getProperty("WebkitAnimation"))) {
      return "webkitAnimationEnd";
    }
    return "animationend";
  }
View Full Code Here

    }
    return "animationend";
  }

  public static String getEventNameForTransistionEnd() {
    Style style = Document.get().createDivElement().getStyle();
    // Test for webkit first since both are okay for chrome but
    // it only supports the prefixed version
    if ("".equals(style.getProperty("WebkitTransition"))) {
      return "webkitTransitionEnd";
    }
    return "transitionend";
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.Style$HasCssName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.