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

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

Introduction

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

Prototype

protected HTML(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:com.gmail.cjbooms.thesis.pythonappengine.client.menus.git.GitCloneDialogWidget.java

License:Open Source License

private static HTML createHtmlContent() {
    StringBuilder sb = new StringBuilder();
    sb.append("<p>");
    sb.append("This is the GIT Clone Dialog, Replace with input text Boxes :");
    return new HTML(sb.toString());
}

From source file:com.gmail.cjbooms.thesis.pythonappengine.client.menus.HelpDialogWidget.java

License:Open Source License

private static HTML createHtmlContent() {
    StringBuilder sb = new StringBuilder();
    sb.append("<p>");
    sb.append("This is a simple Online File Manager, it has been built on top of Google Web Toolkit."
            + "It has some basic functionalties :");
    sb.append("</p>");
    sb.append("<ul>");
    sb.append("<li>").append("Tree structure view of the file system.").append("</li>");
    sb.append("<li>").append("Deleting files and directories.").append("</li>");
    sb.append("<li>").append("Creating new Directories.").append("</li>");
    sb.append("</ul>");
    return new HTML(sb.toString());
}

From source file:com.gmail.cjbooms.thesis.pythonappengine.client.menus.OperationResultDialog.java

License:Open Source License

private HTML createHtmlContent(String message) {
    StringBuilder sb = new StringBuilder();
    sb.append("<p>");
    sb.append(message);//w  w  w  .  j  a v a2s.c  om
    return new HTML(sb.toString());
}

From source file:com.goodow.wave.client.account.ContactPanel.java

License:Apache License

@Inject
ContactPanel(final SearchBox searchBox) {
    this.searchBox = searchBox;
    WaveTitle waveTitle = this.getWaveTitle();
    waveTitle.setText("?");
    searchBox.getTextBox().getElement().setAttribute("placeholder", "?");

    uiBinder.createAndBindUi(this);
    picture.appendChild(createIcon(res.unknown()));
    root.addStyleName(WavePanelResources.css().waveHeader());
    waveSearch.add(searchBox);//from  w  w  w .j  a va2 s.com
    this.add(root);

    FlowPanel toDo = new FlowPanel();
    toDo.addStyleName(WavePanelResources.css().waveWarning());
    toDo.add(new HTML("<b>?<b>"));
    toDo.add(new Label("11.1 ???"));
    toDo.add(new HTML("<br>"));
    toDo.add(new HTML("<b><b>"));
    toDo.add(new Label("11.2 ?"));
    toDo.add(new Label("11.3 ?"));
    toDo.add(new Label("11.4 ??"));
    toDo.add(new Label("11.5 ?"));
    toDo.add(new Label("11.6  "));
    add(toDo);

    waveContented.addStyleName(WavePanelResources.css().waveContent());
    picture_Content.appendChild(createIcon(res.waveContactContent()));
    this.add(waveContented);
    waveFootered.addStyleName(WavePanelResources.css().waveFooter());
    waveFootered.getElement().getStyle().setProperty("padding", "6px 5px 6px 7px");
    Hyperlink link = new Hyperlink("??", "#");
    tagLink.add(link);
    this.add(waveFootered);

}

From source file:com.google.appinventor.client.editor.blocks.BlocklyPanel.java

License:Open Source License

/**
 * Create a Dialog Box. We call this from Javascript (blockly) to
 * display a dialog box.  We do this here because we can get calls
 * from the blocklyframe when it is not visible.  Because we are in
 * the parent window, we can display dialogs that will be visible
 * even when the blocklyframe is not visible.
 *
 * @param title      Title for the Dialog Box
 * @param mess       The message to display
 * @param buttonName The string to display in the "OK" button.
 * @param size       0 or 1. 0 makes a smaller box 1 makes a larger box.
 * @param callback   an opague JavaScriptObject that contains the
 *                   callback function provided by the Javascript code.
 * @return The created dialog box.//from   ww w .j  a  va2 s  . c o m
 */

public static DialogBox createDialog(String title, String mess, final String buttonName,
        final String cancelButtonName, int size, final JavaScriptObject callback) {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setStylePrimaryName("ode-DialogBox");
    dialogBox.setText(title);
    if (size == 0) {
        dialogBox.setHeight("150px");
    } else {
        dialogBox.setHeight("400px");
    }
    dialogBox.setWidth("400px");
    dialogBox.setGlassEnabled(true);
    dialogBox.setAnimationEnabled(true);
    dialogBox.center();
    VerticalPanel DialogBoxContents = new VerticalPanel();
    HTML message = new HTML(mess);
    HorizontalPanel holder = new HorizontalPanel();
    if (buttonName != null) { // If buttonName and cancelButtonName are null
        Button ok = new Button(buttonName); // We won't have any buttons and other
        ok.addClickHandler(new ClickHandler() { // code is needed to dismiss us
            @Override
            public void onClick(ClickEvent event) {
                doCallBack(callback, buttonName);
            }
        });
        holder.add(ok);
    }
    if (cancelButtonName != null) {
        Button cancel = new Button(cancelButtonName);
        cancel.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                doCallBack(callback, cancelButtonName);
            }
        });
        holder.add(cancel);
    }
    DialogBoxContents.add(message);
    DialogBoxContents.add(holder);
    dialogBox.setWidget(DialogBoxContents);
    terminateDrag(); // cancel a drag before showing the modal dialog
    dialogBox.show();
    return dialogBox;
}

