Example usage for com.google.gwt.user.client Window getClientHeight

List of usage examples for com.google.gwt.user.client Window getClientHeight

Introduction

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

Prototype

public static int getClientHeight() 

Source Link

Usage

From source file:olanto.myTerm.client.ContainerPanels.ResultsContainerREDACTOR.java

License:Open Source License

public void adjustSize() {
    int h = Window.getClientHeight() - GuiConstant.HEADER_HEIGHT_EXTRA;
    int w = Window.getClientWidth() - GuiConstant.WIDTH_UNIT_EXTRA;
    sideRes.setPixelSize((int) (w * 1 / 4) - 3, (h / 2 - 30));
    buttonsPanel.setPixelSize((int) (w * 1 / 4) + 2, 30);
    sideCurrent.setPixelSize((int) (w * 1 / 4), h / 2);
    termsDetails.setPixelSize(w * 3 / 4, h * 5 / 6);
    conceptDetails.setPixelSize(w * 3 / 4, h * 1 / 6);
    currentHeader.setWidth((w * 1 / 4) - 3 + "px");
    sideVP.setWidth((w * 1 / 4) + "px");
    buttonsPanel.setCellHorizontalAlignment(addnewcpt, HorizontalPanel.ALIGN_RIGHT);
}

From source file:olanto.myTerm.client.ContainerPanels.ResultsContainerREDACTOR.java

License:Open Source License

public void adjustSize(float s_widthper, float s_heightper) {
    int h = Window.getClientHeight() - GuiConstant.HEADER_HEIGHT_EXTRA;
    int w = Window.getClientWidth() - GuiConstant.WIDTH_UNIT_EXTRA;
    sideVP.setWidth((int) (w * s_widthper) + "px");
    sideRes.setPixelSize((int) (w * s_widthper) - 3, (h / 2 - 30));
    buttonsPanel.setPixelSize((int) (w * s_widthper), 30);
    sideCurrent.setPixelSize((int) (w * s_widthper) - 3, h / 2);
    currentHeader.setPixelSize((int) (w * s_widthper) - 3, 20);
    termsDetails.setPixelSize((int) (w * (1 - s_widthper)), (int) (h * (1 - s_heightper)));
    conceptDetails.setPixelSize((int) (w * (1 - s_widthper)), (int) (h * s_heightper));
    buttonsPanel.setCellHorizontalAlignment(addnewcpt, HorizontalPanel.ALIGN_RIGHT);
}

From source file:olanto.myTerm.client.ContainerPanels.ResultsContainerREVISOR.java

License:Open Source License

public void adjustSize() {
    int h = Window.getClientHeight() - GuiConstant.HEADER_HEIGHT;
    int w = Window.getClientWidth() - GuiConstant.WIDTH_UNIT;
    sideRes.setPixelSize((int) (w * 1 / 4), h);
    termsDetails.setPixelSize(w * 3 / 4, h * 5 / 6);
    conceptDetails.setPixelSize(w * 3 / 4, h * 1 / 6);
}

From source file:opus.gwt.management.console.client.dashboard.DashboardPanel.java

License:Apache License

@UiHandler("deleteButton")
void onDeleteButtonClick(ClickEvent event) {
    deletePopupPanel.setPopupPosition(Window.getClientWidth() / 2 - 210, Window.getClientHeight() / 2 - 150);
    deletePopupPanel.setGlassEnabled(true);
    deletePopupPanel.setGlassStyleName(manager.glassOverlay());
    deletePopupPanel.setAutoHideEnabled(true);
    deletePopupPanel.show();/*from  w w  w .j a v a 2 s.  c om*/
}

From source file:opus.gwt.management.console.client.deployer.ProjectDeployerController.java

License:Apache License

