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

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

Introduction

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

Prototype

public static void setMargin(String size) 

Source Link

Usage

From source file:client.ManagementGui.java

License:Open Source License

/**
 * Build the whole panel./*from  www . j a va2s.  c  o m*/
 */
public final void onModuleLoad() {
    ManagementGui.instance = this;

    this.logoPanel.setWidth("100%");

    this.rightPanel.addStyleName("rightPanel");
    this.rightPanel.setWidth("100%");

    this.resTree.addStyleName("treeMenu");

    this.topologyTree.addStyleName("treeMenu");

    this.argonTree.addStyleName("treeMenu");

    this.stackPanel.setWidth("200");

    this.stackPanel.add(this.resTree, this.createImageHtml("journal.png", "Reservation"), true);
    this.stackPanel.add(this.topologyTree, this.createImageHtml("connect.png", "Tools"), true);
    this.stackPanel.add(this.argonTree, this.createImageHtml("database.png", "Argon"), true);
    this.stackPanel.add(this.renameTree, "About", true);

    this.dock.add(this.logoPanel, DockPanel.NORTH);
    this.dock.add(LoggingPanel.getPanel(), DockPanel.SOUTH);
    this.dock.add(this.stackPanel, DockPanel.WEST);
    this.dock.add(this.rightPanel, DockPanel.CENTER);

    this.dock.setWidth("100%");

    this.dock.setSpacing(4);
    this.dock.setCellWidth(this.rightPanel, "100%");

    Window.addWindowResizeListener(this);
    Window.enableScrolling(true);
    Window.setMargin("0px");

    RootPanel.get().add(this.dock);

    DeferredCommand.addCommand(new Command() {
        public void execute() {
            ManagementGui.this.onWindowResized(Window.getClientWidth(), Window.getClientHeight());
        }
    });

    this.onWindowResized(Window.getClientWidth(), Window.getClientHeight());
}

From source file:com.ait.lienzo.ks.client.LienzoKS.java

License:Open Source License

@Override
public void onLoad() {
    Window.setMargin("0px");

    Window.enableScrolling(false);

    Client.get().setDefaultUncaughtExceptionHandler();

    Viewport vp = Viewport.get(Layout.BORDER);

    HeaderPanel hp = new HeaderPanel();

    vp.add(hp);//from  www. ja va  2 s. co m

    ContentPanel cp = new ContentPanel();

    vp.add(cp);

    NavigationPanel np = new NavigationPanel();

    vp.add(np);

    cp.run();

    GoogleAnalytics.get().sendPageView().documentPath("Application").documentTitle("Lienzo KS").go();
}

From source file:com.dimad.map.executor.client.Main.java

License:Apache License

@Override
public void onModuleLoad() {
    try {//from   w  ww.  j av a2 s .c o  m
        GWT.log("Loading module ...");
        mainPanel = new MainPanel(this).buildPanel();

        Window.enableScrolling(true);
        Window.setMargin("0px");
        Window.setTitle(constants.applicationTitle());

        RootPanel.get().add(mainPanel);

        redraw();
        //disable();
        GWT.log("Module loaded");
    } catch (Throwable e) {
        GWT.log("Could not start application", e);
        Window.alert(e.getMessage());
    }
}

From source file:com.dimdim.conference.ui.layout.client.main.NewLayout.java

License:Open Source License

