Java Code Examples for com.google.gwt.user.client.ui.HTML

The following examples show how to use com.google.gwt.user.client.ui.HTML. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: unitime   Source File: WebTable.java    License: Apache License 2.0 6 votes vote down vote up
public IconsCell add(ImageResource resource, final String title, final boolean html) {
	if (resource == null) return this;
	Image icon = new Image(resource);
	String text = title;
	if (html) { HTML h = new HTML(title); text = h.getText(); }
	icon.setTitle(text);
	icon.setAltText(text);
	if (iPanel.getWidgetCount() > 0)
		icon.getElement().getStyle().setMarginLeft(3, Unit.PX);
	iPanel.add(icon);
	iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
	if (title != null && !title.isEmpty()) {
		icon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title, html);
			}
		});
	}
	return this;
}
 
Example 2
Source Project: incubator-retired-wave   Source File: EditorHarness.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Output content for and editor
 */
private void outputEditorState(final Editor editor,
    final HTML prettyContent, final HTML prettyHtml) {
  Runnable printer = new Runnable() {
    public void run() {
      if (!quiet) {
        String content = EditorDocFormatter.formatContentDomString(editor);
        String html = EditorDocFormatter.formatImplDomString(editor);
        if (content != null) {
          prettyContent.setText(content);
        }
        if (html != null) {
          prettyHtml.setText(html);
        }
      }
    }
  };

  if (LogLevel.showDebug()) {
    // Flush and update once it's safe
    if (editor.getContent().flush(printer)) {
      printer.run(); // note that if true is returned, the command isn't run inside flush.
    }
  }
}
 
Example 3
Source Project: appinventor-extensions   Source File: GalleryPage.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Helper method called by constructor to initialize the report section
 */
private void initAppShare() {
  final HTML sharePrompt = new HTML();
  sharePrompt.setHTML(MESSAGES.gallerySharePrompt());
  sharePrompt.addStyleName("primary-prompt");
  final TextBox urlText = new TextBox();
  urlText.addStyleName("action-textbox");
  urlText.setText(Window.Location.getHost() + MESSAGES.galleryGalleryIdAction() + app.getGalleryAppId());
  urlText.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      urlText.selectAll();
    }
  });
  appSharePanel.add(sharePrompt);
  appSharePanel.add(urlText);
}
 
Example 4
Source Project: appinventor-extensions   Source File: OdeLog.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new output panel for displaying internal messages.
 */
private OdeLog() {
  // Initialize UI
  Button clearButton = new Button(MESSAGES.clearButton());
  clearButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      clear();
    }
  });

  text = new HTML();
  text.setWidth("100%");

  VerticalPanel panel = new VerticalPanel();
  panel.add(clearButton);
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 5
Source Project: appinventor-extensions   Source File: BlockSelectorBox.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a tree item for built-in blocks.
 *
 * @return tree item
 */
public TreeItem getBuiltInBlocksTree(MockForm form) {
  initBundledImages();
  TreeItem builtinNode = new TreeItem(new HTML("<span>" + MESSAGES.builtinBlocksLabel()
      + "</span>"));
  for (final String drawerName : getSubsetDrawerNames(form)) {
    Image drawerImage = new Image(bundledImages.get(drawerName));
    TreeItem itemNode = new TreeItem(new HTML("<span>" + drawerImage
        + getBuiltinDrawerNames(drawerName) + "</span>"));
    SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
      @Override
      public void onSelected() {
        fireBuiltinDrawerSelected(drawerName);
      }
    };
    itemNode.setUserObject(sourceItem);
    builtinNode.addItem(itemNode);
  }
  builtinNode.setState(true);
  return builtinNode;
}
 
Example 6
Source Project: appinventor-extensions   Source File: BlockSelectorBox.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a tree item for generic ("Advanced") component blocks for
 * component types that appear in form.
 *
 * @param form
 *          only component types that appear in this Form will be included
 * @return tree item for this form
 */
public TreeItem getGenericComponentsTree(MockForm form) {
  Map<String, String> typesAndIcons = Maps.newHashMap();
  form.collectTypesAndIcons(typesAndIcons);
  TreeItem advanced = new TreeItem(new HTML("<span>" + MESSAGES.anyComponentLabel() + "</span>"));
  List<String> typeList = new ArrayList<String>(typesAndIcons.keySet());
  Collections.sort(typeList);
  for (final String typeName : typeList) {
    TreeItem itemNode = new TreeItem(new HTML("<span>" + typesAndIcons.get(typeName)
        + MESSAGES.textAnyComponentLabel()
        + ComponentsTranslation.getComponentName(typeName) + "</span>"));
    SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
      @Override
      public void onSelected() {
        fireGenericDrawerSelected(typeName);
      }
    };
    itemNode.setUserObject(sourceItem);
    advanced.addItem(itemNode);
  }
  return advanced;
}
 
