Exemplo n.º 1
0
  /**
   * Constructor requires message text
   *
   * @param text
   */
  public ActionMessage(String text) {

    VLayout vLayout = new VLayout();
    vLayout.setShowEdges(false);

    vLayout.setWidth100();
    vLayout.setHeight100();

    vLayout.setMembersMargin(0);
    vLayout.setLayoutMargin(0);

    StringBuffer sb = new StringBuffer();

    sb.append(
        "<img style=\"margin:16px;margin-top:24px;margin-left:auto;margin-right:auto;display:block;\" ");
    sb.append("src=\"" + GuiStyles.LOADING_IMAGE + "\" width=\"64\" height=\"64\" />");

    sb.append(
        "<p style=\"font:normal 11px tahoma, arial, helvetica, sans-serif;color:"
            + GuiStyles.FONT_COLOR
            + ";text-align:center;\">"
            + text
            + "</p>");

    HTMLFlow flow = new HTMLFlow();
    flow.setContents(sb.toString());

    vLayout.addMember(flow);
    this.addItem(vLayout);

    this.setTitle(GUIGlobals.APP_TITLE);

    this.setShowCloseButton(false);
    this.setShowMinimizeButton(false);

    this.setBodyColor(GuiStyles.BG_COLOR);

    this.setWidth(240);
    this.setHeight(160);

    this.centerInPage();
    this.draw();
  }