diff --git a/icu4j/build.xml b/icu4j/build.xml index 30b6ab7312..e5e04c2ac1 100644 --- a/icu4j/build.xml +++ b/icu4j/build.xml @@ -82,6 +82,7 @@ + @@ -346,6 +347,7 @@ debug="on" deprecation="off"> + @@ -639,6 +641,26 @@ + + + + + +
+ + + + + + + + + +
+
+
+
+ diff --git a/icu4j/src/com/ibm/icu/dev/demo/Launcher.java b/icu4j/src/com/ibm/icu/dev/demo/Launcher.java new file mode 100644 index 0000000000..f4417185a3 --- /dev/null +++ b/icu4j/src/com/ibm/icu/dev/demo/Launcher.java @@ -0,0 +1,186 @@ +/* + ******************************************************************************* + * Copyright (C) 2007, International Business Machines Corporation and * + * others. All Rights Reserved. * + ******************************************************************************* + */ +package com.ibm.icu.dev.demo; + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Color; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Label; +import java.awt.Panel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import com.ibm.icu.dev.demo.impl.DemoApplet; +import com.ibm.icu.dev.demo.impl.DemoUtility; +import com.ibm.icu.util.VersionInfo; + + +/** + * @author srl + * Application to provide a panel of demos to launch + */ +public class Launcher extends DemoApplet { + private static final long serialVersionUID = -8054963875776183877L; + + /** + * base package of all demos + */ + public static final String demoBase = "com.ibm.icu.dev.demo"; + /** + * list of classes, relative to the demoBase. all must have a static void main(String[]) + */ + public static final String demoList[] = { + "calendar.CalendarApp", + "charsetdet.DetectingViewer", + "holiday.HolidayCalendarDemo", +// "number.CurrencyDemo", -- console +// "rbbi.DBBIDemo", +// "rbbi.RBBIDemo", +// "rbbi.TextBoundDemo", + "rbnf.RbnfDemo", +// "timescale.PivotDemo", -- console + "translit.Demo", + }; + + public class LauncherFrame extends Frame implements ActionListener { + private static final long serialVersionUID = -8054963875776183878L; + + public Button buttonList[] = new Button[demoList.length]; // one button for each demo + public Label statusLabel; + private DemoApplet applet; + + LauncherFrame(DemoApplet applet) { + init(); + this.applet = applet; + } + + public void init() { + // close down when close is clicked. + // TODO: this should be factored.. + addWindowListener( + new WindowAdapter() { + public void windowClosing(WindowEvent e) { + setVisible(false); + dispose(); + + if (applet != null) { + applet.demoClosed(); + } else System.exit(0); + } + } ); + + setBackground(DemoUtility.bgColor); + setLayout(new BorderLayout()); + + Panel topPanel = new Panel(); + topPanel.setLayout(new GridLayout(5,3)); + + for(int i=0;i