Example 7
Source Project: appinventor-extensions   Source File: MockComponent.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a tree item for the component which will be displayed in the
 * source structure explorer.
 *
 * @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.
  TreeItem itemNode = new TreeItem(
      new HTML("<span>" + iconImage.getElement().getString() + SafeHtmlUtils.htmlEscapeAllowEntities(getName()) + "</span>")) {
    @Override
    protected Focusable getFocusable() {
      return nullFocusable;
    }
  };
  itemNode.setUserObject(sourceStructureExplorerItem);
  return itemNode;
}
 
Example 8
@Override
public void setPreview(final SafeHtml html) {

    if(locked) return;

    if (
            (contentCanvas.getWidgetCount()>0  && !contentCanvas.getElement().hasAttribute("presenter-view"))
                    || (contentCanvas.getWidgetCount() ==0)
            ) {

            contentCanvas.clear();
            contentCanvas.add(new ScrollPanel(new HTML(html)));
            contentCanvas.getElement().removeAttribute("presenter-view");

    }
}
 
Example 9
Source Project: appinventor-extensions   Source File: Ode.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * corruptionDialog -- Put up a dialog box explaining that we detected corruption
 * while reading in a project file. There is no continuing once this happens.
 *
 */
void corruptionDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.corruptionDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.corruptionDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 10
public HelloWorld() {
	HTML html = new HTML("Hello Word");
	refresh = new Button("refresh UI");
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			GeneralComunicator.refreshUI();
		}
	});

	vPanel = new VerticalPanel();
	vPanel.add(html);
	vPanel.add(refresh);

	refresh.setStyleName("okm-Input");

	initWidget(vPanel);
}
 
Example 11
Source Project: swellrt   Source File: EditorHarness.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Output content for and editor
 */
private void outputEditorState(final Editor editor,
    final HTML prettyContent, final HTML prettyHtml) {
  Runnable printer = new Runnable() {
    public void run() {
      if (!quiet) {
        String content = EditorDocFormatter.formatContentDomString(editor);
        String html = EditorDocFormatter.formatImplDomString(editor);
        if (content != null) {
          prettyContent.setText(content);
        }
        if (html != null) {
          prettyHtml.setText(html);
        }
      }
    }
  };

  if (LogLevel.showDebug()) {
    // Flush and update once it's safe
    if (editor.getContent().flush(printer)) {
      printer.run(); // note that if true is returned, the command isn't run inside flush.
    }
  }
}
 
