Example usage for com.google.gwt.user.client Element addClassName

List of usage examples for com.google.gwt.user.client Element addClassName

Introduction

In this page you can find the example usage for com.google.gwt.user.client Element addClassName.

Prototype

@Override
    public boolean addClassName(String className) 

Source Link

Usage

From source file:com.ikon.extension.frontend.client.widget.base.ColoredFlexTable.java

License:Open Source License

@Override
public void onBrowserEvent(Event event) {
    super.onBrowserEvent(event);
    Element td = getEventTargetCell(event);
    if (td == null)
        return;// w  ww.j  a v  a2s  .  c o  m
    Element tr = DOM.getParent(td);

    switch (DOM.eventGetType(event)) {
    case Event.ONMOUSEOVER:
        tr.addClassName(ROW_STYLE_NAME + "-mouseover");
        break;

    case Event.ONMOUSEOUT: {
        tr.removeClassName(ROW_STYLE_NAME + "-mouseover");
        break;
    }
    }
}

From source file:com.jitlogic.zico.widgets.client.MenuBar.java

License:Open Source License

public void addSeparator() {
    Element div = DOM.createDiv();
    Element span = DOM.createSpan();
    span.addClassName(RESOURCES.css().separator());

    div.appendChild(span);//from w  w w  . j  a v  a2 s.c o  m
    body.appendChild(div);
}

From source file:com.jitlogic.zico.widgets.client.ToolSeparator.java

License:Open Source License

public ToolSeparator() {
    Element div = DOM.createDiv();
    div.addClassName(WidgetResources.INSTANCE.toolBarCss().separator());
    setElement(div);
}

From source file:com.qualogy.qafe.mgwt.client.ui.component.ComponentHelper.java

License:Apache License

public static void addStyle(Element element, String style) {
    if (element == null) {
        return;//from   w w w . ja v a2  s.co  m
    }
    element.addClassName(style);
}

From source file:com.spaceapplications.vaadin.addon.eventtimeline.gwt.client.VEvent.java

public String getBackgroundColor() {
    if (backgroundColor == null || backgroundColor.length() == 0) {
        Element elem = DOM.createDiv();
        elem.addClassName(getStyleName());
        backgroundColor = ComputedStyle.getBackgroundColor(elem);
    }/*w w w  .j av a  2 s. c  o m*/

    return backgroundColor;
}

From source file:com.spaceapplications.vaadin.addon.eventtimeline.gwt.client.VEvent.java

public String getStrokeColor() {
    if (strokeColor == null || strokeColor.length() == 0) {
        Element elem = DOM.createDiv();
        elem.addClassName(getStyleName());
        strokeColor = ComputedStyle.getColor(elem);
    }//from  www.  ja v  a  2s.c om

    return strokeColor;
}

From source file:com.spaceapplications.vaadin.addon.eventtimeline.gwt.client.VEventLabel.java

public VEventLabel(VEvent event, float w, float h) {
    this.event = event;

    setStylePrimaryName(VEventTimelineDisplay.CLASSNAME_EVENT);

    final Element caption = DOM.createDiv();
    // FIXME: the limits to show the caption are hard-coded by now
    if (w > 45 && h > 20) {
        caption.setInnerText(Util.escapeHTML(event.getCaption()));
    } else {// w w w .j  a va  2s  . c  o m
        caption.setInnerHTML("");
    }

    caption.addClassName(VEventTimelineDisplay.CLASSNAME_EVENT_CAPTION);
    getElement().appendChild(caption);

    Element eventContent = DOM.createDiv();
    eventContent.addClassName(VEventTimelineDisplay.CLASSNAME_EVENT_CONTENT);
    eventContent.setInnerHTML(event.getDescription());
    getElement().appendChild(eventContent);

    if (event.getStyleName() != null && event.getStyleName().length() > 0) {
        addStyleName(event.getStyleName());
    }

    setWidth(w + "px");
    setHeight(h + "px");
}

From source file:com.vaadin.client.ui.AriaHelper.java

License:Apache License

/**
 * Moves an element out of sight. That way it is possible to have additional
 * information for an assistive device, that is not in the way for visual
 * users./*from  w w  w . j a  v a 2  s . c o  m*/
 * 
 * @param element
 *            Element to move out of sight
 */
public static void visibleForAssistiveDevicesOnly(Element element) {
    element.addClassName(ASSISTIVE_DEVICE_ONLY_STYLE);
}

From source file:com.vaadin.client.ui.VWindowOverlay.java

License:Apache License

/**
 * Gets the 'overlay container' element pertaining to the given
 * {@link ApplicationConnection}. Each overlay should be created in a
 * overlay container element, so that the correct theme and styles can be
 * applied./*  w  w w . j a  v a2  s  .c o m*/
 * 
 * @param ac
 *            A reference to {@link ApplicationConnection}
 * @return The overlay container
 */
public static Element getOverlayContainer(ApplicationConnection ac) {
    String id = ac.getConfiguration().getRootPanelId();
    id = id += "-window-overlays";
    Element container = DOM.getElementById(id);
    if (container == null) {
        container = DOM.createDiv();
        container.setId(id);
        String styles = ac.getUIConnector().getWidget().getParent().getStyleName();
        container.addClassName(styles);
        container.addClassName(CLASSNAME_CONTAINER);
        RootPanel.get().getElement().appendChild(container);
    }

    return container;
}

From source file:com.vaadin.graph.client.NodePresenter.java

License:Apache License

private void updateCSS() {
    Element element = view.getElement();
    element.setClassName("node");
    element.addClassName(model.getState());
    element.addClassName(model.getKind());
    if (isMouseDown()) {
        element.addClassName("down");
    }/*from   ww  w.  j a v  a2  s.  c  om*/
}