1 24 25 package org.objectweb.cjdbc.console.text.commands.dbadmin; 26 27 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 28 import org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin; 29 30 37 public class ExpertMode extends AbstractAdminCommand 38 { 39 40 private static final String ON = "on"; 41 private static final String OFF = "off"; 42 43 48 public ExpertMode(VirtualDatabaseAdmin module) 49 { 50 super(module); 51 } 52 53 56 public void parse(String commandText) throws Exception 57 { 58 if (ON.equals(commandText.trim())) 59 { 60 ((VirtualDatabaseAdmin)module).addExpertCommands(); 61 console.printInfo(ConsoleTranslate.get("admin.command.expert.mode.switched.on")); 62 } else if (OFF.equals(commandText.trim())) 63 { 64 ((VirtualDatabaseAdmin)module).removeExpertCommands(); 65 console.printInfo(ConsoleTranslate.get("admin.command.expert.mode.switched.off")); 66 } else 67 { 68 console.printError(getUsage()); 69 } 70 } 71 72 75 public String getCommandName() 76 { 77 return "expert"; 78 } 79 80 83 public String getCommandDescription() 84 { 85 return ConsoleTranslate.get("admin.command.expert.mode.description"); 86 } 87 88 91 public String getCommandParameters() 92 { 93 return ConsoleTranslate.get("admin.command.expert.mode.params"); 94 } 95 } 96 | Popular Tags |