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

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

Introduction

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

Prototype

public static void enableScrolling(boolean enable) 

Source Link

Usage

From source file:org.gwtportlets.portlet.client.ui.ClientAreaPanel.java

License:Open Source License

public ClientAreaPanel(Layout layout) {
    super(layout);
    Window.enableScrolling(false);
    RootPanel.get().add(this);
}

From source file:org.openelis.modules.main.client.OpenELISEntry.java

License:Open Source License

/**
 * This is the entry point method./*from ww w .  jav  a  2s  . co m*/
 */
public void onModuleLoad() {
    // All Events will flow this this handler first before any other
    // handlers.
    Event.addNativePreviewHandler(this);
    OpenELISResources.INSTANCE.style().ensureInjected();
    OpenELISResources.INSTANCE.icon().ensureInjected();
    UIResources.INSTANCE.buttonPanel().ensureInjected();
    UIResources.INSTANCE.calendar().ensureInjected();
    UIResources.INSTANCE.collapse().ensureInjected();
    UIResources.INSTANCE.text().ensureInjected();
    UIResources.INSTANCE.dragDrop().ensureInjected();
    UIResources.INSTANCE.general().ensureInjected();
    DebugInfo.setDebugIdPrefix("");

    GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
        public void onUncaughtException(Throwable e) {
            e.printStackTrace();
            if (e.getMessage() == null)
                logger.log(Level.SEVERE, "UNKNOWN", e);
            else
                logger.log(Level.SEVERE, e.getMessage(), e);
            Window.alert("Sorry, but an unexpected error has occurred.  Please contact IT support");
        }
    });

    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
        public void execute() {
            GWT.runAsync(new RunAsyncCallback() {
                public void onSuccess() {
                    try {
                        Window.enableScrolling(true);
                        RootPanel.get("load").getElement().removeFromParent();
                        RootLayoutPanel.get().add(new org.openelis.modules.main.client.OpenELIS());
                        SessionTimer.start();
                    } catch (Throwable e) {
                        e.printStackTrace();
                        remote.log(Level.SEVERE, e.getMessage(), e);
                        Window.alert("Unable to start app : " + e.getMessage());
                    }
                }

                public void onFailure(Throwable caught) {
                    remote.log(Level.SEVERE, caught.getMessage(), caught);
                    Window.alert(caught.getMessage());
                }
            });
        }
    });
}

From source file:org.opennms.features.poller.remote.gwt.client.DefaultApplicationView.java

License:Open Source License

private void setupWindow() {
    Window.setTitle("OpenNMS - Remote Monitor");
    Window.enableScrolling(false);
    Window.setMargin("0px");
    Window.addResizeHandler(this);
}

From source file:org.openremote.web.console.util.BrowserUtils.java

License:Open Source License

public static void initWindow() {
    //         consoleContainer = new AbsolutePanel();
    //         consoleContainer.setWidth("3000px");
    //         consoleContainer.setHeight("3000px");
    //         RootPanel.get().add(consoleContainer, 0, 0);
    //         //consoleContainer.getElement().getStyle().setPosition(Position.FIXED);
    updateWindowInfo();//from  w  w w  . j a  v  a2 s. c  o  m

    if (isMobile) {
        initMobile();
    } else {
        // Prevent scrollbars from being shown
        Window.enableScrolling(false);
    }

    // Add window resize handler
    Window.addResizeHandler(new ResizeHandler() {
        @Override
        public void onResize(ResizeEvent event) {
            doResizeAndRotate();
        }
    });
}

From source file:org.openxdata.designer.client.FormDesignerEntryPoint.java

/**
 * Sets up the form designer./*from w  w w.j av  a  2  s . co m*/
 */
public void onModuleLoadDeffered() {

    try {
        RootPanel rootPanel = RootPanel.get("formtoolsdesigner");
        if (rootPanel == null) {
            FormUtil.dlg.hide();
            return;
        }

        FormUtil.setupUncaughtExceptionHandler();

        FormDesignerUtil.setDesignerTitle();

        String s = FormUtil.getDivValue("allowBindEdit");
        if (s != null && (s.equals("0") || s.equals("false")))
            Context.setAllowBindEdit(false);

        FormUtil.retrieveUserDivParameters();

        Context.setOfflineModeStatus();

        // Get rid of scrollbars, and clear out the window's built-in margin,
        // because we want to take advantage of the entire client area.
        Window.enableScrolling(false);
        Window.setMargin("0" + OpenXdataConstants.UNITS);

        // Different themes use different background colors for the body
        // element, but IE only changes the background of the visible content
        // on the page instead of changing the background color of the entire
        // page. By changing the display style on the body element, we force
        // IE to redraw the background correctly.
        RootPanel.getBodyElement().getStyle().setProperty("display", "none");
        RootPanel.getBodyElement().getStyle().setProperty("display", "");

        loadLocales();

        designer = new FormDesignerWidget(true, true, true);

        // Finally, add the designer widget to the RootPanel, so that it will be displayed.
        rootPanel.add(designer);

        updateTabs();

        //If a form id has been specified in the html host page, load the form
        //with that id in the designer.
        s = FormUtil.getFormId();
        if (s != null)
            designer.loadForm(Integer.parseInt(s));

        // Call the window resized handler to get the initial sizes setup. Doing
        // this in a deferred command causes it to occur after all widgets' sizes
        // have been computed by the browser.
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
            public void execute() {
                designer.onWindowResized(Window.getClientWidth(), Window.getClientHeight());

                String id = FormUtil.getFormId();
                if (id == null || id.equals("-1"))
                    FormUtil.dlg.hide();
            }
        });

        // Hook the window resize event, so that we can adjust the UI.
        Window.addResizeHandler(this);
    } catch (Exception ex) {
        FormUtil.displayException(ex);
    }
}