Example 12
/**
 * The status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 13
Source Project: cuba   Source File: CubaTwinColSelectWidget.java    License: Apache License 2.0 6 votes vote down vote up
protected void enableAddAllBtn() {
    HTML br1 = new HTML("<span/>");
    br1.setStyleName(CLASSNAME + "-deco");
    buttons.add(br1);
    buttons.insert(br1, buttons.getWidgetIndex(addItemsLeftToRightButton) + 1);
    addAll = new VButton();
    addAll.setText(">>");
    addAll.addStyleName("addAll");
    addAllHandlerRegistration = addAll.addClickHandler(this);
    buttons.insert(addAll, buttons.getWidgetIndex(br1) + 1);

    HTML br2 = new HTML("<span/>");
    br2.setStyleName(CLASSNAME + "-deco");
    buttons.add(br2);

    removeAll = new VButton();
    removeAll.setText("<<");
    removeAll.addStyleName("removeAll");
    removeAllHandlerRegistration = removeAll.addClickHandler(this);
    buttons.add(removeAll);
}
 
Example 14
Source Project: SensorWebClient   Source File: DiagramTab.java    License: GNU General Public License v2.0 6 votes vote down vote up
private HTML buildSliderPart(String width, String height, String cursor, String color, double transparancy) {
    HTML container = new HTML();
    container.setWidth(width);
    container.setHeight(height);
    DOM.setStyleAttribute(container.getElement(), "cursor", cursor);
    DOM.setStyleAttribute(container.getElement(), "backgroundColor", color);

    // transparency styling (see also bug#449 and http://www.quirksmode.org/css/opacity.html)
    // note: since GWT complains, '-msFilter' has to be in plain camelCase (w/o '-')
    // ordering is important here
    DOM.setStyleAttribute(container.getElement(), "opacity", Double.toString(transparancy));
    DOM.setStyleAttribute(container.getElement(), "mozOpacity", Double.toString(transparancy));
    String opacity = "(opacity=" +Double.toString(transparancy*100) + ")";
    DOM.setStyleAttribute(container.getElement(), "msFilter", "\"progid:DXImageTransform.Microsoft.Alpha"+ opacity + "\"");
    DOM.setStyleAttribute(container.getElement(), "filter", "alpha" + opacity);
    return container;
}
 
Example 15
Source Project: core   Source File: UploadStep.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
protected Widget asWidget(final Context context) {
    final FlowPanel panel = new FlowPanel();

    HTML description = new HTML(Console.CONSTANTS.common_label_chooseFile());
    description.getElement().setAttribute("style", "padding-bottom:15px;");
    panel.add(description);

    form = new FormPanel();

    // create a panel to hold all of the form widgets.
    VerticalPanel formPanel = new VerticalPanel();
    form.setWidget(formPanel);

    // create a FileUpload widgets.
    fileUpload = new FileUpload();
    fileUpload.setName("uploadFormElement");
    IdHelper.setId(fileUpload, id(), "file");
    formPanel.add(fileUpload);

    panel.add(form);
    return panel;
}
 
Example 16
Source Project: geowe-core   Source File: InfoProjectTool.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void showDialog(final HTML htmlReport) {
	final Dialog simple = new Dialog();
	simple.setHeadingText(project.getTitle());
	simple.setSize("420px", "420px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");
	simple.add(getPanel(htmlReport));
	simple.addButton(new TextButton(UIMessages.INSTANCE.download(),
			new SelectHandler() {
				@Override
				public void onSelect(SelectEvent event) {
					FileExporter.saveAs(htmlReport.getHTML(),
							project.getTitle() + ".html");
				}
			}));
	simple.show();
}
 
Example 17
Source Project: geowe-core   Source File: WmsGetInfoTool.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void showDialog(final HTML info) {
	final Dialog simple = new Dialog();
	simple.setHeadingText(UIMessages.INSTANCE.wmsInfo());
	HorizontalLayoutContainer container = new HorizontalLayoutContainer();
	container.setScrollMode(ScrollMode.AUTO);
	container.setSize("280px", "180px");

	container.add(replaceHref(info));
	simple.setSize("300px", "200px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");

	simple.add(container);

	simple.show();
}
 
Example 18
public ApplicationHeader(String title) {

        prefix = new HTML("");
        prefix.setStyleName("header-content");
        HTML changeButton = new HTML("(change)");

        changeButton.setStyleName("html-link");
        changeButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                Window.alert("Changing profiles not implemented yet!");
            }
        });

        add(prefix);
        //add(changeButton);

        //changeButton.getElement().getParentElement().setAttribute("style", "vertical-align:middle");

        setProfileName(title);
    }
 
Example 19
private void showDialog(final HTML htmlReport) {
	final Dialog simple = new Dialog();
	simple.setHeadingText("GeoWe Report");
	simple.setSize("420px", "420px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");
	simple.add(getPanel(htmlReport));
	simple.addButton(new TextButton(UIMessages.INSTANCE.download(),
			new SelectHandler() {
				@Override
				public void onSelect(SelectEvent event) {
					FileExporter.saveAs(htmlReport.getHTML(),
							getSelectedVectorLayer().getName() + ".html");
				}
			}));
	simple.show();
}
 
Example 20
Source Project: unitime   Source File: TimeGrid.java    License: Apache License 2.0 6 votes vote down vote up
public BusyPanel(String text, int dayOfWeek, int startSlot, int length) {
	super();
	iText = text;
	iDayOfWeek = dayOfWeek;
	iStartSlot = startSlot;
	iLength = length;
	if (iText != null || !iText.isEmpty()) {
		setTitle(iText);
		boolean empty = true;
		for (int i = 0; i < 3; i++) {
			if (iMeetingTable[iDayOfWeek].length <= iStartSlot + i) { empty = false; break; }
			if (iMeetingTable[iDayOfWeek][iStartSlot + i] != null && !iMeetingTable[iDayOfWeek][iStartSlot + i].isEmpty()) {
				empty = false; break;
			}
		}
		if (empty) {
			HTML widget = new HTML(text, false);
			widget.setStyleName("text");
			setWidget(widget);
		}
	}
	setStyleName("busy");
	getElement().getStyle().setWidth(iCellWidth + (iPrint ? 3 : iDayOfWeek + 1 < iNrDays ? 3 : 0), Unit.PX);
	getElement().getStyle().setHeight(125 * iLength / 30, Unit.PX);
	iGrid.insert(this, iCellWidth * iDayOfWeek, 125 * iStartSlot / 30 - 50 * iStart, 1);
}
 
Example 21
@Override
public void execute() {
    final DefaultWindow window = new DefaultWindow(Console.CONSTANTS.accessDenied());
    window.setWidth(320);
    window.setHeight(240);
    HTML message = new HTML(Console.CONSTANTS.insufficientPrivileges());

    DialogueOptions options = new DialogueOptions(
            Console.CONSTANTS.common_label_logout(),
            event -> {
                window.hide();
                new LogoutCmd(ssoEnabled).execute();
            },
            Console.CONSTANTS.common_label_cancel(),
            event -> {}
    );
    options.showCancel(false);

    window.trapWidget(new WindowContentBuilder(message, options).build());
    window.setGlassEnabled(true);
    window.center();
}
 
Example 22
@Override
public void setPreview(final SafeHtml html) {

    if (presenter.getPlaceManager().getCurrentPlaceRequest().getNameToken().equals(serverColumn.getToken())) {
        Scheduler.get().scheduleDeferred(() -> {
            contentCanvas.clear();
            contentCanvas.add(new ScrollPanel(new HTML(html)));
        });
    }

}
 
Example 23
Source Project: core   Source File: Header.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
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");

    for (final ToplevelTabs.Config tlt : toplevelTabs) {
        final String id = "header-" + tlt.getToken();

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

        widget.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                // navigate either child directly or parent if revealed the first time
                /*boolean hasChild = perspectiveStore.hasChild(tlt.getToken());
                String token = hasChild ?
                        perspectiveStore.getChild(tlt.getToken()) : tlt.getToken();
                boolean updateToken = hasChild ? true : tlt.isUpdateToken();*/

                String token = tlt.getToken();
                placeManager.revealPlace(
                        new PlaceRequest.Builder().nameToken(token).build(), tlt.isUpdateToken()
                );
            }
        });
        linksPane.add(widget, id);

    }

    return linksPane;
}
 
