Package com.jbidwatcher

Examples of com.jbidwatcher.UpdaterEntry


  private static void announceNewVersion() {
    List<String> buttons = new ArrayList<String>();
    buttons.add("Download");
    buttons.add("Ignore");

    final UpdaterEntry ue = UpdateManager.getInstance().getUpdateInfo();
    StringBuffer fullMsg = new StringBuffer(4 * ONEK);
    String icon = JConfig.getResource("/jbidwatch64.jpg").toString();
    fullMsg.append("<html><body><table><tr><td><img src=\"" + icon + "\"></td>");
    fullMsg.append("<td valign=\"top\"><span class=\"banner\"><b>A new version of " + Constants.PROGRAM_NAME + " is available!</b></span><br>");
    fullMsg.append("<span class=\"smaller\">" + Constants.PROGRAM_NAME + " <b>").append(ue.getVersion());
    fullMsg.append("</b> is now available. Would you like to <a href=\"" + ue.getURL() + "\">download it now?</a><br><br>");
    fullMsg.append("Upgrading is <em>").append(ue.getSeverity()).append("</em></span></td></tr></table>");
    fullMsg.append("<p><b>Release Notes:</b></p><div class=\"changelog\">");
    String changelog = ue.getChangelog();
    if(changelog == null) {
      fullMsg.append(ue.getDescription());
    } else {
      fullMsg.append(changelog);
    }
    fullMsg.append("</div></body></html>");

    MyActionListener mal = new MyActionListener() {
      private final String go_to = ue.getURL();

      public void actionPerformed(ActionEvent listen_ae) {
        String actionString = listen_ae.getActionCommand();
        if (actionString.equals("Download")) {
          MQFactory.getConcrete("browse").enqueue(go_to);
        }
        m_within.dispose();
        m_within = null;
      }
    };
    OptionUI oui = new OptionUI();
    JFrame newFrame = oui.showChoiceTextDisplay(new JHTMLOutput("Version " + ue.getVersion() + " available!", fullMsg).getStringBuffer(),
        new Dimension(UPDATE_FRAME_WIDTH, UPDATE_FRAME_HEIGHT), "Version " + ue.getVersion() + " available!", buttons,
        "Upgrade information", mal);
    mal.setFrame(newFrame);
  }
View Full Code Here

TOP

Related Classes of com.jbidwatcher.UpdaterEntry

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.