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

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

Introduction

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

Prototype

public void setSize(String width, String height) 

Source Link

Document

Sets the object's size.

Usage

From source file:edu.caltech.ipac.firefly.visualize.ui.ImageSelectDropDown.java

private Widget createContents(PlotWidgetFactory plotFactory) {

    if (useNewPanel) {
        imSelPanel2 = new ImageSelectPanel2(new DropDownComplete(), plotter);
    } else {//from   ww w  .j  a  va 2s.  c  om
        imSelPanel = new ImageSelectPanel(null, true, null, new DropDownComplete(), plotFactory);
    }
    HorizontalPanel buttons = new HorizontalPanel();
    buttons.addStyleName("base-dialog-buttons");
    buttons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    GwtUtil.setStyle(buttons, "paddingRight", "80px");

    Button ok = new Button("Load");
    ok.addStyleName("highlight-text");
    ok.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent ev) {
            doOK();
        }
    });

    buttons.add(ok);
    buttons.add(HelpManager.makeHelpIcon("basics.catalog"));

    VerticalPanel vp = new VerticalPanel();
    Widget content;
    if (useNewPanel) {
        content = GwtUtil.centerAlign(imSelPanel2.getMainPanel());
    } else {
        content = GwtUtil.centerAlign(imSelPanel.getMainPanel());
    }
    vp.add(content);
    vp.add(buttons);

    vp.setCellHorizontalAlignment(content, VerticalPanel.ALIGN_CENTER);
    vp.setSize("95%", "450px");
    vp.setSpacing(3);
    content.setSize("95%", "95%");
    content.addStyleName("component-background");

    if (useNewPanel) {
        addKeyPressToAll(imSelPanel2.getMainPanel());
    } else {
        addKeyPressToAll(imSelPanel.getMainPanel());
    }

    return vp;
}

From source file:edu.caltech.ipac.firefly.visualize.ui.ImageSelectPanel.java

private void setTargetCard(int card) {
    if (card == TARGET_PANEL && _targetPanelHolder.getWidget() == null) {
        _targetPanelHolder.setWidget(_targetPanel);
    }//from w  w  w . j  a  v  a 2s.c  om
    if (card == TARGET_DESC) {
        updateTargetDesc();
    }

    int hideHeight = Math.max(_targetPanelHolder.getOffsetHeight(), _targetDesc.getOffsetHeight());
    int oldHeight = hideTargetLabel.getOffsetHeight();
    hideTargetLabel.setPixelSize(10, hideHeight > oldHeight ? hideHeight : oldHeight);

    if (card == TARGET_HIDDEN && _targetCards.getVisibleWidget() == TARGET_DESC) {
        Widget desc = _targetCards.getWidget(TARGET_DESC);
        Widget hidden = _targetCards.getWidget(TARGET_HIDDEN);
        hidden.setSize(desc.getOffsetWidth() + "px", desc.getOffsetHeight() + "px");
    }

    _targetCards.showWidget(card);
}

From source file:es.upm.fi.dia.oeg.map4rdf.client.view.DashboardView.java

License:Open Source License

@Override
public void setMainPopup(Integer width, Integer height, Widget widget, String style) {
    width -= 50;/*w w  w  .  j  a v  a 2 s  . c o  m*/
    height -= 50;
    mainPopupPanel.clear();
    mainPopupPanel.setVisible(true);
    mainPopupPanel.setWidget(widget);
    if (width == null || width < 0) {
        width = 200;
        mainPopupPanel.setWidth("auto");
    } else {
        mainPopupPanel.setWidth(width + "px");
    }
    if (height == null || height < 0) {
        height = 200;
        mainPopupPanel.setHeight("auto");
    } else {
        mainPopupPanel.setHeight(height + "px");
    }
    if (style == null || style.equals("")) {
        mainPopupPanel.getElement().getStyle().setZIndex(2080);
        mainPopupPanel.getElement().getStyle().setLeft(15, Unit.PX);
        mainPopupPanel.getElement().getStyle().setTop(15, Unit.PX);
    } else if (style.equals("Geoprocessing")) {
        mainPopupPanel.getElement().getStyle().setZIndex(2080);
        mainPopupPanel.getElement().getStyle().setLeft(15, Unit.PX);
        mainPopupPanel.getElement().getStyle().setProperty("top", "");
        mainPopupPanel.getElement().getStyle().clearTop();
        mainPopupPanel.getElement().getStyle().setBottom(15, Unit.PX);
        widget.getElement().getStyle().setLeft((int) (width * 0.06), Unit.PX);
    } else if (style.equals("Big")) {
        mainPopupPanel.getElement().getStyle().setZIndex(2080);
        mainPopupPanel.getElement().getStyle().setLeft(15, Unit.PX);
        mainPopupPanel.getElement().getStyle().setTop(15, Unit.PX);
        widget.setSize(width - 3 + "px", height - 3 + "px");
    }
}

From source file:org.gwtportlets.portlet.smartgwt.client.SmartPortlet.java

License:Open Source License

@Override
public void boundsUpdated() {
    super.boundsUpdated();
    Widget widget = getWidget();
    if (widget != null && autoSizeChild) {
        widget.setSize(Integer.toString(getOffsetWidth()), Integer.toString(getOffsetHeight()));
    }/*w  w  w  .  j  a va2 s  . c om*/
}

