Merge

Wed, 30 Jul 2008 14:41:55 -0700

author
dcubed
date
Wed, 30 Jul 2008 14:41:55 -0700
changeset 694
c7e8144ef65e
parent 673
3df2fe7c4451
parent 693
54499b980c23
child 695
610674f963d2
child 696
7f601f7c9b48

Merge

agent/src/share/lib/jlfgr-1_0.jar file | annotate | diff | comparison | revisions
agent/src/share/lib/maf-1_0.jar file | annotate | diff | comparison | revisions
     1.1 --- a/agent/make/Makefile	Fri Jul 25 11:29:03 2008 -0700
     1.2 +++ b/agent/make/Makefile	Wed Jul 30 14:41:55 2008 -0700
     1.3 @@ -32,6 +32,12 @@
     1.4  include $(GAMMADIR)/make/defs.make
     1.5  endif
     1.6  
     1.7 +ifeq "x$(HOTSPOT_BUILD_VERSION)" "x"
     1.8 +SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)
     1.9 +else
    1.10 +SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
    1.11 +endif
    1.12 +
    1.13  PKGLIST = \
    1.14  sun.jvm.hotspot \
    1.15  sun.jvm.hotspot.asm \
    1.16 @@ -117,7 +123,9 @@
    1.17  sun.jvm.hotspot.ui.treetable \
    1.18  sun.jvm.hotspot.utilities \
    1.19  sun.jvm.hotspot.utilities.memo \
    1.20 -sun.jvm.hotspot.utilities.soql
    1.21 +sun.jvm.hotspot.utilities.soql \
    1.22 +com.sun.java.swing.action \
    1.23 +com.sun.java.swing.ui
    1.24  #END PKGLIST
    1.25  
    1.26  # Generated using the build-filelist script
    1.27 @@ -198,7 +206,9 @@
    1.28  sun/jvm/hotspot/ui/treetable/*.java \
    1.29  sun/jvm/hotspot/utilities/*.java \
    1.30  sun/jvm/hotspot/utilities/memo/*.java \
    1.31 -sun/jvm/hotspot/utilities/soql/*.java 
    1.32 +sun/jvm/hotspot/utilities/soql/*.java \
    1.33 +com/sun/java/swing/action/*.java \
    1.34 +com/sun/java/swing/ui/*.java 
    1.35  #END FILELIST
    1.36  
    1.37  ifneq "x$(ALT_BOOTDIR)" "x"
    1.38 @@ -220,8 +230,6 @@
    1.39  endif
    1.40  
    1.41  SRC_DIR    = ../src/share/classes
    1.42 -LIB_DIR    = ../src/share/lib
    1.43 -CLOSED_LIB_DIR    = ../closed/src/share/lib
    1.44  BUILD_DIR  = ../build
    1.45  OUTPUT_DIR = $(BUILD_DIR)/classes
    1.46  DOC_DIR    = $(BUILD_DIR)/doc
    1.47 @@ -231,9 +239,9 @@
    1.48  ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
    1.49  ALLFILES := $(shell /bin/ls $(ALLFILES))
    1.50  
    1.51 +# tools.jar is used by the sa-jdi binding
    1.52 +CLASSPATH = $(JDK_HOME)/lib/tools.jar
    1.53  
    1.54 -# tools.jar is needed by the JDI - SA binding
    1.55 -CLASSPATH = $(LIB_DIR)/maf-1_0.jar$(CPS)$(JDK_HOME)/lib/tools.jar
    1.56  CLASSPATH := $(subst \,/,$(CLASSPATH))
    1.57  
    1.58  # FIXME: autogenerate call to rmic
    1.59 @@ -241,24 +249,36 @@
    1.60  SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
    1.61  
    1.62  SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties
    1.63 +JAVAC = $(JDK_HOME)/bin/javac
    1.64 +JAVADOC = $(JDK_HOME)/bin/javadoc
    1.65 +RMIC = $(JDK_HOME)/bin/rmic
    1.66  
    1.67  # Tagging it on because there's no reason not to run it
    1.68  all: filelist
    1.69  	@mkdir -p $(OUTPUT_DIR)
    1.70  	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
    1.71 -	@${JDK_HOME}/bin/javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
    1.72 -	@${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
    1.73 +	$(JAVAC) -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
    1.74 +	$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
    1.75  	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
    1.76  	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
    1.77 +	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
    1.78 +	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
    1.79 +	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
    1.80 +	cp -r $(SRC_DIR)/images/*  $(OUTPUT_DIR)/
    1.81  
    1.82  allprof: filelist
    1.83  	@mkdir -p $(OUTPUT_DIR)
    1.84  	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
    1.85 -	@${JDK_HOME}/bin/javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
    1.86 -	@${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
    1.87 +	$(JAVAC) -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
    1.88 +	$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
    1.89  	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
    1.90  	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
    1.91 +	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
    1.92 +	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
    1.93 +	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
    1.94 +	cp -r $(SRC_DIR)/images/*  $(OUTPUT_DIR)/
    1.95  
    1.96 +.PHONY: filelist
    1.97  filelist: $(ALLFILES)
    1.98  	@if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
    1.99            echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \
   1.100 @@ -274,36 +294,23 @@
   1.101  
   1.102  .PHONY: sa-jdi.jar
   1.103  sa-jdi.jar:
   1.104 -	if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
   1.105 -          echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA.";\
   1.106 -          exit 1; \
   1.107 -        fi
   1.108 -	rm -f $(BUILD_DIR)/sa-jdi.jar
   1.109 -	rm -f $(OUTPUT_DIR)/jdi_class_files
   1.110 -	javac -source 1.4 ClosureFinder.java -d $(OUTPUT_DIR)
   1.111 -	cd $(OUTPUT_DIR) ; find sun/jvm/hotspot/jdi -name "*.class" > jdi_class_files
   1.112 -	cd $(OUTPUT_DIR) ; jar cvf ../sa-jdi.jar `java ClosureFinder jdi_class_files .`
   1.113 -	cd $(BUILD_DIR) ; jar uvf sa-jdi.jar -C $(SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
   1.114 -	cd $(BUILD_DIR) ; jar uvf sa-jdi.jar -C $(OUTPUT_DIR) sa.properties
   1.115 -	rm -f $(OUTPUT_DIR)/ClosureFinder.class
   1.116 -	rm -f $(OUTPUT_DIR)/jdi_class_files
   1.117 +	echo "sa-jdi.jar is built by a hotspot build."
   1.118  
   1.119  docs:
   1.120 -	@javadoc -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST)
   1.121 +	@$(JAVADOC) -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST)
   1.122  
   1.123  sizes: $(ALLFILES)
   1.124  	wc -l $(ALLFILES)
   1.125  
   1.126  cscope: $(ALLFILES)
   1.127 +	rm -f java.files
   1.128  	echo $(ALLFILES) > java.files
   1.129  	cscope -b -i java.files -f java.out 
   1.130 +	rm -f java.files
   1.131  
   1.132  .PHONY: sa.jar
   1.133  sa.jar:
   1.134  	rm -f $(BUILD_DIR)/sa.jar
   1.135 -	mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
   1.136 -	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
   1.137 -	cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
   1.138  	cd $(OUTPUT_DIR) ; jar cvf ../sa.jar *
   1.139  
   1.140  clean::
     2.1 --- a/agent/make/bugspot.bat	Fri Jul 25 11:29:03 2008 -0700
     2.2 +++ b/agent/make/bugspot.bat	Wed Jul 30 14:41:55 2008 -0700
     2.3 @@ -22,4 +22,4 @@
     2.4  REM  
     2.5  REM
     2.6  
     2.7 -java -showversion -cp ..\build\classes;..\src\share\lib\maf-1_0.jar;..\src\share\lib\jlfgr-1_0.jar;..\src\share\lib\js.jar;sa.jar;lib\maf-1_0.jar;lib\jlfgr-1_0.jar;lib\js.jar sun.jvm.hotspot.bugspot.Main
     2.8 +java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.bugspot.Main
     3.1 --- a/agent/make/build.xml	Fri Jul 25 11:29:03 2008 -0700
     3.2 +++ b/agent/make/build.xml	Wed Jul 30 14:41:55 2008 -0700
     3.3 @@ -42,7 +42,6 @@
     3.4  
     3.5    <property name="app.name" value="sa"/>
     3.6    <property name="dist.jar" value="${app.name}.jar"/>
     3.7 -  <property name="libs"     value="../src/share/lib"/>
     3.8    <property name="classes"  value="../build/classes"/>
     3.9  
    3.10  <!-- The "prepare" target is used to construct the deployment home
    3.11 @@ -83,11 +82,6 @@
    3.12       home directory structure will be created if needed the first time.
    3.13  -->
    3.14  
    3.15 -  <path id="javac.classpath">
    3.16 -    <pathelement path="${libs}/maf-1_0.jar" />
    3.17 -    <pathelement path="${libs}/jlfgr-1_0.jar" />
    3.18 -  </path>
    3.19 -
    3.20    <target name="compile" depends="prepare" description="Compiles the sources">
    3.21      <javac srcdir="../src/share/classes" 
    3.22             destdir="${classes}"
    3.23 @@ -110,6 +104,18 @@
    3.24      <copy todir="${classes}/sun/jvm/hotspot/ui/resources">
    3.25        <fileset dir="../src/share/classes/sun/jvm/hotspot/ui/resources" includes="*.png" />
    3.26      </copy>
    3.27 +    <copy todir="${classes}/toolbarButtonGraphics/development/">
    3.28 +      <fileset dir="../src/share/classes/images/toolbarButtonGraphics/development/" includes="*.gif" />
    3.29 +    </copy>
    3.30 +    <copy todir="${classes}/toolbarButtonGraphics/general/">
    3.31 +      <fileset dir="../src/share/classes/images/toolbarButtonGraphics/general/" includes="*.gif" />
    3.32 +    </copy>
    3.33 +    <copy todir="${classes}/toolbarButtonGraphics/navigation/">
    3.34 +      <fileset dir="../src/share/classes/images/toolbarButtonGraphics/navigation/" includes="*.gif" />
    3.35 +    </copy>
    3.36 +    <copy todir="${classes}/toolbarButtonGraphics/text/">
    3.37 +      <fileset dir="../src/share/classes/images/toolbarButtonGraphics/text/" includes="*.gif" />
    3.38 +    </copy>
    3.39  
    3.40      <jar jarfile="${classes}/${dist.jar}"
    3.41           basedir="${classes}"/>
     4.1 --- a/agent/make/hsdb.bat	Fri Jul 25 11:29:03 2008 -0700
     4.2 +++ b/agent/make/hsdb.bat	Wed Jul 30 14:41:55 2008 -0700
     4.3 @@ -22,4 +22,4 @@
     4.4  REM  
     4.5  REM
     4.6  
     4.7 -java -showversion -cp ..\build\classes;..\src\share\lib\maf-1_0.jar;..\src\share\lib\jlfgr-1_0.jar;..\src\share\lib\js.jar;sa.jar;lib\maf-1_0.jar;lib\jlfgr-1_0.jar;lib\js.jar sun.jvm.hotspot.HSDB %1 %2
     4.8 +java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.HSDB %1 %2
     5.1 --- a/agent/make/hsdb.sh	Fri Jul 25 11:29:03 2008 -0700
     5.2 +++ b/agent/make/hsdb.sh	Wed Jul 30 14:41:55 2008 -0700
     5.3 @@ -29,4 +29,4 @@
     5.4     SA_JAVA=java
     5.5  fi
     5.6  
     5.7 -$SA_JAVA -showversion -cp $STARTDIR/../build/classes:$STARTDIR/../src/share/lib/maf-1_0.jar:$STARTDIR/../src/share/lib/jlfgr-1_0.jar:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/maf-1_0.jar:$STARTDIR/lib/jlfgr-1_0.jar:$STARTDIR/lib/js.jar sun.jvm.hotspot.HSDB $*
     5.8 +$SA_JAVA -showversion -cp $STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar sun.jvm.hotspot.HSDB $*
     6.1 --- a/agent/make/saenv.bat	Fri Jul 25 11:29:03 2008 -0700
     6.2 +++ b/agent/make/saenv.bat	Wed Jul 30 14:41:55 2008 -0700
     6.3 @@ -39,7 +39,7 @@
     6.4  
     6.5  :sa_java_set
     6.6  
     6.7 -set SA_CLASSPATH=..\build\classes;..\src\share\lib\maf-1_0.jar;..\src\share\lib\jlfgr-1_0.jar;..\src\share\lib\js.jar;sa.jar;lib\maf-1_0.jar;lib\jlfgr-1_0.jar;lib\js.jar
     6.8 +set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar
     6.9  
    6.10  set SA_LIBPATH=..\src\os\win32\windbg\i386;.\win32\i386
    6.11  
     7.1 --- a/agent/make/saenv.sh	Fri Jul 25 11:29:03 2008 -0700
     7.2 +++ b/agent/make/saenv.sh	Wed Jul 30 14:41:55 2008 -0700
     7.3 @@ -58,7 +58,7 @@
     7.4  fi
     7.5  
     7.6  
     7.7 -SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/maf-1_0.jar:$STARTDIR/../src/share/lib/jlfgr-1_0.jar:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/maf-1_0.jar:$STARTDIR/lib/jlfgr-1_0.jar:$STARTDIR/lib/js.jar
     7.8 +SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar
     7.9  
    7.10  OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
    7.11  
     8.1 --- a/agent/make/saenv64.bat	Fri Jul 25 11:29:03 2008 -0700
     8.2 +++ b/agent/make/saenv64.bat	Wed Jul 30 14:41:55 2008 -0700
     8.3 @@ -43,7 +43,7 @@
     8.4  
     8.5  :sa_java_set
     8.6  
     8.7 -set SA_CLASSPATH=..\build\classes;..\src\share\lib\maf-1_0.jar;..\src\share\lib\jlfgr-1_0.jar;..\src\share\lib\js.jar;sa.jar;lib\maf-1_0.jar;lib\jlfgr-1_0.jar;lib\js.jar
     8.8 +set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar
     8.9  
    8.10  REM For now, only AMD-64, IA-64 stack walking is not working anyway
    8.11  set SA_LIBPATH=.\src\os\win32\windbg\amd64;.\win32\amd64
     9.1 --- a/agent/make/saenv64.sh	Fri Jul 25 11:29:03 2008 -0700
     9.2 +++ b/agent/make/saenv64.sh	Wed Jul 30 14:41:55 2008 -0700
     9.3 @@ -55,7 +55,7 @@
     9.4     OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}"
     9.5  fi
     9.6  
     9.7 -SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/maf-1_0.jar:$STARTDIR/../src/share/lib/jlfgr-1_0.jar:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/maf-1_0.jar:$STARTDIR/lib/jlfgr-1_0.jar:$STARTDIR/lib/js.jar
     9.8 +SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar::$STARTDIR/lib/js.jar
     9.9  
    9.10  OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
    9.11  
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/AboutAction.java	Wed Jul 30 14:41:55 2008 -0700
    10.3 @@ -0,0 +1,57 @@
    10.4 +/*
    10.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    10.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    10.7 + *
    10.8 + * This code is free software; you can redistribute it and/or modify it
    10.9 + * under the terms of the GNU General Public License version 2 only, as
   10.10 + * published by the Free Software Foundation.
   10.11 + *
   10.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   10.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   10.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   10.15 + * version 2 for more details (a copy is included in the LICENSE file that
   10.16 + * accompanied this code).
   10.17 + *
   10.18 + * You should have received a copy of the GNU General Public License version
   10.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   10.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   10.21 + *
   10.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   10.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   10.24 + * have any questions.
   10.25 + *
   10.26 + */
   10.27 +
   10.28 +
   10.29 +package com.sun.java.swing.action;
   10.30 +
   10.31 +
   10.32 +// Referenced classes of package com.sun.java.swing.action:
   10.33 +//            DelegateAction, ActionManager
   10.34 +
   10.35 +public class AboutAction extends DelegateAction
   10.36 +{
   10.37 +
   10.38 +    public AboutAction()
   10.39 +    {
   10.40 +        this("general/About16.gif");
   10.41 +    }
   10.42 +
   10.43 +    public AboutAction(String iconPath)
   10.44 +    {
   10.45 +        super("About...", ActionManager.getIcon(iconPath));
   10.46 +        putValue("ActionCommandKey", "about-command");
   10.47 +        putValue("ShortDescription", "About...");
   10.48 +        putValue("LongDescription", "System information and version of the application.");
   10.49 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   10.50 +    }
   10.51 +
   10.52 +    public static final String VALUE_COMMAND = "about-command";
   10.53 +    public static final String VALUE_NAME = "About...";
   10.54 +    public static final String VALUE_SMALL_ICON = "general/About16.gif";
   10.55 +    public static final String VALUE_LARGE_ICON = "general/About24.gif";
   10.56 +    public static final Integer VALUE_MNEMONIC = new Integer(65);
   10.57 +    public static final String VALUE_SHORT_DESCRIPTION = "About...";
   10.58 +    public static final String VALUE_LONG_DESCRIPTION = "System information and version of the application.";
   10.59 +
   10.60 +}
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java	Wed Jul 30 14:41:55 2008 -0700
    11.3 @@ -0,0 +1,95 @@
    11.4 +/*
    11.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    11.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.7 + *
    11.8 + * This code is free software; you can redistribute it and/or modify it
    11.9 + * under the terms of the GNU General Public License version 2 only, as
   11.10 + * published by the Free Software Foundation.
   11.11 + *
   11.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   11.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   11.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   11.15 + * version 2 for more details (a copy is included in the LICENSE file that
   11.16 + * accompanied this code).
   11.17 + *
   11.18 + * You should have received a copy of the GNU General Public License version
   11.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   11.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   11.21 + *
   11.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   11.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   11.24 + * have any questions.
   11.25 + *
   11.26 + */
   11.27 +
   11.28 +
   11.29 +package com.sun.java.swing.action;
   11.30 +
   11.31 +import java.util.HashMap;
   11.32 +import javax.swing.Action;
   11.33 +import javax.swing.ImageIcon;
   11.34 +
   11.35 +// Referenced classes of package com.sun.java.swing.action:
   11.36 +//            DelegateAction, StateChangeAction, ActionUtilities
   11.37 +
   11.38 +public abstract class ActionManager
   11.39 +{
   11.40 +
   11.41 +    protected ActionManager()
   11.42 +    {
   11.43 +        actions = new HashMap();
   11.44 +        addActions();
   11.45 +    }
   11.46 +
   11.47 +    public static ActionManager getInstance()
   11.48 +    {
   11.49 +        return manager;
   11.50 +    }
   11.51 +
   11.52 +    protected abstract void addActions();
   11.53 +
   11.54 +    protected void addAction(String cmdname, Action action)
   11.55 +    {
   11.56 +        actions.put(cmdname, action);
   11.57 +    }
   11.58 +
   11.59 +    public Action getAction(String key)
   11.60 +    {
   11.61 +        return (Action)actions.get(key);
   11.62 +    }
   11.63 +
   11.64 +    public DelegateAction getDelegateAction(String name)
   11.65 +    {
   11.66 +        Action a = getAction(name);
   11.67 +        if(a instanceof DelegateAction)
   11.68 +            return (DelegateAction)a;
   11.69 +        else
   11.70 +            return null;
   11.71 +    }
   11.72 +
   11.73 +    public StateChangeAction getStateChangeAction(String name)
   11.74 +    {
   11.75 +        Action a = getAction(name);
   11.76 +        if(a instanceof StateChangeAction)
   11.77 +            return (StateChangeAction)a;
   11.78 +        else
   11.79 +            return null;
   11.80 +    }
   11.81 +
   11.82 +    public static ImageIcon getIcon(String name)
   11.83 +    {
   11.84 +        return utilities.getIcon(name);
   11.85 +    }
   11.86 +
   11.87 +    public void setActionEnabled(String name, boolean enabled)
   11.88 +    {
   11.89 +        Action action = getAction(name);
   11.90 +        if(action != null)
   11.91 +            action.setEnabled(enabled);
   11.92 +    }
   11.93 +
   11.94 +    private HashMap actions;
   11.95 +    private static ActionUtilities utilities = new ActionUtilities();
   11.96 +    protected static ActionManager manager;
   11.97 +
   11.98 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/ActionUtilities.java	Wed Jul 30 14:41:55 2008 -0700
    12.3 @@ -0,0 +1,49 @@
    12.4 +/*
    12.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    12.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    12.7 + *
    12.8 + * This code is free software; you can redistribute it and/or modify it
    12.9 + * under the terms of the GNU General Public License version 2 only, as
   12.10 + * published by the Free Software Foundation.
   12.11 + *
   12.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   12.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   12.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   12.15 + * version 2 for more details (a copy is included in the LICENSE file that
   12.16 + * accompanied this code).
   12.17 + *
   12.18 + * You should have received a copy of the GNU General Public License version
   12.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   12.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   12.21 + *
   12.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   12.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   12.24 + * have any questions.
   12.25 + *
   12.26 + */
   12.27 +
   12.28 +
   12.29 +package com.sun.java.swing.action;
   12.30 +
   12.31 +import javax.swing.ImageIcon;
   12.32 +
   12.33 +class ActionUtilities
   12.34 +{
   12.35 +
   12.36 +    ActionUtilities()
   12.37 +    {
   12.38 +    }
   12.39 +
   12.40 +    public ImageIcon getIcon(String name)
   12.41 +    {
   12.42 +        String imagePath = "/toolbarButtonGraphics/" + name;
   12.43 +        java.net.URL url = getClass().getResource(imagePath);
   12.44 +        if(url != null)
   12.45 +            return new ImageIcon(url);
   12.46 +        else
   12.47 +            return null;
   12.48 +    }
   12.49 +
   12.50 +    public static final String IMAGE_DIR = "/toolbarButtonGraphics/";
   12.51 +
   12.52 +}
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/AlignCenterAction.java	Wed Jul 30 14:41:55 2008 -0700
    13.3 @@ -0,0 +1,60 @@
    13.4 +/*
    13.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    13.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.7 + *
    13.8 + * This code is free software; you can redistribute it and/or modify it
    13.9 + * under the terms of the GNU General Public License version 2 only, as
   13.10 + * published by the Free Software Foundation.
   13.11 + *
   13.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   13.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   13.15 + * version 2 for more details (a copy is included in the LICENSE file that
   13.16 + * accompanied this code).
   13.17 + *
   13.18 + * You should have received a copy of the GNU General Public License version
   13.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   13.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   13.21 + *
   13.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   13.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   13.24 + * have any questions.
   13.25 + *
   13.26 + */
   13.27 +
   13.28 +
   13.29 +package com.sun.java.swing.action;
   13.30 +
   13.31 +import javax.swing.KeyStroke;
   13.32 +
   13.33 +// Referenced classes of package com.sun.java.swing.action:
   13.34 +//            StateChangeAction, ActionManager
   13.35 +
   13.36 +public class AlignCenterAction extends StateChangeAction
   13.37 +{
   13.38 +
   13.39 +    public AlignCenterAction()
   13.40 +    {
   13.41 +        this("text/AlignCenter16.gif");
   13.42 +    }
   13.43 +
   13.44 +    public AlignCenterAction(String iconPath)
   13.45 +    {
   13.46 +        super("Center", ActionManager.getIcon(iconPath));
   13.47 +        putValue("ActionCommandKey", "align-center-command");
   13.48 +        putValue("ShortDescription", "Center");
   13.49 +        putValue("LongDescription", "Adjust the placement of text to the center of the line");
   13.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   13.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   13.52 +    }
   13.53 +
   13.54 +    public static final String VALUE_COMMAND = "align-center-command";
   13.55 +    public static final String VALUE_NAME = "Center";
   13.56 +    public static final String VALUE_SMALL_ICON = "text/AlignCenter16.gif";
   13.57 +    public static final String VALUE_LARGE_ICON = "text/AlignCenter24.gif";
   13.58 +    public static final Integer VALUE_MNEMONIC = new Integer(78);
   13.59 +    public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(69, 2);
   13.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Center";
   13.61 +    public static final String VALUE_LONG_DESCRIPTION = "Adjust the placement of text to the center of the line";
   13.62 +
   13.63 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/AlignLeftAction.java	Wed Jul 30 14:41:55 2008 -0700
    14.3 @@ -0,0 +1,60 @@
    14.4 +/*
    14.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    14.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.7 + *
    14.8 + * This code is free software; you can redistribute it and/or modify it
    14.9 + * under the terms of the GNU General Public License version 2 only, as
   14.10 + * published by the Free Software Foundation.
   14.11 + *
   14.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   14.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   14.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   14.15 + * version 2 for more details (a copy is included in the LICENSE file that
   14.16 + * accompanied this code).
   14.17 + *
   14.18 + * You should have received a copy of the GNU General Public License version
   14.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   14.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   14.21 + *
   14.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   14.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   14.24 + * have any questions.
   14.25 + *
   14.26 + */
   14.27 +
   14.28 +
   14.29 +package com.sun.java.swing.action;
   14.30 +
   14.31 +import javax.swing.KeyStroke;
   14.32 +
   14.33 +// Referenced classes of package com.sun.java.swing.action:
   14.34 +//            StateChangeAction, ActionManager
   14.35 +
   14.36 +public class AlignLeftAction extends StateChangeAction
   14.37 +{
   14.38 +
   14.39 +    public AlignLeftAction()
   14.40 +    {
   14.41 +        this("text/AlignLeft16.gif");
   14.42 +    }
   14.43 +
   14.44 +    public AlignLeftAction(String iconPath)
   14.45 +    {
   14.46 +        super("Left Align", ActionManager.getIcon(iconPath));
   14.47 +        putValue("ActionCommandKey", "align-left-command");
   14.48 +        putValue("ShortDescription", "Left Align");
   14.49 +        putValue("LongDescription", "Adjust the placement of text along the left edge");
   14.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   14.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   14.52 +    }
   14.53 +
   14.54 +    public static final String VALUE_COMMAND = "align-left-command";
   14.55 +    public static final String VALUE_NAME = "Left Align";
   14.56 +    public static final String VALUE_SMALL_ICON = "text/AlignLeft16.gif";
   14.57 +    public static final String VALUE_LARGE_ICON = "text/AlignLeft24.gif";
   14.58 +    public static final Integer VALUE_MNEMONIC = new Integer(76);
   14.59 +    public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(76, 2);
   14.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Left Align";
   14.61 +    public static final String VALUE_LONG_DESCRIPTION = "Adjust the placement of text along the left edge";
   14.62 +
   14.63 +}
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/AlignRightAction.java	Wed Jul 30 14:41:55 2008 -0700
    15.3 @@ -0,0 +1,60 @@
    15.4 +/*
    15.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    15.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    15.7 + *
    15.8 + * This code is free software; you can redistribute it and/or modify it
    15.9 + * under the terms of the GNU General Public License version 2 only, as
   15.10 + * published by the Free Software Foundation.
   15.11 + *
   15.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   15.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   15.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   15.15 + * version 2 for more details (a copy is included in the LICENSE file that
   15.16 + * accompanied this code).
   15.17 + *
   15.18 + * You should have received a copy of the GNU General Public License version
   15.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   15.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   15.21 + *
   15.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   15.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   15.24 + * have any questions.
   15.25 + *
   15.26 + */
   15.27 +
   15.28 +
   15.29 +package com.sun.java.swing.action;
   15.30 +
   15.31 +import javax.swing.KeyStroke;
   15.32 +
   15.33 +// Referenced classes of package com.sun.java.swing.action:
   15.34 +//            StateChangeAction, ActionManager
   15.35 +
   15.36 +public class AlignRightAction extends StateChangeAction
   15.37 +{
   15.38 +
   15.39 +    public AlignRightAction()
   15.40 +    {
   15.41 +        this("text/AlignRight16.gif");
   15.42 +    }
   15.43 +
   15.44 +    public AlignRightAction(String iconPath)
   15.45 +    {
   15.46 +        super("Right Align", ActionManager.getIcon(iconPath));
   15.47 +        putValue("ActionCommandKey", "align-right-command");
   15.48 +        putValue("ShortDescription", "Right Align");
   15.49 +        putValue("LongDescription", "Adjust the placement of text along the right edge");
   15.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   15.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   15.52 +    }
   15.53 +
   15.54 +    public static final String VALUE_COMMAND = "align-right-command";
   15.55 +    public static final String VALUE_NAME = "Right Align";
   15.56 +    public static final String VALUE_SMALL_ICON = "text/AlignRight16.gif";
   15.57 +    public static final String VALUE_LARGE_ICON = "text/AlignRight24.gif";
   15.58 +    public static final Integer VALUE_MNEMONIC = new Integer(82);
   15.59 +    public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(82, 2);
   15.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Right Align";
   15.61 +    public static final String VALUE_LONG_DESCRIPTION = "Adjust the placement of text along the right edge";
   15.62 +
   15.63 +}
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/ApplyAction.java	Wed Jul 30 14:41:55 2008 -0700
    16.3 @@ -0,0 +1,60 @@
    16.4 +/*
    16.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    16.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.7 + *
    16.8 + * This code is free software; you can redistribute it and/or modify it
    16.9 + * under the terms of the GNU General Public License version 2 only, as
   16.10 + * published by the Free Software Foundation.
   16.11 + *
   16.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   16.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   16.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   16.15 + * version 2 for more details (a copy is included in the LICENSE file that
   16.16 + * accompanied this code).
   16.17 + *
   16.18 + * You should have received a copy of the GNU General Public License version
   16.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   16.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   16.21 + *
   16.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   16.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   16.24 + * have any questions.
   16.25 + *
   16.26 + */
   16.27 +
   16.28 +
   16.29 +package com.sun.java.swing.action;
   16.30 +
   16.31 +import javax.swing.KeyStroke;
   16.32 +
   16.33 +// Referenced classes of package com.sun.java.swing.action:
   16.34 +//            DelegateAction, ActionManager
   16.35 +
   16.36 +public class ApplyAction extends DelegateAction
   16.37 +{
   16.38 +
   16.39 +    public ApplyAction()
   16.40 +    {
   16.41 +        this(VALUE_SMALL_ICON);
   16.42 +    }
   16.43 +
   16.44 +    public ApplyAction(String iconPath)
   16.45 +    {
   16.46 +        super("Apply", ActionManager.getIcon(iconPath));
   16.47 +        putValue("ActionCommandKey", "apply-command");
   16.48 +        putValue("ShortDescription", "Apply the activity");
   16.49 +        putValue("LongDescription", "Apply the activity");
   16.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   16.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   16.52 +    }
   16.53 +
   16.54 +    public static final String VALUE_COMMAND = "apply-command";
   16.55 +    public static final String VALUE_NAME = "Apply";
   16.56 +    public static final String VALUE_SMALL_ICON = null;
   16.57 +    public static final String VALUE_LARGE_ICON = null;
   16.58 +    public static final Integer VALUE_MNEMONIC = new Integer(65);
   16.59 +    public static final KeyStroke VALUE_ACCELERATOR = null;
   16.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Apply the activity";
   16.61 +    public static final String VALUE_LONG_DESCRIPTION = "Apply the activity";
   16.62 +
   16.63 +}
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/BackAction.java	Wed Jul 30 14:41:55 2008 -0700
    17.3 @@ -0,0 +1,60 @@
    17.4 +/*
    17.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    17.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    17.7 + *
    17.8 + * This code is free software; you can redistribute it and/or modify it
    17.9 + * under the terms of the GNU General Public License version 2 only, as
   17.10 + * published by the Free Software Foundation.
   17.11 + *
   17.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   17.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   17.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   17.15 + * version 2 for more details (a copy is included in the LICENSE file that
   17.16 + * accompanied this code).
   17.17 + *
   17.18 + * You should have received a copy of the GNU General Public License version
   17.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   17.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   17.21 + *
   17.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   17.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   17.24 + * have any questions.
   17.25 + *
   17.26 + */
   17.27 +
   17.28 +
   17.29 +package com.sun.java.swing.action;
   17.30 +
   17.31 +import javax.swing.KeyStroke;
   17.32 +
   17.33 +// Referenced classes of package com.sun.java.swing.action:
   17.34 +//            DelegateAction, ActionManager
   17.35 +
   17.36 +public class BackAction extends DelegateAction
   17.37 +{
   17.38 +
   17.39 +    public BackAction()
   17.40 +    {
   17.41 +        this(VALUE_SMALL_ICON);
   17.42 +    }
   17.43 +
   17.44 +    public BackAction(String iconPath)
   17.45 +    {
   17.46 +        super("< Back", ActionManager.getIcon(iconPath));
   17.47 +        putValue("ActionCommandKey", "back-command");
   17.48 +        putValue("ShortDescription", "Select previous item");
   17.49 +        putValue("LongDescription", "Select previous item");
   17.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   17.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   17.52 +    }
   17.53 +
   17.54 +    public static final String VALUE_COMMAND = "back-command";
   17.55 +    public static final String VALUE_NAME = "< Back";
   17.56 +    public static final String VALUE_SMALL_ICON = null;
   17.57 +    public static final String VALUE_LARGE_ICON = null;
   17.58 +    public static final Integer VALUE_MNEMONIC = new Integer(66);
   17.59 +    public static final KeyStroke VALUE_ACCELERATOR = null;
   17.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Select previous item";
   17.61 +    public static final String VALUE_LONG_DESCRIPTION = "Select previous item";
   17.62 +
   17.63 +}
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/CancelAction.java	Wed Jul 30 14:41:55 2008 -0700
    18.3 @@ -0,0 +1,60 @@
    18.4 +/*
    18.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    18.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.7 + *
    18.8 + * This code is free software; you can redistribute it and/or modify it
    18.9 + * under the terms of the GNU General Public License version 2 only, as
   18.10 + * published by the Free Software Foundation.
   18.11 + *
   18.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   18.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   18.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   18.15 + * version 2 for more details (a copy is included in the LICENSE file that
   18.16 + * accompanied this code).
   18.17 + *
   18.18 + * You should have received a copy of the GNU General Public License version
   18.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   18.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   18.21 + *
   18.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   18.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   18.24 + * have any questions.
   18.25 + *
   18.26 + */
   18.27 +
   18.28 +
   18.29 +package com.sun.java.swing.action;
   18.30 +
   18.31 +import javax.swing.KeyStroke;
   18.32 +
   18.33 +// Referenced classes of package com.sun.java.swing.action:
   18.34 +//            DelegateAction, ActionManager
   18.35 +
   18.36 +public class CancelAction extends DelegateAction
   18.37 +{
   18.38 +
   18.39 +    public CancelAction()
   18.40 +    {
   18.41 +        this(VALUE_SMALL_ICON);
   18.42 +    }
   18.43 +
   18.44 +    public CancelAction(String iconPath)
   18.45 +    {
   18.46 +        super("Cancel", ActionManager.getIcon(iconPath));
   18.47 +        putValue("ActionCommandKey", "cancel-command");
   18.48 +        putValue("ShortDescription", "Cancels the action");
   18.49 +        putValue("LongDescription", "Cancels the action");
   18.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   18.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   18.52 +    }
   18.53 +
   18.54 +    public static final String VALUE_COMMAND = "cancel-command";
   18.55 +    public static final String VALUE_NAME = "Cancel";
   18.56 +    public static final String VALUE_SMALL_ICON = null;
   18.57 +    public static final String VALUE_LARGE_ICON = null;
   18.58 +    public static final Integer VALUE_MNEMONIC = new Integer(67);
   18.59 +    public static final KeyStroke VALUE_ACCELERATOR = null;
   18.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Cancels the action";
   18.61 +    public static final String VALUE_LONG_DESCRIPTION = "Cancels the action";
   18.62 +
   18.63 +}
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/DelegateAction.java	Wed Jul 30 14:41:55 2008 -0700
    19.3 @@ -0,0 +1,65 @@
    19.4 +/*
    19.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    19.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.7 + *
    19.8 + * This code is free software; you can redistribute it and/or modify it
    19.9 + * under the terms of the GNU General Public License version 2 only, as
   19.10 + * published by the Free Software Foundation.
   19.11 + *
   19.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   19.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   19.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   19.15 + * version 2 for more details (a copy is included in the LICENSE file that
   19.16 + * accompanied this code).
   19.17 + *
   19.18 + * You should have received a copy of the GNU General Public License version
   19.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   19.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   19.21 + *
   19.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   19.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   19.24 + * have any questions.
   19.25 + *
   19.26 + */
   19.27 +
   19.28 +
   19.29 +package com.sun.java.swing.action;
   19.30 +
   19.31 +import java.awt.event.ActionEvent;
   19.32 +import java.awt.event.ActionListener;
   19.33 +import javax.swing.AbstractAction;
   19.34 +import javax.swing.Icon;
   19.35 +
   19.36 +public abstract class DelegateAction extends AbstractAction
   19.37 +{
   19.38 +
   19.39 +    public DelegateAction(String name, Icon icon)
   19.40 +    {
   19.41 +        super(name, icon);
   19.42 +    }
   19.43 +
   19.44 +    public void addActionListener(ActionListener listener)
   19.45 +    {
   19.46 +        this.listener = listener;
   19.47 +    }
   19.48 +
   19.49 +    public void removeActionListener(ActionListener listener)
   19.50 +    {
   19.51 +        this.listener = null;
   19.52 +    }
   19.53 +
   19.54 +    public ActionListener[] getActionListeners()
   19.55 +    {
   19.56 +        return (new ActionListener[] {
   19.57 +            listener
   19.58 +        });
   19.59 +    }
   19.60 +
   19.61 +    public void actionPerformed(ActionEvent evt)
   19.62 +    {
   19.63 +        if(listener != null)
   19.64 +            listener.actionPerformed(evt);
   19.65 +    }
   19.66 +
   19.67 +    private ActionListener listener;
   19.68 +}
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/ExitAction.java	Wed Jul 30 14:41:55 2008 -0700
    20.3 @@ -0,0 +1,55 @@
    20.4 +/*
    20.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    20.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    20.7 + *
    20.8 + * This code is free software; you can redistribute it and/or modify it
    20.9 + * under the terms of the GNU General Public License version 2 only, as
   20.10 + * published by the Free Software Foundation.
   20.11 + *
   20.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   20.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   20.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   20.15 + * version 2 for more details (a copy is included in the LICENSE file that
   20.16 + * accompanied this code).
   20.17 + *
   20.18 + * You should have received a copy of the GNU General Public License version
   20.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   20.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   20.21 + *
   20.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   20.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   20.24 + * have any questions.
   20.25 + *
   20.26 + */
   20.27 +
   20.28 +
   20.29 +package com.sun.java.swing.action;
   20.30 +
   20.31 +import javax.swing.KeyStroke;
   20.32 +
   20.33 +// Referenced classes of package com.sun.java.swing.action:
   20.34 +//            DelegateAction, ActionManager
   20.35 +
   20.36 +public class ExitAction extends DelegateAction
   20.37 +{
   20.38 +
   20.39 +    public ExitAction()
   20.40 +    {
   20.41 +        super("Exit", ActionManager.getIcon(VALUE_SMALL_ICON));
   20.42 +        putValue("ActionCommandKey", "exit-command");
   20.43 +        putValue("ShortDescription", "Exits the application");
   20.44 +        putValue("LongDescription", "Exits the application");
   20.45 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   20.46 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   20.47 +    }
   20.48 +
   20.49 +    public static final String VALUE_COMMAND = "exit-command";
   20.50 +    public static final String VALUE_NAME = "Exit";
   20.51 +    public static final String VALUE_SMALL_ICON = null;
   20.52 +    public static final String VALUE_LARGE_ICON = null;
   20.53 +    public static final Integer VALUE_MNEMONIC = new Integer(88);
   20.54 +    public static final KeyStroke VALUE_ACCELERATOR = null;
   20.55 +    public static final String VALUE_SHORT_DESCRIPTION = "Exits the application";
   20.56 +    public static final String VALUE_LONG_DESCRIPTION = "Exits the application";
   20.57 +
   20.58 +}
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/FileMenu.java	Wed Jul 30 14:41:55 2008 -0700
    21.3 @@ -0,0 +1,53 @@
    21.4 +/*
    21.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    21.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    21.7 + *
    21.8 + * This code is free software; you can redistribute it and/or modify it
    21.9 + * under the terms of the GNU General Public License version 2 only, as
   21.10 + * published by the Free Software Foundation.
   21.11 + *
   21.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   21.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   21.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   21.15 + * version 2 for more details (a copy is included in the LICENSE file that
   21.16 + * accompanied this code).
   21.17 + *
   21.18 + * You should have received a copy of the GNU General Public License version
   21.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   21.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   21.21 + *
   21.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   21.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   21.24 + * have any questions.
   21.25 + *
   21.26 + */
   21.27 +
   21.28 +
   21.29 +package com.sun.java.swing.action;
   21.30 +
   21.31 +import java.awt.event.ActionEvent;
   21.32 +import javax.swing.AbstractAction;
   21.33 +
   21.34 +public class FileMenu extends AbstractAction
   21.35 +{
   21.36 +
   21.37 +    public FileMenu()
   21.38 +    {
   21.39 +        super("File");
   21.40 +        putValue("ActionCommandKey", "file-menu-command");
   21.41 +        putValue("ShortDescription", "File operations");
   21.42 +        putValue("LongDescription", "File operations");
   21.43 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   21.44 +    }
   21.45 +
   21.46 +    public void actionPerformed(ActionEvent actionevent)
   21.47 +    {
   21.48 +    }
   21.49 +
   21.50 +    public static final String VALUE_COMMAND = "file-menu-command";
   21.51 +    public static final String VALUE_NAME = "File";
   21.52 +    public static final Integer VALUE_MNEMONIC = new Integer(70);
   21.53 +    public static final String VALUE_SHORT_DESCRIPTION = "File operations";
   21.54 +    public static final String VALUE_LONG_DESCRIPTION = "File operations";
   21.55 +
   21.56 +}
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/FinishAction.java	Wed Jul 30 14:41:55 2008 -0700
    22.3 @@ -0,0 +1,60 @@
    22.4 +/*
    22.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    22.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    22.7 + *
    22.8 + * This code is free software; you can redistribute it and/or modify it
    22.9 + * under the terms of the GNU General Public License version 2 only, as
   22.10 + * published by the Free Software Foundation.
   22.11 + *
   22.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   22.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   22.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   22.15 + * version 2 for more details (a copy is included in the LICENSE file that
   22.16 + * accompanied this code).
   22.17 + *
   22.18 + * You should have received a copy of the GNU General Public License version
   22.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   22.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   22.21 + *
   22.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   22.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   22.24 + * have any questions.
   22.25 + *
   22.26 + */
   22.27 +
   22.28 +
   22.29 +package com.sun.java.swing.action;
   22.30 +
   22.31 +import javax.swing.KeyStroke;
   22.32 +
   22.33 +// Referenced classes of package com.sun.java.swing.action:
   22.34 +//            DelegateAction, ActionManager
   22.35 +
   22.36 +public class FinishAction extends DelegateAction
   22.37 +{
   22.38 +
   22.39 +    public FinishAction()
   22.40 +    {
   22.41 +        this(VALUE_SMALL_ICON);
   22.42 +    }
   22.43 +
   22.44 +    public FinishAction(String iconPath)
   22.45 +    {
   22.46 +        super("Finish", ActionManager.getIcon(iconPath));
   22.47 +        putValue("ActionCommandKey", "finish-command");
   22.48 +        putValue("ShortDescription", "Finish the activity");
   22.49 +        putValue("LongDescription", "Finish the activity");
   22.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   22.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   22.52 +    }
   22.53 +
   22.54 +    public static final String VALUE_COMMAND = "finish-command";
   22.55 +    public static final String VALUE_NAME = "Finish";
   22.56 +    public static final String VALUE_SMALL_ICON = null;
   22.57 +    public static final String VALUE_LARGE_ICON = null;
   22.58 +    public static final Integer VALUE_MNEMONIC = new Integer(70);
   22.59 +    public static final KeyStroke VALUE_ACCELERATOR = null;
   22.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Finish the activity";
   22.61 +    public static final String VALUE_LONG_DESCRIPTION = "Finish the activity";
   22.62 +
   22.63 +}
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/HelpAction.java	Wed Jul 30 14:41:55 2008 -0700
    23.3 @@ -0,0 +1,60 @@
    23.4 +/*
    23.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    23.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    23.7 + *
    23.8 + * This code is free software; you can redistribute it and/or modify it
    23.9 + * under the terms of the GNU General Public License version 2 only, as
   23.10 + * published by the Free Software Foundation.
   23.11 + *
   23.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   23.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   23.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   23.15 + * version 2 for more details (a copy is included in the LICENSE file that
   23.16 + * accompanied this code).
   23.17 + *
   23.18 + * You should have received a copy of the GNU General Public License version
   23.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   23.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   23.21 + *
   23.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   23.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   23.24 + * have any questions.
   23.25 + *
   23.26 + */
   23.27 +
   23.28 +
   23.29 +package com.sun.java.swing.action;
   23.30 +
   23.31 +import javax.swing.KeyStroke;
   23.32 +
   23.33 +// Referenced classes of package com.sun.java.swing.action:
   23.34 +//            DelegateAction, ActionManager
   23.35 +
   23.36 +public class HelpAction extends DelegateAction
   23.37 +{
   23.38 +
   23.39 +    public HelpAction()
   23.40 +    {
   23.41 +        this("general/Help16.gif");
   23.42 +    }
   23.43 +
   23.44 +    public HelpAction(String iconPath)
   23.45 +    {
   23.46 +        super("Help", ActionManager.getIcon(iconPath));
   23.47 +        putValue("ActionCommandKey", "help-command");
   23.48 +        putValue("ShortDescription", "Help...");
   23.49 +        putValue("LongDescription", "Provide information which may aid the user.");
   23.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   23.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   23.52 +    }
   23.53 +
   23.54 +    public static final String VALUE_COMMAND = "help-command";
   23.55 +    public static final String VALUE_NAME = "Help";
   23.56 +    public static final String VALUE_SMALL_ICON = "general/Help16.gif";
   23.57 +    public static final String VALUE_LARGE_ICON = "general/Help24.gif";
   23.58 +    public static final Integer VALUE_MNEMONIC = new Integer(72);
   23.59 +    public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(112, 0);
   23.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Help...";
   23.61 +    public static final String VALUE_LONG_DESCRIPTION = "Provide information which may aid the user.";
   23.62 +
   23.63 +}
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/HelpMenu.java	Wed Jul 30 14:41:55 2008 -0700
    24.3 @@ -0,0 +1,53 @@
    24.4 +/*
    24.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    24.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    24.7 + *
    24.8 + * This code is free software; you can redistribute it and/or modify it
    24.9 + * under the terms of the GNU General Public License version 2 only, as
   24.10 + * published by the Free Software Foundation.
   24.11 + *
   24.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   24.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   24.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   24.15 + * version 2 for more details (a copy is included in the LICENSE file that
   24.16 + * accompanied this code).
   24.17 + *
   24.18 + * You should have received a copy of the GNU General Public License version
   24.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   24.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   24.21 + *
   24.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   24.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   24.24 + * have any questions.
   24.25 + *
   24.26 + */
   24.27 +
   24.28 +
   24.29 +package com.sun.java.swing.action;
   24.30 +
   24.31 +import java.awt.event.ActionEvent;
   24.32 +import javax.swing.AbstractAction;
   24.33 +
   24.34 +public class HelpMenu extends AbstractAction
   24.35 +{
   24.36 +
   24.37 +    public HelpMenu()
   24.38 +    {
   24.39 +        super("Help");
   24.40 +        putValue("ActionCommandKey", "help-menu-command");
   24.41 +        putValue("ShortDescription", "Help operations");
   24.42 +        putValue("LongDescription", "Help operations");
   24.43 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   24.44 +    }
   24.45 +
   24.46 +    public void actionPerformed(ActionEvent actionevent)
   24.47 +    {
   24.48 +    }
   24.49 +
   24.50 +    public static final String VALUE_COMMAND = "help-menu-command";
   24.51 +    public static final String VALUE_NAME = "Help";
   24.52 +    public static final Integer VALUE_MNEMONIC = new Integer(72);
   24.53 +    public static final String VALUE_SHORT_DESCRIPTION = "Help operations";
   24.54 +    public static final String VALUE_LONG_DESCRIPTION = "Help operations";
   24.55 +
   24.56 +}
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/NewAction.java	Wed Jul 30 14:41:55 2008 -0700
    25.3 @@ -0,0 +1,60 @@
    25.4 +/*
    25.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    25.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    25.7 + *
    25.8 + * This code is free software; you can redistribute it and/or modify it
    25.9 + * under the terms of the GNU General Public License version 2 only, as
   25.10 + * published by the Free Software Foundation.
   25.11 + *
   25.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   25.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   25.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   25.15 + * version 2 for more details (a copy is included in the LICENSE file that
   25.16 + * accompanied this code).
   25.17 + *
   25.18 + * You should have received a copy of the GNU General Public License version
   25.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   25.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   25.21 + *
   25.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   25.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   25.24 + * have any questions.
   25.25 + *
   25.26 + */
   25.27 +
   25.28 +
   25.29 +package com.sun.java.swing.action;
   25.30 +
   25.31 +import javax.swing.KeyStroke;
   25.32 +
   25.33 +// Referenced classes of package com.sun.java.swing.action:
   25.34 +//            DelegateAction, ActionManager
   25.35 +
   25.36 +public class NewAction extends DelegateAction
   25.37 +{
   25.38 +
   25.39 +    public NewAction()
   25.40 +    {
   25.41 +        this("general/New16.gif");
   25.42 +    }
   25.43 +
   25.44 +    public NewAction(String iconPath)
   25.45 +    {
   25.46 +        super("New", ActionManager.getIcon(iconPath));
   25.47 +        putValue("ActionCommandKey", "new-command");
   25.48 +        putValue("ShortDescription", "Create a new object.");
   25.49 +        putValue("LongDescription", "Create a new object.");
   25.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   25.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   25.52 +    }
   25.53 +
   25.54 +    public static final String VALUE_COMMAND = "new-command";
   25.55 +    public static final String VALUE_NAME = "New";
   25.56 +    public static final String VALUE_SMALL_ICON = "general/New16.gif";
   25.57 +    public static final String VALUE_LARGE_ICON = "general/New24.gif";
   25.58 +    public static final Integer VALUE_MNEMONIC = new Integer(78);
   25.59 +    public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(78, 2);
   25.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Create a new object.";
   25.61 +    public static final String VALUE_LONG_DESCRIPTION = "Create a new object.";
   25.62 +
   25.63 +}
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/NextAction.java	Wed Jul 30 14:41:55 2008 -0700
    26.3 @@ -0,0 +1,60 @@
    26.4 +/*
    26.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    26.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    26.7 + *
    26.8 + * This code is free software; you can redistribute it and/or modify it
    26.9 + * under the terms of the GNU General Public License version 2 only, as
   26.10 + * published by the Free Software Foundation.
   26.11 + *
   26.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   26.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   26.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   26.15 + * version 2 for more details (a copy is included in the LICENSE file that
   26.16 + * accompanied this code).
   26.17 + *
   26.18 + * You should have received a copy of the GNU General Public License version
   26.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   26.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   26.21 + *
   26.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   26.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   26.24 + * have any questions.
   26.25 + *
   26.26 + */
   26.27 +
   26.28 +
   26.29 +package com.sun.java.swing.action;
   26.30 +
   26.31 +import javax.swing.KeyStroke;
   26.32 +
   26.33 +// Referenced classes of package com.sun.java.swing.action:
   26.34 +//            DelegateAction, ActionManager
   26.35 +
   26.36 +public class NextAction extends DelegateAction
   26.37 +{
   26.38 +
   26.39 +    public NextAction()
   26.40 +    {
   26.41 +        this(VALUE_SMALL_ICON);
   26.42 +    }
   26.43 +
   26.44 +    public NextAction(String iconPath)
   26.45 +    {
   26.46 +        super("Next >", ActionManager.getIcon(iconPath));
   26.47 +        putValue("ActionCommandKey", "next-command");
   26.48 +        putValue("ShortDescription", "Select next item");
   26.49 +        putValue("LongDescription", "Select next item");
   26.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   26.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   26.52 +    }
   26.53 +
   26.54 +    public static final String VALUE_COMMAND = "next-command";
   26.55 +    public static final String VALUE_NAME = "Next >";
   26.56 +    public static final String VALUE_SMALL_ICON = null;
   26.57 +    public static final String VALUE_LARGE_ICON = null;
   26.58 +    public static final Integer VALUE_MNEMONIC = new Integer(78);
   26.59 +    public static final KeyStroke VALUE_ACCELERATOR = null;
   26.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Select next item";
   26.61 +    public static final String VALUE_LONG_DESCRIPTION = "Select next item";
   26.62 +
   26.63 +}
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/OkAction.java	Wed Jul 30 14:41:55 2008 -0700
    27.3 @@ -0,0 +1,60 @@
    27.4 +/*
    27.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    27.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    27.7 + *
    27.8 + * This code is free software; you can redistribute it and/or modify it
    27.9 + * under the terms of the GNU General Public License version 2 only, as
   27.10 + * published by the Free Software Foundation.
   27.11 + *
   27.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   27.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   27.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   27.15 + * version 2 for more details (a copy is included in the LICENSE file that
   27.16 + * accompanied this code).
   27.17 + *
   27.18 + * You should have received a copy of the GNU General Public License version
   27.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   27.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   27.21 + *
   27.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   27.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   27.24 + * have any questions.
   27.25 + *
   27.26 + */
   27.27 +
   27.28 +
   27.29 +package com.sun.java.swing.action;
   27.30 +
   27.31 +import javax.swing.KeyStroke;
   27.32 +
   27.33 +// Referenced classes of package com.sun.java.swing.action:
   27.34 +//            DelegateAction, ActionManager
   27.35 +
   27.36 +public class OkAction extends DelegateAction
   27.37 +{
   27.38 +
   27.39 +    public OkAction()
   27.40 +    {
   27.41 +        this(VALUE_SMALL_ICON);
   27.42 +    }
   27.43 +
   27.44 +    public OkAction(String iconPath)
   27.45 +    {
   27.46 +        super("OK", ActionManager.getIcon(iconPath));
   27.47 +        putValue("ActionCommandKey", "ok-command");
   27.48 +        putValue("ShortDescription", "Acknowleges the action");
   27.49 +        putValue("LongDescription", "Acknowleges the action");
   27.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   27.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   27.52 +    }
   27.53 +
   27.54 +    public static final String VALUE_COMMAND = "ok-command";
   27.55 +    public static final String VALUE_NAME = "OK";
   27.56 +    public static final String VALUE_SMALL_ICON = null;
   27.57 +    public static final String VALUE_LARGE_ICON = null;
   27.58 +    public static final Integer VALUE_MNEMONIC = new Integer(79);
   27.59 +    public static final KeyStroke VALUE_ACCELERATOR = null;
   27.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Acknowleges the action";
   27.61 +    public static final String VALUE_LONG_DESCRIPTION = "Acknowleges the action";
   27.62 +
   27.63 +}
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/OpenAction.java	Wed Jul 30 14:41:55 2008 -0700
    28.3 @@ -0,0 +1,60 @@
    28.4 +/*
    28.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    28.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    28.7 + *
    28.8 + * This code is free software; you can redistribute it and/or modify it
    28.9 + * under the terms of the GNU General Public License version 2 only, as
   28.10 + * published by the Free Software Foundation.
   28.11 + *
   28.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   28.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   28.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   28.15 + * version 2 for more details (a copy is included in the LICENSE file that
   28.16 + * accompanied this code).
   28.17 + *
   28.18 + * You should have received a copy of the GNU General Public License version
   28.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   28.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   28.21 + *
   28.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   28.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   28.24 + * have any questions.
   28.25 + *
   28.26 + */
   28.27 +
   28.28 +
   28.29 +package com.sun.java.swing.action;
   28.30 +
   28.31 +import javax.swing.KeyStroke;
   28.32 +
   28.33 +// Referenced classes of package com.sun.java.swing.action:
   28.34 +//            DelegateAction, ActionManager
   28.35 +
   28.36 +public class OpenAction extends DelegateAction
   28.37 +{
   28.38 +
   28.39 +    public OpenAction()
   28.40 +    {
   28.41 +        this("general/Open16.gif");
   28.42 +    }
   28.43 +
   28.44 +    public OpenAction(String iconPath)
   28.45 +    {
   28.46 +        super("Open...", ActionManager.getIcon(iconPath));
   28.47 +        putValue("ActionCommandKey", "open-command");
   28.48 +        putValue("ShortDescription", "Open the specified object.");
   28.49 +        putValue("LongDescription", "Open the specified object.");
   28.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   28.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   28.52 +    }
   28.53 +
   28.54 +    public static final String VALUE_COMMAND = "open-command";
   28.55 +    public static final String VALUE_NAME = "Open...";
   28.56 +    public static final String VALUE_SMALL_ICON = "general/Open16.gif";
   28.57 +    public static final String VALUE_LARGE_ICON = "general/Open24.gif";
   28.58 +    public static final Integer VALUE_MNEMONIC = new Integer(79);
   28.59 +    public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(79, 2);
   28.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Open the specified object.";
   28.61 +    public static final String VALUE_LONG_DESCRIPTION = "Open the specified object.";
   28.62 +
   28.63 +}
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/SaveAction.java	Wed Jul 30 14:41:55 2008 -0700
    29.3 @@ -0,0 +1,60 @@
    29.4 +/*
    29.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    29.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    29.7 + *
    29.8 + * This code is free software; you can redistribute it and/or modify it
    29.9 + * under the terms of the GNU General Public License version 2 only, as
   29.10 + * published by the Free Software Foundation.
   29.11 + *
   29.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   29.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   29.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   29.15 + * version 2 for more details (a copy is included in the LICENSE file that
   29.16 + * accompanied this code).
   29.17 + *
   29.18 + * You should have received a copy of the GNU General Public License version
   29.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   29.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   29.21 + *
   29.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   29.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   29.24 + * have any questions.
   29.25 + *
   29.26 + */
   29.27 +
   29.28 +
   29.29 +package com.sun.java.swing.action;
   29.30 +
   29.31 +import javax.swing.KeyStroke;
   29.32 +
   29.33 +// Referenced classes of package com.sun.java.swing.action:
   29.34 +//            DelegateAction, ActionManager
   29.35 +
   29.36 +public class SaveAction extends DelegateAction
   29.37 +{
   29.38 +
   29.39 +    public SaveAction()
   29.40 +    {
   29.41 +        this("general/Save16.gif");
   29.42 +    }
   29.43 +
   29.44 +    public SaveAction(String iconPath)
   29.45 +    {
   29.46 +        super("Save", ActionManager.getIcon(iconPath));
   29.47 +        putValue("ActionCommandKey", "save-command");
   29.48 +        putValue("ShortDescription", "Commit changes to a permanent storage area");
   29.49 +        putValue("LongDescription", "Commit changes to a permanent storage area");
   29.50 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   29.51 +        putValue("AcceleratorKey", VALUE_ACCELERATOR);
   29.52 +    }
   29.53 +
   29.54 +    public static final String VALUE_COMMAND = "save-command";
   29.55 +    public static final String VALUE_NAME = "Save";
   29.56 +    public static final String VALUE_SMALL_ICON = "general/Save16.gif";
   29.57 +    public static final String VALUE_LARGE_ICON = "general/Save24.gif";
   29.58 +    public static final Integer VALUE_MNEMONIC = new Integer(83);
   29.59 +    public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(83, 2);
   29.60 +    public static final String VALUE_SHORT_DESCRIPTION = "Commit changes to a permanent storage area";
   29.61 +    public static final String VALUE_LONG_DESCRIPTION = "Commit changes to a permanent storage area";
   29.62 +
   29.63 +}
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/SaveAsAction.java	Wed Jul 30 14:41:55 2008 -0700
    30.3 @@ -0,0 +1,57 @@
    30.4 +/*
    30.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    30.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    30.7 + *
    30.8 + * This code is free software; you can redistribute it and/or modify it
    30.9 + * under the terms of the GNU General Public License version 2 only, as
   30.10 + * published by the Free Software Foundation.
   30.11 + *
   30.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   30.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   30.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   30.15 + * version 2 for more details (a copy is included in the LICENSE file that
   30.16 + * accompanied this code).
   30.17 + *
   30.18 + * You should have received a copy of the GNU General Public License version
   30.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   30.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   30.21 + *
   30.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   30.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   30.24 + * have any questions.
   30.25 + *
   30.26 + */
   30.27 +
   30.28 +
   30.29 +package com.sun.java.swing.action;
   30.30 +
   30.31 +
   30.32 +// Referenced classes of package com.sun.java.swing.action:
   30.33 +//            DelegateAction, ActionManager
   30.34 +
   30.35 +public class SaveAsAction extends DelegateAction
   30.36 +{
   30.37 +
   30.38 +    public SaveAsAction()
   30.39 +    {
   30.40 +        this("general/SaveAs16.gif");
   30.41 +    }
   30.42 +
   30.43 +    public SaveAsAction(String iconPath)
   30.44 +    {
   30.45 +        super("Save As", ActionManager.getIcon(iconPath));
   30.46 +        putValue("ActionCommandKey", "save-as-command");
   30.47 +        putValue("ShortDescription", "Save as a new file");
   30.48 +        putValue("LongDescription", "Saves the current object as another object");
   30.49 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   30.50 +    }
   30.51 +
   30.52 +    public static final String VALUE_COMMAND = "save-as-command";
   30.53 +    public static final String VALUE_NAME = "Save As";
   30.54 +    public static final String VALUE_SMALL_ICON = "general/SaveAs16.gif";
   30.55 +    public static final String VALUE_LARGE_ICON = "general/SaveAs24.gif";
   30.56 +    public static final Integer VALUE_MNEMONIC = new Integer(65);
   30.57 +    public static final String VALUE_SHORT_DESCRIPTION = "Save as a new file";
   30.58 +    public static final String VALUE_LONG_DESCRIPTION = "Saves the current object as another object";
   30.59 +
   30.60 +}
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/StateChangeAction.java	Wed Jul 30 14:41:55 2008 -0700
    31.3 @@ -0,0 +1,88 @@
    31.4 +/*
    31.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    31.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    31.7 + *
    31.8 + * This code is free software; you can redistribute it and/or modify it
    31.9 + * under the terms of the GNU General Public License version 2 only, as
   31.10 + * published by the Free Software Foundation.
   31.11 + *
   31.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   31.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   31.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   31.15 + * version 2 for more details (a copy is included in the LICENSE file that
   31.16 + * accompanied this code).
   31.17 + *
   31.18 + * You should have received a copy of the GNU General Public License version
   31.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   31.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   31.21 + *
   31.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   31.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   31.24 + * have any questions.
   31.25 + *
   31.26 + */
   31.27 +
   31.28 +
   31.29 +package com.sun.java.swing.action;
   31.30 +
   31.31 +import java.awt.event.ItemEvent;
   31.32 +import java.awt.event.ItemListener;
   31.33 +import javax.swing.Icon;
   31.34 +
   31.35 +// Referenced classes of package com.sun.java.swing.action:
   31.36 +//            DelegateAction
   31.37 +
   31.38 +public abstract class StateChangeAction extends DelegateAction
   31.39 +    implements ItemListener
   31.40 +{
   31.41 +
   31.42 +    public StateChangeAction(String name)
   31.43 +    {
   31.44 +        super(name, null);
   31.45 +        selected = false;
   31.46 +    }
   31.47 +
   31.48 +    public StateChangeAction(String name, Icon icon)
   31.49 +    {
   31.50 +        super(name, icon);
   31.51 +        selected = false;
   31.52 +    }
   31.53 +
   31.54 +    public boolean isSelected()
   31.55 +    {
   31.56 +        return selected;
   31.57 +    }
   31.58 +
   31.59 +    public synchronized void setSelected(boolean newValue)
   31.60 +    {
   31.61 +        boolean oldValue = selected;
   31.62 +        if(oldValue != newValue)
   31.63 +        {
   31.64 +            selected = newValue;
   31.65 +            firePropertyChange("selected", Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
   31.66 +        }
   31.67 +    }
   31.68 +
   31.69 +    public void setItemListener(ItemListener listener)
   31.70 +    {
   31.71 +        this.listener = listener;
   31.72 +    }
   31.73 +
   31.74 +    public ItemListener getItemListener()
   31.75 +    {
   31.76 +        return listener;
   31.77 +    }
   31.78 +
   31.79 +    public void itemStateChanged(ItemEvent evt)
   31.80 +    {
   31.81 +        if(evt.getStateChange() == 1)
   31.82 +            setSelected(true);
   31.83 +        else
   31.84 +            setSelected(false);
   31.85 +        if(listener != null)
   31.86 +            listener.itemStateChanged(evt);
   31.87 +    }
   31.88 +
   31.89 +    protected boolean selected;
   31.90 +    private ItemListener listener;
   31.91 +}
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/agent/src/share/classes/com/sun/java/swing/action/ViewMenu.java	Wed Jul 30 14:41:55 2008 -0700
    32.3 @@ -0,0 +1,53 @@
    32.4 +/*
    32.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    32.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    32.7 + *
    32.8 + * This code is free software; you can redistribute it and/or modify it
    32.9 + * under the terms of the GNU General Public License version 2 only, as
   32.10 + * published by the Free Software Foundation.
   32.11 + *
   32.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   32.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   32.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   32.15 + * version 2 for more details (a copy is included in the LICENSE file that
   32.16 + * accompanied this code).
   32.17 + *
   32.18 + * You should have received a copy of the GNU General Public License version
   32.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   32.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   32.21 + *
   32.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   32.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   32.24 + * have any questions.
   32.25 + *
   32.26 + */
   32.27 +
   32.28 +
   32.29 +package com.sun.java.swing.action;
   32.30 +
   32.31 +import java.awt.event.ActionEvent;
   32.32 +import javax.swing.AbstractAction;
   32.33 +
   32.34 +public class ViewMenu extends AbstractAction
   32.35 +{
   32.36 +
   32.37 +    public ViewMenu()
   32.38 +    {
   32.39 +        super("View");
   32.40 +        putValue("ActionCommandKey", "view-menu-command");
   32.41 +        putValue("ShortDescription", "View operations");
   32.42 +        putValue("LongDescription", "View operations");
   32.43 +        putValue("MnemonicKey", VALUE_MNEMONIC);
   32.44 +    }
   32.45 +
   32.46 +    public void actionPerformed(ActionEvent actionevent)
   32.47 +    {
   32.48 +    }
   32.49 +
   32.50 +    public static final String VALUE_COMMAND = "view-menu-command";
   32.51 +    public static final String VALUE_NAME = "View";
   32.52 +    public static final Integer VALUE_MNEMONIC = new Integer(86);
   32.53 +    public static final String VALUE_SHORT_DESCRIPTION = "View operations";
   32.54 +    public static final String VALUE_LONG_DESCRIPTION = "View operations";
   32.55 +
   32.56 +}
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/CommonMenuBar.java	Wed Jul 30 14:41:55 2008 -0700
    33.3 @@ -0,0 +1,108 @@
    33.4 +/*
    33.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    33.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    33.7 + *
    33.8 + * This code is free software; you can redistribute it and/or modify it
    33.9 + * under the terms of the GNU General Public License version 2 only, as
   33.10 + * published by the Free Software Foundation.
   33.11 + *
   33.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   33.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   33.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   33.15 + * version 2 for more details (a copy is included in the LICENSE file that
   33.16 + * accompanied this code).
   33.17 + *
   33.18 + * You should have received a copy of the GNU General Public License version
   33.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   33.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   33.21 + *
   33.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   33.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   33.24 + * have any questions.
   33.25 + *
   33.26 + */
   33.27 +
   33.28 +
   33.29 +package com.sun.java.swing.ui;
   33.30 +
   33.31 +import com.sun.java.swing.action.ActionManager;
   33.32 +import com.sun.java.swing.action.StateChangeAction;
   33.33 +import javax.swing.*;
   33.34 +
   33.35 +// Referenced classes of package com.sun.java.swing.ui:
   33.36 +//            ToggleActionPropertyChangeListener, StatusBar
   33.37 +
   33.38 +public abstract class CommonMenuBar extends JMenuBar
   33.39 +{
   33.40 +
   33.41 +    protected CommonMenuBar(ActionManager manager)
   33.42 +    {
   33.43 +        this(manager, StatusBar.getInstance());
   33.44 +    }
   33.45 +
   33.46 +    protected CommonMenuBar(ActionManager manager, StatusBar status)
   33.47 +    {
   33.48 +        this.manager = manager;
   33.49 +        statusBar = status;
   33.50 +        configureMenu();
   33.51 +    }
   33.52 +
   33.53 +    protected abstract void configureMenu();
   33.54 +
   33.55 +    protected void configureToggleMenuItem(JMenuItem menuItem, Action action)
   33.56 +    {
   33.57 +        configureMenuItem(menuItem, action);
   33.58 +        action.addPropertyChangeListener(new ToggleActionPropertyChangeListener(menuItem));
   33.59 +    }
   33.60 +
   33.61 +    protected void configureMenuItem(JMenuItem menuItem, Action action)
   33.62 +    {
   33.63 +        menuItem.addMouseListener(statusBar);
   33.64 +    }
   33.65 +
   33.66 +    protected JMenu createMenu(String name, char mnemonic)
   33.67 +    {
   33.68 +        JMenu menu = new JMenu(name);
   33.69 +        menu.setMnemonic(mnemonic);
   33.70 +        return menu;
   33.71 +    }
   33.72 +
   33.73 +    protected void addMenuItem(JMenu menu, Action action)
   33.74 +    {
   33.75 +        JMenuItem menuItem = menu.add(action);
   33.76 +        configureMenuItem(menuItem, action);
   33.77 +    }
   33.78 +
   33.79 +    protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a)
   33.80 +    {
   33.81 +        addCheckBoxMenuItem(menu, a, false);
   33.82 +    }
   33.83 +
   33.84 +    protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
   33.85 +    {
   33.86 +        JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
   33.87 +        mi.addItemListener(a);
   33.88 +        mi.setSelected(selected);
   33.89 +        menu.add(mi);
   33.90 +        configureToggleMenuItem(mi, a);
   33.91 +    }
   33.92 +
   33.93 +    protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a)
   33.94 +    {
   33.95 +        addRadioButtonMenuItem(menu, group, a, false);
   33.96 +    }
   33.97 +
   33.98 +    protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
   33.99 +    {
  33.100 +        JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
  33.101 +        mi.addItemListener(a);
  33.102 +        mi.setSelected(selected);
  33.103 +        menu.add(mi);
  33.104 +        if(group != null)
  33.105 +            group.add(mi);
  33.106 +        configureToggleMenuItem(mi, a);
  33.107 +    }
  33.108 +
  33.109 +    protected ActionManager manager;
  33.110 +    private StatusBar statusBar;
  33.111 +}
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java	Wed Jul 30 14:41:55 2008 -0700
    34.3 @@ -0,0 +1,95 @@
    34.4 +/*
    34.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    34.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    34.7 + *
    34.8 + * This code is free software; you can redistribute it and/or modify it
    34.9 + * under the terms of the GNU General Public License version 2 only, as
   34.10 + * published by the Free Software Foundation.
   34.11 + *
   34.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   34.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   34.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   34.15 + * version 2 for more details (a copy is included in the LICENSE file that
   34.16 + * accompanied this code).
   34.17 + *
   34.18 + * You should have received a copy of the GNU General Public License version
   34.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   34.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   34.21 + *
   34.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   34.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   34.24 + * have any questions.
   34.25 + *
   34.26 + */
   34.27 +
   34.28 +
   34.29 +package com.sun.java.swing.ui;
   34.30 +
   34.31 +import com.sun.java.swing.action.ActionManager;
   34.32 +import com.sun.java.swing.action.StateChangeAction;
   34.33 +import java.awt.Dimension;
   34.34 +import java.awt.Insets;
   34.35 +import javax.swing.*;
   34.36 +
   34.37 +// Referenced classes of package com.sun.java.swing.ui:
   34.38 +//            ToggleActionPropertyChangeListener, StatusBar, CommonUI
   34.39 +
   34.40 +public abstract class CommonToolBar extends JToolBar
   34.41 +{
   34.42 +
   34.43 +    protected CommonToolBar(ActionManager manager)
   34.44 +    {
   34.45 +        this(manager, StatusBar.getInstance());
   34.46 +    }
   34.47 +
   34.48 +    protected CommonToolBar(ActionManager manager, StatusBar status)
   34.49 +    {
   34.50 +        this.manager = manager;
   34.51 +        statusBar = status;
   34.52 +        buttonSize = new Dimension(CommonUI.buttconPrefSize);
   34.53 +        buttonInsets = new Insets(0, 0, 0, 0);
   34.54 +        addComponents();
   34.55 +    }
   34.56 +
   34.57 +    protected abstract void addComponents();
   34.58 +
   34.59 +    protected void addButton(Action action)
   34.60 +    {
   34.61 +        javax.swing.JButton button = add(action);
   34.62 +        configureButton(button, action);
   34.63 +    }
   34.64 +
   34.65 +    protected void addToggleButton(StateChangeAction a)
   34.66 +    {
   34.67 +        addToggleButton(a, null);
   34.68 +    }
   34.69 +
   34.70 +    protected void addToggleButton(StateChangeAction a, ButtonGroup group)
   34.71 +    {
   34.72 +        JToggleButton button = new JToggleButton(a);
   34.73 +        button.addItemListener(a);
   34.74 +        button.setSelected(a.isSelected());
   34.75 +        if(group != null)
   34.76 +            group.add(button);
   34.77 +        add(button);
   34.78 +        configureToggleButton(button, a);
   34.79 +    }
   34.80 +
   34.81 +    protected void configureToggleButton(JToggleButton button, Action action)
   34.82 +    {
   34.83 +        configureButton(button, action);
   34.84 +        action.addPropertyChangeListener(new ToggleActionPropertyChangeListener(button));
   34.85 +    }
   34.86 +
   34.87 +    protected void configureButton(AbstractButton button, Action action)
   34.88 +    {
   34.89 +        button.setToolTipText((String)action.getValue("Name"));
   34.90 +        button.setText("");
   34.91 +        button.addMouseListener(statusBar);
   34.92 +    }
   34.93 +
   34.94 +    protected ActionManager manager;
   34.95 +    private Dimension buttonSize;
   34.96 +    private Insets buttonInsets;
   34.97 +    private StatusBar statusBar;
   34.98 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java	Wed Jul 30 14:41:55 2008 -0700
    35.3 @@ -0,0 +1,392 @@
    35.4 +/*
    35.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    35.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    35.7 + *
    35.8 + * This code is free software; you can redistribute it and/or modify it
    35.9 + * under the terms of the GNU General Public License version 2 only, as
   35.10 + * published by the Free Software Foundation.
   35.11 + *
   35.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   35.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   35.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   35.15 + * version 2 for more details (a copy is included in the LICENSE file that
   35.16 + * accompanied this code).
   35.17 + *
   35.18 + * You should have received a copy of the GNU General Public License version
   35.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   35.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   35.21 + *
   35.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   35.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   35.24 + * have any questions.
   35.25 + *
   35.26 + */
   35.27 +
   35.28 +
   35.29 +package com.sun.java.swing.ui;
   35.30 +
   35.31 +import java.awt.*;
   35.32 +import java.awt.event.ActionListener;
   35.33 +import java.awt.event.KeyListener;
   35.34 +import java.util.StringTokenizer;
   35.35 +import java.util.Vector;
   35.36 +import javax.swing.*;
   35.37 +import javax.swing.border.Border;
   35.38 +import javax.swing.text.*;
   35.39 +
   35.40 +public class CommonUI
   35.41 +{
   35.42 +    private static class NumberDocument extends PlainDocument
   35.43 +    {
   35.44 +
   35.45 +        public void insertString(int offs, String str, AttributeSet atts)
   35.46 +            throws BadLocationException
   35.47 +        {
   35.48 +            if(!Character.isDigit(str.charAt(0)))
   35.49 +            {
   35.50 +                return;
   35.51 +            } else
   35.52 +            {
   35.53 +                super.insertString(offs, str, atts);
   35.54 +                return;
   35.55 +            }
   35.56 +        }
   35.57 +
   35.58 +        private NumberDocument()
   35.59 +        {
   35.60 +        }
   35.61 +
   35.62 +    }
   35.63 +
   35.64 +
   35.65 +    public CommonUI()
   35.66 +    {
   35.67 +    }
   35.68 +
   35.69 +    public static JLabel createLabel(String text, int mnemonic, Component comp)
   35.70 +    {
   35.71 +        JLabel label = new JLabel("  " + text);
   35.72 +        label.setMinimumSize(labelPrefSize);
   35.73 +        if(mnemonic != -1)
   35.74 +            label.setDisplayedMnemonic(mnemonic);
   35.75 +        if(comp != null)
   35.76 +            label.setLabelFor(comp);
   35.77 +        if(text.length() == 0)
   35.78 +            label.setPreferredSize(labelPrefSize);
   35.79 +        return label;
   35.80 +    }
   35.81 +
   35.82 +    public static JLabel createLabel(String text)
   35.83 +    {
   35.84 +        return createLabel(text, -1, null);
   35.85 +    }
   35.86 +
   35.87 +    public static JTextField createTextField(String text, KeyListener listener, boolean numbers)
   35.88 +    {
   35.89 +        JTextField field = new JTextField(text);
   35.90 +        field.setMinimumSize(textPrefSize);
   35.91 +        if(text.length() == 0)
   35.92 +            field.setPreferredSize(textPrefSize);
   35.93 +        if(listener != null)
   35.94 +            field.addKeyListener(listener);
   35.95 +        if(numbers)
   35.96 +            field.setDocument(new NumberDocument());
   35.97 +        return field;
   35.98 +    }
   35.99 +
  35.100 +    public static JTextField createTextField(String text, boolean numbers)
  35.101 +    {
  35.102 +        return createTextField(text, null, numbers);
  35.103 +    }
  35.104 +
  35.105 +    public static JTextField createTextField(String text, KeyListener listener)
  35.106 +    {
  35.107 +        return createTextField(text, listener, false);
  35.108 +    }
  35.109 +
  35.110 +    public static JTextField createTextField(String text)
  35.111 +    {
  35.112 +        return createTextField(text, null, false);
  35.113 +    }
  35.114 +
  35.115 +    public static JRadioButton createRadioButton(String text, int mnemonic, ActionListener listener, boolean selected)
  35.116 +    {
  35.117 +        JRadioButton button = new JRadioButton(text);
  35.118 +        button.setMnemonic(mnemonic);
  35.119 +        button.setSelected(selected);
  35.120 +        button.setMinimumSize(labelPrefSize);
  35.121 +        if(listener != null)
  35.122 +            button.addActionListener(listener);
  35.123 +        if(text.length() == 0)
  35.124 +            button.setPreferredSize(labelPrefSize);
  35.125 +        return button;
  35.126 +    }
  35.127 +
  35.128 +    public static JRadioButton createRadioButton(String text, int mnemonic, boolean selected)
  35.129 +    {
  35.130 +        return createRadioButton(text, mnemonic, null, selected);
  35.131 +    }
  35.132 +
  35.133 +    public static JRadioButton createRadioButton(String text, int mnemonic, ActionListener listener)
  35.134 +    {
  35.135 +        return createRadioButton(text, mnemonic, listener, false);
  35.136 +    }
  35.137 +
  35.138 +    public static JRadioButton createRadioButton(String text, int mnemonic)
  35.139 +    {
  35.140 +        return createRadioButton(text, mnemonic, null, false);
  35.141 +    }
  35.142 +
  35.143 +    public static JRadioButton createRadioButton(String text)
  35.144 +    {
  35.145 +        return createRadioButton(text, -1, null, false);
  35.146 +    }
  35.147 +
  35.148 +    public static JCheckBox createCheckBox(String text, int mnemonic, ActionListener listener, boolean selected)
  35.149 +    {
  35.150 +        JCheckBox checkbox = new JCheckBox(text);
  35.151 +        checkbox.setMinimumSize(labelPrefSize);
  35.152 +        if(mnemonic != -1)
  35.153 +            checkbox.setMnemonic(mnemonic);
  35.154 +        checkbox.setSelected(selected);
  35.155 +        if(text.length() == 0)
  35.156 +            checkbox.setPreferredSize(labelPrefSize);
  35.157 +        if(listener != null)
  35.158 +            checkbox.addActionListener(listener);
  35.159 +        return checkbox;
  35.160 +    }
  35.161 +
  35.162 +    public static JCheckBox createCheckBox(String text, int mnemonic, ActionListener listener)
  35.163 +    {
  35.164 +        return createCheckBox(text, mnemonic, listener, false);
  35.165 +    }
  35.166 +
  35.167 +    public static JCheckBox createCheckBox(String text, int mnemonic, boolean selected)
  35.168 +    {
  35.169 +        return createCheckBox(text, mnemonic, null, selected);
  35.170 +    }
  35.171 +
  35.172 +    public static JCheckBox createCheckBox(String text, int mnemonic)
  35.173 +    {
  35.174 +        return createCheckBox(text, mnemonic, null, false);
  35.175 +    }
  35.176 +
  35.177 +    public static JCheckBox createCheckBox(String text)
  35.178 +    {
  35.179 +        return createCheckBox(text, -1, null, false);
  35.180 +    }
  35.181 +
  35.182 +    public static JComboBox createComboBox(Object items[], ActionListener listener, boolean editable)
  35.183 +    {
  35.184 +        JComboBox comboBox = new JComboBox(items);
  35.185 +        if(listener != null)
  35.186 +            comboBox.addActionListener(listener);
  35.187 +        comboBox.setEditable(editable);
  35.188 +        return comboBox;
  35.189 +    }
  35.190 +
  35.191 +    public static JComboBox createComboBox(Object items[], boolean editable)
  35.192 +    {
  35.193 +        return createComboBox(items, null, editable);
  35.194 +    }
  35.195 +
  35.196 +    public static JComboBox createComboBox(Vector items, ActionListener listener, boolean editable)
  35.197 +    {
  35.198 +        JComboBox comboBox = new JComboBox(items);
  35.199 +        if(listener != null)
  35.200 +            comboBox.addActionListener(listener);
  35.201 +        comboBox.setEditable(editable);
  35.202 +        return comboBox;
  35.203 +    }
  35.204 +
  35.205 +    public static JComboBox createComboBox(Vector items, boolean editable)
  35.206 +    {
  35.207 +        return createComboBox(items, null, editable);
  35.208 +    }
  35.209 +
  35.210 +    public static JButton createButton(Action action)
  35.211 +    {
  35.212 +        JButton button = new JButton(action);
  35.213 +        setButtonSize(button, buttonPrefSize);
  35.214 +        return button;
  35.215 +    }
  35.216 +
  35.217 +    public static JButton createButton(String text, ActionListener listener, int mnemonic)
  35.218 +    {
  35.219 +        JButton button = new JButton(text);
  35.220 +        if(listener != null)
  35.221 +            button.addActionListener(listener);
  35.222 +        if(mnemonic != -1)
  35.223 +            button.setMnemonic(mnemonic);
  35.224 +        setButtonSize(button, buttonPrefSize);
  35.225 +        return button;
  35.226 +    }
  35.227 +
  35.228 +    private static void setButtonSize(JButton button, Dimension size)
  35.229 +    {
  35.230 +        String text = button.getText();
  35.231 +        button.setMinimumSize(size);
  35.232 +        if(text.length() == 0)
  35.233 +        {
  35.234 +            button.setPreferredSize(size);
  35.235 +        } else
  35.236 +        {
  35.237 +            Dimension psize = button.getPreferredSize();
  35.238 +            if(psize.width < size.width)
  35.239 +                button.setPreferredSize(size);
  35.240 +        }
  35.241 +    }
  35.242 +
  35.243 +    public static JButton createButton(String text, ActionListener listener)
  35.244 +    {
  35.245 +        return createButton(text, listener, -1);
  35.246 +    }
  35.247 +
  35.248 +    public static JButton createSmallButton(String text, ActionListener listener, int mnemonic)
  35.249 +    {
  35.250 +        JButton button = createButton(text, listener, mnemonic);
  35.251 +        setButtonSize(button, smbuttonPrefSize);
  35.252 +        return button;
  35.253 +    }
  35.254 +
  35.255 +    public static JButton createSmallButton(String text, ActionListener listener)
  35.256 +    {
  35.257 +        return createSmallButton(text, listener, -1);
  35.258 +    }
  35.259 +
  35.260 +    public static Border createBorder(String text)
  35.261 +    {
  35.262 +        Border border = BorderFactory.createEtchedBorder();
  35.263 +        return BorderFactory.createTitledBorder(border, text, 0, 2);
  35.264 +    }
  35.265 +
  35.266 +    public static Border createBorder()
  35.267 +    {
  35.268 +        return BorderFactory.createEmptyBorder(4, 4, 4, 4);
  35.269 +    }
  35.270 +
  35.271 +    public static JScrollPane createListPane(JList list, String text)
  35.272 +    {
  35.273 +        JScrollPane pane = new JScrollPane(list);
  35.274 +        pane.setBorder(BorderFactory.createCompoundBorder(createBorder(text), BorderFactory.createLoweredBevelBorder()));
  35.275 +        return pane;
  35.276 +    }
  35.277 +
  35.278 +    public static void centerComponent(Component source, Component parent)
  35.279 +    {
  35.280 +        Dimension dim = source.getSize();
  35.281 +        Rectangle rect;
  35.282 +        if(parent != null)
  35.283 +        {
  35.284 +            rect = parent.getBounds();
  35.285 +        } else
  35.286 +        {
  35.287 +            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
  35.288 +            rect = new Rectangle(0, 0, d.width, d.height);
  35.289 +        }
  35.290 +        int x = rect.x + (rect.width - dim.width) / 2;
  35.291 +        int y = rect.y + (rect.height - dim.height) / 2;
  35.292 +        source.setLocation(x, y);
  35.293 +    }
  35.294 +
  35.295 +    public static void centerComponent(Component source)
  35.296 +    {
  35.297 +        centerComponent(source, null);
  35.298 +    }
  35.299 +
  35.300 +    public static JFrame getParentFrame(Component source)
  35.301 +    {
  35.302 +        Container parent;
  35.303 +        for(parent = source.getParent(); parent != null; parent = parent.getParent())
  35.304 +            if(parent instanceof JFrame)
  35.305 +                break;
  35.306 +
  35.307 +        if(parent == null)
  35.308 +            return null;
  35.309 +        else
  35.310 +            return (JFrame)parent;
  35.311 +    }
  35.312 +
  35.313 +    public static Integer msToSec(Integer ms)
  35.314 +    {
  35.315 +        int value = ms.intValue();
  35.316 +        value /= 1000;
  35.317 +        return new Integer(value);
  35.318 +    }
  35.319 +
  35.320 +    public static Integer secToMs(Integer sec)
  35.321 +    {
  35.322 +        int value = sec.intValue();
  35.323 +        value *= 1000;
  35.324 +        return new Integer(value);
  35.325 +    }
  35.326 +
  35.327 +    public static String stringFromStringArray(String strings[], String delim)
  35.328 +    {
  35.329 +        String string = "";
  35.330 +        String separator;
  35.331 +        if(delim == null || delim.equals(""))
  35.332 +            separator = " ";
  35.333 +        else
  35.334 +            separator = delim;
  35.335 +        for(int i = 0; i < strings.length; i++)
  35.336 +        {
  35.337 +            string = string + strings[i];
  35.338 +            string = string + separator;
  35.339 +        }
  35.340 +
  35.341 +        return string;
  35.342 +    }
  35.343 +
  35.344 +    public static String stringFromStringArray(String strings[])
  35.345 +    {
  35.346 +        return stringFromStringArray(strings, "");
  35.347 +    }
  35.348 +
  35.349 +    public static String[] stringArrayFromString(String string, String delim)
  35.350 +    {
  35.351 +        StringTokenizer st;
  35.352 +        if(delim == null || delim.equals(""))
  35.353 +            st = new StringTokenizer(string);
  35.354 +        else
  35.355 +            st = new StringTokenizer(string, delim);
  35.356 +        int numTokens = st.countTokens();
  35.357 +        String strings[] = new String[numTokens];
  35.358 +        int index = 0;
  35.359 +        while(st.hasMoreTokens())
  35.360 +            strings[index++] = st.nextToken();
  35.361 +        return strings;
  35.362 +    }
  35.363 +
  35.364 +    public static String[] stringArrayFromString(String string)
  35.365 +    {
  35.366 +        return stringArrayFromString(string, "");
  35.367 +    }
  35.368 +
  35.369 +    public static void setWaitCursor(Component comp)
  35.370 +    {
  35.371 +        comp.setCursor(Cursor.getPredefinedCursor(3));
  35.372 +    }
  35.373 +
  35.374 +    public static void setDefaultCursor(Component comp)
  35.375 +    {
  35.376 +        comp.setCursor(Cursor.getPredefinedCursor(0));
  35.377 +    }
  35.378 +
  35.379 +    public static final int BUTTON_WIDTH = 100;
  35.380 +    public static final int BUTTON_HEIGHT = 26;
  35.381 +    public static final int BUTTCON_WIDTH = 28;
  35.382 +    public static final int BUTTCON_HEIGHT = 28;
  35.383 +    public static final int SM_BUTTON_WIDTH = 72;
  35.384 +    public static final int SM_BUTTON_HEIGHT = 26;
  35.385 +    public static final int LABEL_WIDTH = 100;
  35.386 +    public static final int LABEL_HEIGHT = 20;
  35.387 +    public static final int TEXT_WIDTH = 150;
  35.388 +    public static final int TEXT_HEIGHT = 20;
  35.389 +    public static Dimension buttonPrefSize = new Dimension(100, 26);
  35.390 +    public static Dimension buttconPrefSize = new Dimension(28, 28);
  35.391 +    public static Dimension smbuttonPrefSize = new Dimension(72, 26);
  35.392 +    public static Dimension labelPrefSize = new Dimension(100, 20);
  35.393 +    public static Dimension textPrefSize = new Dimension(150, 20);
  35.394 +
  35.395 +}
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java	Wed Jul 30 14:41:55 2008 -0700
    36.3 @@ -0,0 +1,51 @@
    36.4 +/*
    36.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    36.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    36.7 + *
    36.8 + * This code is free software; you can redistribute it and/or modify it
    36.9 + * under the terms of the GNU General Public License version 2 only, as
   36.10 + * published by the Free Software Foundation.
   36.11 + *
   36.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   36.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   36.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   36.15 + * version 2 for more details (a copy is included in the LICENSE file that
   36.16 + * accompanied this code).
   36.17 + *
   36.18 + * You should have received a copy of the GNU General Public License version
   36.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   36.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   36.21 + *
   36.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   36.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   36.24 + * have any questions.
   36.25 + *
   36.26 + */
   36.27 +
   36.28 +
   36.29 +package com.sun.java.swing.ui;
   36.30 +
   36.31 +import com.sun.java.swing.action.*;
   36.32 +import java.awt.event.ActionListener;
   36.33 +import javax.swing.JPanel;
   36.34 +
   36.35 +// Referenced classes of package com.sun.java.swing.ui:
   36.36 +//            CommonUI
   36.37 +
   36.38 +public class OkCancelButtonPanel extends JPanel
   36.39 +{
   36.40 +
   36.41 +    public OkCancelButtonPanel(ActionListener listener)
   36.42 +    {
   36.43 +        DelegateAction okAction = new OkAction();
   36.44 +        okAction.addActionListener(listener);
   36.45 +        DelegateAction cancelAction = new CancelAction();
   36.46 +        cancelAction.addActionListener(listener);
   36.47 +        add(CommonUI.createButton(okAction));
   36.48 +        add(CommonUI.createButton(cancelAction));
   36.49 +    }
   36.50 +
   36.51 +    public static final String OK_COMMAND = "ok-command";
   36.52 +    public static final String CANCEL_COMMAND = "cancel-command";
   36.53 +
   36.54 +}
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/OkCancelDialog.java	Wed Jul 30 14:41:55 2008 -0700
    37.3 @@ -0,0 +1,82 @@
    37.4 +/*
    37.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    37.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    37.7 + *
    37.8 + * This code is free software; you can redistribute it and/or modify it
    37.9 + * under the terms of the GNU General Public License version 2 only, as
   37.10 + * published by the Free Software Foundation.
   37.11 + *
   37.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   37.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   37.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   37.15 + * version 2 for more details (a copy is included in the LICENSE file that
   37.16 + * accompanied this code).
   37.17 + *
   37.18 + * You should have received a copy of the GNU General Public License version
   37.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   37.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   37.21 + *
   37.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   37.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   37.24 + * have any questions.
   37.25 + *
   37.26 + */
   37.27 +
   37.28 +
   37.29 +package com.sun.java.swing.ui;
   37.30 +
   37.31 +import java.awt.BorderLayout;
   37.32 +import java.awt.Container;
   37.33 +import java.awt.event.ActionEvent;
   37.34 +import java.awt.event.ActionListener;
   37.35 +import javax.swing.JDialog;
   37.36 +import javax.swing.JPanel;
   37.37 +
   37.38 +// Referenced classes of package com.sun.java.swing.ui:
   37.39 +//            OkCancelButtonPanel, CommonUI
   37.40 +
   37.41 +public class OkCancelDialog extends JDialog
   37.42 +    implements ActionListener
   37.43 +{
   37.44 +
   37.45 +    public OkCancelDialog(String title, JPanel panel)
   37.46 +    {
   37.47 +        this(title, panel, true);
   37.48 +    }
   37.49 +
   37.50 +    public OkCancelDialog(String title, JPanel panel, boolean modal)
   37.51 +    {
   37.52 +        setTitle(title);
   37.53 +        setModal(modal);
   37.54 +        Container pane = getContentPane();
   37.55 +        pane.setLayout(new BorderLayout());
   37.56 +        pane.add(panel, "Center");
   37.57 +        pane.add(new OkCancelButtonPanel(this), "South");
   37.58 +        pack();
   37.59 +        CommonUI.centerComponent(this);
   37.60 +    }
   37.61 +
   37.62 +    public boolean isOk()
   37.63 +    {
   37.64 +        return okPressed;
   37.65 +    }
   37.66 +
   37.67 +    public void actionPerformed(ActionEvent evt)
   37.68 +    {
   37.69 +        String command = evt.getActionCommand();
   37.70 +        if(command.equals("ok-command"))
   37.71 +        {
   37.72 +            okPressed = true;
   37.73 +            setVisible(false);
   37.74 +            dispose();
   37.75 +        } else
   37.76 +        if(command.equals("cancel-command"))
   37.77 +        {
   37.78 +            okPressed = false;
   37.79 +            setVisible(false);
   37.80 +            dispose();
   37.81 +        }
   37.82 +    }
   37.83 +
   37.84 +    private boolean okPressed;
   37.85 +}
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/SplashScreen.java	Wed Jul 30 14:41:55 2008 -0700
    38.3 @@ -0,0 +1,85 @@
    38.4 +/*
    38.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    38.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    38.7 + *
    38.8 + * This code is free software; you can redistribute it and/or modify it
    38.9 + * under the terms of the GNU General Public License version 2 only, as
   38.10 + * published by the Free Software Foundation.
   38.11 + *
   38.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   38.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   38.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   38.15 + * version 2 for more details (a copy is included in the LICENSE file that
   38.16 + * accompanied this code).
   38.17 + *
   38.18 + * You should have received a copy of the GNU General Public License version
   38.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   38.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   38.21 + *
   38.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   38.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   38.24 + * have any questions.
   38.25 + *
   38.26 + */
   38.27 +
   38.28 +
   38.29 +package com.sun.java.swing.ui;
   38.30 +
   38.31 +import java.awt.*;
   38.32 +import javax.swing.ImageIcon;
   38.33 +
   38.34 +public class SplashScreen extends Window
   38.35 +{
   38.36 +
   38.37 +    public SplashScreen(Frame f)
   38.38 +    {
   38.39 +        super(f);
   38.40 +        setBackground(Color.white);
   38.41 +        java.net.URL url = getClass().getResource("/images/SplashScreen.jpg");
   38.42 +        if(url != null)
   38.43 +        {
   38.44 +            screen = new ImageIcon(url);
   38.45 +            MediaTracker mt = new MediaTracker(this);
   38.46 +            mt.addImage(screen.getImage(), 0);
   38.47 +            try
   38.48 +            {
   38.49 +                mt.waitForAll();
   38.50 +            }
   38.51 +            catch(Exception ex) { }
   38.52 +        }
   38.53 +    }
   38.54 +
   38.55 +    public void setVisible(boolean val)
   38.56 +    {
   38.57 +        if(screen == null)
   38.58 +            return;
   38.59 +        if(val)
   38.60 +        {
   38.61 +            setSize(screen.getIconWidth(), screen.getIconHeight());
   38.62 +            setLocation(-500, -500);
   38.63 +            super.setVisible(true);
   38.64 +            Dimension d = getToolkit().getScreenSize();
   38.65 +            Insets i = getInsets();
   38.66 +            int w = screen.getIconWidth() + i.left + i.right;
   38.67 +            int h = screen.getIconHeight() + i.top + i.bottom;
   38.68 +            setSize(w, h);
   38.69 +            setLocation(d.width / 2 - w / 2, d.height / 2 - h / 2);
   38.70 +        } else
   38.71 +        {
   38.72 +            super.setVisible(false);
   38.73 +        }
   38.74 +    }
   38.75 +
   38.76 +    public void paint(Graphics g)
   38.77 +    {
   38.78 +        if(screen != null)
   38.79 +        {
   38.80 +            Dimension d = getSize();
   38.81 +            g.setColor(Color.black);
   38.82 +            g.drawRect(0, 0, d.width - 1, d.height - 1);
   38.83 +            g.drawImage(screen.getImage(), 1, 1, this);
   38.84 +        }
   38.85 +    }
   38.86 +
   38.87 +    private ImageIcon screen;
   38.88 +}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/StatusBar.java	Wed Jul 30 14:41:55 2008 -0700
    39.3 @@ -0,0 +1,178 @@
    39.4 +/*
    39.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    39.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    39.7 + *
    39.8 + * This code is free software; you can redistribute it and/or modify it
    39.9 + * under the terms of the GNU General Public License version 2 only, as
   39.10 + * published by the Free Software Foundation.
   39.11 + *
   39.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   39.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   39.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   39.15 + * version 2 for more details (a copy is included in the LICENSE file that
   39.16 + * accompanied this code).
   39.17 + *
   39.18 + * You should have received a copy of the GNU General Public License version
   39.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   39.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   39.21 + *
   39.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   39.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   39.24 + * have any questions.
   39.25 + *
   39.26 + */
   39.27 +
   39.28 +
   39.29 +package com.sun.java.swing.ui;
   39.30 +
   39.31 +import java.awt.*;
   39.32 +import java.awt.event.*;
   39.33 +import javax.swing.*;
   39.34 +
   39.35 +public class StatusBar extends JPanel
   39.36 +    implements ActionListener, MouseListener
   39.37 +{
   39.38 +
   39.39 +    public StatusBar()
   39.40 +    {
   39.41 +        setLayout(new FlowLayout(0));
   39.42 +        setBorder(BorderFactory.createEtchedBorder());
   39.43 +        progressBar = new JProgressBar(0, 0, 100);
   39.44 +        progressBar.setPreferredSize(new Dimension(60, progressBar.getPreferredSize().height + 2));
   39.45 +        progressBar.setVisible(false);
   39.46 +        label = new JLabel("                                                                                        ");
   39.47 +        preferredSize = new Dimension(getWidth(label.getText()), 2 * getFontHeight());
   39.48 +        add(progressBar);
   39.49 +        add(label);
   39.50 +    }
   39.51 +
   39.52 +    public static StatusBar getInstance()
   39.53 +    {
   39.54 +        if(statusBar == null)
   39.55 +            statusBar = new StatusBar();
   39.56 +        return statusBar;
   39.57 +    }
   39.58 +
   39.59 +    public static void setInstance(StatusBar sb)
   39.60 +    {
   39.61 +        statusBar = sb;
   39.62 +    }
   39.63 +
   39.64 +    protected int getWidth(String s)
   39.65 +    {
   39.66 +        FontMetrics fm = getFontMetrics(getFont());
   39.67 +        if(fm == null)
   39.68 +            return 0;
   39.69 +        else
   39.70 +            return fm.stringWidth(s);
   39.71 +    }
   39.72 +
   39.73 +    protected int getFontHeight()
   39.74 +    {
   39.75 +        FontMetrics fm = getFontMetrics(getFont());
   39.76 +        if(fm == null)
   39.77 +            return 0;
   39.78 +        else
   39.79 +            return fm.getHeight();
   39.80 +    }
   39.81 +
   39.82 +    public Dimension getPreferredSize()
   39.83 +    {
   39.84 +        return preferredSize;
   39.85 +    }
   39.86 +
   39.87 +    public void setMessage(String message)
   39.88 +    {
   39.89 +        label.setText(message);
   39.90 +        label.repaint();
   39.91 +    }
   39.92 +
   39.93 +    public void startBusyBar()
   39.94 +    {
   39.95 +        forward = true;
   39.96 +        if(timer == null)
   39.97 +        {
   39.98 +            setMessage("");
   39.99 +            progressBar.setVisible(true);
  39.100 +            timer = new Timer(15, this);
  39.101 +            timer.start();
  39.102 +        }
  39.103 +    }
  39.104 +
  39.105 +    public void stopBusyBar()
  39.106 +    {
  39.107 +        if(timer != null)
  39.108 +        {
  39.109 +            timer.stop();
  39.110 +            timer = null;
  39.111 +        }
  39.112 +        setMessage("");
  39.113 +        progressBar.setVisible(false);
  39.114 +        progressBar.setValue(0);
  39.115 +    }
  39.116 +
  39.117 +    public void actionPerformed(ActionEvent evt)
  39.118 +    {
  39.119 +        int value = progressBar.getValue();
  39.120 +        if(forward)
  39.121 +        {
  39.122 +            if(value < 100)
  39.123 +            {
  39.124 +                progressBar.setValue(value + 1);
  39.125 +            } else
  39.126 +            {
  39.127 +                forward = false;
  39.128 +                progressBar.setValue(value - 1);
  39.129 +            }
  39.130 +        } else
  39.131 +        if(value > 0)
  39.132 +        {
  39.133 +            progressBar.setValue(value - 1);
  39.134 +        } else
  39.135 +        {
  39.136 +            forward = true;
  39.137 +            progressBar.setValue(value + 1);
  39.138 +        }
  39.139 +    }
  39.140 +
  39.141 +    public void mouseClicked(MouseEvent mouseevent)
  39.142 +    {
  39.143 +    }
  39.144 +
  39.145 +    public void mousePressed(MouseEvent mouseevent)
  39.146 +    {
  39.147 +    }
  39.148 +
  39.149 +    public void mouseReleased(MouseEvent mouseevent)
  39.150 +    {
  39.151 +    }
  39.152 +
  39.153 +    public void mouseExited(MouseEvent evt)
  39.154 +    {
  39.155 +        setMessage("");
  39.156 +    }
  39.157 +
  39.158 +    public void mouseEntered(MouseEvent evt)
  39.159 +    {
  39.160 +        if(evt.getSource() instanceof AbstractButton)
  39.161 +        {
  39.162 +            AbstractButton button = (AbstractButton)evt.getSource();
  39.163 +            Action action = button.getAction();
  39.164 +            if(action != null)
  39.165 +            {
  39.166 +                String message = (String)action.getValue("LongDescription");
  39.167 +                setMessage(message);
  39.168 +            }
  39.169 +        }
  39.170 +    }
  39.171 +
  39.172 +    private static final int PROGRESS_MAX = 100;
  39.173 +    private static final int PROGRESS_MIN = 0;
  39.174 +    private JLabel label;
  39.175 +    private Dimension preferredSize;
  39.176 +    private JProgressBar progressBar;
  39.177 +    private Timer timer;
  39.178 +    private boolean forward;
  39.179 +    private static StatusBar statusBar;
  39.180 +
  39.181 +}
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/TabsDlg.java	Wed Jul 30 14:41:55 2008 -0700
    40.3 @@ -0,0 +1,221 @@
    40.4 +/*
    40.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    40.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    40.7 + *
    40.8 + * This code is free software; you can redistribute it and/or modify it
    40.9 + * under the terms of the GNU General Public License version 2 only, as
   40.10 + * published by the Free Software Foundation.
   40.11 + *
   40.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   40.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   40.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   40.15 + * version 2 for more details (a copy is included in the LICENSE file that
   40.16 + * accompanied this code).
   40.17 + *
   40.18 + * You should have received a copy of the GNU General Public License version
   40.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   40.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   40.21 + *
   40.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   40.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   40.24 + * have any questions.
   40.25 + *
   40.26 + */
   40.27 +
   40.28 +
   40.29 +package com.sun.java.swing.ui;
   40.30 +
   40.31 +import com.sun.java.swing.action.*;
   40.32 +import java.awt.*;
   40.33 +import java.awt.event.ActionEvent;
   40.34 +import java.awt.event.ActionListener;
   40.35 +import java.util.Vector;
   40.36 +import javax.swing.*;
   40.37 +
   40.38 +// Referenced classes of package com.sun.java.swing.ui:
   40.39 +//            CommonUI
   40.40 +
   40.41 +public class TabsDlg extends JDialog
   40.42 +{
   40.43 +    private class ApplyListener
   40.44 +        implements ActionListener
   40.45 +    {
   40.46 +
   40.47 +        public void actionPerformed(ActionEvent evt)
   40.48 +        {
   40.49 +            if(applyListener != null)
   40.50 +            {
   40.51 +                applyListener.actionPerformed(evt);
   40.52 +                enableApplyButton(false);
   40.53 +            }
   40.54 +        }
   40.55 +
   40.56 +        private ApplyListener()
   40.57 +        {
   40.58 +        }
   40.59 +
   40.60 +    }
   40.61 +
   40.62 +    private class CancelListener
   40.63 +        implements ActionListener
   40.64 +    {
   40.65 +
   40.66 +        public void actionPerformed(ActionEvent evt)
   40.67 +        {
   40.68 +            if(cancelListener != null)
   40.69 +                cancelListener.actionPerformed(evt);
   40.70 +            setVisible(false);
   40.71 +        }
   40.72 +
   40.73 +        private CancelListener()
   40.74 +        {
   40.75 +        }
   40.76 +
   40.77 +    }
   40.78 +
   40.79 +    private class OkListener
   40.80 +        implements ActionListener
   40.81 +    {
   40.82 +
   40.83 +        public void actionPerformed(ActionEvent evt)
   40.84 +        {
   40.85 +            if(okListener != null)
   40.86 +                okListener.actionPerformed(evt);
   40.87 +            setVisible(false);
   40.88 +        }
   40.89 +
   40.90 +        private OkListener()
   40.91 +        {
   40.92 +        }
   40.93 +
   40.94 +    }
   40.95 +
   40.96 +
   40.97 +    public TabsDlg(String title, Vector panels)
   40.98 +    {
   40.99 +        super(new JFrame(), title, true);
  40.100 +        okListener = null;
  40.101 +        cancelListener = null;
  40.102 +        applyListener = null;
  40.103 +        Container pane = getContentPane();
  40.104 +        pane.setLayout(new BorderLayout());
  40.105 +        tabsPanel = new JTabbedPane();
  40.106 +        int numPanels = panels.size();
  40.107 +        for(int i = 0; i < numPanels; i++)
  40.108 +        {
  40.109 +            JPanel panel = (JPanel)panels.elementAt(i);
  40.110 +            tabsPanel.addTab(panel.getName(), panel);
  40.111 +        }
  40.112 +
  40.113 +        pane.add(tabsPanel, "Center");
  40.114 +        pane.add(createButtonPanel(), "South");
  40.115 +        pack();
  40.116 +        CommonUI.centerComponent(this);
  40.117 +    }
  40.118 +
  40.119 +    public static void main(String args[])
  40.120 +    {
  40.121 +        JPanel p1 = new JPanel();
  40.122 +        p1.add(new JButton("One"));
  40.123 +        p1.setName("One");
  40.124 +        JPanel p2 = new JPanel();
  40.125 +        p2.add(new JButton("Two"));
  40.126 +        p2.setName("Two");
  40.127 +        JPanel p3 = new JPanel();
  40.128 +        p3.add(new JButton("Three"));
  40.129 +        p3.setName("Three");
  40.130 +        JPanel p4 = new JPanel();
  40.131 +        p4.add(new JButton("Four"));
  40.132 +        p4.setName("Four");
  40.133 +        Vector panels = new Vector();
  40.134 +        panels.addElement(p1);
  40.135 +        panels.addElement(p2);
  40.136 +        panels.addElement(p3);
  40.137 +        panels.addElement(p4);
  40.138 +        tabsDlg = new TabsDlg("Test Dialog", panels);
  40.139 +        tabsDlg.addOkListener(new ActionListener() {
  40.140 +
  40.141 +            public void actionPerformed(ActionEvent evt)
  40.142 +            {
  40.143 +                System.exit(0);
  40.144 +            }
  40.145 +
  40.146 +        }
  40.147 +);
  40.148 +        tabsDlg.addCancelListener(new ActionListener() {
  40.149 +
  40.150 +            public void actionPerformed(ActionEvent evt)
  40.151 +            {
  40.152 +                System.exit(0);
  40.153 +            }
  40.154 +
  40.155 +        }
  40.156 +);
  40.157 +        tabsDlg.setVisible(true);
  40.158 +    }
  40.159 +
  40.160 +    private JPanel createButtonPanel()
  40.161 +    {
  40.162 +        JPanel panel = new JPanel();
  40.163 +        okAction = new OkAction();
  40.164 +        cancelAction = new CancelAction();
  40.165 +        applyAction = new ApplyAction();
  40.166 +        okAction.addActionListener(new OkListener());
  40.167 +        cancelAction.addActionListener(new CancelListener());
  40.168 +        applyAction.addActionListener(new ApplyListener());
  40.169 +        panel.add(CommonUI.createButton(okAction));
  40.170 +        panel.add(CommonUI.createButton(cancelAction));
  40.171 +        panel.add(CommonUI.createButton(applyAction));
  40.172 +        JPanel p2 = new JPanel(new BorderLayout());
  40.173 +        p2.add(panel, "Center");
  40.174 +        p2.add(new JSeparator(), "North");
  40.175 +        return p2;
  40.176 +    }
  40.177 +
  40.178 +    public void enableApplyButton(boolean enabled)
  40.179 +    {
  40.180 +        applyAction.setEnabled(enabled);
  40.181 +    }
  40.182 +
  40.183 +    public synchronized void addOkListener(ActionListener l)
  40.184 +    {
  40.185 +        okListener = AWTEventMulticaster.add(okListener, l);
  40.186 +    }
  40.187 +
  40.188 +    public synchronized void removeOkListener(ActionListener l)
  40.189 +    {
  40.190 +        okListener = AWTEventMulticaster.remove(okListener, l);
  40.191 +    }
  40.192 +
  40.193 +    public synchronized void addCancelListener(ActionListener l)
  40.194 +    {
  40.195 +        cancelListener = AWTEventMulticaster.add(cancelListener, l);
  40.196 +    }
  40.197 +
  40.198 +    public synchronized void removeCancelListener(ActionListener l)
  40.199 +    {
  40.200 +        cancelListener = AWTEventMulticaster.remove(cancelListener, l);
  40.201 +    }
  40.202 +
  40.203 +    public synchronized void addApplyListener(ActionListener l)
  40.204 +    {
  40.205 +        applyListener = AWTEventMulticaster.add(applyListener, l);
  40.206 +    }
  40.207 +
  40.208 +    public synchronized void removeApplyListener(ActionListener l)
  40.209 +    {
  40.210 +        applyListener = AWTEventMulticaster.remove(applyListener, l);
  40.211 +    }
  40.212 +
  40.213 +    private JTabbedPane tabsPanel;
  40.214 +    private DelegateAction okAction;
  40.215 +    private DelegateAction cancelAction;
  40.216 +    private DelegateAction applyAction;
  40.217 +    private ActionListener okListener;
  40.218 +    private ActionListener cancelListener;
  40.219 +    private ActionListener applyListener;
  40.220 +    private static TabsDlg tabsDlg;
  40.221 +
  40.222 +
  40.223 +
  40.224 +}
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java	Wed Jul 30 14:41:55 2008 -0700
    41.3 @@ -0,0 +1,52 @@
    41.4 +/*
    41.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    41.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    41.7 + *
    41.8 + * This code is free software; you can redistribute it and/or modify it
    41.9 + * under the terms of the GNU General Public License version 2 only, as
   41.10 + * published by the Free Software Foundation.
   41.11 + *
   41.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   41.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   41.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   41.15 + * version 2 for more details (a copy is included in the LICENSE file that
   41.16 + * accompanied this code).
   41.17 + *
   41.18 + * You should have received a copy of the GNU General Public License version
   41.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   41.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   41.21 + *
   41.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   41.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   41.24 + * have any questions.
   41.25 + *
   41.26 + */
   41.27 +
   41.28 +
   41.29 +package com.sun.java.swing.ui;
   41.30 +
   41.31 +import java.beans.PropertyChangeEvent;
   41.32 +import java.beans.PropertyChangeListener;
   41.33 +import javax.swing.AbstractButton;
   41.34 +
   41.35 +public class ToggleActionPropertyChangeListener
   41.36 +    implements PropertyChangeListener
   41.37 +{
   41.38 +
   41.39 +    public ToggleActionPropertyChangeListener(AbstractButton button)
   41.40 +    {
   41.41 +        this.button = button;
   41.42 +    }
   41.43 +
   41.44 +    public void propertyChange(PropertyChangeEvent evt)
   41.45 +    {
   41.46 +        String propertyName = evt.getPropertyName();
   41.47 +        if(propertyName.equals("selected"))
   41.48 +        {
   41.49 +            Boolean selected = (Boolean)evt.getNewValue();
   41.50 +            button.setSelected(selected.booleanValue());
   41.51 +        }
   41.52 +    }
   41.53 +
   41.54 +    private AbstractButton button;
   41.55 +}
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/agent/src/share/classes/com/sun/java/swing/ui/WizardDlg.java	Wed Jul 30 14:41:55 2008 -0700
    42.3 @@ -0,0 +1,336 @@
    42.4 +/*
    42.5 + * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
    42.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    42.7 + *
    42.8 + * This code is free software; you can redistribute it and/or modify it
    42.9 + * under the terms of the GNU General Public License version 2 only, as
   42.10 + * published by the Free Software Foundation.
   42.11 + *
   42.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   42.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   42.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   42.15 + * version 2 for more details (a copy is included in the LICENSE file that
   42.16 + * accompanied this code).
   42.17 + *
   42.18 + * You should have received a copy of the GNU General Public License version
   42.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   42.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   42.21 + *
   42.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   42.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
   42.24 + * have any questions.
   42.25 + *
   42.26 + */
   42.27 +
   42.28 +
   42.29 +package com.sun.java.swing.ui;
   42.30 +
   42.31 +import com.sun.java.swing.action.*;
   42.32 +import java.awt.*;
   42.33 +import java.awt.event.ActionEvent;
   42.34 +import java.awt.event.ActionListener;
   42.35 +import java.util.Vector;
   42.36 +import javax.swing.*;
   42.37 +
   42.38 +// Referenced classes of package com.sun.java.swing.ui:
   42.39 +//            CommonUI
   42.40 +
   42.41 +public class WizardDlg extends JDialog
   42.42 +{
   42.43 +    private class CancelListener
   42.44 +        implements ActionListener
   42.45 +    {
   42.46 +
   42.47 +        public void actionPerformed(ActionEvent evt)
   42.48 +        {
   42.49 +            if(cancelListener != null)
   42.50 +                cancelListener.actionPerformed(evt);
   42.51 +            setVisible(false);
   42.52 +        }
   42.53 +
   42.54 +        private CancelListener()
   42.55 +        {
   42.56 +        }
   42.57 +
   42.58 +    }
   42.59 +
   42.60 +    private class FinishListener
   42.61 +        implements ActionListener
   42.62 +    {
   42.63 +
   42.64 +        public void actionPerformed(ActionEvent evt)
   42.65 +        {
   42.66 +            if(finishListener != null)
   42.67 +                finishListener.actionPerformed(evt);
   42.68 +            setVisible(false);
   42.69 +        }
   42.70 +
   42.71 +        private FinishListener()
   42.72 +        {
   42.73 +        }
   42.74 +
   42.75 +    }
   42.76 +
   42.77 +    private class NextListener
   42.78 +        implements ActionListener
   42.79 +    {
   42.80 +
   42.81 +        public void actionPerformed(ActionEvent evt)
   42.82 +        {
   42.83 +            cardShowing++;
   42.84 +            if(cardShowing > numCards)
   42.85 +                cardShowing = numCards;
   42.86 +            else
   42.87 +                panesLayout.next(panesPanel);
   42.88 +            if(nextListener != null)
   42.89 +                nextListener.actionPerformed(evt);
   42.90 +            enableBackNextButtons();
   42.91 +        }
   42.92 +
   42.93 +        private NextListener()
   42.94 +        {
   42.95 +        }
   42.96 +
   42.97 +    }
   42.98 +
   42.99 +    private class BackListener
  42.100 +        implements ActionListener
  42.101 +    {
  42.102 +
  42.103 +        public void actionPerformed(ActionEvent evt)
  42.104 +        {
  42.105 +            cardShowing--;
  42.106 +            if(cardShowing < 1)
  42.107 +                cardShowing = 1;
  42.108 +            else
  42.109 +                panesLayout.previous(panesPanel);
  42.110 +            if(backListener != null)
  42.111 +                backListener.actionPerformed(evt);
  42.112 +            enableBackNextButtons();
  42.113 +        }
  42.114 +
  42.115 +        private BackListener()
  42.116 +        {
  42.117 +        }
  42.118 +
  42.119 +    }
  42.120 +
  42.121 +
  42.122 +    public WizardDlg(JFrame frame, String title, Vector panels, Vector images)
  42.123 +    {
  42.124 +        super(frame, title, true);
  42.125 +        this.title = title;
  42.126 +        this.images = images;
  42.127 +        Container pane = getContentPane();
  42.128 +        pane.setLayout(new BorderLayout());
  42.129 +        panesLayout = new CardLayout();
  42.130 +        panesPanel = new JPanel(panesLayout);
  42.131 +        pane.add(panesPanel, "Center");
  42.132 +        pane.add(createButtonPanel(), "South");
  42.133 +        setPanels(panels);
  42.134 +        pack();
  42.135 +        CommonUI.centerComponent(this);
  42.136 +    }
  42.137 +
  42.138 +    public WizardDlg(JFrame frame, String title, Vector panels)
  42.139 +    {
  42.140 +        this(frame, title, panels, null);
  42.141 +    }
  42.142 +
  42.143 +    public WizardDlg(String title, Vector panels)
  42.144 +    {
  42.145 +        this(new JFrame(), title, panels, null);
  42.146 +    }
  42.147 +
  42.148 +    public void setPanels(Vector panels)
  42.149 +    {
  42.150 +        numCards = panels.size();
  42.151 +        cardShowing = 1;
  42.152 +        this.panels = panels;
  42.153 +        panesPanel.removeAll();
  42.154 +        for(int i = 0; i < numCards; i++)
  42.155 +            panesPanel.add((JPanel)panels.elementAt(i), (new Integer(i)).toString());
  42.156 +
  42.157 +        validate();
  42.158 +        enableBackNextButtons();
  42.159 +    }
  42.160 +
  42.161 +    public void reset()
  42.162 +    {
  42.163 +        cardShowing = 1;
  42.164 +        panesLayout.first(panesPanel);
  42.165 +        enableBackNextButtons();
  42.166 +    }
  42.167 +
  42.168 +    public void setWestPanel(JPanel panel)
  42.169 +    {
  42.170 +        Container pane = getContentPane();
  42.171 +        pane.add(panel, "West");
  42.172 +    }
  42.173 +
  42.174 +    public static void main(String args[])
  42.175 +    {
  42.176 +        JPanel p1 = new JPanel();
  42.177 +        p1.add(new JButton("One"));
  42.178 +        JPanel p2 = new JPanel();
  42.179 +        p2.add(new JButton("Two"));
  42.180 +        JPanel p3 = new JPanel();
  42.181 +        p3.add(new JButton("Three"));
  42.182 +        JPanel p4 = new JPanel();
  42.183 +        p4.add(new JButton("Four"));
  42.184 +        Vector panels = new Vector();
  42.185 +        panels.addElement(p1);
  42.186 +        panels.addElement(p2);
  42.187 +        panels.addElement(p3);
  42.188 +        panels.addElement(p4);
  42.189 +        wizardDlg = new WizardDlg("Test Dialog", panels);
  42.190 +        wizardDlg.addFinishListener(new ActionListener() {
  42.191 +
  42.192 +            public void actionPerformed(ActionEvent evt)
  42.193 +            {
  42.194 +                System.exit(0);
  42.195 +            }
  42.196 +
  42.197 +        }
  42.198 +);
  42.199 +        wizardDlg.addCancelListener(new ActionListener() {
  42.200 +
  42.201 +            public void actionPerformed(ActionEvent evt)
  42.202 +            {
  42.203 +                System.exit(0);
  42.204 +            }
  42.205 +
  42.206 +        }
  42.207 +);
  42.208 +        wizardDlg.setVisible(true);
  42.209 +    }
  42.210 +
  42.211 +    private JPanel createButtonPanel()
  42.212 +    {
  42.213 +        JPanel panel = new JPanel();
  42.214 +        backAction = new BackAction();
  42.215 +        nextAction = new NextAction();
  42.216 +        finishAction = new FinishAction();
  42.217 +        cancelAction = new CancelAction();
  42.218 +        backAction.setEnabled(false);
  42.219 +        finishAction.setEnabled(false);
  42.220 +        backAction.addActionListener(new BackListener());
  42.221 +        nextAction.addActionListener(new NextListener());
  42.222 +        finishAction.addActionListener(new FinishListener());
  42.223 +        cancelAction.addActionListener(new CancelListener());
  42.224 +        panel.add(CommonUI.createButton(backAction));
  42.225 +        panel.add(CommonUI.createButton(nextAction));
  42.226 +        panel.add(CommonUI.createButton(finishAction));
  42.227 +        panel.add(CommonUI.createButton(cancelAction));
  42.228 +        JPanel p2 = new JPanel(new BorderLayout());
  42.229 +        p2.add(panel, "Center");
  42.230 +        p2.add(new JSeparator(), "North");
  42.231 +        return p2;
  42.232 +    }
  42.233 +
  42.234 +    private void enableBackNextButtons()
  42.235 +    {
  42.236 +        if(cardShowing == 1)
  42.237 +        {
  42.238 +            backAction.setEnabled(false);
  42.239 +            finishAction.setEnabled(false);
  42.240 +            if(numCards > 1)
  42.241 +            {
  42.242 +                nextAction.setEnabled(true);
  42.243 +            } else
  42.244 +            {
  42.245 +                finishAction.setEnabled(true);
  42.246 +                nextAction.setEnabled(false);
  42.247 +            }
  42.248 +        } else
  42.249 +        if(cardShowing == numCards)
  42.250 +        {
  42.251 +            nextAction.setEnabled(false);
  42.252 +            finishAction.setEnabled(true);
  42.253 +            if(numCards > 1)
  42.254 +                backAction.setEnabled(true);
  42.255 +            else
  42.256 +                backAction.setEnabled(false);
  42.257 +        } else
  42.258 +        {
  42.259 +            backAction.setEnabled(true);
  42.260 +            nextAction.setEnabled(true);
  42.261 +            finishAction.setEnabled(false);
  42.262 +        }
  42.263 +        setTitle();
  42.264 +    }
  42.265 +
  42.266 +    private void setTitle()
  42.267 +    {
  42.268 +        JPanel panel = (JPanel)panels.elementAt(cardShowing - 1);
  42.269 +        String newTitle = title;
  42.270 +        String panelTitle = panel.getName();
  42.271 +        if(panelTitle != null && panelTitle.equals(""))
  42.272 +        {
  42.273 +            newTitle = newTitle + " - ";
  42.274 +            newTitle = newTitle + panelTitle;
  42.275 +        }
  42.276 +        super.setTitle(newTitle);
  42.277 +    }
  42.278 +
  42.279 +    public synchronized void addFinishListener(ActionListener l)
  42.280 +    {
  42.281 +        finishListener = AWTEventMulticaster.add(finishListener, l);
  42.282 +    }
  42.283 +
  42.284 +    public synchronized void removeFinishListener(ActionListener l)
  42.285 +    {
  42.286 +        finishListener = AWTEventMulticaster.remove(finishListener, l);
  42.287 +    }
  42.288 +
  42.289 +    public synchronized void addCancelListener(ActionListener l)
  42.290 +    {
  42.291 +        cancelListener = AWTEventMulticaster.add(cancelListener, l);
  42.292 +    }
  42.293 +
  42.294 +    public synchronized void removeCancelListener(ActionListener l)
  42.295 +    {
  42.296 +        cancelListener = AWTEventMulticaster.remove(cancelListener, l);
  42.297 +    }
  42.298 +
  42.299 +    public synchronized void addNextListener(ActionListener l)
  42.300 +    {
  42.301 +        nextListener = AWTEventMulticaster.add(nextListener, l);
  42.302 +    }
  42.303 +
  42.304 +    public synchronized void removeNextListener(ActionListener l)
  42.305 +    {
  42.306 +        nextListener = AWTEventMulticaster.remove(nextListener, l);
  42.307 +    }
  42.308 +
  42.309 +    public synchronized void addBackListener(ActionListener l)
  42.310 +    {
  42.311 +        backListener = AWTEventMulticaster.add(backListener, l);
  42.312 +    }
  42.313 +
  42.314 +    public synchronized void removeBackListener(ActionListener l)
  42.315 +    {
  42.316 +        backListener = AWTEventMulticaster.remove(backListener, l);
  42.317 +    }
  42.318 +
  42.319 +    private CardLayout panesLayout;
  42.320 +    private JPanel panesPanel;
  42.321 +    private DelegateAction backAction;
  42.322 +    private DelegateAction nextAction;
  42.323 +    private DelegateAction finishAction;
  42.324 +    private DelegateAction cancelAction;
  42.325 +    private ActionListener finishListener;
  42.326 +    private ActionListener cancelListener;
  42.327 +    private ActionListener nextListener;
  42.328 +    private ActionListener backListener;
  42.329 +    private int numCards;
  42.330 +    private int cardShowing;
  42.331 +    private String title;
  42.332 +    private Vector panels;
  42.333 +    private Vector images;
  42.334 +    private static WizardDlg wizardDlg;
  42.335 +
  42.336 +
  42.337 +
  42.338 +
  42.339 +}
    43.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/development/Server16.gif has changed
    44.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/development/Server24.gif has changed
    45.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/About16.gif has changed
    46.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/About24.gif has changed
    47.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Delete16.gif has changed
    48.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Delete24.gif has changed
    49.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Find16.gif has changed
    50.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Help16.gif has changed
    51.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Help24.gif has changed
    52.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/History16.gif has changed
    53.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/History24.gif has changed
    54.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Information16.gif has changed
    55.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Information24.gif has changed
    56.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/New16.gif has changed
    57.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/New24.gif has changed
    58.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Open16.gif has changed
    59.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Open24.gif has changed
    60.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Save16.gif has changed
    61.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Save24.gif has changed
    62.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif has changed
    63.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif has changed
    64.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif has changed
    65.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif has changed
    66.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif has changed
    67.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif has changed
    68.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif has changed
    69.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif has changed
    70.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif has changed
    71.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif has changed
    72.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif has changed
    73.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif has changed
    74.1 Binary file agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif has changed
    75.1 Binary file agent/src/share/lib/jlfgr-1_0.jar has changed
    76.1 Binary file agent/src/share/lib/maf-1_0.jar has changed

mercurial