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

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

Introduction

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

Prototype

public void setWidth(String width) 

Source Link

Document

Sets the object's width.

Usage

From source file:scrum.client.sprint.RequirementWorkIndicatorBarWidget.java

License:Open Source License

@Override
protected void onUpdate() {
    Sprint sprint = requirement.getSprint();
    int maxBarWidth = 125; // Gwt.getRootWidget().getOffsetWidth() / 10;
    int maxWorkInRequirement = 1;
    for (Requirement r : sprint.getRequirements()) {
        int work = r.getBurnedWork() + r.getRemainingWork();
        if (work > maxWorkInRequirement)
            maxWorkInRequirement = work;
    }//from  w  w  w  . j  ava  2s.  c om
    int pixelsPerHour = maxBarWidth / maxWorkInRequirement;

    flowPanel.clear();
    int burnedHours = requirement.getBurnedWork();
    Widget burnedWidget = Gwt.createEmptyDiv("EstimationBarWidget-bar1");
    burnedWidget.setHeight("6px");
    burnedWidget.setWidth((pixelsPerHour * burnedHours) + "px");
    flowPanel.add(burnedWidget);

    int remainingHours = requirement.getRemainingWork();
    Widget remainingWidget = Gwt.createEmptyDiv("EstimationBarWidget-bar0");
    remainingWidget.setHeight("6px");
    remainingWidget.setWidth((pixelsPerHour * remainingHours) + "px");
    flowPanel.add(remainingWidget);

    flowPanel.getElement().setTitle(burnedHours + " of " + (burnedHours + remainingHours) + " hours burned.");
}

From source file:stroom.dashboard.client.vis.BasicVisSettingsViewImpl.java

License:Apache License

@Override
public void setVisualisationView(final View view) {
    final Widget widget = view.asWidget();
    widget.setWidth("100%");
    this.visualisation.setWidget(widget);
}

From source file:stroom.menubar.client.view.MenubarViewImpl.java

License:Apache License

@Override
public Widget asWidget() {
    final Widget widget = super.asWidget();
    widget.setStyleName("menuBar");
    widget.setWidth("100%");
    return widget;
}