01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.romaframework.wizard.command.project.impl;
18:
19: import org.romaframework.wizard.ProjectManager;
20: import org.romaframework.wizard.command.BaseWizardCommand;
21:
22: /**
23: * This wizard set the current project in roma config. See help to know syntax.
24: *
25: * @author Luca Garulli (luca.garulli@assetdata.it)
26: */
27: public class ProjectSwitchWizard extends BaseWizardCommand {
28: public String getName() {
29: return "switch";
30: }
31:
32: public String getParameters() {
33: return "<project-name> [<project-path>]";
34: }
35:
36: public void execute(String[] iParameters) {
37: if (iParameters.length < 2)
38: syntaxError();
39:
40: String projectName = iParameters[1];
41:
42: String projectPath = null;
43: if (iParameters.length > 2)
44: projectPath = iParameters[2];
45:
46: // UPDATE PROJECT INFORMATION
47: ProjectManager.getInstance().switchCurrentProject(projectName,
48: projectPath);
49: }
50:
51: public void help() {
52: getIO().getError().println(getCommandHelp());
53: getIO()
54: .getError()
55: .println(
56: " where: <project-name> is the name of project you want to set as current");
57: getIO()
58: .getError()
59: .println(
60: " <project-path> is the project path in case is changed");
61: }
62: }
|