Examples of XMLBeanWriter


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

  {
    try
    {
      File f = getGlobalPrefsFile();

      XMLBeanWriter xbw = new XMLBeanWriter();

      Collection<OracleAliasPrefs> set = _oracleAliasPrefsByAliasIdentifier.values();
      if (set.size() > 0)
      {
        xbw.addIteratorToRoot(set.iterator());
      }

      xbw.save(f);
    } catch (Exception e)
    {
      throw new RuntimeException(e);
    }
View Full Code Here

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

   */
  private void savePrefs()
  {
    try
    {
      XMLBeanWriter wtr = new XMLBeanWriter(_prefs);
      wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME));
    }
    catch (Exception ex)
    {
      // i18n[exportconfig.errorWritingPrefs=Error occured writing to preferences file: {0}]
      s_log.error(s_stringMgr.getString("exportconfig.errorWritingPrefs", USER_PREFS_FILE_NAME), ex);
View Full Code Here

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

    */
   protected void save()
   {
      try
      {
         XMLBeanWriter xmlout = new XMLBeanWriter();

         for (Iterator<Bookmark> i = bookmarks.iterator(); i.hasNext();)
         {
            Bookmark bookmark = i.next();

            xmlout.addToRoot(bookmark);
         }

         xmlout.save(bookmarkFile);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

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

  public void writeScriptProps(ScriptProps scriptProps)
  {
    try
    {
      XMLBeanWriter bw = new XMLBeanWriter(scriptProps);
      bw.save(getScriptPropertiesFile());
    }
    catch (Exception e)
    {
      throw new RuntimeException(e);
    }
View Full Code Here

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

         {
            File pluginUserSettingsFolder = _plugin.getPluginUserSettingsFolder();

            File cfgsFile = new File(pluginUserSettingsFolder.getPath(), HIBERNATE_CONFIGS_XML_FILE);

            XMLBeanWriter bw = new XMLBeanWriter();

            ArrayList<HibernateConfiguration> buf = new ArrayList<HibernateConfiguration>();
            for (int i = 0; i < _panel.cboConfigs.getItemCount(); i++)
            {
               HibernateConfiguration cfg = (HibernateConfiguration) _panel.cboConfigs.getItemAt(i);
               bw.addToRoot(cfg);
               buf.add(cfg);
            }

            bw.save(cfgsFile);

            if(null != _hibernatePrefsListener)
            {
               _hibernatePrefsListener.configurationChanged(buf);
            }
View Full Code Here

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

   private void saveFormats()
   {
      try
      {
         String userSettingsFolder = _plugin.getPluginUserSettingsFolder().getPath();
         XMLBeanWriter bw = new XMLBeanWriter();
         for (int i = 0; i < _formats.length; i++)
         {
            bw.addToRoot(_formats[i]);
         }
         bw.save(userSettingsFolder + File.separator + FORMAT_XML_FILE_NAME);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

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

     * Save preferences to disk.  Always write to the user settings folder, not
     * the application settings folder.
     */
    public static void savePrefs() {
        try {
            XMLBeanWriter wtr = new XMLBeanWriter(_prefs);
            wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME));
        } catch (Exception ex) {
            s_log.error("Error occured writing to preferences file: "
                    + USER_PREFS_FILE_NAME, ex);
        }
    }
View Full Code Here

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

  private void savePrefs()
  {
    try
    {
      File prefsFile = new File(getPluginUserSettingsFolder(), PREFS_FILE_NAME);
      final XMLBeanWriter wtr = new XMLBeanWriter(_newSessionPrefs);
      wtr.save(prefsFile);
    }
    catch (Exception e)
    {
      throw new RuntimeException(e);
    }
View Full Code Here

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

   public void write(GraphControllerXmlBean xmlBean)
   {
      try
      {
         XMLBeanWriter bw = new XMLBeanWriter(xmlBean);
         bw.save(_graphFile);

      String[] params = {xmlBean.getTitle(), _graphFile};
      // i18n[graph.graphSaved=Graph "{0}" saved to "{1}"]
      String msg = s_stringMgr.getString("graph.graphSaved", params);
View Full Code Here

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

            try {
                if (_exportPrefsChk.getModel().isSelected()) {
                    File f = new File(_exportPrefsText.getText());
                    if (!f.exists() || confirmOverwrite(f)) {
                        SquirrelPreferences prefs = _app.getSquirrelPreferences();
                        new XMLBeanWriter(prefs).save(f);
                    }
                }
                if (_exportDriversChk.getModel().isSelected()) {
                    File f = new File(_exportDriversText.getText());
                    if (!f.exists() || confirmOverwrite(f)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.