Example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

List of usage examples for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

Introduction

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

Prototype

private HTMLPanel(Element elem) 

Source Link

Document

Construct a new HTMLPanel with the specified element.

Usage

From source file:org.geosdi.maplite.client.widget.MapLiteGetFeatureInfoTool.java

public void addGetFeatureInfoToWMS(WMS wmsLayer) {
    WMSGetFeatureInfo wmsGetFeatureInfo = FeatureInfoControlFactory.createControl(wmsLayer);
    wmsGetFeatureInfo.addGetFeatureListener(new GetFeatureInfoListener() {
        ///*from   w  w  w  . j a va 2 s  .c om*/
        @Override
        public void onGetFeatureInfo(final GetFeatureInfoListener.GetFeatureInfoEvent eventObject) {
            try {
                Scheduler.get().scheduleDeferred(new Command() {
                    @Override
                    public void execute() {

                        logger.info("...GetFeatureInfo executing...");
                        if (textContainsNotEmptyHTMLBody(eventObject.getText())) {
                            logger.info("*** GetFeatureInfo has a not empty body");
                            try {
                                getFeatureInfoVerticalPanel.add(new HTMLPanel(eventObject.getText()));
                                if (!getFeatureInfoPanel.isVisible()) {
                                    getFeatureInfoPanel.setVisible(true);
                                    getFeatureInfoPanel.center();
                                }
                            } catch (Exception e) {
                                logger.warning("**** ERROR on adding getFeatureInfo to the showing panel: "
                                        + e.toString());
                            }
                        }
                        logger.finer("...GetFeatureInfo getFeatures...: " + eventObject.getFeatures());
                        logger.finer("...GetFeatureInfo getText...: " + eventObject.getText());
                        checkLastElement();
                    }
                });
            } catch (Exception e) {
                logger.warning("Error in getFeatureInfo: " + e);
            }
        }
    });
    map.addControl(wmsGetFeatureInfo);
    this.wMSGetFeatureInfos.add(wmsGetFeatureInfo);
    wmsGetFeatureInfo.activate();
}

From source file:org.jboss.as.console.client.Console.java

License:Apache License

public void onModuleLoad2() {

    // load console css bundle
    ConsoleResources.INSTANCE.css().ensureInjected();

    // display the loading panel
    final Widget loadingPanel = new LoadingPanel().asWidget();
    RootLayoutPanel.get().add(loadingPanel);

    GWT.runAsync(new RunAsyncCallback() {
        public void onFailure(Throwable caught) {
            Window.alert("Failed to load application components!");
        }/*from  w ww .  j  av  a 2  s .  c o m*/

        public void onSuccess() {
            DelayedBindRegistry.bind(MODULES);

            // ordered bootstrap
            final BootstrapProcess bootstrap = new BootstrapProcess();

            bootstrap.addHook(new ExecutionMode(MODULES.getBootstrapContext(), MODULES.getDispatchAsync()));
            bootstrap.addHook(new RegisterSubsystems(MODULES.getSubsystemRegistry()));
            bootstrap.addHook(new ChoseProcessor(MODULES.getBootstrapContext()));
            bootstrap.addHook(
                    new EagerLoadProfiles(MODULES.getProfileStore(), MODULES.getCurrentSelectedProfile()));
            bootstrap.addHook(new RemoveLoadingPanel(loadingPanel));
            bootstrap.addHook(new LoadMainApp(MODULES.getBootstrapContext(), MODULES.getPlaceManager(),
                    MODULES.getTokenFormatter()));

            // viz can be loaded in background ...
            //bootstrap.addHook(new LoadGoogleViz());

            bootstrap.execute(new AsyncCallback<Boolean>() {
                @Override
                public void onFailure(Throwable caught) {
                    error("Bootstrap failed", caught.getMessage());
                }

                @Override
                public void onSuccess(Boolean wasSuccessfull) {
                    if (!wasSuccessfull) {
                        // currently we only deal with authentication errors
                        RootLayoutPanel.get().remove(loadingPanel);

                        String cause = "";
                        if (MODULES.getBootstrapContext().getLastError() != null)
                            cause = MODULES.getBootstrapContext().getLastError().getMessage();

                        HTMLPanel explanation = new HTMLPanel(
                                "<center><div style='padding-top:150px;'><h2>The web console could not be loaded.</h2>"
                                        + cause + "</div></center>");
                        RootLayoutPanel.get().add(explanation);
                    }

                }
            });
        }

    });
}

