Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.LayoutPanel


    public Widget asWidget() {
        final CollapsibleSplitLayoutPanel layout = new CollapsibleSplitLayoutPanel(2);


        final LayoutPanel westPanelWrapper = new LayoutPanel();
        westPanelWrapper.setStyleName("fill-layout");

        final HTML collapseButton = new HTML("<i class='icon-double-angle-left'></i>");
        collapseButton.setStyleName("lhs-toggle");
        collapseButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                boolean collapsed = layout.toggleCollapsedState(westPanelWrapper);
                westPanel.setVisible(!collapsed);
                if (collapsed)
                    collapseButton.setHTML("<i class='icon-double-angle-right'></i>");
                else
                    collapseButton.setHTML("<i class='icon-double-angle-left'></i>");

            }
        });

        westPanelWrapper.add(collapseButton);
        westPanelWrapper.add(westPanel);

        // fix display issue
        collapseButton.getElement().getParentElement().getStyle().setOverflow(Style.Overflow.VISIBLE);

         // workaround: the panel always open not collapsed, but the west panel might be invisible
        layout.addAttachHandler(new AttachEvent.Handler() {
            @Override
            public void onAttachOrDetach(AttachEvent event) {
                if(event.isAttached() && !layout.isCollapsed(westPanelWrapper))
                    westPanel.setVisible(true); // workaround

            }
        });

        westPanelWrapper.setWidgetTopHeight(westPanel, 0, Style.Unit.PX, 100, Style.Unit.PCT);
        westPanelWrapper.setWidgetTopHeight(collapseButton, 5, Style.Unit.PX, 15, Style.Unit.PX);
        westPanelWrapper.setWidgetRightWidth(collapseButton, 5, Style.Unit.PX, 15, Style.Unit.PX);

        layout.addWest(westPanelWrapper, 217);
        layout.add(centerPanel);

        //layout.setWidgetMinSize(nav, 15);
View Full Code Here


        groupDeploymentBrowser = new ServerGroupDeploymentBrowser(presenter, deploymentStore, hostInfoStore);
        pagedView.addPage(Console.CONSTANTS.common_label_back(), overviewPanel.build());
        pagedView.addPage("Group Deployments", groupDeploymentBrowser.asWidget());
        pagedView.showPage(0);

        LayoutPanel layout = new LayoutPanel();
        layout.add(pagedView.asWidget());
        return layout;
    }
View Full Code Here

        panel.add(table);

        // assemble the panels
        panel.setStyleName("rhs-content-panel");
        ScrollPanel scroll = new ScrollPanel(panel);
        LayoutPanel layout = new LayoutPanel();
        layout.add(scroll);
        layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);
        return layout;
    }
View Full Code Here

        this.presenter = presenter;
    }

    public Widget asWidget() {

        LayoutPanel layout = new LayoutPanel();

        ToolStrip topLevelTools = new ToolStrip();
        ToolButton commonLabelAddBtn = new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                presenter.launchNewXADatasourceWizard();
            }
        });
        commonLabelAddBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_xADataSourceEditor());
        topLevelTools.addToolButtonRight(commonLabelAddBtn);


        ClickHandler clickHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final XADataSource currentSelection = details.getCurrentSelection();
                if(currentSelection!=null)
                {
                    Feedback.confirm(
                            Console.MESSAGES.deleteTitle("XA Datasource"),
                            Console.MESSAGES.deleteConfirm("XA Datasource "+currentSelection.getName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.onDeleteXA(currentSelection);
                                    }
                                }
                            });
                }
            }
        };
        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
        deleteBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_delete_xADataSourceEditor());
        deleteBtn.addClickHandler(clickHandler);
        topLevelTools.addToolButtonRight(deleteBtn);

        // ----

        VerticalPanel vpanel = new VerticalPanel();
        vpanel.setStyleName("rhs-content-panel");

        ScrollPanel scroll = new ScrollPanel(vpanel);
        layout.add(scroll);

        layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

        // ---

        vpanel.add(new ContentHeaderLabel("JDBC XA Datasources"));
