1 | /*
|
---|
2 | * Copyright 2005 Paul Hinds
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
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 | package org.tp23.antinstaller.runtime.exe;
|
---|
17 |
|
---|
18 | import java.util.ResourceBundle;
|
---|
19 | import org.tp23.antinstaller.InstallException;
|
---|
20 | import org.tp23.antinstaller.InstallerContext;
|
---|
21 |
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Executes the Screens part of the build
|
---|
25 | * @author Paul Hinds
|
---|
26 | * @version $Id: ExecuteRunnerFilter.java,v 1.3 2006/12/21 01:48:51 teknopaul Exp $
|
---|
27 | */
|
---|
28 | public class ExecuteRunnerFilter implements ExecuteFilter {
|
---|
29 |
|
---|
30 | private static final ResourceBundle res = ResourceBundle.getBundle("resources.LanguagePack");
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext)
|
---|
34 | */
|
---|
35 | public void exec(InstallerContext ctx) throws InstallException {
|
---|
36 | if(ctx.getInstaller().isVerbose()){
|
---|
37 | ctx.log("Starting UI Screens");
|
---|
38 | }
|
---|
39 | boolean ok = ctx.getRunner().runInstaller();
|
---|
40 | if(!ok){
|
---|
41 | throw new AbortException(res.getString("install-cancelled"));
|
---|
42 | }
|
---|
43 | ctx.log("Install screens rendered");
|
---|
44 | }
|
---|
45 |
|
---|
46 | public static class AbortException extends InstallException{
|
---|
47 | public AbortException(String message){
|
---|
48 | super(message);
|
---|
49 | }
|
---|
50 | }
|
---|
51 | }
|
---|