Search in sources :

Example 1 with Viewport

use of com.extjs.gxt.ui.client.widget.Viewport in project kapua by eclipse.

the class KapuaCloudConsole method renderLoginDialog.

private void renderLoginDialog() {
    final Viewport viewport = new Viewport();
    final BorderLayout borderLayout = new BorderLayout();
    viewport.setLayout(borderLayout);
    if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
        viewport.setStyleName("login");
    } else {
        viewport.setStyleName("login-ie8");
    }
    // 
    // center
    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerData.setMargins(new Margins(0));
    centerData.setCollapsible(false);
    centerData.setFloatable(false);
    centerData.setHideCollapseTool(false);
    centerData.setSplit(false);
    LayoutContainer splash = new LayoutContainer(new FillLayout());
    viewport.add(splash, centerData);
    // 
    // north
    SimplePanel ethLogo = new SimplePanel();
    if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
        ethLogo.setStyleName("ethLogo");
    } else {
        ethLogo.setStyleName("ethLogo-ie8");
    }
    SimplePanel cloudLogo = new SimplePanel();
    if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
        cloudLogo.setStyleName("cloudLogo");
    } else {
        cloudLogo.setStyleName("cloudLogo-ie8");
    }
    TableLayout layout = new TableLayout(2);
    layout.setWidth("100%");
    LayoutContainer lcFooter = new LayoutContainer(layout);
    if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
        lcFooter.setStyleName("loginBanner");
    } else {
        lcFooter.setStyleName("loginBanner-ie8");
    }
    lcFooter.add(cloudLogo, new TableData(Style.HorizontalAlignment.LEFT, Style.VerticalAlignment.BOTTOM));
    lcFooter.add(ethLogo, new TableData(Style.HorizontalAlignment.RIGHT, Style.VerticalAlignment.BOTTOM));
    BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 72);
    northData.setCollapsible(false);
    northData.setFloatable(false);
    northData.setHideCollapseTool(false);
    northData.setSplit(false);
    northData.setMargins(new Margins(0));
    viewport.add(lcFooter, northData);
    RootPanel.get().add(viewport);
    // Dialog window
    final LoginDialog loginDialog = new LoginDialog();
    loginDialog.addListener(Events.Hide, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent be) {
            if (loginDialog.isAllowMainScreen()) {
                currentSession = loginDialog.getCurrentSession();
                if (currentSession != null) {
                    String username = currentSession.getGwtUser().getUsername();
                    if (username != null) {
                        // 
                        // Enter into the normal viewport
                        RootPanel.get().remove(viewport);
                        render(currentSession);
                    } else {
                        ConsoleInfo.display(MSGS.error(), MSGS.loginError());
                        loginDialog.show();
                    }
                } else {
                    ConsoleInfo.display(MSGS.error(), MSGS.loginError());
                    loginDialog.show();
                }
            }
        }
    });
    if (!UserAgentUtils.isIE()) {
        Window.addResizeHandler(new ResizeHandler() {

            public void onResize(ResizeEvent arg0) {
                loginDialog.center();
            }
        });
    }
    loginDialog.show();
}
Also used : BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Viewport(com.extjs.gxt.ui.client.widget.Viewport) SimplePanel(com.google.gwt.user.client.ui.SimplePanel) FillLayout(com.extjs.gxt.ui.client.widget.layout.FillLayout) ResizeEvent(com.google.gwt.event.logical.shared.ResizeEvent) BorderLayout(com.extjs.gxt.ui.client.widget.layout.BorderLayout) LayoutContainer(com.extjs.gxt.ui.client.widget.LayoutContainer) ResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler) Margins(com.extjs.gxt.ui.client.util.Margins) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent) TableData(com.extjs.gxt.ui.client.widget.layout.TableData) TableLayout(com.extjs.gxt.ui.client.widget.layout.TableLayout)

Example 2 with Viewport

use of com.extjs.gxt.ui.client.widget.Viewport in project activityinfo by bedatadriven.

the class EmbedEntryPoint method addToRootPanel.

private void addToRootPanel(Widget panel) {
    Viewport viewport = new Viewport();
    viewport.setLayout(new FitLayout());
    viewport.add(panel);
    RootPanel.get().add(viewport);
}
Also used : Viewport(com.extjs.gxt.ui.client.widget.Viewport) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 3 with Viewport