protected void loadConsole() {
    DebugPanel.getDebugPanel().addDebugMessage("Initializing Console");
    //   Now once the environment i initialized the client model can be
    //   created which depends on it.

    //      String getEventsURL = ConferenceGlobals.webappRoot+
    //         "GetEvents.action?sessionKey="+ConferenceGlobals.sessionKey;
    String getEventsURL = ConferenceGlobals.webappRoot + "GetEvents.action?sessionKey="
            + ConferenceGlobals.sessionKey;
    String serverPingURL = ConferenceGlobals.webappRoot + "PingServer.action";
    ClientModel.createClientModel();/*w w  w  .  java2 s  .  c  om*/
    DebugPanel.getDebugPanel().addDebugMessage("Client model creation complete");

    Window.setMargin("0px");

    try {
        UIRosterEntry currentUser = ClientModel.getClientModel().getRosterModel().getCurrentUser();
        fullPanel = new ConsoleFullPanel(this, currentUser);
        //RootPanel.get("MainConsole").remove(this.lmm);
        //RootPanel.get("MainConsole").add(fullPanel);

        //RootPanel.get("MainConsole").add(fullPanel.getTopPanel())
        //this.meetingAssistent = new MeetingAssistentDialog(this.workspaceClickListener);
    } catch (Exception e) {
        Window.alert(e.getMessage());
    }
    DebugPanel.getDebugPanel().addDebugMessage("Fetching initial data");
    ClientModel.getClientModel().getClientStateModel().addListener(this.fullPanel.getMiddlePanel());
    ClientModel.getClientModel().getRosterModel()
            .addListener(this.fullPanel.getMiddlePanel().getRosterModelListener());

    UIParams uiParams = UIParams.getUIParams();
    EventsJsonHandler eventsHandler = EventsJsonHandler.getHandler();
    eventsHandler.setEventsTracker(DebugPanel.getDebugPanel());
    gerth = new GetEventResponseTextHandler(eventsHandler, uiParams.getRegularEventPollIntervalMillis(),
            uiParams.getMaxEventPollErrors());
    gerth.setServerPingURL(serverPingURL);
    eventsReadingTimer = new JSONurlReadingTimer(getEventsURL, getConfKey(),
            uiParams.getInitialEventPollDelayMillis(), gerth);
    gerth.setServerStatusListener(this.eventsReadingTimer);
    eventsReadingTimer.start();

    Window.addWindowResizeListener(this);
    DeferredCommand.add(new Command() {
        public void execute() {
            onWindowResized(Window.getClientWidth(), Window.getClientHeight());
            continueLoading();
        }
    });

    ClientModel.getClientModel().getRosterModel().reportConsoleLoaded();

    //      ConsoleDataReader dataReader = new ConsoleDataReader(this);
    //      dataReader.readConsoleData();
    DebugPanel.getDebugPanel().addDebugMessage("Console initialization complete.");
    showConsole();

    //      linking meeting assistant dialog listener
    meetingAssistent = new MeetingAssistentDialog(fullPanel.getMiddlePanel().getLeftPanel());
    fullPanel.getTopPanel().getLinksPanel().getAssistantLabel().addClickListener(this);
}

From source file:com.dimdim.conference.ui.layout2.client.MainLayout.java

License:Open Source License

protected void loadConsole() {
    DebugPanel.getDebugPanel().addDebugMessage("Initializing Console");
    //   Now once the environment i initialized the client model can be
    //   created which depends on it.

    //      String getEventsURL = ConferenceGlobals.webappRoot+
    //         "GetEvents.action?sessionKey="+ConferenceGlobals.sessionKey;
    String getEventsURL = ConferenceGlobals.webappRoot + "GetEvents.action?sessionKey="
            + ConferenceGlobals.sessionKey;
    String serverPingURL = ConferenceGlobals.webappRoot + "PingServer.action";
    ClientModel.createClientModel();//from   w w w.ja va2s.c  o m
    DebugPanel.getDebugPanel().addDebugMessage("Client model creation complete");

    Window.setMargin("0px");

    try {
        UIRosterEntry currentUser = ClientModel.getClientModel().getRosterModel().getCurrentUser();
        fullPanel = new ConsoleFullPanel(this, currentUser);
        //RootPanel.get("MainConsole").remove(this.lmm);
        //RootPanel.get("MainConsole").add(fullPanel);

        //RootPanel.get("MainConsole").add(fullPanel.getTopPanel())
        //this.meetingAssistent = new MeetingAssistentDialog(this.workspaceClickListener);
    } catch (Exception e) {
        Window.alert(e.getMessage());
    }
    DebugPanel.getDebugPanel().addDebugMessage("Fetching initial data");
    ClientModel.getClientModel().getClientStateModel().addListener(this.fullPanel.getMiddlePanel());
    ClientModel.getClientModel().getRosterModel()
            .addListener(this.fullPanel.getMiddlePanel().getRosterModelListener());

    UIParams uiParams = UIParams.getUIParams();
    EventsJsonHandler eventsHandler = EventsJsonHandler.getHandler();
    eventsHandler.setEventsTracker(DebugPanel.getDebugPanel());
    gerth = new GetEventResponseTextHandler(eventsHandler, uiParams.getRegularEventPollIntervalMillis(),
            uiParams.getMaxEventPollErrors());
    gerth.setServerPingURL(serverPingURL);
    eventsReadingTimer = new JSONurlReadingTimer(getEventsURL, getConfKey(),
            uiParams.getInitialEventPollDelayMillis(), gerth);
    gerth.setServerStatusListener(this.eventsReadingTimer);
    eventsReadingTimer.start();

    resizeListener = new ResizeListener();
    Window.addWindowResizeListener(resizeListener);
    DeferredCommand.addCommand(new Command() {
        public void execute() {
            resizeListener.onWindowResized(Window.getClientWidth(), Window.getClientHeight());
            continueLoading();
        }
    });

    ClientModel.getClientModel().getRosterModel().reportConsoleLoaded();

    //      ConsoleDataReader dataReader = new ConsoleDataReader(this);
    //      dataReader.readConsoleData();
    DebugPanel.getDebugPanel().addDebugMessage("Console initialization complete.");

    JSInterface.addCallbackListener(CopyFlashListener.getListener());
    //      showConsole();

    //      linking meeting assistant dialog listener
    //      meetingAssistent = new MeetingAssistentDialog(fullPanel.getMiddlePanel().getLeftPanel());
    //      fullPanel.getTopPanel().getToolsPanel().getAssistantLabel().addClickListener(this);
}

