Package org.wikipediacleaner.gui.swing.menu

Examples of org.wikipediacleaner.gui.swing.menu.BasicMenuCreator


    if (isbn == null) {
      return null;
    }

    // Menu creation
    BasicMenuCreator menu = new BasicMenuCreator();
    JPopupMenu popup = menu.createPopupMenu(GT._(
        "ISBN: {0}",
        limitTextLength(isbn.getISBN(), 50)));
    List<String> infos = ISBNRange.getInformation(isbn.getISBN());
    if (infos != null) {
      for (String info : infos) {
        menu.addDisabledText(popup, info);
      }
    }
    menu.addCurrentChapter(popup, position, pageAnalysis);

    return popup;
  }
View Full Code Here


    }
    CheckErrorPage error = (CheckErrorPage) object;
    CheckErrorAlgorithm algorithm = error.getAlgorithm();

    // Menu name
    BasicMenuCreator menu = new BasicMenuCreator();
    JPopupMenu popup = menu.createPopupMenu(GT._("Error n°{0}", algorithm.getErrorNumberString()));

    // Global fixes
    JMenuItem menuItem = null;
    String[] fixes = algorithm.getGlobalFixes();
    if ((fixes != null) && (fixes.length > 0)) {
      menu.addSeparator(popup);
      for (int i = 0; i < fixes.length; i++) {
        menuItem = new JMenuItem(fixes[i]);
        ActionListener action = new CheckErrorGlobalFixAction(
            algorithm, fixes[i], error.getPage(), textComponent, button);
        menuItem.addActionListener(action);
        popup.add(menuItem);
      }
    }

    // Create sub menus
    menu.addSeparator(popup);
    menu.addItemView(wiki, popup, algorithm.getLink(), GT._("Detail"));
    CheckWiki checkWiki = APIFactory.getCheckWiki();
    String toolserverUrl = checkWiki.getUrlDescription(wiki, algorithm);
    menu.addItemView(null, popup, toolserverUrl, GT._("List on {0}", CheckWiki.getServerName(wiki)));
    menu.addItemView(wiki, popup, algorithm.getWhiteListPageName(), GT._("View or edit whitelist"));

    popup.show(e.getComponent(), e.getX(), e.getY());
  }
View Full Code Here

        } else {
          themeMenu.add(item);
        }
      }
    }
    BasicMenuCreator menu = new BasicMenuCreator();
    JPopupMenu popup = menu.createPopupMenu(null);
    menu.addSubmenus(popup, items);
    popup.show(source, 0, source.getHeight());
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.wikipediacleaner.gui.swing.component.AbstractPageListPopupListener#createPopup(javax.swing.JPopupMenu, org.wikipediacleaner.api.data.Page)
   */
  @Override
  protected void createPopup(JPopupMenu popup, Page link) {
    BasicMenuCreator menu = new BasicMenuCreator();
    menu.addSeparator(popup);
    menu.addAnalyze(wikipedia, popup, link);
    menu.addView(wikipedia, popup, link, true);
    menu.addDisambiguation(wikipedia, popup, link);
  }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.gui.swing.menu.BasicMenuCreator

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.