Package org.wikipediacleaner.utils

Examples of org.wikipediacleaner.utils.Configuration


            GT._("You must input a page name for updating warnings"),
            (text != null) ? text : combo);
        return null;
      }
      tmp = tmp.trim();
      Configuration config = Configuration.getConfiguration();
      config.setString(
          null, ConfigurationValueString.PAGE_NAME, tmp);
      config.save();
      return Collections.singletonList(
          DataManager.getPage(wiki, tmp, null, null, null));
    }

    return null;
View Full Code Here


      String message,
      ConfigurationValueBoolean property) {
    if (property == null) {
      return null;
    }
    Configuration config = Configuration.getConfiguration();
    boolean selected = config.getBoolean(null, property);
    JCheckBox chk = Utilities.createJCheckBox(message, selected);
    booleanValues.put(property, chk);
    return chk;
  }
View Full Code Here

  /**
   * Apply new values to the boolean options.
   */
  private void applyBoolean() {
    Configuration config = Configuration.getConfiguration();

    for (Entry<ConfigurationValueBoolean, JCheckBox> entry : booleanValues.entrySet()) {
      if ((entry.getValue() != null) && (entry.getKey() != null)) {
        config.setBoolean(null, entry.getKey(), entry.getValue().isSelected());
      }
    }
  }
View Full Code Here

      ConfigurationValueInteger property,
      int minimum, int maximum, int stepSize) {
    if (property == null) {
      return null;
    }
    Configuration config = Configuration.getConfiguration();
    int value = config.getInt(null, property);
    SpinnerNumberModel model = new SpinnerNumberModel(value, minimum, maximum, stepSize);
    JSpinner spin = new JSpinner(model);
    integerValues.put(property, spin);
    return spin;
  }
View Full Code Here

      ConfigurationValueInteger property,
      ButtonGroup group) {
    if ((property == null) || (group == null)) {
      return;
    }
    Configuration config = Configuration.getConfiguration();
    int value = config.getInt(null, property);
    integerValues.put(property, group);
    setButtonGroupSelection(group, value);
  }
View Full Code Here

  /**
   * Apply new values to the integer options.
   */
  private void applyInteger() {
    Configuration config = Configuration.getConfiguration();

    for (Entry<ConfigurationValueInteger, Object> entry : integerValues.entrySet()) {
      if ((entry.getValue() != null) && (entry.getKey() != null)) {
        if (entry.getValue() instanceof JSpinner) {
          JSpinner spinner = (JSpinner) entry.getValue();
          Object value = spinner.getValue();
          if (value instanceof Integer) {
            Integer intValue = (Integer) value;
            config.setInt(null, entry.getKey(), intValue.intValue());
          }
        }
        if (entry.getValue() instanceof ButtonGroup) {
          ButtonGroup group = (ButtonGroup) entry.getValue();
          int count = 0;
          Enumeration<AbstractButton> buttons = group.getElements();
          while (buttons.hasMoreElements()) {
            AbstractButton button = buttons.nextElement();
            if (group.isSelected(button.getModel())) {
              config.setInt(null, entry.getKey(), count);
            }
            count++;
          }
        }
      }
View Full Code Here

      ConfigurationValueString property,
      int columns) {
    if (property == null) {
      return null;
    }
    Configuration config = Configuration.getConfiguration();
    String value = config.getString(null, property);
    JTextField txt = new JTextField(columns);
    txt.setText(value);
    stringValues.put(property, txt);
    return txt;
  }
View Full Code Here

    if (property == null) {
      return null;
    }
    JComboBox combo = new JComboBox(items);
    combo.setEditable(false);
    Configuration config = Configuration.getConfiguration();
    String value = config.getString(null, property);
    combo.setSelectedItem(value);
    stringValues.put(property, combo);
    return combo;
  }
View Full Code Here

  /**
   * Apply new values to the string options.
   */
  private void applyString() {
    Configuration config = Configuration.getConfiguration();

    for (Entry<ConfigurationValueString, JComponent> entry : stringValues.entrySet()) {
      if ((entry.getValue() != null) && (entry.getKey() != null)) {
        if (entry.getValue() instanceof JTextField) {
          JTextField text = (JTextField) entry.getValue();
          config.setString(null, entry.getKey(), text.getText());
        }
        if (entry.getValue() instanceof JComboBox) {
          JComboBox combo = (JComboBox) entry.getValue();
          Object selection = combo.getSelectedItem();
          if (selection != null) {
            config.setString(null, entry.getKey(), selection.toString());
          }
        }
      }
    }
  }
View Full Code Here

    if ((doc == null) || (pageAnalysis == null)) {
      return;
    }

    // Retrieve configuration
    Configuration config = Configuration.getConfiguration();
    int limit = config.getInt(null, ConfigurationValueInteger.SYNTAX_HIGHLIGHTING_LIMIT);
    if (doc.getLength() > limit) {
      return;
    }
    ConfigurationValueStyle.StyleProperties styleCategory = config.getStyle(
        ConfigurationValueStyle.CATEGORY);
    ConfigurationValueStyle.StyleProperties styleComments = config.getStyle(
        ConfigurationValueStyle.COMMENTS);
    ConfigurationValueStyle.StyleProperties styleExternalLink = config.getStyle(
        ConfigurationValueStyle.EXTERNAL_LINK);
    ConfigurationValueStyle.StyleProperties styleImage = config.getStyle(
        ConfigurationValueStyle.IMAGE);
    ConfigurationValueStyle.StyleProperties styleInternalLink = config.getStyle(
        ConfigurationValueStyle.INTERNAL_LINK);
    ConfigurationValueStyle.StyleProperties styleInterwikiLink = config.getStyle(
        ConfigurationValueStyle.INTERWIKI_LINK);
    ConfigurationValueStyle.StyleProperties styleLanguageLink = config.getStyle(
        ConfigurationValueStyle.LANGUAGE_LINK);
    ConfigurationValueStyle.StyleProperties styleProgramming = config.getStyle(
        ConfigurationValueStyle.PROGRAMMING);
    ConfigurationValueStyle.StyleProperties styleTag = config.getStyle(
        ConfigurationValueStyle.TAG);
    ConfigurationValueStyle.StyleProperties styleTemplate = config.getStyle(
        ConfigurationValueStyle.TEMPLATE);
    ConfigurationValueStyle.StyleProperties styleTitle = config.getStyle(
        ConfigurationValueStyle.TITLE);

    // Format
    List<PageElement> elements = pageAnalysis.getElements(
        styleCategory.getEnabled(),
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.