From source file:org.jboss.as.console.client.core.Header.java

License:Open Source License

private Widget getLinksSection() {
    linksPane = new HTMLPanel(createLinks());
    linksPane.getElement().setId("header-links-section");
    linksPane.getElement().setAttribute("role", "menubar");
    linksPane.getElement().setAttribute("aria-controls", "main-content-area");

    String[][] sections = bootstrap.isStandalone() ? SECTIONS_STANADLONE : SECTIONS;

    for (String[] section : sections) {
        final String name = section[0];
        final String id = "header-" + name;

        SafeHtmlBuilder html = new SafeHtmlBuilder();
        html.appendHtmlConstant("<div class='header-link-label'>");
        html.appendHtmlConstant("<span role='menuitem'>");
        html.appendHtmlConstant(section[1]);
        html.appendHtmlConstant("</span>");
        html.appendHtmlConstant("</div>");
        HTML widget = new HTML(html.toSafeHtml());
        widget.setStyleName("fill-layout");

        widget.addClickHandler(new ClickHandler() {
            @Override/*from   w  ww . jav a2s. com*/
            public void onClick(ClickEvent event) {
                placeManager.revealPlace(new PlaceRequest(name));
            }
        });
        linksPane.add(widget, id);

    }

    //subnavigation = createSubnavigation();
    //linksPane.add(subnavigation, "subnavigation");

    return linksPane;
}

From source file:org.jboss.as.console.client.domain.topology.HtmlGenerator.java

License:Open Source License

HTMLPanel createPanel() {
    return new HTMLPanel(this.toSafeHtml().asString());
}

From source file:org.jboss.as.console.client.shared.homepage.ContentBox.java

License:Open Source License

public ContentBox(final String id, final String title, final SafeHtml body, final String linkTitle,
        final String linkTarget) {

    dp = new DisclosurePanel();
    dp.setHeader(new HTML(TEMPLATES.header(IdHelper.asId(id + "_", getClass(), "_" + "header"), title)));
    dp.addOpenHandler(this);
    dp.addCloseHandler(this);
    dp.setOpen(true);//from  w w  w  .  ja v a 2 s .com

    String linkId = IdHelper.asId(id + "_", getClass(), "_" + "link");
    HTMLPanel panel = new HTMLPanel(TEMPLATES.body(body, linkId));
    panel.addStyleName("homepage-content-box-body");
    InlineHyperlink hyperlink = new InlineHyperlink(linkTitle, linkTarget);
    hyperlink.addStyleName("homepage-link");
    panel.add(hyperlink, linkId);
    dp.add(panel);

    initWidget(dp);
    setStyleName("homepage-content-box");
}

From source file:org.jboss.as.console.client.shared.homepage.ContentBox.java

License:Open Source License

public ContentBox(final String id, final String title, final SafeHtml body, Widget widget) {

    dp = new DisclosurePanel();
    dp.setHeader(new HTML(TEMPLATES.header(IdHelper.asId(id + "_", getClass(), "_" + "header"), title)));
    dp.addOpenHandler(this);
    dp.addCloseHandler(this);
    dp.setOpen(true);//from  w ww  .j  a va2 s. c  om

    String linkId = HTMLPanel.createUniqueId();
    HTMLPanel panel = new HTMLPanel(TEMPLATES.body(body, linkId));
    panel.addStyleName("homepage-content-box-body");
    panel.add(widget, linkId);
    dp.add(panel);

    initWidget(dp);
    setStyleName("homepage-content-box");
}

From source file:org.jboss.as.console.client.shared.homepage.InfoBox.java

License:Open Source License

public InfoBox(final String token, final String title, final String description,
        final ClickHandler clickHandler) {
    String linkId = IdHelper.asId(getClass(), "_" + token);
    HTMLPanel panel = new HTMLPanel(TEMPLATES.infoBox(linkId, description));
    panel.getElement().setId(IdHelper.asId(getClass(), "_info-box"));
    panel.addStyleName("homepage-info-box");
    Widget link;/*from  w w  w .  ja  v a2s . c o m*/
    if (clickHandler != null) {
        Anchor anchor = new Anchor(title);
        anchor.addClickHandler(clickHandler);
        link = anchor;
    } else {
        link = new InlineHyperlink(title, token);
    }
    link.addStyleName("homepage-link");
    panel.add(link, linkId);

    initWidget(panel);
}

From source file:org.jboss.as.console.client.shared.patching.wizard.apply.AppliedFailedStep.java