Example 24
Source Project: core   Source File: FinderTooltip.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
private void showTooltip() {
    HTML html = new HTML(context.render(this.currentItem));
    html.setStyleName("finder-tooltip-content");
    this.popup.setWidget(html);

    switch (this.popup.getArrow())
    {
        case BOTTOM:
        {
            int left = currentAnchor.getAbsoluteLeft();
            int top = currentAnchor.getAbsoluteTop();
            int width = currentAnchor.getOffsetWidth();
            this.popup.setPopupPosition(
                    left+20,
                    top-40
            );
            break;
        }
        default: {
            this.popup.setPopupPosition(
                    currentAnchor.getAbsoluteLeft(),
                    currentAnchor.getAbsoluteTop()
            );
        }

    }

    this.popup.setAutoHideEnabled(true);
    this.popup.show();
}
 
Example 25
Source Project: core   Source File: MessageWindow.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
public Widget asWidget() {
    VerticalPanel layout = new VerticalPanel();
    layout.setStyleName("window-content");

    final HTML label = new HTML(text);
    layout.add(label);

    DialogueOptions options = new DialogueOptions(
        "OK", new MyClickHandler(true),
            Console.CONSTANTS.common_label_cancel(), new MyClickHandler(false));

    return new WindowContentBuilder(layout, options).build();
}
 
Example 26
Source Project: swcv   Source File: WordCloudDetailApp.java    License: MIT License 5 votes vote down vote up
private SimplePanel createPanel(String svg, int width, int height)
{
    SimplePanel panel = new SimplePanel();
    panel.setPixelSize(width, height);
    panel.addStyleName("center");
    HTML html = new HTML(svg);
    html.setWidth("100%");
    html.setHeight("100%");
    panel.add(html);
    return panel;
}
 
Example 27
@Override
public void setPreview(final SafeHtml html) {

    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
        @Override
        public void execute() {
            previewCanvas.clear();
            previewCanvas.add(new ScrollPanel(new HTML(html)));
        }
    });

}
 
