Logo Search packages:      
Sourcecode: josm-plugins version File versions  Download package

static void org::openstreetmap::josm::plugins::validator::tests::SpellCheck::readPresetFromPreferences (  )  [inline, static]

Reads the tagging presets

Definition at line 305 of file SpellCheck.java.

References readPresets().

Referenced by initializePresets().

      {
            String allAnnotations = Main.pref.get("taggingpreset.sources");
            StringTokenizer st = new StringTokenizer(allAnnotations, ";");
            while (st.hasMoreTokens()) 
            {
                  InputStream in = null;
                  String source = st.nextToken();
                  try 
                  {
                        if (source.startsWith("http") || source.startsWith("ftp") || source.startsWith("file"))
                              in = new URL(source).openStream();
                        else if (source.startsWith("resource://"))
                              in = Main.class.getResourceAsStream(source.substring("resource:/".length()));
                        else
                              in = new FileInputStream(source);
                        readPresets(in);
                        in.close();
                  } 
                  catch (IOException e) 
                  {
                        // Error already reported by JOSM
                  } 
                  catch (SAXException e) 
                  {
                // Error already reported by JOSM
                  }
            }
      }


Generated by  Doxygen 1.6.0   Back to index