Пример #1
0
  /**
   * Creates the subscribe label.
   *
   * @param linkName the link name
   * @return the newly created subscribe label
   */
  private Component createWebSignupLabel(String linkName, final String linkURL) {
    JLabel subscribeLabel =
        new JLabel("<html><a href=''>" + linkName + "</a></html>", JLabel.RIGHT);

    subscribeLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    subscribeLabel.setToolTipText(
        DesktopUtilActivator.getResources()
            .getI18NString("plugin.simpleaccregwizz.SPECIAL_SIGNUP"));
    subscribeLabel.addMouseListener(
        new MouseAdapter() {
          public void mousePressed(MouseEvent e) {
            try {
              DesktopUtilActivator.getBrowserLauncher().openURL(linkURL);
            } catch (UnsupportedOperationException ex) {
              // This should not happen, because we check if the
              // operation is supported, before adding the sign
              // up.
              logger.error("The web sign up is not supported.", ex);
            }
          }
        });
    return subscribeLabel;
  }