License:Open Source License

@Override
protected IsWidget body(final ApplyContext context) {
    FlowPanel body = new FlowPanel();
    body.add(new HTML(TEMPLATES.errorPanel(Console.CONSTANTS.patch_manager_apply_error_body())));

    errorDetails = new ErrorDetails(Console.CONSTANTS.patch_manager_show_details(),
            Console.CONSTANTS.patch_manager_hide_details());
    body.add(errorDetails);/*  ww w. j  ava2s. c  o  m*/

    body.add(new HTML("<h3 class=\"patch-followup-header\">"
            + Console.CONSTANTS.patch_manager_possible_actions() + "</h3>"));
    HTMLPanel actions = new HTMLPanel(
            TEMPLATES.appliedFailed(Console.CONSTANTS.patch_manager_apply_error_cancel_title(),
                    Console.CONSTANTS.patch_manager_apply_error_cancel_body(),
                    Console.CONSTANTS.patch_manager_apply_error_select_title(),
                    Console.CONSTANTS.patch_manager_apply_error_select_body()));
    selectPatch = new DefaultButton(Console.CONSTANTS.patch_manager_select_patch_title());
    selectPatch.getElement().setAttribute("style", "min-width:60px;");
    selectPatch.addStyleName("primary");
    actions.add(selectPatch, "select-different-patch");
    body.add(actions);

    return body;
}

From source file:org.jboss.as.console.client.shared.patching.wizard.apply.ConflictStep.java

License:Open Source License

@Override
protected IsWidget body(final ApplyContext context) {
    FlowPanel body = new FlowPanel();
    body.add(new HTML(TEMPLATES.errorPanel(Console.CONSTANTS.patch_manager_conflict_body())));

    errorDetails = new ErrorDetails(Console.CONSTANTS.patch_manager_show_details(),
            Console.CONSTANTS.patch_manager_hide_details());
    body.add(errorDetails);/*from  w  w  w  . j  a v  a2 s .  c om*/

    body.add(new HTML("<h3 class=\"patch-followup-header\">"
            + Console.CONSTANTS.patch_manager_possible_actions() + "</h3>"));
    HTMLPanel actions = new HTMLPanel(
            TEMPLATES.patchConflicts(Console.CONSTANTS.patch_manager_conflict_cancel_title(),
                    Console.CONSTANTS.patch_manager_conflict_cancel_body(),
                    Console.MESSAGES.patch_manager_conflict_override_title(),
                    Console.CONSTANTS.patch_manager_conflict_override_body()));
    overrideCheck = new CheckBox(Console.CONSTANTS.patch_manager_conflict_override_check());
    overrideCheck.getElement().setId(asId(PREFIX, getClass(), "_Override"));
    overrideCheck.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(final ValueChangeEvent<Boolean> event) {
            setEnabled(event.getValue(), true);
        }
    });
    actions.add(overrideCheck, "patch-conflict-override");
    body.add(actions);

    return body;
}

From source file:org.jboss.as.console.client.shared.patching.wizard.rollback.RollbackFailedStep.java

License:Open Source License

@Override
protected IsWidget body(final RollbackContext context) {
    FlowPanel body = new FlowPanel();
    body.add(new HTML(TEMPLATES.errorPanel(Console.CONSTANTS.patch_manager_rollback_error_body())));

    errorDetails = new ErrorDetails(Console.CONSTANTS.patch_manager_show_details(),
            Console.CONSTANTS.patch_manager_hide_details());
    body.add(errorDetails);//from  w w  w . j  a v  a 2 s . c o  m

    body.add(new HTML("<h3 class=\"patch-followup-header\">"
            + Console.CONSTANTS.patch_manager_possible_actions() + "</h3>"));
    HTMLPanel actions = new HTMLPanel(
            TEMPLATES.rollbackFailed(Console.CONSTANTS.patch_manager_rollback_error_cancel_title(),
                    Console.CONSTANTS.patch_manager_rollback_error_cancel_body(),
                    Console.CONSTANTS.patch_manager_rollback_error_select_title(),
                    Console.CONSTANTS.patch_manager_rollback_error_select_body()));
    chooseOptions = new DefaultButton(Console.CONSTANTS.patch_manager_rollback_options_title());
    chooseOptions.getElement().setAttribute("style", "min-width:60px;");
    chooseOptions.addStyleName("primary");
    actions.add(chooseOptions, "choose-options");
    body.add(actions);

    return body;
}