Example usage for com.google.gwt.user.client.ui Widget addStyleName

List of usage examples for com.google.gwt.user.client.ui Widget addStyleName

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Widget addStyleName.

Prototype

public void addStyleName(String style) 

Source Link

Document

Adds a secondary or dependent style name to this object.

Usage

From source file:org.unitime.timetable.gwt.client.widgets.FilterPanel.java

License:Apache License

public void addMiddle(Widget w) {
    w.addStyleName("filter-item");
    iMiddle.add(w);
}

From source file:org.unitime.timetable.gwt.client.widgets.FilterPanel.java

License:Apache License

public void addLeft(Widget w) {
    w.addStyleName("filter-item");
    iLeft.add(w);
}

From source file:org.unitime.timetable.gwt.client.widgets.FilterPanel.java

License:Apache License

public void addRight(Widget w) {
    w.addStyleName("filter-item");
    iRight.add(w);
}

From source file:org.vaadin.addon.itemlayout.widgetset.client.list.AbstractListLayoutConnector.java

License:Open Source License

/**
 * Show or hide an element/*  ww w.  j  a v a2 s . c o m*/
 * 
 * @param {@link Widget} pWidget, the element to show or hide
 * @param {@link boolean} pVisible, true to show, false to hide
 */
private void showWidget(final Widget pWidget, final boolean pVisible) {
    if (pVisible) {
        pWidget.removeStyleName(ItemLayoutConstant.CLASS_SLOT_REMOVED);
    } else {
        pWidget.addStyleName(ItemLayoutConstant.CLASS_SLOT_REMOVED);
    }
}

From source file:org.vaadin.miki.itemgrid.client.itemgrid.ItemGridConnector.java

License:Apache License

private void repaintGrid() {
    List<ComponentConnector> children = this.getChildComponents();
    int itemCount = children == null ? 0 : children.size();
    int rows = itemCount == 0 ? 0 : ((itemCount - 1) / this.getState().columns) + 1;
    this.getWidget().clear(true);
    this.getWidget().resize(rows, this.getState().columns);
    for (int zmp1 = 0; zmp1 < itemCount; zmp1++) {
        int column = zmp1 % this.getState().columns;
        int row = zmp1 / this.getState().columns;
        ComponentConnector connector = children.get(zmp1);
        Widget widget = connector.getWidget();
        this.getWidget().setWidget(row, column, widget);
        if (this.getState().selected.contains(zmp1))
            widget.addStyleName("m-itemgrid-selected");
        else/*from ww  w  .  j  a v a 2  s . c o  m*/
            widget.removeStyleName("m-itemgrid-selected");
    }
}

From source file:org.vaadin.miki.itemgrid.client.itemgrid.ItemGridConnector.java

License:Apache License

@Override
public void setChildComponents(List<ComponentConnector> children) {
    this.widgetItemIds.clear();
    for (int zmp1 = 0; zmp1 < children.size(); zmp1++) {
        ComponentConnector connector = children.get(zmp1);
        Widget widget = connector.getWidget();
        // #12 this should in theory solve it, but does so only after something happens with the component
        if (widget.getElement() != null && (widget.getElement().getInnerText() == null
                || widget.getElement().getInnerText().isEmpty())) {
            widget.getElement().setInnerText("\u200A");
        }// ww w  .j av  a  2 s. c  om
        widget.addStyleName("m-itemgrid-item");
        this.widgetItemIds.put(connector, zmp1);
        this.repaintGrid();
    }
}

From source file:org.vaadin.sasha.portallayout.client.dnd.AbstractDragController.java

License:Apache License

/**
 * Similar to {@link #makeDraggable(Widget)}, but allow separate, child to be specified as the
 * drag handle by which the first widget can be dragged.
 * /*w  w  w.j a v  a  2s  .co m*/
 * @param draggable the widget to be made draggable
 * @param dragHandle the widget by which widget can be dragged
 */
public void makeDraggable(Widget draggable, Widget dragHandle) {
    mouseDragHandler.makeDraggable(draggable, dragHandle);
    draggable.addStyleName(DragClientBundle.INSTANCE.css().draggable());
    dragHandle.addStyleName(DragClientBundle.INSTANCE.css().handle());
    dragHandles.put(draggable, dragHandle);
}