View Full Code Here

        this.presenter = presenter;
    }

    public Widget asWidget() {

        LayoutPanel layout = new LayoutPanel();

        ToolStrip topLevelTools = new ToolStrip();
        topLevelTools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                presenter.launchNewDatasourceWizard();
            }
        }));


        ClickHandler clickHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final DataSource currentSelection = details.getCurrentSelection();
                if(currentSelection!=null)
                {
                    Feedback.confirm(
                            Console.MESSAGES.deleteTitle("Datasource"),
                            Console.MESSAGES.deleteConfirm("Datasource "+currentSelection.getName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.onDelete(currentSelection);
                                    }
                                }
                            });
                }
            }
        };
        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
        deleteBtn.addClickHandler(clickHandler);
        topLevelTools.addToolButtonRight(deleteBtn);

        // ----

        VerticalPanel vpanel = new VerticalPanel();
        vpanel.setStyleName("rhs-content-panel");

        ScrollPanel scroll = new ScrollPanel(vpanel);
        layout.add(scroll);

        layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

        // ---

        vpanel.add(new ContentHeaderLabel("JDBC Datasources"));
        vpanel.add(new ContentDescription(Console.CONSTANTS.subsys_jca_dataSources_desc()));
View Full Code Here

        }

        @Override
        public Widget asWidget()
        {
            LayoutPanel layout = new LayoutPanel();
            layout.setStyleName("fill-layout");

            FakeTabPanel titleBar = new FakeTabPanel(interactionUnit.getLabel());
            layout.add(titleBar);

            Widget deckPanelWidget = deckPanel.asWidget();

            VerticalPanel panel = new VerticalPanel();
            panel.setStyleName("rhs-content-panel");
            panel.add(deckPanelWidget);

            ScrollPanel scroll = new ScrollPanel(panel);
            layout.add(scroll);

            layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 40, Style.Unit.PX);
            layout.setWidgetTopHeight(scroll, 40, Style.Unit.PX, 100, Style.Unit.PCT);

            deckPanelWidget.addAttachHandler(new AttachEvent.Handler() {
                @Override
                public void onAttachOrDetach(AttachEvent attachEvent) {
                    deckPanel.showWidget(0);
View Full Code Here

    }

    public Widget asWidget() {

        LayoutPanel outerLayout = new LayoutPanel();
        outerLayout.addStyleName("page-header");

        Widget logo = getProductSection();
        Widget links = getLinksSection();

        LayoutPanel line = new LayoutPanel();
        line.setStyleName("header-line");
        LayoutPanel top = new LayoutPanel();
        top.setStyleName("header-top");
        LayoutPanel bottom = new LayoutPanel();
        bottom.setStyleName("header-bottom");

        outerLayout.add(line);
        outerLayout.add(top);
        outerLayout.add(bottom);

        outerLayout.setWidgetTopHeight(line, 0, Style.Unit.PX, 4, Style.Unit.PX);
        outerLayout.setWidgetTopHeight(top, 4, Style.Unit.PX, 32, Style.Unit.PX);
        outerLayout.setWidgetTopHeight(bottom, 36, Style.Unit.PX, 44, Style.Unit.PX);

        top.add(logo);
        top.setWidgetLeftWidth(logo, 15, Style.Unit.PX, 700, Style.Unit.PX);
        top.setWidgetTopHeight(logo, 0, Style.Unit.PX, 32, Style.Unit.PX);

        bottom.add(links);

        // Debug tools
        VerticalPanel debugTools = new VerticalPanel();

        if(!GWT.isScript())
        {
            HTML rbac = new HTML("<i title='RBAC Diagnostics' style='cursor:pointer;color:#cecece;font-size:30px;font-weight:normal!important' class='icon-eye-open'></i>");
            debugTools.add(rbac);

            rbac.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    RBACContextView.launch();
                }
            });
        }

        bottom.add(debugTools);
        bottom.setWidgetLeftWidth(links, 0, Style.Unit.PX, 500, Style.Unit.PX);
        bottom.setWidgetTopHeight(links, 0, Style.Unit.PX, 44, Style.Unit.PX);

        bottom.setWidgetRightWidth(debugTools, 0, Style.Unit.PX, 50, Style.Unit.PX);
        bottom.setWidgetTopHeight(debugTools, 0, Style.Unit.PX, 44, Style.Unit.PX);


        HorizontalPanel tools = new HorizontalPanel();