From source file:org.rebioma.client.OccurrenceView.java

License:Apache License

@Override
protected void resize(final int width, int height) {
    //      Window.alert("My view " + History.getToken() + " = " + isMyView(History.getToken()));
    if (!isMyView(History.getToken())) {
        return;//from   w  w  w .j a  v a2  s  . co  m
    }
    int w = width - 20;
    toolHp.setWidth(w + "px");
    height = height - mainSp.getAbsoluteTop();
    if (height <= 0) {
        height = 1;
    }
    mainSp.setPixelSize(w, height - 10);
    if (activeViewInfo != null) {
        //         getPopupView(activeViewInfo.getName()).reshow();
        //         viewPanel.setWidget(activeViewInfo.getView());
        if (viewPanel.getWidget() != null)
            viewPanel.getWidget().setHeight((height - 10 - toolHp.getOffsetHeight()) + "px");
    }
    Window.enableScrolling(toolHp.getOffsetWidth() - 10 > w);

}

From source file:org.rebioma.client.Portal.java

License:Apache License

public void onModuleLoad() {
    //     loadMapApi();
    // Uncomment this to test new view stuff:
    DisplayPopup.setCloseImageUrl("images/xclose.gif");
    Window.enableScrolling(false);
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(new Label(constants.LoadingUser()));
    hp.setWidth("100%");
    hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    RootPanel.get().add(hp);/*from www  .j av a  2 s  .c om*/
    checkCurrentSession();
    // Window.confirm(browserDetect());

}

From source file:org.rstudio.studio.client.application.ui.ApplicationWindow.java

License:Open Source License

@Inject
public ApplicationWindow(ApplicationHeader applicationHeader, GlobalDisplay globalDisplay,
        Provider<CodeSearch> pCodeSearch) {
    globalDisplay_ = globalDisplay;/*from w  w  w. j av a 2 s .c  o  m*/
    pCodeSearch_ = pCodeSearch;

    // occupy full client area of the window
    Window.enableScrolling(false);
    Window.setMargin("0px");

    // app ui contained within a vertical panel
    applicationPanel_ = new LayoutPanel();

    // header bar
    applicationHeader_ = applicationHeader;
    Widget applicationHeaderWidget = applicationHeader_.asWidget();
    applicationHeaderWidget.setWidth("100%");
    applicationPanel_.add(applicationHeader_);
    updateHeaderTopBottom();
    applicationHeaderWidget.setVisible(false);

    // main view container
    initWidget(applicationPanel_);
}

From source file:org.rstudio.studio.client.common.satellite.SatelliteWindow.java

License:Open Source License

public SatelliteWindow(Provider<EventBus> pEventBus, Provider<FontSizeManager> pFontSizeManager) {
    // save references
    pEventBus_ = pEventBus;/*from   w  ww.j  a v  a  2s.c o m*/
    pFontSizeManager_ = pFontSizeManager;

    // occupy full client area of the window
    if (!allowScrolling())
        Window.enableScrolling(false);
    Window.setMargin("0px");

    // create application panel
    mainPanel_ = new LayoutPanel();

    // init widget
    initWidget(mainPanel_);
}

From source file:org.talend.mdm.webapp.browserecords.client.widget.GenerateContainer.java

License:Open Source License

public static void generateContentPanel(String panelId, String heading) {
    if (instance != null) {
        instance.removeFromParent();/*from w  w w.  j  a  v a 2s  . c o m*/
    }

    instance = new ContentPanel() {

        @Override
        public void onAttach() {
            monitorWindowResize = true;
            Window.enableScrolling(true);
            super.onAttach();
            GXT.hideLoadingPanel("loading");//$NON-NLS-1$
        }

    };
    instance.setHeaderVisible(false);
    instance.setBorders(false);
    instance.setId(panelId);
    instance.setHeading(heading);
}