Package net.sourceforge.squirrel_sql.fw.gui

Examples of net.sourceforge.squirrel_sql.fw.gui.CursorChanger


                _panel = panel;
  }

  public void actionPerformed(ActionEvent evt)
  {
                CursorChanger cursorChg = new CursorChanger(getApplication().getMainFrame());
                cursorChg.show();
                try
                {
                        _panel.repopulateInvalidObjects();
                }
                finally
                {
                        cursorChg.restore();
                }
  }
View Full Code Here


                _panel = panel;
  }

  public void actionPerformed(ActionEvent evt)
  {
                CursorChanger cursorChg = new CursorChanger(getApplication().getMainFrame());
                cursorChg.show();
                try
                {
                        _panel.populateSessionInfo();
                }
                finally
                {
                        cursorChg.restore();
                }
  }
View Full Code Here

                _panel = panel;
  }

  public void actionPerformed(ActionEvent evt)
  {
                CursorChanger cursorChg = new CursorChanger(getApplication().getMainFrame());
                cursorChg.show();
                try
                {
                        _panel.populateDBOutput();
                }
                finally
                {
                        cursorChg.restore();
                }
  }
View Full Code Here

                _panel = panel;
  }

  public void actionPerformed(ActionEvent evt)
  {
                CursorChanger cursorChg = new CursorChanger(getApplication().getMainFrame());
                cursorChg.show();
                try
                {
                        _panel.populateSGATrace();
                }
                finally
                {
                        cursorChg.restore();
                }
  }
View Full Code Here

   * Refresh the log.
   */
  private void refreshLog()
  {
    enableComponents(false);
    final CursorChanger cursorChg = new CursorChanger(getAwtContainer());
    cursorChg.show();
    try
    {
      try
      {
        SwingUtilities.invokeAndWait(new Runnable()
        {
          public void run()
          {
            _logContentsTxt.setText("");
          }
        });
      }
      catch (final Exception ex)
      {
        // i18n[ViewLogsSheet.error.clearlogcontents=Error clearing the log contents]
        s_log.error(s_stringMgr.getString("ViewLogsSheet.error.clearlogcontents"), ex);
      }
      final File logFile = (File) _logDirCmb.getSelectedItem();
      if (logFile != null)
      {
        try
        {
          if (logFile.exists() && logFile.canRead())
          {
            final BufferedReader rdr = new BufferedReader(new FileReader(logFile));
            try
            {
              String line = null;
              StringBuilder chunk = new StringBuilder(16384);
              while ((line = rdr.readLine()) != null)
              {
                if (_closing) { return; }

                if (chunk.length() > 16000)
                {
                  final String finalLine = chunk.toString();
                  SwingUtilities.invokeAndWait(new Runnable()
                  {
                    public void run()
                    {
                      if (!_closing)
                      {
                        _logContentsTxt.append(finalLine);
                      }
                    }
                  });
                  chunk = new StringBuilder(16384);
                }
                else
                {
                  if (shouldAppendLineToChunk(line))
                  {
                    chunk.append(line).append('\n');
                  }
                }
              }

              if (_closing) { return; }

              final String finalLine = chunk.toString();
              SwingUtilities.invokeAndWait(new Runnable()
              {
                public void run()
                {
                  if (!_closing)
                  {
                    _logContentsTxt.append(finalLine);
                  }
                }
              });
            }
            finally
            {
              rdr.close();
            }
          }
        }
        catch (final Exception ex)
        {
          // i18n[ViewLogsSheet.error.processinglogfile=Error occured processing log file]
          final String msg = s_stringMgr.getString("ViewLogsSheet.error.processinglogfile");
          s_log.error(msg, ex);
        }
      }
      else
      {
        if (s_log.isDebugEnabled()) {
          // i18n[ViewLogsSheet.info.nulllogfile=Null log file name]
          s_log.debug(s_stringMgr.getString("ViewLogsSheet.info.nulllogfile"));
        }
      }

      if (_closing) { return; }

      // Position to the start of the last line in log.
      try
      {
        final int pos = Math.max(0, _logContentsTxt.getText().length() - 1);
        final int line = _logContentsTxt.getLineOfOffset(pos);
        final int finalpos = _logContentsTxt.getLineStartOffset(line);
        SwingUtilities.invokeAndWait(new Runnable()
        {
          public void run()
          {
            _logContentsTxt.setCaretPosition(finalpos);
          }
        });
      }
      catch (final Exception ex)
      {
        // i18n[ViewLogsSheet.error.setcaret=Error positioning caret in log text component]
        s_log.error(s_stringMgr.getString("ViewLogsSheet.error.setcaret"), ex);
      }
    }
    finally
    {
      enableComponents(true);
      _refreshing = false;
      cursorChg.restore();
    }
  }
View Full Code Here

      _app.getSquirrelPreferences().getShowColoriconsInToolbar());
  }

  public void actionPerformed(ActionEvent evt)
  {
    CursorChanger cursorChg = new CursorChanger(_app.getMainFrame());
    cursorChg.show();
    try
    {
      super.actionPerformed(evt);
    }
    finally
    {
      cursorChg.restore();
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.fw.gui.CursorChanger

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.