Example 28
Source Project: unitime   Source File: RoomNoteChanges.java    License: Apache License 2.0 5 votes vote down vote up
private void populate(GwtRpcResponseList<ChangeLogInterface> logs) {
	List<UniTimeTableHeader> header = new ArrayList<UniTimeTableHeader>();
	
	header.add(new UniTimeTableHeader(MESSAGES.colDate(), clickHandler(0)));
	header.add(new UniTimeTableHeader(MESSAGES.colAcademicSession(), clickHandler(1)));
	header.add(new UniTimeTableHeader(MESSAGES.colManager(), clickHandler(2)));
	header.add(new UniTimeTableHeader(MESSAGES.colNote(), clickHandler(3)));
	iChanges.addRow(null, header);
	
	for (ChangeLogInterface log: logs) {
		List<Widget> line = new ArrayList<Widget>();
		
		line.add(new Label(sDateFormat.format(log.getDate()), false));
		line.add(new Label(log.getSession(), false));
		line.add(new HTML(log.getManager() == null ? "<i>" + MESSAGES.notApplicable() + "</i>" : log.getManager(), false));
		HTML note = new HTML(log.getObject() == null || log.getObject().isEmpty() || "-".equals(log.getObject()) ? "<i>" + MESSAGES.emptyNote() + "</i>" : log.getObject());
		note.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE_WRAP);
		line.add(note);
		
		iChanges.addRow(log, line);
		iChanges.getRowFormatter().setVerticalAlign(iChanges.getRowCount() - 1, HasVerticalAlignment.ALIGN_TOP);
	}
	
	if (LastChangesCookie.getInstance().getSortColumn() >= 0) {
		iChanges.sort((UniTimeTableHeader)null, comparator(LastChangesCookie.getInstance().getSortColumn(), LastChangesCookie.getInstance().getSortOrder()));
		header.get(LastChangesCookie.getInstance().getSortColumn()).setOrder(LastChangesCookie.getInstance().getSortOrder());
	}
	
	iChanges.setColumnVisible(1, iMultiSessionToggle.getValue());
}
 
Example 29
Source Project: appinventor-extensions   Source File: GalleryPage.java    License: Apache License 2.0 5 votes vote down vote up
/**
   * Helper method called by constructor to initialize ui components
   */
  private void initComponents() {
    // Initialize UI
    panel = new VerticalPanel();
    panel.setWidth("100%");
    galleryGUI = new FlowPanel();
    appSingle = new FlowPanel();
    appDetails = new FlowPanel();
    appHeader = new FlowPanel();
    appInfo = new FlowPanel();
    appAction = new FlowPanel();
    appAuthor = new FlowPanel();
    appMeta = new FlowPanel();
    appDates = new FlowPanel();
    appPrimaryWrapper = new FlowPanel();
    appSecondaryWrapper = new FlowPanel();
    appDescPanel = new FlowPanel();
    appReportPanel = new FlowPanel();
    appSharePanel = new FlowPanel();
    appActionTabs = new TabPanel();
    sidebarTabs = new TabPanel();
    appComments = new FlowPanel();
    appCommentsList = new FlowPanel();
    appsByAuthor = new FlowPanel();
    appsByTags = new FlowPanel();
    appsRemixes = new FlowPanel();
    returnToGallery = new FlowPanel();
//    tagSelected = "";

    appCreated = new Label();
    appChanged = new Label();
    descBox = new FlowPanel();
    titleBox = new FlowPanel();
    desc = new TextArea();
    titleText = new TextArea();
    moreInfoText = new TextArea();
    creditText = new TextArea();
    ccLicenseRef = new HTML(MESSAGES.galleryCcLicenseRef());
    ccLicenseRef.addStyleName("app-action-html");
  }
 
Example 30
Source Project: appinventor-extensions   Source File: TopToolbar.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void execute() {
  final DialogBox db = new DialogBox(false, true);
  db.setText("About The Companion");
  db.setStyleName("ode-DialogBox");
  db.setHeight("200px");
  db.setWidth("400px");
  db.setGlassEnabled(true);
  db.setAnimationEnabled(true);
  db.center();

  String downloadinfo = "";
  if (!YaVersion.COMPANION_UPDATE_URL1.equals("")) {
    String url = "http://" + Window.Location.getHost() + YaVersion.COMPANION_UPDATE_URL1;
    downloadinfo = "<br/>\n<a href=" + url + ">Download URL: " + url + "</a><br/>\n";
    downloadinfo += BlocklyPanel.getQRCode(url);
  }

  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(
      "Companion Version " + BlocklyPanel.getCompVersion() + downloadinfo
  );

  SimplePanel holder = new SimplePanel();
  Button ok = new Button("Close");
  ok.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {
      db.hide();
    }
  });
  holder.add(ok);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  db.setWidget(DialogBoxContents);
  db.show();
}