View Javadoc

1   package net.sf.tomp.xtcl.command;
2   
3   import net.sf.tomp.xtcl.Context;
4   
5   /***
6    * Sets verbosity to Context.
7    * 
8    * @author tomp
9    */
10  public class Verbose extends AbstractCommand {
11  	
12      /*** verbosity */
13      protected boolean verbose;
14  
15      /***
16       * Remembers verbosity to be later set Context.
17       * 
18       * @param v verbosity 
19       */
20      public void setVerbose(boolean v) {
21          verbose = v;
22      }
23  
24      /***
25       * Sets verbosity to Context.
26       */
27      public int execute(Context c) throws Exception {
28          c.setVerbose(verbose);
29          return done(c, 0);
30      }
31  
32      /***
33       * @return "VERBOSE " + (verbose ? "ON" : "OFF");
34       */
35      public String toString() {
36          return "VERBOSE " + (verbose ? "ON" : "OFF");
37      }
38  }
39  
40  /*
41   * The contents of this file are subject to the Mozilla Public License Version
42   * 1.1 (the "License"); you may not use this file except in compliance with the
43   * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
44   * Software distributed under the License is distributed on an "AS IS" basis,
45   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
46   * the specific language governing rights and limitations under the License. The
47   * Original Code is: all this file. The Initial Developer of the Original Code
48   * is: Tomas Pitner, Masaryk University in Brno, Czech Republic. Contributor(s):
49   */