Package org.wikipediacleaner.gui.swing.action

Examples of org.wikipediacleaner.gui.swing.action.ActionExternalViewer


              errorResult.addReplacement(url + suffix);
            }
          }
          errorResult.addPossibleAction(
              new SimpleAction(GT._("External viewer"),
                  new ActionExternalViewer(url)));
          errors.add(errorResult);
        }
      }
    }
    return result;
View Full Code Here


              // Add actions for external links
              for (PageElementExternalLink link : links) {
                errorResult.addPossibleAction(new SimpleAction(
                    GT._("External Viewer"),
                    new ActionExternalViewer(link.getLink())));
              }
              errors.add(errorResult);
            }
          }
        }
View Full Code Here

                  descriptionChecker));

          // Action: view image
          errorResult.addPossibleAction(new SimpleAction(
              GT._("View image"),
              new ActionExternalViewer(
                  wiki,
                  image.getNamespace() + ":" + image.getImage(),
                  true)));
          errors.add(errorResult);
        }
View Full Code Here

            }
          }
          errorResult.addPossibleAction(
              GT._("External Viewer"),
              new BasicActionProvider(
                  new ActionExternalViewer(fromWiki, pageTitle)));
        }
        errors.add(errorResult);
      }
    }
View Full Code Here

        Iterator<Page> iter = page.getRedirectIteratorWithPage();
        while (iter.hasNext()) {
          Page pageTmp = iter.next();
          fixedBeginView += addItem(
              submenuView, pageTmp, null, true,
              new ActionExternalViewer(wiki, pageTmp.getTitle()));
          fixedBeginHistory += addItem(
              submenuHistory, pageTmp, null, true,
              new ActionExternalViewer(
                  wiki, pageTmp.getTitle(), ActionExternalViewer.ACTION_HISTORY));
        }
        if ((links != null) && (links.size() > 0) && showLinks) {
          fixedBeginView += addSeparator(submenuView);
          fixedBeginHistory += addSeparator(submenuHistory);
   
          for (Page p : links) {
            if (p.isRedirect()) {
              JMenu submenuRedirectView = new JMenu(p.getTitle());
              JMenu submenuRedirectHistory = new JMenu(p.getTitle());
              Iterator<Page> itPage = p.getRedirectIteratorWithPage();
              while (itPage.hasNext()) {
                Page redirect = itPage.next();
                addItem(
                    submenuRedirectView, redirect, null, true,
                    new ActionExternalViewer(wiki, redirect.getTitle()));
                addItem(
                    submenuRedirectHistory, redirect, null, true,
                    new ActionExternalViewer(
                        wiki, redirect.getTitle(), ActionExternalViewer.ACTION_HISTORY));
              }
              submenuView.add(submenuRedirectView);
              submenuHistory.add(submenuRedirectHistory);
            } else {
              addItem(
                  submenuView, p, null, true,
                  new ActionExternalViewer(wiki, p.getTitle()));
              addItem(
                  submenuHistory, p, null, true,
                  new ActionExternalViewer(
                      wiki, p.getTitle(), ActionExternalViewer.ACTION_HISTORY));
            }
          }

          fixedEndView += addSeparator(submenuView);
          fixedEndHistory += addSeparator(submenuHistory);

          iter = page.getRedirectIteratorWithPage();
          while (iter.hasNext()) {
            Page pageTmp = iter.next();
            fixedEndView += addItem(
                submenuView, pageTmp, null, true,
                new ActionExternalViewer(wiki, pageTmp.getTitle()));
            fixedEndHistory += addItem(
                submenuHistory, pageTmp, null, true,
                new ActionExternalViewer(
                    wiki, pageTmp.getTitle(), ActionExternalViewer.ACTION_HISTORY));
          }
        }
        addSubmenu(popup, submenuView, fixedBeginView, fixedEndView);
        addSubmenu(popup, submenuHistory, fixedBeginHistory, fixedEndHistory);
      } else {
        String title = null;
        if ((page.getNamespace() != null) &&
            (page.getNamespace().intValue() == Namespace.TEMPLATE)) {
          title = GT._("Template External Viewer");
        } else {
          title = GT._("External Viewer");
        }
        addItem(
            popup, page, title, true,
            new ActionExternalViewer(wiki, page.getTitle()));
        if ((page.getNamespace() != null) &&
            (page.getNamespace().intValue() == Namespace.TEMPLATE)) {
          title = GT._("Template history");
        } else {
          title = GT._("History");
        }
        addItem(
            popup, page, title, true,
            new ActionExternalViewer(
                wiki, page.getTitle(), ActionExternalViewer.ACTION_HISTORY));
      }
    }
  }
View Full Code Here

   * @param label Menu label.
   */
  public void addItemView(
      EnumWikipedia wiki, JPopupMenu popup, String url, String label) {
    if ((url != null) && (Utilities.isDesktopSupported())) {
      addItem(popup, null, label, true, new ActionExternalViewer(wiki, url));
    }
  }
View Full Code Here

      for (String[] searchEngine : searchEngines) {
        try {
          if (searchEngine.length > 1) {
            actions.add(new SimpleAction(
                searchEngine[0],
                new ActionExternalViewer(MessageFormat.format(searchEngine[1], search))));
          }
        } catch (IllegalArgumentException e) {
          //
        }
      }
View Full Code Here

      for (String[] searchEngine : searchEngines) {
        try {
          if (searchEngine.length > 1) {
            actions.add(new SimpleAction(
                searchEngine[0],
                new ActionExternalViewer(MessageFormat.format(searchEngine[1], search))));
          }
        } catch (IllegalArgumentException e) {
          //
        }
      }
View Full Code Here

        String[] searchEngine = searchEngines.get(index);
        if (paramName.equals(searchEngine[3].trim())) {
          try {
            actions.add(new SimpleAction(
                searchEngine[0],
                new ActionExternalViewer(MessageFormat.format(
                    searchEngine[1], URLEncoder.encode(paramValue, "UTF8")))));
          } catch (UnsupportedEncodingException e) {
            // Nothing to do
          }
          searchEngines.remove(index);
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.gui.swing.action.ActionExternalViewer

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.