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

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


    public HostMgmtView() {

        layout = new SplitLayoutPanel(10);

        contentCanvas = new LayoutPanel();
        lhsNavigation = new LHSHostsNavigation();

        layout.addWest(lhsNavigation.asWidget(), 197);
        layout.add(contentCanvas);
View Full Code Here


    public DomainRuntimeView() {
        super();

        layout = new SplitLayoutPanel(10);

        contentCanvas = new LayoutPanel();
        lhsNavigation = new DomainRuntimeNavigation();

        Widget nav = lhsNavigation.asWidget();
        nav.getElement().setAttribute("role", "navigation");
View Full Code Here

    }

    public Widget asWidget() {

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

        Widget logo = getProductSection();
        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"});
            toolReference.add(new String[] {"Resource Access", "access-log"});
            StringBuilder runAsRole = new StringBuilder("Run as");
            if (Preferences.has(RUN_AS_ROLE)) {
                runAsRole.append(" ").append(Preferences.get(RUN_AS_ROLE));
            } else {
                runAsRole.append("...");
            }
            toolReference.add(new String[] {runAsRole.toString(), "run-as-role"});
        }

        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:11px; align:left");
        layout.add(version);

        String userHtml = "<i class='icon-user'></i>&nbsp;"+Console.getBootstrapContext().getPrincipal();
        String roleHtml = "<i class='icon-tag'></i>&nbsp;"+Console.getBootstrapContext().getRole();

        HTML principal = new HTML(userHtml+"&nbsp;|&nbsp;"+roleHtml);
        principal.getElement().setAttribute("style", "color:#ffffff;font-size:11px; align:left");
        layout.add(principal);

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

        layout.setWidgetLeftWidth(principal, 210, Style.Unit.PX, 300, Style.Unit.PX);
        layout.setWidgetTopHeight(principal, 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

    @Inject
    public MainLayoutViewImpl(Header header, Footer footer, MessageCenter messageCenter) {

        this.messageCenter = messageCenter;

        mainContentPanel = new LayoutPanel();
        mainContentPanel.setStyleName("main-content-panel");

        // see http://www.w3.org/TR/wai-aria/states_and_properties#aria-live
        mainContentPanel.getElement().setAttribute("role", "region");
        mainContentPanel.getElement().setAttribute("aria-live", "polite");
        mainContentPanel.getElement().setId("main-content-area");

        headerPanel = new LayoutPanel();
        headerPanel.setStyleName("header-panel");

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

        panel = new DockLayoutPanel(Style.Unit.PX);
        panel.getElement().setAttribute("id", "container");
View Full Code Here

  public void onModuleLoad() {
    projectService = GWT.create(ProjectRpc.class);
    userService = GWT.create(UserRpc.class);
    dataService = GWT.create(DataRpc.class);

    contentPanel = new LayoutPanel();
    RootLayoutPanel.get().add(contentPanel);

    // Handle history changes. (Such as clicking a navigation hyperlink.)
    History.addValueChangeHandler(new ValueChangeHandler<String>() {
      @Override
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

    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

        this.presenter = presenter;
    }

    @Override
    public Widget createWidget() {
        LayoutPanel layout = new LayoutPanel();

        FakeTabPanel titleBar = new FakeTabPanel("Transactions");
        layout.add(titleBar);

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

        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);

        panel.add(new ContentHeaderLabel("Transaction Manager"));
        panel.add(new ContentDescription(Console.CONSTANTS.subys_tx_desc()));

        // -----
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.