/*-------------------------------------------------------------------------- * Copyright 2008 utgenome.org * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *--------------------------------------------------------------------------*/ //-------------------------------------- // utgb-shell Project // // GWT.java // Since: Jun 2, 2008 // // $URL$ // $Author$ //-------------------------------------- package org.utgenome.shell; import java.io.IOException; import org.utgenome.config.TrackConfiguration; import org.xerial.util.log.Logger; /** * A sub command for creating a GWT interface * * @author leo * */ public class GWT extends UTGBShellSubCommandBase { private static Logger _logger = Logger.getLogger(GWT.class); @Override public void execute(String[] args) throws UTGBShellException { TrackConfiguration config = loadTrackConfiguration(); if (!isInProjectRoot()) throw new UTGBShellException("must be in the project root"); String packageName = config.getPackage(); String projectName = config.getProjectName(); ScaffoldGenerator generator = new ScaffoldGenerator(globalOption.projectDir, new Create.CreateAllScaffoldFileFilter()); try { generator.createGWTModuleScaffold(projectName, packageName); } catch (IOException e) { _logger.error("failed to craate GWT module: " + e.getMessage()); } } @Override public String name() { return "gwt"; } public String getDetailedDescription() { return loadUsage("help-gwt.txt"); } public String getOneLinerDescription() { return "create a GWT interface"; } public String getOptionList() { return ""; } }