Package org.wikipediacleaner.api.data

Examples of org.wikipediacleaner.api.data.TemplateMatcher


          if (list == null) {
            list = new ArrayList<TemplateMatcher>();
          }
          String[] parameterNames = parameterList.split(",");
          for (String parameterName : parameterNames) {
            TemplateMatcher matcher = new TemplateMatcher1L(
                wiki, templateName, explanation, false, false,
                parameterName, defaultValue, neededParameter);
            list.add(matcher);
          }
          templateMatchers.put(templateName, list);
View Full Code Here


          if (list == null) {
            list = new ArrayList<TemplateMatcher>();
          }
          String[] parameterNames = parameterList.split(",");
          for (String parameterName : parameterNames) {
            TemplateMatcher matcher = new TemplateMatcher1LT(
                wiki, templateName, explanation, false, false,
                parameterName, defaultValue, neededParameter);
            list.add(matcher);
          }
          templateMatchers.put(templateName, list);
View Full Code Here

        if ((templateName != null) && (parameterName1 != null) && (parameterName2 != null)) {
          List<TemplateMatcher> list = templateMatchers.get(templateName);
          if (list == null) {
            list = new ArrayList<TemplateMatcher>();
          }
          TemplateMatcher matcher = new TemplateMatcher1L2T(
              wiki, templateName, explanation,
              parameterName1, parameterName2);
          list.add(matcher);
          templateMatchers.put(templateName, list);
        }
View Full Code Here

          if (list == null) {
            list = new ArrayList<TemplateMatcher>();
          }
          String[] parameterNames = parameterList.split(",");
          for (String parameterName : parameterNames) {
            TemplateMatcher matcher = new TemplateMatcher1L(
                wiki, templateName, explanation, true, false,
                parameterName, defaultValue, neededParameter);
            list.add(matcher);
          }
          templateMatchers.put(templateName, list);
View Full Code Here

          if (list == null) {
            list = new ArrayList<TemplateMatcher>();
          }
          String[] parameterNames = parameterList.split(",");
          for (String parameterName : parameterNames) {
            TemplateMatcher matcher = new TemplateMatcher1LT(
                wiki, templateName, explanation, true, false,
                parameterName, defaultValue, neededParameter);
            list.add(matcher);
          }
          templateMatchers.put(templateName, list);
View Full Code Here

          if (list == null) {
            list = new ArrayList<TemplateMatcher>();
          }
          String[] parameterNames = parameterList.split(",");
          for (String parameterName : parameterNames) {
            TemplateMatcher matcher = new TemplateMatcher1L(
                wiki, templateName, explanation, false, true,
                parameterName, defaultValue, neededParameter);
            list.add(matcher);
          }
          templateMatchers.put(templateName, list);
View Full Code Here

          if (list == null) {
            list = new ArrayList<TemplateMatcher>();
          }
          String[] parameterNames = parameterList.split(",");
          for (String parameterName : parameterNames) {
            TemplateMatcher matcher = new TemplateMatcher1LT(
                wiki, templateName, explanation, false, true,
                parameterName, defaultValue, neededParameter);
            list.add(matcher);
          }
          templateMatchers.put(templateName, list);
View Full Code Here

    Object attrPageElement = attributes.getAttribute(MWPaneFormatter.ATTRIBUTE_PAGE_ELEMENT);
    Object attrTemplateMatcher = attributes.getAttribute(MWPaneFormatter.ATTRIBUTE_TEMPLATE_MATCHER);
    Object attrText = attributes.getAttribute(MWPaneFormatter.ATTRIBUTE_TEXT);

    Page page = (attrPage instanceof Page) ? (Page) attrPage : null;
    TemplateMatcher matcher = (attrTemplateMatcher instanceof TemplateMatcher) ?
        (TemplateMatcher) attrTemplateMatcher : null;
    MWPaneDisambiguationMenuCreator menu = new MWPaneDisambiguationMenuCreator();

    // Manage TemplateMatcher
    if (attrPageElement instanceof PageElementTemplate) {
      PageElementTemplate template = (PageElementTemplate) attrPageElement;

      String templateTitle = getWikipedia().getWikiConfiguration().getPageTitle(
          Namespace.TEMPLATE,
          template.getTemplateName());
      JPopupMenu popup = menu.createPopupMenu(templateTitle);
      if ((matcher != null) &&
          (matcher.getExplanation() != null) &&
          (matcher.getExplanation().length() > 0)) {
        menu.addDisabledText(popup, "→ " + matcher.getExplanation() + " ←");
      }
      menu.addCurrentChapter(popup, position, pageAnalysis);

      menu.addSeparator(popup);
      Page templatePage = DataManager.getPage(getWikipedia(), templateTitle, null, null, null);
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.data.TemplateMatcher

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.