Пример #1
0
 private JLabel createTitleLabel(final AddOnProperties addOn) {
   return new JLabel(
       "<html><body><b><font size='+2'>"
           + toHtml(addOn.getTranslatedName())
           + " "
           + addOn.getVersion().replaceAll("^v", "")
           + "</font></b></body></html>");
 }
Пример #2
0
 private JLabel createAuthorLabel(final AddOnProperties addOn) {
   final String text =
       addOn.getAuthor() == null
           ? ""
           : "<html><body><b><font size='-1'>"
               + getText("authored.by", toHtml(addOn.getAuthor()))
               + "</font></b></body></html>";
   return new JLabel(text);
 }
Пример #3
0
 private JComponent createAddOnHomepageButton(final AddOnProperties addOn) {
   // parse the URI on creation of the dialog to test the URI syntax early
   try {
     return UITools.createHtmlLinkStyleButton(
         addOn.getHomepage().toURI(), addOn.getHomepage().toString());
   } catch (Exception e) {
     LogUtils.warn("add-on " + addOn + " has no valid homepage: " + e);
     return new JLabel("-");
   }
 }
Пример #4
0
 private JComponent createDetails(final AddOnProperties addOn) {
   final StringBuilder text = new StringBuilder(1024);
   text.append("<html><body>");
   text.append(toHtml(addOn.getDescription()));
   text.append("<p>");
   if (addOn instanceof ScriptAddOnProperties) {
     List<Script> scripts = ((ScriptAddOnProperties) addOn).getScripts();
     if (!scripts.isEmpty()) {
       text.append("<table border='1'>");
       text.append(
           row(
               "th",
               getText("header.function"),
               getText("header.menu"),
               getText("header.shortcut")));
       for (ScriptAddOnProperties.Script script : scripts) {
         text.append(
             row(
                 "td",
                 bold(TextUtils.getText(script.menuTitleKey)),
                 formatMenuLocation(script),
                 formatShortcut(script)));
       }
       text.append("</table>");
     }
   }
   if (warning != null) {
     text.append("<p><p>");
     text.append(warning.replaceAll("</?(html|body)>", ""));
   }
   text.append("</body></html>");
   final JLabel label = new JLabel(text.toString());
   final ImageIcon icon =
       IconNotFound.createIconOrReturnNull(addOn.getName() + "-screenshot-1.png");
   if (icon != null) label.setIcon(icon);
   return label;
 }
Пример #5
0
 private JLabel createImageLabel(AddOnProperties addOn) {
   final JLabel label = new JLabel("");
   label.setIcon(IconNotFound.createIconOrReturnNotFoundIcon(addOn.getName() + ".png"));
   return label;
 }