From source file:com.ephesoft.dcma.gwt.rv.client.view.ReviewValidateView.java

License:Open Source License

public ReviewValidateView() {
    super();/*from   www.  j  a  v  a  2 s . com*/
    outer = BINDER.createAndBindUi(this);

    Window.enableScrolling(true);
    Window.setMargin("0px");

    Element topElem = outer.getWidgetContainerElement(topPanel);
    topElem.getStyle().setZIndex(2);
    topElem.getStyle().setOverflow(Overflow.VISIBLE);
    reviewValidateViewPanel.addStyleName("left10");
    slidingPanel.setWidget(rVView);
    rvView.setText(LocaleDictionary.get().getConstantValue(ReviewValidateConstants.MSG_BACK));
    rvView.addStyleName("margin");
}

From source file:com.etx.mortgagecalculator.client.ui.widgets.uiwidget.java

License:GNU General Public License

public uiwidget() {
    initWidget(uiBinder.createAndBindUi(this));

    Window.enableScrolling(false);
    Window.setMargin("0px");
    Date d = new Date();
    firstdate.setValue(d);//w  w w.j  a  v  a  2 s  .co  m

    fmt = NumberFormat.getCurrencyFormat();

    mortgageamountTextbox.addStyleName("gwt-mortgageamountTextbox");
    terminyearsTextbox.addStyleName("gwt-Textbox");
    interestrateTextbox.addStyleName("gwt-Textbox");
    onetimeprepaymentTextbox.addStyleName("gwt-Textbox");
    annualprepaymentTextbox.addStyleName("gwt-Textbox");
    increasepaymentbyTextbox.addStyleName("gwt-Textbox");
    htmlpanel.addStyleName("gwt-htmlpanel");
    monthlyPayments.addStyleName("gwt-monthlypayment");
    terminyears.addStyleName("gwt-terminyears");
    lblpaymentlabel.addStyleName("gwt-paymentlabel");
    payoffdate.addStyleName("gwt-PayoffDate");
    lblamortlabel.addStyleName("gwt-amortizationschedlabel");
    firstdate.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat("MMM dd, yyyy")));

    calculatemortgage();
    click(button);

    button.setVisible(false);
    lblonetimeprepayment.setVisible(false);
    onetimeprepaymentTextbox.setVisible(false);
    lblannualprepayment.setVisible(false);
    annualprepaymentTextbox.setVisible(false);
    firstdate.setVisible(false);
    try {

        lang = com.google.gwt.user.client.Window.Location.getParameter("lang");

        if (lang == null) {
            lang = "en";
        }

        /*
        This section is not very good solution for separating languages, it needs to be reworked
        Ideally this should go to XML file.
        Developed this way to test it and never had a chance to change it.
        */

        //Slovak
        if (lang.equals("sk") == true) {
            lblMortgageLabel.setText("Vyska Hypoteky");
            lblmortgageamortization.setText("Doba Splacania (mesiace)");
            lblannualinterestrate.setText("Rocna urokova miera (%)");
            lblpaymentfrequency.setText("Frekvencia Platby");
            //lblmortgagestartdate.setText ( "Datum Zaciatku Hypoteky" ) ;
            lblpaymentlabel.setText("Mesacna Splatka:");
            lblpayoffdate.setText("Datum Splatenia:");
            lblonetimeprepayment.setText("Jednorazovo pridat");
            lblannualprepayment.setText("Rocne pridat");
            lblincreasepaymentby.setText("Mesacne Pridat");
            lbltotalcostoftheloan.setText(" Celkova Suma Uveru:");
            lblinterestpaidforterm.setText("Celkovy Urok:");
            lblextrapaymentssaved.setText("Platby navyse usetrili:");
            //lblextrapaymentnewdate.setText ( "Datum splatenia s platbami navyse:" ) ;
            lblamortlabel.setText("Splatkovy Kalendar (Mesacna Amortizacna Tabulka)");
            lblcopyright.setText("Licensed under GNU GPL v2.0 - Developed by ETX Software Inc. (ETX.ca)"); // This line can be changed to your liking, as long as you reference open source project: https://github.com/JozefJarosciak/MortgageCalculator and www.ETX.ca
            years = "rokov";
            days = "dni";

            amortizationtable1lang = "<table style=\"width:100%\">" + "<tr>" + "<td><b>Mesiac</b></td>"
                    + "<td><b>Platba</b></td>" + "<td><b>Umor</b></td>" + "<td><b>Urok</b></td>"
                    + "<td><b>Urok (sucet)</b></td>" + "<td><b>Zostatok</b></td>" + "</tr>";

        }

        //English
        if (lang.equals("en") == true) {
            lblMortgageLabel.setText("Mortgage Amount");
            lblmortgageamortization.setText("Mortgage Amortization (months)");
            lblannualinterestrate.setText("Annual Interest Rate (%)");
            lblpaymentfrequency.setText("Payment Frequency");
            //lblmortgagestartdate.setText("Mortgage start date");
            lblpaymentlabel.setText("Monthly Payment:");
            lblpayoffdate.setText("Pay-Off Date (from today's date):");
            lblonetimeprepayment.setText("One-Time Prepayment");
            lblannualprepayment.setText("Annual Prepayment");
            lblincreasepaymentby.setText("Add to Mortgage (montly)");
            lbltotalcostoftheloan.setText("Total cost of the loan:");
            lblinterestpaidforterm.setText("Interest Paid for Term:");
            lblextrapaymentssaved.setText("Extra Payments Saved:");
            //lblextrapaymentnewdate.setText("Pay-Off Date with Extra Payments. In:");
            lblamortlabel.setText("Amortization Schedule (monthly payments)");
            lblcopyright.setText("Licensed under GNU GPL v2.0 - Developed by ETX Software Inc. (ETX.ca)"); // This line can be changed to your liking, as long as you reference open source project: https://github.com/JozefJarosciak/MortgageCalculator and www.ETX.ca
            years = "years";
            days = "days";

            amortizationtable1lang = "<table style=\"width:100%\">" + "<tr>" + "<td><b>Month</b></td>"
                    + "<td><b>Payment</b></td>" + "<td><b>Principal Paid</b></td>"
                    + "<td><b>Interest Paid</b></td>" + "<td><b>Total Interest</b></td>"
                    + "<td><b>Balance</b></td>" + "</tr>";

        }
    } catch (Exception e) {
    }

}