use of com.extjs.gxt.ui.client.widget.Viewport in project geo-platform by geosdi.

the class GeoPlatformLayoutManager method initLayoutManager.

/**
 * Build The Main GeoPlatform UI
 */
private void initLayoutManager() {
    viewport = new Viewport();
    viewport.setLayout(new BorderLayout());
    createEast();
    createWest();
    createCenter();
    createSouth();
}
Also used : BorderLayout(com.extjs.gxt.ui.client.widget.layout.BorderLayout) Viewport(com.extjs.gxt.ui.client.widget.Viewport)

Example 4 with Viewport

use of com.extjs.gxt.ui.client.widget.Viewport in project kura by eclipse.

the class denali method render.

private void render(GwtSession gwtSession) {
    Log.debug("Beginning page render");
    final Viewport viewport = new Viewport();
    final BorderLayout borderLayout = new BorderLayout();
    viewport.setLayout(borderLayout);
    viewport.setStyleAttribute("padding", "5px");
    // 
    // north
    BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 52);
    northData.setCollapsible(false);
    northData.setFloatable(false);
    northData.setHideCollapseTool(false);
    northData.setSplit(false);
    northData.setMargins(new Margins(0, 0, 5, 0));
    viewport.add(new NorthView(gwtSession), northData);
    // 
    // center
    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerData.setMargins(new Margins(0));
    ContentPanel center = new ContentPanel();
    center.setLayout(new FitLayout());
    center.setBorders(false);
    center.setBodyBorder(false);
    center.setId("center-panel-wrapper");
    viewport.add(center, centerData);
    // 
    // west
    BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 180);
    westData.setSplit(true);
    westData.setCollapsible(true);
    westData.setMargins(new Margins(0, 5, 0, 0));
    WestNavigationView westView = new WestNavigationView(gwtSession, center, m_connected);
    viewport.add(westView, westData);
    // 
    // south
    BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 18);
    southData.setCollapsible(false);
    southData.setFloatable(false);
    southData.setHideCollapseTool(false);
    southData.setSplit(false);
    southData.setMargins(new Margins(3, 5, 0, 0));
    final HorizontalPanel south = new HorizontalPanel();
    south.setTableWidth("100%");
    south.setId("south-panel-wrapper");
    Date now = new Date();
    @SuppressWarnings("deprecation") int year = now.getYear() + 1900;
    Label copyright = new Label(MSGS.copyright(String.valueOf(year)));
    copyright.setStyleName("x-form-label");
    TableData td = new TableData();
    td.setHorizontalAlign(HorizontalAlignment.LEFT);
    south.add(copyright, td);
    final Label developmentMode = new Label(MSGS.developmentMode());
    developmentMode.setStyleName("x-form-label");
    developmentMode.getElement().getStyle().setColor("red");
    final TableData tdExecMode = new TableData();
    tdExecMode.setHorizontalAlign(HorizontalAlignment.LEFT);
    if (isDevelopMode) {
        south.add(developmentMode, tdExecMode);
    }
    Label version = new Label(gwtSession.getKuraVersion());
    version.setStyleName("x-form-label");
    TableData tdVersion = new TableData();
    tdVersion.setHorizontalAlign(HorizontalAlignment.RIGHT);
    south.add(version, tdVersion);
    viewport.add(south, southData);
    // 
    // Initial Selection
    // center.setIconAbstractImagePrototype.create(Resources.INSTANCE.alerts()));
    // center.setHeading(MSGS.announcements());
    // center.removeAll();
    // center.add(new Overview(currentSession));
    // center.layout();
    // 
    // RootPanel
    RootPanel.get().add(viewport);
}
Also used : BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Viewport(com.extjs.gxt.ui.client.widget.Viewport) Label(com.google.gwt.user.client.ui.Label) Date(java.util.Date) EntryPoint(com.google.gwt.core.client.EntryPoint) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel) BorderLayout(com.extjs.gxt.ui.client.widget.layout.BorderLayout) HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel) Margins(com.extjs.gxt.ui.client.util.Margins) TableData(com.extjs.gxt.ui.client.widget.layout.TableData) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 5 with Viewport

