[Squirrel-sql-commits] sql12/app/src/net/sourceforge/squirrel_sql/client/mainframe/action DeleteAl
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Gerd W. <ger...@us...> - 2006-06-23 21:41:22
|
Update of /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/mainframe/action In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15128/app/src/net/sourceforge/squirrel_sql/client/mainframe/action Modified Files: DeleteAliasAction.java DeleteAliasCommand.java Log Message: Oracle Alias Properties Index: DeleteAliasCommand.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/mainframe/action/DeleteAliasCommand.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DeleteAliasCommand.java 6 Oct 2003 01:09:52 -0000 1.2 --- DeleteAliasCommand.java 23 Jun 2006 21:41:17 -0000 1.3 *************** *** 27,30 **** --- 27,32 ---- import net.sourceforge.squirrel_sql.client.IApplication; + import net.sourceforge.squirrel_sql.client.gui.db.SQLAlias; + /** * This <CODE>ICommand</CODE> allows the user to delete an existing *************** *** 35,89 **** public class DeleteAliasCommand implements ICommand { ! /** Internationalized strings for this class. */ ! private static final StringManager s_stringMgr = ! StringManagerFactory.getStringManager(DeleteAliasCommand.class); ! /** Application API. */ ! private final IApplication _app; ! /** Owner of the maintenance dialog. */ ! private Frame _frame; ! /** <TT>ISQLAlias</TT> to be deleted. */ ! private ISQLAlias _sqlAlias; ! /** ! * Ctor. ! * ! * @param app Application API. ! * @param frame Owning <TT>Frame</TT>. ! * @param sqlAlias <ISQLAlias</TT> to be deleted. ! * ! * @throws IllegalArgumentException ! * Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> or ! * <TT>IApplication</TT> passed. ! */ ! public DeleteAliasCommand(IApplication app, Frame frame, ! ISQLAlias sqlAlias) ! { ! super(); ! if (app == null) ! { ! throw new IllegalArgumentException("Null IApplication passed"); ! } ! if (sqlAlias == null) ! { ! throw new IllegalArgumentException("Null ISQLAlias passed"); ! } ! _app = app; ! _frame = frame; ! _sqlAlias = sqlAlias; ! } ! /** ! * Delete the current <TT>ISQLAlias</TT> after confirmation. ! */ ! public void execute() ! { ! if (Dialogs.showYesNo(_frame, s_stringMgr.getString("DeleteAliasCommand.confirm", _sqlAlias.getName()))) ! { ! _app.getDataCache().removeAlias(_sqlAlias); ! } ! } } --- 37,90 ---- public class DeleteAliasCommand implements ICommand { ! /** Internationalized strings for this class. */ ! private static final StringManager s_stringMgr = ! StringManagerFactory.getStringManager(DeleteAliasCommand.class); ! /** Application API. */ ! private final IApplication _app; ! /** Owner of the maintenance dialog. */ ! private Frame _frame; ! /** <TT>SQLAlias</TT> to be deleted. */ ! private SQLAlias _sqlAlias; ! /** ! * Ctor. ! * ! * @param app Application API. ! * @param frame Owning <TT>Frame</TT>. ! * @param sqlAlias <ISQLAlias</TT> to be deleted. ! * ! * @throws IllegalArgumentException ! * Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> or ! * <TT>IApplication</TT> passed. ! */ ! public DeleteAliasCommand(IApplication app, Frame frame, SQLAlias sqlAlias) ! { ! super(); ! if (app == null) ! { ! throw new IllegalArgumentException("Null IApplication passed"); ! } ! if (sqlAlias == null) ! { ! throw new IllegalArgumentException("Null ISQLAlias passed"); ! } ! _app = app; ! _frame = frame; ! _sqlAlias = sqlAlias; ! } ! /** ! * Delete the current <TT>ISQLAlias</TT> after confirmation. ! */ ! public void execute() ! { ! if (Dialogs.showYesNo(_frame, s_stringMgr.getString("DeleteAliasCommand.confirm", _sqlAlias.getName()))) ! { ! _app.getDataCache().removeAlias(_sqlAlias); ! } ! } } Index: DeleteAliasAction.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/mainframe/action/DeleteAliasAction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DeleteAliasAction.java 15 Dec 2005 12:27:45 -0000 1.5 --- DeleteAliasAction.java 23 Jun 2006 21:41:17 -0000 1.6 *************** *** 31,34 **** --- 31,36 ---- import net.sourceforge.squirrel_sql.client.gui.db.AliasesListInternalFrame; import net.sourceforge.squirrel_sql.client.gui.db.IAliasesList; + import net.sourceforge.squirrel_sql.client.gui.db.SQLAlias; + /** * This <CODE>Action</CODE> allows the user to delete an <TT>ISQLAlias</TT>. *************** *** 38,97 **** public class DeleteAliasAction extends SquirrelAction { ! /** Logger for this class. */ ! private static ILogger s_log = ! LoggerController.createLogger(DeleteAliasAction.class); ! /** ! * List of all the users aliases. ! */ ! private IAliasesList _aliases; /** Internationalized strings for this class. */ private static final StringManager s_stringMgr = ! StringManagerFactory.getStringManager(DeleteAliasAction.class); ! ! /** ! * Ctor specifying the list of aliases. ! * ! * @param app Application API. ! * @param list List of <TT>ISQLAlias</TT> objects. ! * ! * @throws IllegalArgumentException ! * thrown if a <TT>null</TT> <TT>AliasesList</TT> passed. ! */ ! public DeleteAliasAction(IApplication app, IAliasesList list) ! { ! super(app); ! if (list == null) ! { ! throw new IllegalArgumentException("Null AliasesList passed"); ! } ! _aliases = list; ! } ! /** ! * Perform this action. Use the <TT>DeleteAliasCommand</TT>. ! * ! * @param evt The current event. ! */ ! public void actionPerformed(ActionEvent evt) ! { ! IApplication app = getApplication(); ! AliasesListInternalFrame tw = app.getWindowManager().getAliasesListInternalFrame(); ! tw.moveToFront(); ! try ! { ! tw.setSelected(true); ! } ! catch (PropertyVetoException ex) ! { //i18n[DeleteAliasAction.error.selectingwindow=Error selecting window] ! s_log.error(s_stringMgr.getString("DeleteAliasAction.error.selectingwindow"), ex); ! } ! ISQLAlias alias = _aliases.getSelectedAlias(); ! if (alias != null) ! { ! new DeleteAliasCommand(app, getParentFrame(evt), alias).execute(); ! } ! } } --- 40,99 ---- public class DeleteAliasAction extends SquirrelAction { ! /** Logger for this class. */ ! private static ILogger s_log = ! LoggerController.createLogger(DeleteAliasAction.class); ! /** ! * List of all the users aliases. ! */ ! private IAliasesList _aliases; /** Internationalized strings for this class. */ private static final StringManager s_stringMgr = ! StringManagerFactory.getStringManager(DeleteAliasAction.class); ! /** ! * Ctor specifying the list of aliases. ! * ! * @param app Application API. ! * @param list List of <TT>ISQLAlias</TT> objects. ! * ! * @throws IllegalArgumentException ! * thrown if a <TT>null</TT> <TT>AliasesList</TT> passed. ! */ ! public DeleteAliasAction(IApplication app, IAliasesList list) ! { ! super(app); ! if (list == null) ! { ! throw new IllegalArgumentException("Null AliasesList passed"); ! } ! _aliases = list; ! } ! ! /** ! * Perform this action. Use the <TT>DeleteAliasCommand</TT>. ! * ! * @param evt The current event. ! */ ! public void actionPerformed(ActionEvent evt) ! { ! IApplication app = getApplication(); ! AliasesListInternalFrame tw = app.getWindowManager().getAliasesListInternalFrame(); ! tw.moveToFront(); ! try ! { ! tw.setSelected(true); ! } ! catch (PropertyVetoException ex) ! { //i18n[DeleteAliasAction.error.selectingwindow=Error selecting window] ! s_log.error(s_stringMgr.getString("DeleteAliasAction.error.selectingwindow"), ex); ! } ! SQLAlias alias = _aliases.getSelectedAlias(); ! if (alias != null) ! { ! new DeleteAliasCommand(app, getParentFrame(evt), alias).execute(); ! } ! } } |