From source file:com.example.GWTOAuthLoginDemo.client.GWTOAuthLoginDemo.java

License:Open Source License

private void showApp(int what) {
    Window.setMargin("0px");
    RootLayoutPanel rootLayoutPanel = RootLayoutPanel.get();
    rootLayoutPanel.clear();//from w w  w  . j  a  v  a  2  s.  co m
    if (what == APPSCREEN_MAIN) {
        appScreen.setWidth("100%");
        rootLayoutPanel.add(appScreen);
    } else {
        String html = WELCOME_STRING;
        appScreenLogin.setWidth("100%");
        appScreenLogin.updateWecomeLabel(html);
        appScreenLogin.resetLoginParams();
        rootLayoutPanel.add(appScreenLogin);
    }
}

From source file:com.google.gwt.sample.mail.client.Mail.java

License:Apache License

/**
 * This method constructs the application user interface by instantiating
 * controls and hooking up event handler.
 *///from  ww  w  . j  a  v a 2 s.c  om
public void onModuleLoad() {
    // Inject global styles.
    GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected();

    // Create the UI defined in Mail.ui.xml.
    DockLayoutPanel outer = binder.createAndBindUi(this);

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

    // Special-case stuff to make topPanel overhang a bit.
    Element topElem = outer.getWidgetContainerElement(topPanel);
    topElem.getStyle().setZIndex(2);
    topElem.getStyle().setOverflow(Overflow.VISIBLE);

    // Listen for item selection, displaying the currently-selected item in
    // the detail area.
    mailList.setListener(new MailList.Listener() {
        public void onItemSelected(MailItem item) {
            mailDetail.setItem(item);
        }
    });

    // Add the outer panel to the RootLayoutPanel, so that it will be
    // displayed.
    RootLayoutPanel root = RootLayoutPanel.get();
    root.add(outer);
}

From source file:com.gwtcx.extgwt.client.desktop.view.AbstractMainPageView.java

License:Open Source License

@Inject
public AbstractMainPageView(final EventBus eventBus, final Masthead masthead,
        final ApplicationMenu applicationMenu) {
    super();/*from   w ww .  j a v a  2s.  c  om*/

    Log.debug("AbstractMainPageView()");

    this.eventBus = eventBus;
    this.masthead = masthead;
    this.applicationMenu = applicationMenu;

    createAndBindUi();

    // get rid of scroll bars, and clear out the window's built-in margin,
    // because we want to take advantage of the entire client area
    getViewport().setEnableScroll(false); // calls Window.enableScrolling(false);
    Window.setMargin("0px");

    getNorthPanel().add(getMasthead());
    getNorthPanel().add(getApplicationMenu());

    bindCustomUiHandlers();
}