View Javadoc

1   /*
2   Karma CLI - Command Line Interface for the Karma application
3   Copyright (C) 2004  Toolforge <www.toolforge.nl>
4   
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9   
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  Lesser General Public License for more details.
14  
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19  package nl.toolforge.karma.cli.cmd;
20  
21  import nl.toolforge.karma.core.cmd.CommandDescriptor;
22  import nl.toolforge.karma.core.cmd.CommandException;
23  import nl.toolforge.karma.core.cmd.event.MessageEvent;
24  import nl.toolforge.karma.core.cmd.event.SimpleMessage;
25  import nl.toolforge.karma.core.cmd.impl.SelectManifest;
26  
27  /***
28   * @author W.H. Schraal
29   *
30   * @version $Id: SelectManifestImpl.java,v 1.23 2004/10/09 21:28:06 asmedes Exp $
31   */
32  public class SelectManifestImpl extends SelectManifest {
33  
34    public SelectManifestImpl(CommandDescriptor descriptor) {
35      super(descriptor);
36    }
37  
38    /***
39     * Execute the command in the CLI. When the execution was succesfull, a message is shown on the console.
40     *
41     */
42    public void execute() throws CommandException {
43  
44      // Use stuff that's being done in the superclass.
45      //
46      super.execute(); // Ignore the response from the superclass
47  
48  		SimpleMessage message =
49          new SimpleMessage(
50              getFrontendMessages().getString("message.MANIFEST_ACTIVATED"), new Object[]{getSelectedManifest().getName()}
51          );
52      getCommandResponse().addEvent(new MessageEvent(this, message));
53    }
54  }