Package org.wikipediacleaner.utils

Examples of org.wikipediacleaner.utils.Configuration


   * Initialize list of inactive chapters.
   */
  private static void initializeInactiveChapters() {
    synchronized (lockClass) {
      if (inactiveChapters == null) {
        Configuration config = Configuration.getConfiguration();
        inactiveChapters = config.getStringList(null, Configuration.ARRAY_SPELLING_INACTIVE);
      }
    }
  }
View Full Code Here


      } else if (!inactiveChapters.contains(chapterName)) {
        inactiveChapters.add(chapterName);
        Collections.sort(inactiveChapters);
      }
    }
    Configuration config = Configuration.getConfiguration();
    config.setStringList(null, Configuration.ARRAY_SPELLING_INACTIVE, inactiveChapters);
  }
View Full Code Here

    // Menu name
    String text = (String) attrText;
    JPopupMenu popup = menu.createPopupMenu(null);

    // Create sub menus
    Configuration config = Configuration.getConfiguration();
    AbstractButton addNote = null;
    if (config.getBoolean(null, ConfigurationValueBoolean.ADD_NOTE_FOR_HELP)) {
      addNote = textPane.getCheckBoxAddNote();
    }
    menu.addReplaceLink(getWikipedia(), popup, page, text, element, textPane);
    menu.addItemRemoveLink(popup, text, textPane, startOffset, endOffset);
    menu.addMarkAsNormal(getWikipedia(), popup, page, text, element, textPane);
View Full Code Here

  /**
   * Action called when Signature button is pressed.
   */
  public void actionSignature() {
    Configuration config = Configuration.getConfiguration();
    try {
      textNewSection.getDocument().insertString(
          textNewSection.getCaretPosition(),
          config.getString(
              null,
              ConfigurationValueString.SIGNATURE),
          null);
    } catch (BadLocationException e) {
      //
View Full Code Here

  @Override
  public Object construct() {
    String text = initialText;

    try {
      Configuration config = Configuration.getConfiguration();
      text = translateInternalLinks(
          text,
          config.getBoolean(null, ConfigurationValueBoolean.TRANSLATION_INTERNAL_LINK_TEXT),
          config.getBoolean(null, ConfigurationValueBoolean.TRANSLATION_INTERLANGUAGE));
      text = translateCategories(
          text,
          config.getBoolean(null, ConfigurationValueBoolean.TRANSLATION_CATEGORY));
      text = translateTemplates(
          text,
          config.getBoolean(null, ConfigurationValueBoolean.TRANSLATION_TEMPLATE_NAME),
          config.getBoolean(null, ConfigurationValueBoolean.TRANSLATION_TEMPLATE_NO_PARAM));
    } catch (APIException e) {
      return null;
    }

    return text;
View Full Code Here

   *
   * @param shortcut Shortcut.
   * @param line Line.
   */
  private void applyShortcut(ConfigurationValueShortcut shortcut, int line) {
    Configuration config = Configuration.getConfiguration();
    ConfigurationValueShortcut.ShortcutProperties configShortcut = getShortcut(line, shortcut.getName());
    config.setShortcut(shortcut, configShortcut);
  }
View Full Code Here

   *
   * @param line Line number.
   * @param shortcut Shortcut.
   */
  private void setShortcut(int line, ConfigurationValueShortcut shortcut) {
    Configuration config = Configuration.getConfiguration();
    if (shortcut == null) {
      return;
    }
    ConfigurationValueShortcut.ShortcutProperties properties = config.getShortcut(shortcut);
    setEnabled(line, properties.getEnabled());
    setCtrl(line, properties.getCtrlKey());
    setAlt(line, properties.getAltKey());
    setShift(line, properties.getShiftKey());
    setKey(line, properties.getKey());
View Full Code Here

   * Initialize the panel.
   */
  private void initialize() {

    // Configuration
    Configuration config = Configuration.getConfiguration();

    // Initialize constraints
    final int maxX = 3;
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.gridheight = 1;
    constraints.gridwidth = maxX;
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.insets = new Insets(0, 0, 0, 0);
    constraints.ipadx = 0;
    constraints.ipady = 0;
    constraints.weightx = 1;
    constraints.weighty = 0;

    // Label
    JLabel labelCW = Utilities.createJLabel(GT._("Automatic fixing for Check Wiki"));
    add(labelCW, constraints);
    constraints.gridy++;

    // Table for listing errors
    modelCWAutomaticFixing = new BotCWTableModel(window.getWikipedia());
    tableCWAutomaticFixing = new JTable(modelCWAutomaticFixing);
    modelCWAutomaticFixing.configureColumnModel(tableCWAutomaticFixing.getColumnModel());
    Utilities.addRowSorter(tableCWAutomaticFixing, modelCWAutomaticFixing);
    JScrollPane paneCWAutomaticFixing = new JScrollPane(tableCWAutomaticFixing);
    paneCWAutomaticFixing.setMinimumSize(new Dimension(200, 200));
    paneCWAutomaticFixing.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    paneCWAutomaticFixing.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    constraints.weighty = 1;
    add(paneCWAutomaticFixing, constraints);
    constraints.gridy++;
    constraints.weighty = 0;

    // Check box to decide if pages should be analyzed if not fixed
    chkCWAnalyze = Utilities.createJCheckBox(
        GT._("Analyze pages that couldn't be fixed by bot"),
        config.getBoolean(null, ConfigurationValueBoolean.CHECK_BOT_ANALYZE));
    add(chkCWAnalyze, constraints);
    constraints.gridy++;

    // Number of errors
    modelNbPages = new SpinnerNumberModel(
        config.getInt(null, ConfigurationValueInteger.CHECK_BOT_NB_PAGES), 1, 10000, 1);
    JSpinner spinNbPages = new JSpinner(modelNbPages);
    JLabel labelNbPages = Utilities.createJLabel(GT._("Number of pages:"));
    labelNbPages.setLabelFor(spinNbPages);
    constraints.gridwidth = 2;
    constraints.weightx = 1;
View Full Code Here

      if (selection instanceof Page) {
        Page selected = (Page) selection;
        backlinksProperties.put(selected.getTitle(), mark);
      }
    }
    Configuration configuration = Configuration.getConfiguration();
    configuration.setSubProperties(
        getWikipedia(),
        Configuration.PROPERTIES_BACKLINKS, getPageName(),
        backlinksProperties);
    listLinks.repaint();
  }
View Full Code Here

      listLinks.ensureIndexIsVisible(0);
      return;
    }

    // Initialize array for items to be selected
    Configuration config = Configuration.getConfiguration();
    int maxCount = config.getInt(
        null,
        ConfigurationValueInteger.MAXIMUM_PAGES);
    maxCount = Math.min(maxCount, listLinks.getModel().getSize() - firstSelection);
    if (maxCount <= 0) {
      listLinks.clearSelection();
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.utils.Configuration

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.