/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/action/CloseAllSQLResultWindowsCommand.java

https://github.com/igorhvr/squirrel-sql · Java · 58 lines · 20 code · 4 blank · 34 comment · 2 complexity · ebef6fbb14fdcca604a04e0aae80edf9 MD5 · raw file

  1. package net.sourceforge.squirrel_sql.client.session.action;
  2. /*
  3. * Copyright (C) 2001-2004 Colin Bell
  4. * colbell@users.sourceforge.net
  5. *
  6. * Modifications Copyright (C) 2003-2004 Jason Height
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. import net.sourceforge.squirrel_sql.fw.util.ICommand;
  23. import net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI;
  24. /**
  25. * This <CODE>ICommand</CODE> closes all the torn off SQL Results
  26. * windows for the specified session.
  27. *
  28. * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
  29. */
  30. public class CloseAllSQLResultWindowsCommand implements ICommand
  31. {
  32. private final ISQLPanelAPI _api;
  33. /**
  34. * Ctor.
  35. *
  36. * @param api
  37. *
  38. * @throws IllegalArgumentException
  39. * Thrown if a <TT>null</TT> <TT>ISession</TT> passed.
  40. */
  41. public CloseAllSQLResultWindowsCommand(ISQLPanelAPI api)
  42. {
  43. super();
  44. if (api == null)
  45. {
  46. throw new IllegalArgumentException("ISQLPanelAPI == null");
  47. }
  48. _api = api;
  49. }
  50. public void execute()
  51. {
  52. _api.closeAllSQLResultFrames();
  53. }
  54. }