01: /*
02: * Copyright 2005 Paul Hinds
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: package org.tp23.antinstaller.runtime;
17:
18: import java.io.IOException;
19:
20: import org.tp23.antinstaller.InstallException;
21: import org.tp23.antinstaller.InstallerContext;
22: import org.tp23.antinstaller.page.Page;
23:
24: public class AutoTextRunner extends TextRunner {
25:
26: public AutoTextRunner(InstallerContext ctx) throws IOException {
27: super (ctx);
28: }
29:
30: public boolean runInstaller() throws InstallException {
31: Page[] pages = installer.getPages();
32: // run all postDisplayTargets as if the pages were shown
33: for (int i = 0; i < pages.length; i++) {
34: Page page = pages[i];
35: if (page.getPostDisplayTarget() != null) {
36: if (ifHelper.ifProperty(page)
37: && ifHelper.ifTarget(page, ctx.getInstaller()
38: .getPages())) { // page would have been shown
39: runPost(page);
40: }
41: }
42: }
43:
44: return true;
45: }
46: }
|