View Full Code Here

        this.productConfig = prodConfig;
        this.context = context;
    }

    public Widget asWidget() {
        final LayoutPanel layout = new LayoutPanel();
        final PopupPanel toolsPopup = new DefaultPopup(DefaultPopup.Arrow.BOTTOM);
        final List<String[]> toolReference = new ArrayList<String[]>();

        if(context.isSuperUser()) {
            toolReference.add(new String[]{"Management Model", "browser"});
        }

        toolReference.add(new String[]{"Expression Resolver", "expressions"});
        if (diagnostics.isEnabled()) {
            toolReference.add(new String[]{"Diagnostics", "debug-panel"});
        }

        // only enabled in dev mode
        if (!GWT.isScript()) {
            toolReference.add(new String[]{"Modelling", "mbui-workbench"});
            toolReference.add(new String[]{"Resource Access", "access-log"});
        }

        final VerticalPanel toolsList = new VerticalPanel();
        toolsList.getElement().setAttribute("width", "160px");
        for(final String[] tool : toolReference)
        {
            InlineLink browser = new InlineLink(tool[0]);
            browser.getElement().setAttribute("style", "margin:4px");
            browser.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent clickEvent) {
                    toolsPopup.hide();
                    placeManager.revealPlace(
                            new PlaceRequest.Builder().nameToken(NameTokens.ToolsPresenter).with("name", tool[1])
                                    .build());
                }
            });
            toolsList.add(browser);
        }
        toolsPopup.setWidget(toolsList);

        final HTML toolsLink = new HTML("<i class='icon-caret-up'></i>&nbsp;"+"Tools");
        toolsLink.addStyleName("footer-link");
        toolsLink.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                int listHeight = toolsList.getWidgetCount() * 25;
                toolsPopup.setPopupPosition(
                        toolsLink.getAbsoluteLeft()-45,
                        toolsLink.getAbsoluteTop()-(listHeight-25)-50
                );
                toolsPopup.setWidth("165");
                toolsPopup.setHeight(listHeight +"");
                toolsPopup.show();
            }
        });

        HTML settings = new HTML("<i class='icon-wrench'></i>&nbsp;"+Console.CONSTANTS.common_label_settings());
        settings.addStyleName("footer-link");
        settings.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                placeManager.revealPlace(
                        new PlaceRequest.Builder().nameToken(NameTokens.SettingsPresenter).build()
                );
            }
        });

        HorizontalPanel tools = new HorizontalPanel();
        tools.add(toolsLink);
        tools.add(settings);
        layout.add(tools);

        PROGRESS_ELEMENT.addStyleName("footer");
        layout.add(PROGRESS_ELEMENT);

        String versionToShow = productConfig.getConsoleVersion();
        if (versionToShow == null) {
            // That's no HAL build - fall back core version
            versionToShow = productConfig.getCoreVersion();
        }
        HTML version = new HTML(versionToShow);
        version.setTitle("Version Information");
        version.addStyleName("footer-link");
        version.getElement().setAttribute("style", "font-size:10px; align:left");
        version.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(final ClickEvent event) {
                final DefaultWindow window = new DefaultWindow("Version Information");
                DialogueOptions options = new DialogueOptions(Console.CONSTANTS.common_label_done(), new ClickHandler() {
                    @Override
                    public void onClick(final ClickEvent event) {
                        window.hide();
                    }
                }, "", new ClickHandler() {
                    @Override
                    public void onClick(final ClickEvent event) {
                        // noop
                    }
                }).showCancel(false);
                window.setWidth(480);
                window.setHeight(360);
                window.trapWidget(new WindowContentBuilder(new ProductConfigPanel().asWidget(), options).build());
                window.setGlassEnabled(true);
                window.center();
            }
        });

        layout.add(version);
        layout.setWidgetLeftWidth(version, 20, PX, 200, PX);
        layout.setWidgetTopHeight(version, 10, PX, 32, PX);

        layout.setWidgetRightWidth(PROGRESS_ELEMENT, 200, PX, 150, PX);
        layout.setWidgetTopHeight(PROGRESS_ELEMENT, 12, PX, 32, PX);

        layout.setWidgetRightWidth(tools, 5, PX, 200, PX);
        layout.setWidgetTopHeight(tools, 10, PX, 32, PX);

        layout.setWidgetHorizontalPosition(tools, Layout.Alignment.END);
        layout.getElement().setAttribute("role", "complementary");

        return layout;
    }