From source file:com.google.appinventor.client.editor.simple.components.MockComponent.java

License:Open Source License

/**
 * Constructs a tree item for the component which will be displayed in the
 * source structure explorer./*from   w  w  w  . jav a2s.  co  m*/
 *
 * @return  tree item for this component
 */
protected TreeItem buildTree() {
    // Instantiate new tree item for this component
    // Note: We create a ClippedImagePrototype because we need something that can be
    // used to get HTML for the iconImage. AbstractImagePrototype requires
    // an ImageResource, which we don't necessarily have.
    String imageHTML = new ClippedImagePrototype(iconImage.getUrl(), iconImage.getOriginLeft(),
            iconImage.getOriginTop(), ICON_IMAGE_WIDTH, ICON_IMAGE_HEIGHT).getHTML();
    TreeItem itemNode = new TreeItem(new HTML("<span>" + imageHTML + getName() + "</span>"));
    itemNode.setUserObject(sourceStructureExplorerItem);
    return itemNode;
}

From source file:com.google.appinventor.client.editor.youngandroid.BlocklyPanel.java

License:Open Source License

/**
 * Create a Dialog Box. We call this from Javascript (blockly) to
 * display a dialog box.  We do this here because we can get calls
 * from the blocklyframe when it is not visible.  Because we are in
 * the parent window, we can display dialogs that will be visible
 * even when the blocklyframe is not visible.
 *
 * @param title      Title for the Dialog Box
 * @param mess       The message to display
 * @param buttonName The string to display in the "OK" button.
 * @param size       0 or 1. 0 makes a smaller box 1 makes a larger box.
 * @param callback   an opague JavaScriptObject that contains the
 *                   callback function provided by the Javascript code.
 * @return The created dialog box./*from  ww w  .j a v  a 2 s  .c o  m*/
 */

public static DialogBox createDialog(String title, String mess, final String buttonName,
        final String cancelButtonName, int size, final JavaScriptObject callback) {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setStylePrimaryName("ode-DialogBox");
    dialogBox.setText(title);
    if (size == 0) {
        dialogBox.setHeight("150px");
    } else {
        dialogBox.setHeight("400px");
    }
    dialogBox.setWidth("400px");
    dialogBox.setGlassEnabled(true);
    dialogBox.setAnimationEnabled(true);
    dialogBox.center();
    VerticalPanel DialogBoxContents = new VerticalPanel();
    HTML message = new HTML(mess);
    message.setStyleName("DialogBox-message");
    HorizontalPanel holder = new HorizontalPanel();
    if (buttonName != null) { // If buttonName and cancelButtonName are null
        Button ok = new Button(buttonName); // We won't have any buttons and other
        ok.addClickListener(new ClickListener() { // code is needed to dismiss us
            public void onClick(Widget sender) {
                doCallBack(callback, buttonName);
            }
        });
        holder.add(ok);
    }
    if (cancelButtonName != null) {
        Button cancel = new Button(cancelButtonName);
        cancel.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                doCallBack(callback, cancelButtonName);
            }
        });
        holder.add(cancel);
    }
    DialogBoxContents.add(message);
    DialogBoxContents.add(holder);
    dialogBox.setWidget(DialogBoxContents);
    dialogBox.show();
    return dialogBox;
}

From source file:com.google.appinventor.client.editor.youngandroid.TutorialPanel.java

License:Open Source License