private void deployProject() {
    createdProjectName = deploymentOptionsPanel.getProjectName();

    ArrayList<String> paths = appBrowserPanel.getAppPaths();
    ArrayList<String> apptypes = appBrowserPanel.getAppTypes();
    ArrayList<String> appNames = appBrowserPanel.getAppNames();

    StringBuffer formBuilder = new StringBuffer();
    formBuilder.append("csrfmiddlewaretoken=");
    formBuilder.append(URL.encodeQueryString(jsVarHandler.getCSRFTokenURL()));

    formBuilder.append("&form-TOTAL_FORMS=");
    formBuilder.append(URL.encodeQueryString(String.valueOf(paths.size())));
    formBuilder.append("&form-INITIAL_FORMS=");
    formBuilder.append(URL.encodeQueryString(String.valueOf(0)));
    formBuilder.append("&form-MAX_NUM_FORMS=");

    for (int i = 0; i < paths.size(); i++) {
        formBuilder.append("&form-" + i + "-apptype=");
        formBuilder.append(apptypes.get(i));

        formBuilder.append("&form-" + i + "-apppath=");
        formBuilder.append(paths.get(i));

        formBuilder.append("&form-" + i + "-appname=");
        formBuilder.append(appNames.get(i));
    }// w  w w.ja v  a 2 s .  com

    formBuilder.append(deploymentOptionsPanel.getPostData());
    formBuilder.append(projectOptionsPanel.getPostData());
    formBuilder.append(databaseOptionsPanel.getPostData());

    RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
            "/deployments/" + createdProjectName + "/");
    builder.setHeader("Content-type", "application/x-www-form-urlencoded");
    //builder.setHeader(header, value);

    try {
        Request request = builder.sendRequest(formBuilder.toString(), new RequestCallback() {
            public void onError(Request request, Throwable exception) {
                ErrorPanel ep = new ErrorPanel(clientFactory);
                ep.errorHTML.setHTML("<p>Error Occured</p>");
                deployerDeckPanel.add(ep);
                deployerDeckPanel.showWidget(deployerDeckPanel.getWidgetIndex(ep));
            }

            public void onResponseReceived(Request request, Response response) {
                if (response.getText().contains("Back to")) {
                    loadingPopup.hide();
                    eventBus.fireEvent(new AsyncRequestEvent("addProject", createdProjectName));
                } else {
                    loadingPopup.hide();
                    ErrorPanel ep = new ErrorPanel(clientFactory);
                    ep.errorHTML.setHTML(response.getText());
                    deployerDeckPanel.add(ep);
                    deployerDeckPanel.showWidget(deployerDeckPanel.getWidgetIndex(ep));
                }
            }
        });
    } catch (RequestException e) {

    }

    loadingPopup.setGlassEnabled(true);
    loadingPopup.setGlassStyleName(style.loadingGlass());
    loadingPopup.show();
    int left = (Window.getClientWidth() / 2) - 150;
    int top = (Window.getClientHeight() / 2) - 10;
    loadingPopup.setPopupPosition(left, top);
    loadingPopup.show();
}

From source file:org.activityinfo.ui.client.page.report.editor.ElementDialog.java

License:Open Source License

public void show(ReportElement element, Callback callback) {
    this.callback = callback;

    setWidth((int) (Window.getClientWidth() * 0.90));
    setHeight((int) (Window.getClientHeight() * 0.90));
    if (element.getTitle() == null) {
        setHeadingText("New Report Element");
    } else {/*  w  ww.ja v  a 2  s  .  c  o m*/
        setHeadingText(element.getTitle());
    }

    removeAll();

    bind(element);

    this.editor = editorProvider.create(model);
    this.editor.bind(model);
    add(editor.getWidget());
    layout();

    super.show();
}

From source file:org.apache.servicemix.gshellweb.client.Console.java

License:Apache License

public Console() {

    addStyleName("console");
    addStyleName("console-pro");
    setAnimationEnabled(true);/*from w w  w .  j a v  a2 s  .  c o  m*/

    FlowPanel panel = new FlowPanel();
    add(panel);

    // Setup the output area.
    output = new HTML();
    output.setStyleName("output");
    panel.add(output);

    // Setup the prompt Area..
    prompt = new HTML();
    prompt.setStyleName("prompt");
    input = new TextBox();
    input.setStyleName("input");
    Grid promptTable = new Grid(1, 2);
    promptTable.setWidget(0, 0, prompt);
    promptTable.getCellFormatter().setStyleName(0, 0, "prompt");
    promptTable.setWidget(0, 1, input);
    promptTable.getCellFormatter().setStyleName(0, 1, "input");
    panel.add(promptTable);

    input.addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyPress(Widget sender, char keyCode, int modifiers) {
            switch (keyCode) {
            case KEY_TAB:
                onTab();
                input.cancelKey();
                break;
            case KEY_UP:
                onUpHistory();
                input.cancelKey();
                break;
            case KEY_DOWN:
                onDownHistroy();
                input.cancelKey();
                break;
            case KEY_ENTER:
                onEnter();
                input.cancelKey();
                break;
            }
        }

    });

    getElement().getStyle().setProperty("margin", "20px");
    getElement().getStyle().setProperty("minWidth", (Window.getClientWidth() - 100) + "px");
    getElement().getStyle().setProperty("minHeight", (Window.getClientHeight() - 100) + "px");

    Window.addWindowResizeListener(new WindowResizeListener() {
        public void onWindowResized(int width, int height) {
            getElement().getStyle().setProperty("minWidth", (Window.getClientWidth() - 100) + "px");
            getElement().getStyle().setProperty("minHeight", (Window.getClientHeight() - 100) + "px");
            input.getElement().scrollIntoView();
        }
    });

}