From source file:org.hudsonci.maven.plugin.ui.gwt.configure.documents.internal.DocumentMasterViewImpl.java

License:Open Source License

public void setDocumentDetailView(final DocumentDetailView view) {
    Widget widget = view.asWidget();
    widget.setSize("100%", "100%");
    // View starts hidden
    widget.setVisible(false);//  w  ww.  j  av a  2s  . c  o  m
    detailContainer.setDetail(widget);
}

From source file:org.jbpm.console.ng.pr.client.editors.diagram.ProcessDiagramPopupPresenter.java

License:Apache License

private void renderDesigner(final String deploymentId, final String processId, final String activeNodes,
        final String completedNodes) {

    view.getContainer().clear();/* w  ww .  ja v  a  2s  . c om*/
    DummyProcessPath dummyProcessPath = new DummyProcessPath(processId);
    PathPlaceRequest defaultPlaceRequest = new PathPlaceRequest(dummyProcessPath);
    //Set Parameters here: 
    defaultPlaceRequest.addParameter("readOnly", "true");
    if (!activeNodes.equals("")) {
        defaultPlaceRequest.addParameter("activeNodes", activeNodes);
    }
    if (!completedNodes.equals("")) {
        defaultPlaceRequest.addParameter("completedNodes", completedNodes);
    }
    defaultPlaceRequest.addParameter("processId", processId);
    defaultPlaceRequest.addParameter("deploymentId", deploymentId);

    AbstractWorkbenchActivity activity = null;

    Set<Activity> activities = activityManager.getActivities(defaultPlaceRequest);
    activity = (AbstractWorkbenchActivity) activities.iterator().next();

    IsWidget widget = activity.getWidget();
    activity.launch(place, null);
    if (activity instanceof AbstractWorkbenchEditorActivity) {
        ((AbstractWorkbenchEditorActivity) activity).onStartup(new ObservablePathImpl().wrap(dummyProcessPath),
                defaultPlaceRequest);
    }

    Widget asWidget = ((MultiPageEditorView) widget.asWidget()).getTabContent().asWidget();

    Widget widget1 = ((com.github.gwtbootstrap.client.ui.TabPane) ((com.google.gwt.user.client.ui.ComplexPanel) asWidget)
            .getWidget(0)).getWidget(0);

    Widget widget2 = ((com.google.gwt.user.client.ui.ComplexPanel) widget1).getWidget(0);
    Widget widget3 = ((Page.PageView) widget2).getSp().getWidget();
    widget3.setSize("1000px", "600px");
    view.getContainer().add(widget3);
    activity.onOpen();
}

From source file:org.jbpm.formbuilder.client.FormBuilderView.java

License:Apache License

protected final void checkBinding() {
    if (timeToBind()) {
        Widget widget = uiBinder.createAndBindUi(this);
        setSize("100%", "100%");
        widget.setSize("100%", "100%");
        add(widget);//from  w w  w  .  j  a v  a 2s . co  m
        int fullHeight = Window.getClientHeight();
        String height = "" + (fullHeight - 80) + "px";
        String smallerHeight = "" + (fullHeight - 105) + "px";
        treeView.setHeight(height);
        menuView.setHeight(height);
        editionView.setHeight(height);
        ioAssociationView.setHeight(height);
        layoutView.setHeight(smallerHeight);
    }
}

From source file:org.obiba.opal.web.gwt.app.client.ui.TabDeckPanel.java

License:Apache License

/**
 * Reset the dimensions of the widget when it is removed.
 *///from w ww .  j  a  v a  2  s.  c o m
private void resetChildWidget(Widget w) {
    w.setSize("", "");
    w.setVisible(true);
}

From source file:org.openxdata.sharedlib.client.util.FormUtil.java

/**
 * Maximizes a widget./*from www  .j a v  a2s.c  o m*/
 * 
 * @param widget the widget to maximize.
 */
public static void maximizeWidget(Widget widget) {
    widget.setSize("100%", "100%");
}

From source file:org.pepstock.jem.gwt.client.MainTabPanel.java

License:Open Source License

/**
 * @see ResizeCapable#onResize(int, int)
 *//*from   www.j  a va2 s  . c o  m*/
@Override
public void onResize(int availableWidth, int availableHeight) {
    int desiredWidth = availableWidth - Sizes.MAIN_TAB_PANEL_PADDING_TOP_LEFT_RIGHT
            - Sizes.MAIN_TAB_PANEL_PADDING_TOP_LEFT_RIGHT - Sizes.MAIN_TAB_PANEL_BORDER
            - Sizes.MAIN_TAB_PANEL_BORDER;
    int desiredHeight = availableHeight - Sizes.TABBAR_HEIGHT_PX - Sizes.MAIN_TAB_PANEL_PADDING_TOP_LEFT_RIGHT
            - Sizes.MAIN_TAB_PANEL_PADDING_BOTTOM - Sizes.MAIN_TAB_PANEL_BORDER;

    for (int i = 0; i < getWidgetCount(); i++) {
        Widget w = getWidget(i);
        w.setSize(Sizes.toString(desiredWidth), Sizes.toString(desiredHeight));
        if (w instanceof ResizeCapable) {
            ((ResizeCapable) w).onResize(desiredWidth, desiredHeight);
        }
    }
}