/**
 * Creates video on page!/* w  ww  .  j a  va2s.  co  m*/
 */
private static void createVideoDialog(String tutorialId) {
    // Create the UI elements of the DialogBox
    final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal)
    dialogBox.setStylePrimaryName("ode-DialogBox");
    dialogBox.setText("Tutorial Video");
    dialogBox.setGlassEnabled(true);
    dialogBox.setAnimationEnabled(true);
    VerticalPanel DialogBoxContents = new VerticalPanel();
    // Adds Youtube Video
    HTML message = new HTML("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/"
            + tutorialId + "?rel=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>");
    message.setStyleName("DialogBox-message");
    FlowPanel holder = new FlowPanel();
    Button ok = new Button("Close");
    ok.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            dialogBox.hide();
        }
    });
    ok.setStyleName("DialogBox-button");
    holder.add(ok);
    DialogBoxContents.add(message);
    DialogBoxContents.add(holder);
    dialogBox.setWidget(DialogBoxContents);
    dialogBox.center();
    dialogBox.show();
}

From source file:com.google.appinventor.client.explorer.youngandroid.AssetList.java

License:Open Source License

private void refreshAssetList() {
    OdeLog.log("AssetList: refreshing for project " + projectId);
    assetList.clear();/*  w  w  w .  j  a v  a 2s  .  com*/

    if (assetsFolder != null) {
        for (ProjectNode node : assetsFolder.getChildren()) {
            // Add the name to the tree. We need to enclose it in a span
            // because the CSS style for selection specifies a span.
            String nodeName = node.getName();
            if (nodeName.length() > 20)
                nodeName = nodeName.substring(0, 8) + "..."
                        + nodeName.substring(nodeName.length() - 9, nodeName.length());
            TreeItem treeItem = new TreeItem(new HTML("<span>" + nodeName + "</span>"));
            // keep a pointer from the tree item back to the actual node
            treeItem.setUserObject(node);
            assetList.addItem(treeItem);
        }
    }
}

From source file:com.google.appinventor.client.explorer.youngandroid.GalleryList.java

License:Open Source License

/**
 * Creates a new GalleryList// w w w . j ava 2  s  .  co m
 */
public GalleryList() {

    gallery = GalleryClient.getInstance();
    gallery.addListener(this);
    galleryGF = new GalleryGuiFactory();

    selectedApps = new ArrayList<GalleryApp>();

    // Initialize UI
    galleryGUI = new FlowPanel();
    galleryGUI.addStyleName("gallery");
    appTabs = new TabPanel();
    appRecent = new FlowPanel();
    appFeatured = new FlowPanel();
    appPopular = new FlowPanel();
    appSearch = new FlowPanel();
    appTutorial = new FlowPanel();
    appRecentContent = new FlowPanel();
    appFeaturedContent = new FlowPanel();
    appPopularContent = new FlowPanel();
    appSearchContent = new FlowPanel();
    appTutorialContent = new FlowPanel();
    searchText = new TextBox();

    // HTML segment for gallery typeface
    HTML headerExtra = new HTML("<link href='http://fonts.googleapis.com/css?"
            + "family=Roboto:400,300,100' rel='stylesheet' type='text/css'>");
    galleryGUI.add(headerExtra);

    // Add content to panels
    appFeaturedTab = new GalleryAppTab(appFeatured, appFeaturedContent, REQUEST_FEATURED);
    appRecentTab = new GalleryAppTab(appRecent, appRecentContent, REQUEST_RECENT);
    appSearchTab = new GalleryAppTab(appSearch, appSearchContent, REQUEST_SEARCH);
    appPopularTab = new GalleryAppTab(appPopular, appPopularContent, REQUEST_MOSTLIKED);
    appTutorialTab = new GalleryAppTab(appTutorial, appTutorialContent, REQUEST_TUTORIAL);
    // don't think we need because in regular addgallerytab below

    // Add panels to main tabPanel
    appTabs.add(appRecent, "Recent");
    appTabs.add(appTutorial, "Tutorials");
    appTabs.add(appFeatured, "Featured");
    appTabs.add(appPopular, "Popular");
    appTabs.add(appSearch, "Search");
    appTabs.selectTab(0);
    appTabs.addStyleName("gallery-app-tabs");
    galleryGUI.add(appTabs);

    // Initialize top-level GUI
    VerticalPanel panel = new VerticalPanel();
    panel.setWidth("100%");
    panel.add(galleryGUI);

    initWidget(panel);
}