From source file:org.appverse.web.showcases.gwtshowcase.gwtfrontend.admin.common.layout.views.impl.gxt.AdminLayoutViewImpl.java

License:Appverse Public License

@Override
public void createView() {
    initWidget(uiBinder.createAndBindUi(this));
    flow.setScrollMode(ScrollMode.ALWAYS);
    flow.setHeight(Window.getClientHeight() - 40);
    centerBorderLayout();//from   ww w.j ava  2s  .c  o  m
    Window.addResizeHandler(new ResizeHandler() {
        @Override
        public void onResize(final ResizeEvent event) {
            centerBorderLayout();
        }
    });
}

From source file:org.artificer.ui.client.local.services.notification.NotificationWidget.java

License:Apache License

/**
 * Returns true if the given screen coordinates lie within the boundary of the growl dialog.
 * @param clientX/*w  w  w . j a v a 2s.co m*/
 * @param clientY
 */
private boolean isMouseInMe(int clientX, int clientY) {
    try {
        String bottomStyle = getElement().getStyle().getBottom();
        int bottom = new Integer(bottomStyle.split("px")[0]).intValue();
        bottom = Window.getClientHeight() - bottom;

        int top = bottom - getOffsetHeight();
        int left = Window.getClientWidth() - NotificationConstants.WIDTH - NotificationConstants.MARGIN;
        int right = left + NotificationConstants.WIDTH;

        return clientX >= left && clientX <= right && clientY >= top && clientY <= bottom;
    } catch (Throwable t) {
        return false;
    }
}

From source file:org.artificer.ui.client.local.services.NotificationService.java

License:Apache License

/**
 * Positions the notification widget./*from  w  ww .  j a va2s  . co m*/
 * @param notification
 */
private void positionAndShowNotificationDialog(Notification notification) {
    NotificationWidget widget = notification.getWidget();
    int notificationIndex = notification.getIndex();
    NotificationWidget relativeTo = null;
    if (notificationIndex > 0) {
        relativeTo = activeNotifications.get(notificationIndex - 1).getWidget();
    }

    // Show the widget first, but make it invisible (so GWT can do its absolute positioning mojo)
    widget.getElement().getStyle().setVisibility(Visibility.HIDDEN);
    rootPanel.add(widget);

    // Calculate the notification widget's position, either because this is the only one
    // or relative to the one below it.
    int bottom = NotificationConstants.MARGIN;
    int right = NotificationConstants.MARGIN;
    if (relativeTo != null) {
        String relativeTo_bottomStyle = relativeTo.getElement().getStyle().getBottom();
        int relativeTo_bottom = new Integer(relativeTo_bottomStyle.split("px")[0]).intValue();
        bottom = relativeTo_bottom + relativeTo.getOffsetHeight() + NotificationConstants.MARGIN;
    }

    // Now pin the notification to the right using fixed positioning
    widget.getElement().getStyle().setPosition(Position.FIXED);
    widget.getElement().getStyle().setBottom(Window.getClientHeight() + 100, Unit.PX);
    widget.getElement().getStyle().setRight(right, Unit.PX);
    widget.getElement().getStyle().setProperty("left", null);
    widget.getElement().getStyle().setProperty("top", null);
    widget.getElement().getStyle().setVisibility(Visibility.VISIBLE);

    moveNotificationTo(notification.getWidget(), bottom);
}