From source file:org.vaadin.sasha.portallayout.client.dnd.AbstractDragController.java

License:Apache License

public void toggleSelection(Widget draggable) {
    assert draggable != null;
    if (context.selectedWidgets.remove(draggable)) {
        draggable.removeStyleName(DragClientBundle.INSTANCE.css().selected());
    } else if (multipleSelectionAllowed) {
        context.selectedWidgets.add(draggable);
        draggable.addStyleName(DragClientBundle.INSTANCE.css().selected());
    } else {//from w w w .j  a va  2 s  .  c  o m
        context.selectedWidgets.clear();
        context.selectedWidgets.add(draggable);
    }
}

From source file:org.wso2.ESBEditor.client.Controllers.NoInsertAtEndIndexedDropController.java

License:Open Source License

@Override
public void onDrop(DragContext context) {
    ElementCount++;/*from   w  w  w .  j av  a2  s  .  c o m*/
    xLoc += INCREMENT_CONSTANT; //incrementing the next drop integer value needs to be tested on all browsers and reset.
    for (Widget widget : context.selectedWidgets) {
        Image newDroppedElem = new Image();
        newDroppedElem.getElement().setId(DRAGGED + ElementCount);
        newDroppedElem.getElement().setPropertyBoolean(DRAGGABLE, false);
        newDroppedElem.addClickHandler(ESBEditor.clickHandler);
        widget.removeStyleName(DRAGGED_ELEM_STYLE);
        widget.addStyleName(DRAGGABLE_ELEM_STYLE);
        RootPanel.get(DRAGGABLE_PANEL).add(widget);
        RootPanel.get(DROPPABLE_PANEL).remove(widget);

        String thisId = widget.getElement().getId();

        if (thisId.equalsIgnoreCase(CALL_MEDIATOR)) {
            newDroppedElem.setResource(DropCallImage);
        }
        if (thisId.equalsIgnoreCase(CALL_TEMPLATE_MEDIATOR)) {
            newDroppedElem.setResource(DropCallTempImage);
        }
        if (thisId.equalsIgnoreCase(LOG_MEDIATOR)) {
            newDroppedElem.setResource(DropLogImage);
        }
        if (thisId.equalsIgnoreCase(DROP_MEDIATOR)) {
            newDroppedElem.setResource(DropDropImage);
        }
        if (thisId.equalsIgnoreCase(STORE_MEDIATOR)) {
            newDroppedElem.setResource(DropStoreImage);
        }
        if (thisId.equalsIgnoreCase(SEND_MEDIATOR)) {
            newDroppedElem.setResource(DropSendImage);
        }
        if (thisId.equalsIgnoreCase(CLONE_MEDIATOR)) {
            newDroppedElem.setResource(DropCloneImage);
        }
        if (thisId.equalsIgnoreCase(THROTTLE_MEDIATOR)) {
            newDroppedElem.setResource(DropThrottleImage);
        }
        if (thisId.equalsIgnoreCase(RESPOND_MEDIATOR)) {
            newDroppedElem.setResource(DropRespondImage);
        }
        if (thisId.equalsIgnoreCase(PROPERTY_MEDIATOR)) {
            newDroppedElem.setResource(DropPropertyImage);
        }
        if (thisId.equalsIgnoreCase(PAYLFAC_MEDIATOR)) {
            newDroppedElem.setResource(DropPayloadFactoryImage);
        }

        RootPanel.get(DROPPABLE_PANEL).add(newDroppedElem);
        RootPanel.get(DROPPABLE_PANEL).setWidgetPosition(newDroppedElem, xLoc, yLoc);
        newDroppedElem = null;
        RootPanel.get(DROPPABLE_PANEL).getAbsoluteLeft();
    }
    super.onDrop(context);
}

From source file:org.xmlsh.jsonxmlspeed.client.DataFilePanel.java

License:BSD License

private void addColumn(String columnHeading) {
    Widget widget = new Label(columnHeading);
    int cell = documents.getCellCount(0);

    widget.setWidth("100%");
    widget.addStyleName("FlexTable-ColumnLabel");

    documents.setWidget(0, cell, widget);

    documents.getCellFormatter().addStyleName(0, cell, "FlexTable-ColumnLabelCell");
}