Package org.wikipediacleaner.api.check

Examples of org.wikipediacleaner.api.check.CheckErrorResult.addPossibleAction()


      for (Replacement replacement : group.getReplacements()) {

        // Manage comment
        String comment = replacement.getComment();
        if (comment == null) {
          error.addPossibleAction(null, new NullActionProvider());
        } else if (!comment.equals(previousComment)) {
          error.addPossibleAction(comment, new NullActionProvider());
        }
        previousComment = comment;
View Full Code Here


        // Manage comment
        String comment = replacement.getComment();
        if (comment == null) {
          error.addPossibleAction(null, new NullActionProvider());
        } else if (!comment.equals(previousComment)) {
          error.addPossibleAction(comment, new NullActionProvider());
        }
        previousComment = comment;

        error.addReplacement(replacement.getReplacement(), replacement.isAutomatic());
        if (Boolean.TRUE.equals(replacement.isMultiple())) {
View Full Code Here

      error.addReplacement(group.getText(), GT._("Restore original text"));

      // Multiple replacements
      if (!multiples.isEmpty()) {
        if (multiples.size() == 1) {
          error.addPossibleAction(new SimpleAction(
              GT._("Replace each time with {0}", multiples.get(0)),
              new MWPaneReplaceAllAction(group.getText(), multiples.get(0))));
        } else {
          List<Actionnable> actions = new ArrayList<Actionnable>();
          for (String multiple : multiples) {
View Full Code Here

        } else {
          List<Actionnable> actions = new ArrayList<Actionnable>();
          for (String multiple : multiples) {
            actions.add(new SimpleAction(multiple, new MWPaneReplaceAllAction(group.getText(), multiple)));
          }
          error.addPossibleAction(new CompositeAction(GT._("Replace each time with"), actions));
        }
      }
      errors.add(error);
    }
View Full Code Here

            } else {
              String question = GT._("What text should be displayed by the link?");
              AddTextActionProvider action = new AddTextActionProvider(
                  "[[" + (needColon ? ":" : "") + article + "|", "]]", null,
                  question, article, checker);
              errorResult.addPossibleAction(
                  GT._("Convert into an internal link"),
                  action);
            }
          }
          errors.add(errorResult);
View Full Code Here

              }
            }
          }
          prefixFull.append("|");
          prefixShort.append("|alt=");
          errorResult.addPossibleAction(
              GT._("Add a description..."),
              new AddTextActionProvider(
                  prefixFull.toString(), "]]",
                  new TextProviderImageDescription(image),
                  GT._("What description would you like to use for the image ?"),
View Full Code Here

              new AddTextActionProvider(
                  prefixFull.toString(), "]]",
                  new TextProviderImageDescription(image),
                  GT._("What description would you like to use for the image ?"),
                  descriptionChecker));
          errorResult.addPossibleAction(
              GT._("Add an alternate description..."),
              new AddTextActionProvider(
                  prefixShort.toString(), "]]",
                  new TextProviderImageDescription(image),
                  GT._("What alternate description would you like to use for the image ?"),
View Full Code Here

                  new TextProviderImageDescription(image),
                  GT._("What alternate description would you like to use for the image ?"),
                  descriptionChecker));

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

          if (errors == null) {
            return true;
          }
          result = true;
          CheckErrorResult errorResult = createCheckErrorResult(analysis, isbn, true);
          errorResult.addPossibleAction(
              GT._(
                  "The checksum is {0} instead of {1}",
                  new Object[] { check, computedCheck } ),
              new NullActionProvider());
          addHelpNeededTemplates(analysis, errorResult, isbn);
View Full Code Here

            analysis, link.getBeginIndex(), link.getEndIndex());
        String lgCode = link.getInterwiki().getPrefix();
        EnumWikipedia fromWiki = EnumWikipedia.getWikipedia(lgCode);
        if ((fromWiki != null) && (fromWiki.getSettings().getCode().equals(lgCode))) {
          String pageTitle = link.getLink();
          errorResult.addPossibleAction(
              GT._("Check language links"),
              new CheckLanguageLinkActionProvider(
                  fromWiki, toWiki,
                  pageTitle, link.getText()));
          if ((templatesList != null) && (templatesList.size() > 0)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.