Java Code Examples for com.google.gwt.user.client.Window#setMargin()

The following examples show how to use com.google.gwt.user.client.Window#setMargin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HtmlLauncher.java    From gdx-vfx with Apache License 2.0 5 votes vote down vote up
@Override
    public GwtApplicationConfiguration getConfig() {
        Window.enableScrolling(false);
        Window.setMargin("0");
        Window.addResizeHandler(new ResizeListener());

        int w = Window.getClientWidth() - PADDING;
        int h = Window.getClientHeight() - PADDING;
        cfg = new GwtApplicationConfiguration(w, h);
        cfg.preferFlash = false;
        cfg.disableAudio = true;
//        cfg.useDebugGL = true;  //TODO Remove it.
        return cfg;
    }
 
Example 2
Source File: Login.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void onModuleLoad() {
	if (RootPanel.get("loadingwrapper-login") == null)
		return;

	GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
		@Override
		public void onUncaughtException(Throwable caught) {
			SC.warn("Error", caught.getMessage());
		}

	});

	instance = this;

	declareShowLostDialog(this);

	// Tries to capture locale parameter
	final String lang = Util.detectLocale();
	I18N.setLocale(lang);

	// Tries to capture tenant parameter
	final String tenant = Util.detectTenant();

	// Get grid 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("0px");

	InfoService.Instance.get().getInfo(I18N.getLocale(), tenant, true, new AsyncCallback<GUIInfo>() {
		@Override
		public void onFailure(Throwable error) {
			SC.warn(error.getMessage());
		}

		@Override
		public void onSuccess(final GUIInfo info) {
			CookiesManager.saveRelease(info);

			I18N.init(info);

			WindowUtils.setTitle(info, null);

			Feature.init(info);
			Session.get().setInfo(info);

			WindowUtils.setFavicon(info);

			if ("mobile".equals(Util.getJavascriptVariable("j_layout")))
				loginPanel = new MobileLoginPanel(info);
			else
				loginPanel = new LoginPanel(info);

			Login.this.showLogin();
		}

	});
}