Package net.sourceforge.squirrel_sql.client.util

Examples of net.sourceforge.squirrel_sql.client.util.ApplicationFiles


  }

    @SuppressWarnings("unchecked")
  public static SquirrelPreferences load()
  {
    File prefsFile = new ApplicationFiles().getUserPreferencesFile();
    try
    {
      XMLBeanReader doc = new XMLBeanReader();
      doc.load(prefsFile);
      Iterator it = doc.iterator();
View Full Code Here


  /**
   * Save preferences to disk.
   */
  public synchronized void save()
  {
    File prefsFile = new ApplicationFiles().getUserPreferencesFile();
    try
    {
      XMLBeanWriter wtr = new XMLBeanWriter(this);
      wtr.save(prefsFile);
    }
View Full Code Here

      createUserInterface();
    }

    void loadData(IApplication app, SquirrelPreferences prefs)
    {
      final ApplicationFiles appFiles = new ApplicationFiles();
      _loginTimeout.setInt(prefs.getLoginTimeout());
            _largeScriptStmtCount.setInt(prefs.getLargeScriptStmtCount());
      _debugJdbcStream.setSelected(prefs.isJdbcDebugToStream());
      _debugJdbcWriter.setSelected(prefs.isJdbcDebugToWriter());
      _debugJdbcDont.setSelected(prefs.isJdbcDebugDontDebug());
      _jdbcDebugLogFileNameLbl.setText(appFiles.getJDBCDebugLogFile().getPath());
         _fileOpenInPreviousDir.setSelected(prefs.isFileOpenInPreviousDir());
         _fileOpenInSpecifiedDir.setSelected(prefs.isFileOpenInSpecifiedDir());
         _fileSpecifiedDir.setText(prefs.getFileSpecifiedDir());
    }
View Full Code Here

      gbc.fill = GridBagConstraints.HORIZONTAL;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets(2, 4, 2, 4);
         gbc.anchor = GridBagConstraints.NORTHWEST;

         ApplicationFiles appFiles = new ApplicationFiles();
         String execLogFile = appFiles.getExecutionLogFile().getPath();
         String configFile = ApplicationArguments.getInstance().getLoggingConfigFileName();
         configFile = null == configFile ? s_stringMgr.getString("GeneralPreferencesPanel.unspecified") :configFile;

         gbc.gridx = 0;
      gbc.gridy = 0;
View Full Code Here

         final GridBagConstraints gbc = new GridBagConstraints();
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets(2, 4, 2, 4);
         gbc.anchor = GridBagConstraints.NORTHWEST;

         ApplicationFiles appFiles = new ApplicationFiles();
         String userDir = appFiles.getUserSettingsDirectory().getPath();
         String homeDir = appFiles.getSquirrelHomeDir().getPath();


         gbc.gridx = 0;
         gbc.gridy = 0;
         // i18n[GeneralPreferencesPanel.squirrelHomePath=Home directory: -home {0}]
View Full Code Here

   {
      String uniquePrefix = alias.getIdentifier().toString();

      uniquePrefix = uniquePrefix.replace(':', '_').replace(File.separatorChar, '-');

      String path = new ApplicationFiles().getUserSettingsDirectory().getPath() +
                    File.separator + "schemacaches" + File.separator + uniquePrefix + "_schemacache.ser";

      File ret = new File(path);
      ret.getParentFile().mkdirs();
View Full Code Here

  {
    String logConfigFileName = ApplicationArguments.getInstance().getLoggingConfigFileName();
    if (logConfigFileName != null) {
      PropertyConfigurator.configure(logConfigFileName);
    } else {
      ApplicationFiles appFiles = new ApplicationFiles();
     
      String logMessagePattern = "%-4r [%t] %-5p %c %x - %m%n";
      Layout layout = new PatternLayout(logMessagePattern);
     
      File logsDir = new File(appFiles.getUserSettingsDirectory(), "logs");
      File updateLogFile = new File(logsDir, "updater.log");
     
      FileAppender appender = new FileAppender(layout, updateLogFile.getAbsolutePath());
     
      LoggerController.registerLoggerFactory(new SquirrelLoggerFactory(appender, false));
View Full Code Here

    indicateNewStartupTask(splash, s_stringMgr.getString("Application.splash.createjdbcmgr"));
    _driverMgr = new SQLDriverManager();

    // TODO: pass in a message handler so user gets error msgs.
    indicateNewStartupTask(splash, s_stringMgr.getString("Application.splash.loadingjdbc"));
    _appFiles = new ApplicationFiles();

    String errMsg = FileTransformer.transform(_appFiles);
    if (null != errMsg)
    {
      System.err.println(errMsg);
View Full Code Here

  private void loadSQLHistory()
  {
    try
    {
      XMLBeanReader doc = new XMLBeanReader();
      doc.load(new ApplicationFiles().getUserSQLHistoryFile());
      Iterator it = doc.iterator();
      if (it.hasNext())
      {
        _sqlHistory = (SQLHistory) it.next();
      }
View Full Code Here

          _sqlHistory.setData(reducedData);
        }
      }

      XMLBeanWriter wtr = new XMLBeanWriter(_sqlHistory);
      wtr.save(new ApplicationFiles().getUserSQLHistoryFile());
    }
    catch (Exception ex)
    {
      // i18n[Application.error.savesqlhistory=Unable to write SQL queries to persistant storage.]
      s_log.error(s_stringMgr.getString("Application.error.savesqlhistory"), ex);
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.util.ApplicationFiles

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.