View Full Code Here

    }

    public Widget asWidget() {

        LayoutPanel outerLayout = new LayoutPanel();
        outerLayout.addStyleName("page-header");

        Widget logo = getLogoSection();
        Widget links = getLinksSection();

        LayoutPanel rhs = new LayoutPanel();
        rhs.setStyleName("fill-layout");

        MessageCenterView messageCenterView = new MessageCenterView(messageCenter);
        Widget messageCenter = messageCenterView.asWidget();
        rhs.add(messageCenter);
        rhs.add(links);

        rhs.setWidgetRightWidth(messageCenter, 10, Style.Unit.PX, 100, Style.Unit.PCT);
        rhs.setWidgetRightWidth(links, 10, Style.Unit.PX, 100, Style.Unit.PCT);
        rhs.setWidgetBottomHeight(messageCenter, 27, Style.Unit.PX, 28, Style.Unit.PX);
        rhs.setWidgetBottomHeight(links, 0, Style.Unit.PX, 24, Style.Unit.PX);

        LayoutPanel innerLayout = new LayoutPanel();
        innerLayout.add(logo);
        innerLayout.add(rhs);

        innerLayout.setWidgetLeftWidth(logo, 0, Style.Unit.PX, 50, Style.Unit.PCT);
        innerLayout.setWidgetRightWidth(rhs, 10, Style.Unit.PX, 50, Style.Unit.PCT);
        innerLayout.setWidgetBottomHeight(rhs, 0, Style.Unit.PX, 58, Style.Unit.PX);

        outerLayout.add(innerLayout);

        outerLayout.setWidgetTopHeight(innerLayout, 0, Style.Unit.PX, 58, Style.Unit.PX);
View Full Code Here

        this.productConfig = prodConfig;
    }

    public Widget asWidget() {

        final LayoutPanel layout = new LayoutPanel();
        layout.setStyleName("footer-panel");

        final PopupPanel toolsPopup = new DefaultPopup(DefaultPopup.Arrow.BOTTOM);


        final List<String[]> toolReference = new ArrayList<String[]>();
        toolReference.add(new String[]{"Management Model", "browser"});
        toolReference.add(new String[]{"Expression Resolver", "expressions"});

        if(diagnostics.isEnabled())
        {
            toolReference.add(new String[]{"Diagnostics", "debug-panel"});
        }

        // only enabled in dev mode
        if(!GWT.isScript())
        {
            toolReference.add(new String[] {"Modelling", "mbui-workbench"});
        }

        final VerticalPanel toolsList = new VerticalPanel();
        toolsList.getElement().setAttribute("width", "160px");

        for(final String[] tool : toolReference)
        {
            InlineLink browser = new InlineLink(tool[0]);
            browser.getElement().setAttribute("style", "margin:4px");
            browser.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent clickEvent) {
                    toolsPopup.hide();
                    placeManager.revealPlace(
                            new PlaceRequest(NameTokens.ToolsPresenter).with("name", tool[1])
                    );
                }
            });

            toolsList.add(browser);
        }
        toolsPopup.setWidget(toolsList);

        final HTML toolsLink = new HTML("<i class='icon-caret-up'></i>&nbsp;"+"Tools");
        toolsLink.addStyleName("footer-link");
        toolsLink.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {

                int listHeight = toolsList.getWidgetCount() * 25;

                toolsPopup.setPopupPosition(
                        toolsLink.getAbsoluteLeft()-45,
                        toolsLink.getAbsoluteTop()-(listHeight-25)-50

                );

                toolsPopup.setWidth("165");
                toolsPopup.setHeight(listHeight +"");

                toolsPopup.show();
            }
        });

        HTML settings = new HTML("<i class='icon-wrench'></i>&nbsp;"+Console.CONSTANTS.common_label_settings());
        settings.addStyleName("footer-link");
        settings.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                placeManager.revealPlace(
                        new PlaceRequest(NameTokens.SettingsPresenter)
                );
            }
        });


        HTML logout = new HTML("<i class='icon-signout'></i>&nbsp;"+Console.CONSTANTS.common_label_logout());
        logout.addStyleName("footer-link");
        logout.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                Feedback.confirm(
                        Console.CONSTANTS.common_label_logout(),
                        Console.CONSTANTS.logout_confirm(),
                        new Feedback.ConfirmationHandler() {
                            @Override
                            public void onConfirmation(boolean isConfirmed) {
                                if(isConfirmed)
                                {
                                    new LogoutCmd().execute();
                                }
                            }
                        }
                );

            }
        });


        HorizontalPanel tools = new HorizontalPanel();
        tools.add(toolsLink);
        tools.add(settings);
        tools.add(logout);

        layout.add(tools);

        HTML version = new HTML(productConfig.getCoreVersion());
        version.getElement().setAttribute("style", "color:#ffffff;font-size:10px; align:left");
        layout.add(version);

        layout.setWidgetLeftWidth(version, 20, Style.Unit.PX, 200, Style.Unit.PX);
        layout.setWidgetTopHeight(version, 3, Style.Unit.PX, 16, Style.Unit.PX);

        layout.setWidgetRightWidth(tools, 5, Style.Unit.PX, 500, Style.Unit.PX);
        layout.setWidgetTopHeight(tools, 2, Style.Unit.PX, 28, Style.Unit.PX);

        layout.setWidgetHorizontalPosition(tools, Layout.Alignment.END);

        layout.getElement().setAttribute("role", "complementary");

        return layout;
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.LayoutPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.