Package net.sourceforge.squirrel_sql.fw.xml

Examples of net.sourceforge.squirrel_sql.fw.xml.XMLBeanReader


   */
  private void loadOldPrefs(File oldPrefsFile) throws XMLException
  {
    try
    {
      XMLBeanReader doc = new XMLBeanReader();
      doc.load(oldPrefsFile, getClass().getClassLoader());
      Iterator<?> it = doc.iterator();
      if (it.hasNext())
      {
        _lafPrefs = (LAFPreferences) it.next();
      }
    }
View Full Code Here


   protected void load() throws IOException
   {

      try
      {
         XMLBeanReader xmlin = new XMLBeanReader();

         if (bookmarkFile.exists())
         {
            xmlin.load(bookmarkFile, getClass().getClassLoader());
            for (Iterator<?> i = xmlin.iterator(); i.hasNext();)
            {
               Object bean = i.next();
               if (bean instanceof Bookmark)
               {
                  add((Bookmark) bean);
View Full Code Here

  {
    try
    {
      if(getScriptPropertiesFile().exists())
      {
        XMLBeanReader br = new XMLBeanReader();
        br.load(getScriptPropertiesFile(), this.getClass().getClassLoader());
        return (ScriptProps) br.iterator().next();
      }
      else
      {
        return null;
      }
View Full Code Here

   public void initialize()
   {
      try
      {
         XMLBeanReader reader = HibernateUtil.createHibernateConfigsReader(_plugin);

         if (reader == null)
         {
            return;
         }
View Full Code Here

         LoggerController.createLogger(HibernateUtil.class);

   public static XMLBeanReader createHibernateConfigsReader(HibernatePlugin plugin)
         throws IOException, XMLException
   {
      XMLBeanReader reader = new XMLBeanReader();
      File pluginUserSettingsFolder = plugin.getPluginUserSettingsFolder();


      File xmlFile = getXmlFile(pluginUserSettingsFolder);


      if (false == xmlFile.exists())
      {
         return null;
      }

      reader.load(xmlFile, plugin.getClass().getClassLoader());
      return reader;
   }
View Full Code Here

   private void loadConfigsFromXml()
      throws IOException, XMLException
   {

      XMLBeanReader reader = HibernateUtil.createHibernateConfigsReader(_plugin);

      if (null != reader)
      {
         loadConfigs(reader, Preferences.userRoot().get(PREF_KEY_LAST_SELECTED_CONFIG, null));
      }
View Full Code Here

         File f = new File(userSettingsFolder + File.separator + FORMAT_XML_FILE_NAME);

         if(f.exists())
         {
            XMLBeanReader br = new XMLBeanReader();
            br.load(userSettingsFolder + File.separator + FORMAT_XML_FILE_NAME, this.getClass().getClassLoader());

            Vector<FormatXmlBean> buf = new Vector<FormatXmlBean>();

            for(Iterator<?> i=br.iterator(); i.hasNext();)
            {
               buf.add((FormatXmlBean)i.next());
            }

            _formats = buf.toArray(new FormatXmlBean[buf.size()]);
View Full Code Here

     * Load from preferences file.
     */
    private static void loadPrefs() {
        File prefFile = null;
        try {
            XMLBeanReader doc = new XMLBeanReader();
           
            prefFile = PreferenceUtil.getPreferenceFileToReadFrom(plugin);
           
            doc.load(prefFile, DBCopyPreferenceBean.class.getClassLoader());
           
            Iterator<Object> it = doc.iterator();
            if (it.hasNext()) {
                _prefs = (DBCopyPreferenceBean)it.next();
            }
        } catch (FileNotFoundException ignore) {
            s_log.info(USER_PREFS_FILE_NAME + "("+prefFile.getAbsolutePath()+
View Full Code Here

    {
      _newSessionPrefs = new CodeCompletionPreferences();
      File prefsFile = new File(getPluginUserSettingsFolder(), PREFS_FILE_NAME);
      if(prefsFile.exists())
      {
        XMLBeanReader reader = new XMLBeanReader();
        reader.load(prefsFile, getClass().getClassLoader());

        Iterator<?> it = reader.iterator();

        if (it.hasNext())
        {
          _newSessionPrefs = (CodeCompletionPreferences) it.next();
        }
View Full Code Here

   public GraphControllerXmlBean read()
   {
      try
      {
         XMLBeanReader br = new XMLBeanReader();
         br.load(_graphFile, this.getClass().getClassLoader());
         return (GraphControllerXmlBean) br.iterator().next();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.fw.xml.XMLBeanReader

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.