use of com.extjs.gxt.ui.client.widget.Viewport in project kapua by eclipse.

the class KapuaCloudConsole method render.

private void render(GwtSession gwtSession) {
    final BorderLayout borderLayout = new BorderLayout();
    viewport = new Viewport();
    viewport.setLayout(borderLayout);
    // Set class name based on account. This allows for styling based on account
    // RootPanel.getBodyElement().addClassName(gwtSession.getSelectedAccount().getName());
    // 
    // North View
    BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 36);
    northData.setCollapsible(false);
    northData.setFloatable(false);
    northData.setHideCollapseTool(false);
    northData.setSplit(false);
    northData.setMargins(new Margins(0, 0, 5, 0));
    northView = new NorthView(currentSession, this);
    viewport.add(northView, northData);
    // 
    // Center View
    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerData.setMargins(new Margins(0, 5, 0, 0));
    centerView = new LayoutContainer();
    centerView.setLayout(new FitLayout());
    centerView.setBorders(false);
    viewport.add(centerView, centerData);
    // 
    // West View
    BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200);
    westData.setSplit(false);
    westData.setMargins(new Margins(0, 5, 0, 5));
    westView = new WestNavigationView(currentSession, centerView);
    viewport.add(westView, westData);
    // 
    // South view
    BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 18);
    southData.setCollapsible(false);
    southData.setFloatable(false);
    southData.setHideCollapseTool(false);
    southData.setSplit(false);
    southData.setMargins(new Margins(5, 5, 5, 5));
    southView = new HorizontalPanel();
    southView.setTableWidth("100%");
    TableData td = new TableData();
    td.setHorizontalAlign(HorizontalAlignment.LEFT);
    TableData tdVersion = new TableData();
    tdVersion.setHorizontalAlign(HorizontalAlignment.RIGHT);
    Date now = new Date();
    @SuppressWarnings("deprecation") int year = now.getYear() + 1900;
    Label copyright = new Label(MSGS.copyright(String.valueOf(year)));
    copyright.setStyleName("x-form-label");
    Label version = new Label(currentSession.getVersion() + "-" + currentSession.getBuildNumber());
    version.setStyleName("x-form-label");
    version.setToolTip(currentSession.getBuildVersion());
    southView.add(copyright, td);
    southView.add(version, tdVersion);
    viewport.add(southView, southData);
    // 
    // RootPanel
    RootPanel.get().add(viewport);
}
Also used : BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Viewport(com.extjs.gxt.ui.client.widget.Viewport) Label(com.extjs.gxt.ui.client.widget.Label) Date(java.util.Date) EntryPoint(com.google.gwt.core.client.EntryPoint) BorderLayout(com.extjs.gxt.ui.client.widget.layout.BorderLayout) LayoutContainer(com.extjs.gxt.ui.client.widget.LayoutContainer) HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel) Margins(com.extjs.gxt.ui.client.util.Margins) TableData(com.extjs.gxt.ui.client.widget.layout.TableData) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Aggregations

Viewport (com.extjs.gxt.ui.client.widget.Viewport)5 BorderLayout (com.extjs.gxt.ui.client.widget.layout.BorderLayout)4 Margins (com.extjs.gxt.ui.client.util.Margins)3 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)3 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)3 TableData (com.extjs.gxt.ui.client.widget.layout.TableData)3 HorizontalPanel (com.extjs.gxt.ui.client.widget.HorizontalPanel)2 LayoutContainer (com.extjs.gxt.ui.client.widget.LayoutContainer)2 EntryPoint (com.google.gwt.core.client.EntryPoint)2 Date (java.util.Date)2 ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)1 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)1 Label (com.extjs.gxt.ui.client.widget.Label)1 FillLayout (com.extjs.gxt.ui.client.widget.layout.FillLayout)1 TableLayout (com.extjs.gxt.ui.client.widget.layout.TableLayout)1 ResizeEvent (com.google.gwt.event.logical.shared.ResizeEvent)1 ResizeHandler (com.google.gwt.event.logical.shared.ResizeHandler)1 Label (com.google.gwt.user.client.ui.Label)1 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)1