Merge
|
@ -7,3 +7,4 @@ cbc8ad9dd0e085a607427ea35411990982f19a36 jdk7-b25
|
||||||
2dab2f712e1832c92acfa63ec0337048b9422c20 jdk7-b30
|
2dab2f712e1832c92acfa63ec0337048b9422c20 jdk7-b30
|
||||||
3300a35a0bd56d695b92fe0b34f03ebbfc939064 jdk7-b31
|
3300a35a0bd56d695b92fe0b34f03ebbfc939064 jdk7-b31
|
||||||
64da805be725721bf2004e7409a0d7a16fc8ddbc jdk7-b32
|
64da805be725721bf2004e7409a0d7a16fc8ddbc jdk7-b32
|
||||||
|
bb1ef4ee3d2c8cbf43a37d372325a7952be590b9 jdk7-b33
|
||||||
|
|
4
Makefile
|
@ -74,7 +74,7 @@ include ./make/deploy-rules.gmk
|
||||||
all::
|
all::
|
||||||
@$(START_ECHO)
|
@$(START_ECHO)
|
||||||
|
|
||||||
all:: openjdk_check sanity all_product_build
|
all:: openjdk_check sanity
|
||||||
|
|
||||||
ifeq ($(SKIP_FASTDEBUG_BUILD), false)
|
ifeq ($(SKIP_FASTDEBUG_BUILD), false)
|
||||||
all:: fastdebug_build
|
all:: fastdebug_build
|
||||||
|
@ -88,6 +88,8 @@ ifneq ($(SKIP_OPENJDK_BUILD), true)
|
||||||
all:: openjdk_build
|
all:: openjdk_build
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
all:: all_product_build
|
||||||
|
|
||||||
all::
|
all::
|
||||||
@$(FINISH_ECHO)
|
@$(FINISH_ECHO)
|
||||||
|
|
||||||
|
|
|
@ -7,3 +7,4 @@ e84e9018bebbf3e5bafc5706e7882a15cb1c7d99 jdk7-b27
|
||||||
c0252adbb2abbfdd6c35595429ac6fbdd98e20ac jdk7-b30
|
c0252adbb2abbfdd6c35595429ac6fbdd98e20ac jdk7-b30
|
||||||
ef6af34d75a7b44e77083f1d4ee47631fa09d3b4 jdk7-b31
|
ef6af34d75a7b44e77083f1d4ee47631fa09d3b4 jdk7-b31
|
||||||
80a0f46a6203e727012bd579fe38a609b83decce jdk7-b32
|
80a0f46a6203e727012bd579fe38a609b83decce jdk7-b32
|
||||||
|
6a5b9d2f8b20de54e3bfe33cd12bd0793caedc4e jdk7-b33
|
||||||
|
|
|
@ -7,3 +7,4 @@ c14dab40ed9bf45ad21150bd70c9c80cdf655415 jdk7-b28
|
||||||
d1605aabd0a15ecf93787c47de63073c33fba52d jdk7-b30
|
d1605aabd0a15ecf93787c47de63073c33fba52d jdk7-b30
|
||||||
9c2ecc2ffb125f14fab3857fe7689598956348a0 jdk7-b31
|
9c2ecc2ffb125f14fab3857fe7689598956348a0 jdk7-b31
|
||||||
b727c32788a906c04839516ae7443a085185a300 jdk7-b32
|
b727c32788a906c04839516ae7443a085185a300 jdk7-b32
|
||||||
|
585535ec8a14adafa6bfea65d6975e29094c8cec jdk7-b33
|
||||||
|
|
|
@ -32,6 +32,12 @@ else
|
||||||
include $(GAMMADIR)/make/defs.make
|
include $(GAMMADIR)/make/defs.make
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq "x$(HOTSPOT_BUILD_VERSION)" "x"
|
||||||
|
SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)
|
||||||
|
else
|
||||||
|
SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
|
||||||
|
endif
|
||||||
|
|
||||||
PKGLIST = \
|
PKGLIST = \
|
||||||
sun.jvm.hotspot \
|
sun.jvm.hotspot \
|
||||||
sun.jvm.hotspot.asm \
|
sun.jvm.hotspot.asm \
|
||||||
|
@ -117,7 +123,9 @@ sun.jvm.hotspot.ui.tree \
|
||||||
sun.jvm.hotspot.ui.treetable \
|
sun.jvm.hotspot.ui.treetable \
|
||||||
sun.jvm.hotspot.utilities \
|
sun.jvm.hotspot.utilities \
|
||||||
sun.jvm.hotspot.utilities.memo \
|
sun.jvm.hotspot.utilities.memo \
|
||||||
sun.jvm.hotspot.utilities.soql
|
sun.jvm.hotspot.utilities.soql \
|
||||||
|
com.sun.java.swing.action \
|
||||||
|
com.sun.java.swing.ui
|
||||||
#END PKGLIST
|
#END PKGLIST
|
||||||
|
|
||||||
# Generated using the build-filelist script
|
# Generated using the build-filelist script
|
||||||
|
@ -198,7 +206,9 @@ sun/jvm/hotspot/ui/tree/*.java \
|
||||||
sun/jvm/hotspot/ui/treetable/*.java \
|
sun/jvm/hotspot/ui/treetable/*.java \
|
||||||
sun/jvm/hotspot/utilities/*.java \
|
sun/jvm/hotspot/utilities/*.java \
|
||||||
sun/jvm/hotspot/utilities/memo/*.java \
|
sun/jvm/hotspot/utilities/memo/*.java \
|
||||||
sun/jvm/hotspot/utilities/soql/*.java
|
sun/jvm/hotspot/utilities/soql/*.java \
|
||||||
|
com/sun/java/swing/action/*.java \
|
||||||
|
com/sun/java/swing/ui/*.java
|
||||||
#END FILELIST
|
#END FILELIST
|
||||||
|
|
||||||
ifneq "x$(ALT_BOOTDIR)" "x"
|
ifneq "x$(ALT_BOOTDIR)" "x"
|
||||||
|
@ -220,8 +230,6 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SRC_DIR = ../src/share/classes
|
SRC_DIR = ../src/share/classes
|
||||||
LIB_DIR = ../src/share/lib
|
|
||||||
CLOSED_LIB_DIR = ../closed/src/share/lib
|
|
||||||
BUILD_DIR = ../build
|
BUILD_DIR = ../build
|
||||||
OUTPUT_DIR = $(BUILD_DIR)/classes
|
OUTPUT_DIR = $(BUILD_DIR)/classes
|
||||||
DOC_DIR = $(BUILD_DIR)/doc
|
DOC_DIR = $(BUILD_DIR)/doc
|
||||||
|
@ -231,9 +239,9 @@ DOC_DIR = $(BUILD_DIR)/doc
|
||||||
ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
|
ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
|
||||||
ALLFILES := $(shell /bin/ls $(ALLFILES))
|
ALLFILES := $(shell /bin/ls $(ALLFILES))
|
||||||
|
|
||||||
|
# tools.jar is used by the sa-jdi binding
|
||||||
|
CLASSPATH = $(JDK_HOME)/lib/tools.jar
|
||||||
|
|
||||||
# tools.jar is needed by the JDI - SA binding
|
|
||||||
CLASSPATH = $(LIB_DIR)/maf-1_0.jar$(CPS)$(JDK_HOME)/lib/tools.jar
|
|
||||||
CLASSPATH := $(subst \,/,$(CLASSPATH))
|
CLASSPATH := $(subst \,/,$(CLASSPATH))
|
||||||
|
|
||||||
# FIXME: autogenerate call to rmic
|
# FIXME: autogenerate call to rmic
|
||||||
|
@ -241,24 +249,36 @@ CLASSPATH := $(subst \,/,$(CLASSPATH))
|
||||||
SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
|
SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
|
||||||
|
|
||||||
SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties
|
SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties
|
||||||
|
JAVAC = $(JDK_HOME)/bin/javac
|
||||||
|
JAVADOC = $(JDK_HOME)/bin/javadoc
|
||||||
|
RMIC = $(JDK_HOME)/bin/rmic
|
||||||
|
|
||||||
# Tagging it on because there's no reason not to run it
|
# Tagging it on because there's no reason not to run it
|
||||||
all: filelist
|
all: filelist
|
||||||
@mkdir -p $(OUTPUT_DIR)
|
@mkdir -p $(OUTPUT_DIR)
|
||||||
@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
|
@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
|
||||||
@${JDK_HOME}/bin/javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
|
$(JAVAC) -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
|
||||||
@${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
|
$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
|
||||||
rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
|
rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
|
||||||
cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
|
cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
|
||||||
|
mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
|
||||||
|
rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
|
||||||
|
cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
|
||||||
|
cp -r $(SRC_DIR)/images/* $(OUTPUT_DIR)/
|
||||||
|
|
||||||
allprof: filelist
|
allprof: filelist
|
||||||
@mkdir -p $(OUTPUT_DIR)
|
@mkdir -p $(OUTPUT_DIR)
|
||||||
@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
|
@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
|
||||||
@${JDK_HOME}/bin/javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
|
$(JAVAC) -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
|
||||||
@${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
|
$(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
|
||||||
rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
|
rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
|
||||||
cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
|
cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
|
||||||
|
mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
|
||||||
|
rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
|
||||||
|
cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
|
||||||
|
cp -r $(SRC_DIR)/images/* $(OUTPUT_DIR)/
|
||||||
|
|
||||||
|
.PHONY: filelist
|
||||||
filelist: $(ALLFILES)
|
filelist: $(ALLFILES)
|
||||||
@if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
|
@if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
|
||||||
echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \
|
echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \
|
||||||
|
@ -274,36 +294,23 @@ natives:
|
||||||
|
|
||||||
.PHONY: sa-jdi.jar
|
.PHONY: sa-jdi.jar
|
||||||
sa-jdi.jar:
|
sa-jdi.jar:
|
||||||
if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \
|
echo "sa-jdi.jar is built by a hotspot build."
|
||||||
echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA.";\
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
rm -f $(BUILD_DIR)/sa-jdi.jar
|
|
||||||
rm -f $(OUTPUT_DIR)/jdi_class_files
|
|
||||||
javac -source 1.4 ClosureFinder.java -d $(OUTPUT_DIR)
|
|
||||||
cd $(OUTPUT_DIR) ; find sun/jvm/hotspot/jdi -name "*.class" > jdi_class_files
|
|
||||||
cd $(OUTPUT_DIR) ; jar cvf ../sa-jdi.jar `java ClosureFinder jdi_class_files .`
|
|
||||||
cd $(BUILD_DIR) ; jar uvf sa-jdi.jar -C $(SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
|
|
||||||
cd $(BUILD_DIR) ; jar uvf sa-jdi.jar -C $(OUTPUT_DIR) sa.properties
|
|
||||||
rm -f $(OUTPUT_DIR)/ClosureFinder.class
|
|
||||||
rm -f $(OUTPUT_DIR)/jdi_class_files
|
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
@javadoc -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST)
|
@$(JAVADOC) -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST)
|
||||||
|
|
||||||
sizes: $(ALLFILES)
|
sizes: $(ALLFILES)
|
||||||
wc -l $(ALLFILES)
|
wc -l $(ALLFILES)
|
||||||
|
|
||||||
cscope: $(ALLFILES)
|
cscope: $(ALLFILES)
|
||||||
|
rm -f java.files
|
||||||
echo $(ALLFILES) > java.files
|
echo $(ALLFILES) > java.files
|
||||||
cscope -b -i java.files -f java.out
|
cscope -b -i java.files -f java.out
|
||||||
|
rm -f java.files
|
||||||
|
|
||||||
.PHONY: sa.jar
|
.PHONY: sa.jar
|
||||||
sa.jar:
|
sa.jar:
|
||||||
rm -f $(BUILD_DIR)/sa.jar
|
rm -f $(BUILD_DIR)/sa.jar
|
||||||
mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources
|
|
||||||
rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/*
|
|
||||||
cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/
|
|
||||||
cd $(OUTPUT_DIR) ; jar cvf ../sa.jar *
|
cd $(OUTPUT_DIR) ; jar cvf ../sa.jar *
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
|
|
|
@ -22,4 +22,4 @@ REM have any questions.
|
||||||
REM
|
REM
|
||||||
REM
|
REM
|
||||||
|
|
||||||
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
|
java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.bugspot.Main
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
|
|
||||||
<property name="app.name" value="sa"/>
|
<property name="app.name" value="sa"/>
|
||||||
<property name="dist.jar" value="${app.name}.jar"/>
|
<property name="dist.jar" value="${app.name}.jar"/>
|
||||||
<property name="libs" value="../src/share/lib"/>
|
|
||||||
<property name="classes" value="../build/classes"/>
|
<property name="classes" value="../build/classes"/>
|
||||||
|
|
||||||
<!-- The "prepare" target is used to construct the deployment home
|
<!-- The "prepare" target is used to construct the deployment home
|
||||||
|
@ -83,11 +82,6 @@
|
||||||
home directory structure will be created if needed the first time.
|
home directory structure will be created if needed the first time.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<path id="javac.classpath">
|
|
||||||
<pathelement path="${libs}/maf-1_0.jar" />
|
|
||||||
<pathelement path="${libs}/jlfgr-1_0.jar" />
|
|
||||||
</path>
|
|
||||||
|
|
||||||
<target name="compile" depends="prepare" description="Compiles the sources">
|
<target name="compile" depends="prepare" description="Compiles the sources">
|
||||||
<javac srcdir="../src/share/classes"
|
<javac srcdir="../src/share/classes"
|
||||||
destdir="${classes}"
|
destdir="${classes}"
|
||||||
|
@ -110,6 +104,18 @@
|
||||||
<copy todir="${classes}/sun/jvm/hotspot/ui/resources">
|
<copy todir="${classes}/sun/jvm/hotspot/ui/resources">
|
||||||
<fileset dir="../src/share/classes/sun/jvm/hotspot/ui/resources" includes="*.png" />
|
<fileset dir="../src/share/classes/sun/jvm/hotspot/ui/resources" includes="*.png" />
|
||||||
</copy>
|
</copy>
|
||||||
|
<copy todir="${classes}/toolbarButtonGraphics/development/">
|
||||||
|
<fileset dir="../src/share/classes/images/toolbarButtonGraphics/development/" includes="*.gif" />
|
||||||
|
</copy>
|
||||||
|
<copy todir="${classes}/toolbarButtonGraphics/general/">
|
||||||
|
<fileset dir="../src/share/classes/images/toolbarButtonGraphics/general/" includes="*.gif" />
|
||||||
|
</copy>
|
||||||
|
<copy todir="${classes}/toolbarButtonGraphics/navigation/">
|
||||||
|
<fileset dir="../src/share/classes/images/toolbarButtonGraphics/navigation/" includes="*.gif" />
|
||||||
|
</copy>
|
||||||
|
<copy todir="${classes}/toolbarButtonGraphics/text/">
|
||||||
|
<fileset dir="../src/share/classes/images/toolbarButtonGraphics/text/" includes="*.gif" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
<jar jarfile="${classes}/${dist.jar}"
|
<jar jarfile="${classes}/${dist.jar}"
|
||||||
basedir="${classes}"/>
|
basedir="${classes}"/>
|
||||||
|
|
|
@ -22,4 +22,4 @@ REM have any questions.
|
||||||
REM
|
REM
|
||||||
REM
|
REM
|
||||||
|
|
||||||
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
|
java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.HSDB %1 %2
|
||||||
|
|
|
@ -29,4 +29,4 @@ if [ "x$SA_JAVA" = "x" ]; then
|
||||||
SA_JAVA=java
|
SA_JAVA=java
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$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 $*
|
$SA_JAVA -showversion -cp $STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar sun.jvm.hotspot.HSDB $*
|
||||||
|
|
|
@ -39,7 +39,7 @@ set SA_JAVA=java
|
||||||
|
|
||||||
:sa_java_set
|
:sa_java_set
|
||||||
|
|
||||||
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
|
set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar
|
||||||
|
|
||||||
set SA_LIBPATH=..\src\os\win32\windbg\i386;.\win32\i386
|
set SA_LIBPATH=..\src\os\win32\windbg\i386;.\win32\i386
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
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
|
SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar
|
||||||
|
|
||||||
OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
|
OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ set SA_JAVA=java
|
||||||
|
|
||||||
:sa_java_set
|
:sa_java_set
|
||||||
|
|
||||||
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
|
set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar
|
||||||
|
|
||||||
REM For now, only AMD-64, IA-64 stack walking is not working anyway
|
REM For now, only AMD-64, IA-64 stack walking is not working anyway
|
||||||
set SA_LIBPATH=.\src\os\win32\windbg\amd64;.\win32\amd64
|
set SA_LIBPATH=.\src\os\win32\windbg\amd64;.\win32\amd64
|
||||||
|
|
|
@ -55,7 +55,7 @@ if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then
|
||||||
OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}"
|
OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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
|
SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar::$STARTDIR/lib/js.jar
|
||||||
|
|
||||||
OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
|
OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class AboutAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public AboutAction()
|
||||||
|
{
|
||||||
|
this("general/About16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public AboutAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("About...", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "about-command");
|
||||||
|
putValue("ShortDescription", "About...");
|
||||||
|
putValue("LongDescription", "System information and version of the application.");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "about-command";
|
||||||
|
public static final String VALUE_NAME = "About...";
|
||||||
|
public static final String VALUE_SMALL_ICON = "general/About16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "general/About24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(65);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "About...";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "System information and version of the application.";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import javax.swing.Action;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, StateChangeAction, ActionUtilities
|
||||||
|
|
||||||
|
public abstract class ActionManager
|
||||||
|
{
|
||||||
|
|
||||||
|
protected ActionManager()
|
||||||
|
{
|
||||||
|
actions = new HashMap();
|
||||||
|
addActions();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActionManager getInstance()
|
||||||
|
{
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void addActions();
|
||||||
|
|
||||||
|
protected void addAction(String cmdname, Action action)
|
||||||
|
{
|
||||||
|
actions.put(cmdname, action);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action getAction(String key)
|
||||||
|
{
|
||||||
|
return (Action)actions.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DelegateAction getDelegateAction(String name)
|
||||||
|
{
|
||||||
|
Action a = getAction(name);
|
||||||
|
if(a instanceof DelegateAction)
|
||||||
|
return (DelegateAction)a;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StateChangeAction getStateChangeAction(String name)
|
||||||
|
{
|
||||||
|
Action a = getAction(name);
|
||||||
|
if(a instanceof StateChangeAction)
|
||||||
|
return (StateChangeAction)a;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ImageIcon getIcon(String name)
|
||||||
|
{
|
||||||
|
return utilities.getIcon(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActionEnabled(String name, boolean enabled)
|
||||||
|
{
|
||||||
|
Action action = getAction(name);
|
||||||
|
if(action != null)
|
||||||
|
action.setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap actions;
|
||||||
|
private static ActionUtilities utilities = new ActionUtilities();
|
||||||
|
protected static ActionManager manager;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
|
||||||
|
class ActionUtilities
|
||||||
|
{
|
||||||
|
|
||||||
|
ActionUtilities()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageIcon getIcon(String name)
|
||||||
|
{
|
||||||
|
String imagePath = "/toolbarButtonGraphics/" + name;
|
||||||
|
java.net.URL url = getClass().getResource(imagePath);
|
||||||
|
if(url != null)
|
||||||
|
return new ImageIcon(url);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String IMAGE_DIR = "/toolbarButtonGraphics/";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// StateChangeAction, ActionManager
|
||||||
|
|
||||||
|
public class AlignCenterAction extends StateChangeAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public AlignCenterAction()
|
||||||
|
{
|
||||||
|
this("text/AlignCenter16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlignCenterAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Center", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "align-center-command");
|
||||||
|
putValue("ShortDescription", "Center");
|
||||||
|
putValue("LongDescription", "Adjust the placement of text to the center of the line");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "align-center-command";
|
||||||
|
public static final String VALUE_NAME = "Center";
|
||||||
|
public static final String VALUE_SMALL_ICON = "text/AlignCenter16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "text/AlignCenter24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(78);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(69, 2);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Center";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Adjust the placement of text to the center of the line";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// StateChangeAction, ActionManager
|
||||||
|
|
||||||
|
public class AlignLeftAction extends StateChangeAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public AlignLeftAction()
|
||||||
|
{
|
||||||
|
this("text/AlignLeft16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlignLeftAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Left Align", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "align-left-command");
|
||||||
|
putValue("ShortDescription", "Left Align");
|
||||||
|
putValue("LongDescription", "Adjust the placement of text along the left edge");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "align-left-command";
|
||||||
|
public static final String VALUE_NAME = "Left Align";
|
||||||
|
public static final String VALUE_SMALL_ICON = "text/AlignLeft16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "text/AlignLeft24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(76);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(76, 2);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Left Align";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Adjust the placement of text along the left edge";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// StateChangeAction, ActionManager
|
||||||
|
|
||||||
|
public class AlignRightAction extends StateChangeAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public AlignRightAction()
|
||||||
|
{
|
||||||
|
this("text/AlignRight16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlignRightAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Right Align", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "align-right-command");
|
||||||
|
putValue("ShortDescription", "Right Align");
|
||||||
|
putValue("LongDescription", "Adjust the placement of text along the right edge");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "align-right-command";
|
||||||
|
public static final String VALUE_NAME = "Right Align";
|
||||||
|
public static final String VALUE_SMALL_ICON = "text/AlignRight16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "text/AlignRight24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(82);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(82, 2);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Right Align";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Adjust the placement of text along the right edge";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class ApplyAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public ApplyAction()
|
||||||
|
{
|
||||||
|
this(VALUE_SMALL_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApplyAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Apply", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "apply-command");
|
||||||
|
putValue("ShortDescription", "Apply the activity");
|
||||||
|
putValue("LongDescription", "Apply the activity");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "apply-command";
|
||||||
|
public static final String VALUE_NAME = "Apply";
|
||||||
|
public static final String VALUE_SMALL_ICON = null;
|
||||||
|
public static final String VALUE_LARGE_ICON = null;
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(65);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = null;
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Apply the activity";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Apply the activity";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class BackAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public BackAction()
|
||||||
|
{
|
||||||
|
this(VALUE_SMALL_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BackAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("< Back", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "back-command");
|
||||||
|
putValue("ShortDescription", "Select previous item");
|
||||||
|
putValue("LongDescription", "Select previous item");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "back-command";
|
||||||
|
public static final String VALUE_NAME = "< Back";
|
||||||
|
public static final String VALUE_SMALL_ICON = null;
|
||||||
|
public static final String VALUE_LARGE_ICON = null;
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(66);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = null;
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Select previous item";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Select previous item";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class CancelAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public CancelAction()
|
||||||
|
{
|
||||||
|
this(VALUE_SMALL_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CancelAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Cancel", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "cancel-command");
|
||||||
|
putValue("ShortDescription", "Cancels the action");
|
||||||
|
putValue("LongDescription", "Cancels the action");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "cancel-command";
|
||||||
|
public static final String VALUE_NAME = "Cancel";
|
||||||
|
public static final String VALUE_SMALL_ICON = null;
|
||||||
|
public static final String VALUE_LARGE_ICON = null;
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(67);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = null;
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Cancels the action";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Cancels the action";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
import javax.swing.Icon;
|
||||||
|
|
||||||
|
public abstract class DelegateAction extends AbstractAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public DelegateAction(String name, Icon icon)
|
||||||
|
{
|
||||||
|
super(name, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addActionListener(ActionListener listener)
|
||||||
|
{
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeActionListener(ActionListener listener)
|
||||||
|
{
|
||||||
|
this.listener = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionListener[] getActionListeners()
|
||||||
|
{
|
||||||
|
return (new ActionListener[] {
|
||||||
|
listener
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
if(listener != null)
|
||||||
|
listener.actionPerformed(evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ActionListener listener;
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class ExitAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public ExitAction()
|
||||||
|
{
|
||||||
|
super("Exit", ActionManager.getIcon(VALUE_SMALL_ICON));
|
||||||
|
putValue("ActionCommandKey", "exit-command");
|
||||||
|
putValue("ShortDescription", "Exits the application");
|
||||||
|
putValue("LongDescription", "Exits the application");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "exit-command";
|
||||||
|
public static final String VALUE_NAME = "Exit";
|
||||||
|
public static final String VALUE_SMALL_ICON = null;
|
||||||
|
public static final String VALUE_LARGE_ICON = null;
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(88);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = null;
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Exits the application";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Exits the application";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
public class FileMenu extends AbstractAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public FileMenu()
|
||||||
|
{
|
||||||
|
super("File");
|
||||||
|
putValue("ActionCommandKey", "file-menu-command");
|
||||||
|
putValue("ShortDescription", "File operations");
|
||||||
|
putValue("LongDescription", "File operations");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent actionevent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "file-menu-command";
|
||||||
|
public static final String VALUE_NAME = "File";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(70);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "File operations";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "File operations";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class FinishAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public FinishAction()
|
||||||
|
{
|
||||||
|
this(VALUE_SMALL_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FinishAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Finish", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "finish-command");
|
||||||
|
putValue("ShortDescription", "Finish the activity");
|
||||||
|
putValue("LongDescription", "Finish the activity");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "finish-command";
|
||||||
|
public static final String VALUE_NAME = "Finish";
|
||||||
|
public static final String VALUE_SMALL_ICON = null;
|
||||||
|
public static final String VALUE_LARGE_ICON = null;
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(70);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = null;
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Finish the activity";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Finish the activity";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class HelpAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public HelpAction()
|
||||||
|
{
|
||||||
|
this("general/Help16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public HelpAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Help", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "help-command");
|
||||||
|
putValue("ShortDescription", "Help...");
|
||||||
|
putValue("LongDescription", "Provide information which may aid the user.");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "help-command";
|
||||||
|
public static final String VALUE_NAME = "Help";
|
||||||
|
public static final String VALUE_SMALL_ICON = "general/Help16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "general/Help24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(72);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(112, 0);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Help...";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Provide information which may aid the user.";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
public class HelpMenu extends AbstractAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public HelpMenu()
|
||||||
|
{
|
||||||
|
super("Help");
|
||||||
|
putValue("ActionCommandKey", "help-menu-command");
|
||||||
|
putValue("ShortDescription", "Help operations");
|
||||||
|
putValue("LongDescription", "Help operations");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent actionevent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "help-menu-command";
|
||||||
|
public static final String VALUE_NAME = "Help";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(72);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Help operations";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Help operations";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class NewAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public NewAction()
|
||||||
|
{
|
||||||
|
this("general/New16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("New", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "new-command");
|
||||||
|
putValue("ShortDescription", "Create a new object.");
|
||||||
|
putValue("LongDescription", "Create a new object.");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "new-command";
|
||||||
|
public static final String VALUE_NAME = "New";
|
||||||
|
public static final String VALUE_SMALL_ICON = "general/New16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "general/New24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(78);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(78, 2);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Create a new object.";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Create a new object.";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class NextAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public NextAction()
|
||||||
|
{
|
||||||
|
this(VALUE_SMALL_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NextAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Next >", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "next-command");
|
||||||
|
putValue("ShortDescription", "Select next item");
|
||||||
|
putValue("LongDescription", "Select next item");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "next-command";
|
||||||
|
public static final String VALUE_NAME = "Next >";
|
||||||
|
public static final String VALUE_SMALL_ICON = null;
|
||||||
|
public static final String VALUE_LARGE_ICON = null;
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(78);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = null;
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Select next item";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Select next item";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class OkAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public OkAction()
|
||||||
|
{
|
||||||
|
this(VALUE_SMALL_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OkAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("OK", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "ok-command");
|
||||||
|
putValue("ShortDescription", "Acknowleges the action");
|
||||||
|
putValue("LongDescription", "Acknowleges the action");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "ok-command";
|
||||||
|
public static final String VALUE_NAME = "OK";
|
||||||
|
public static final String VALUE_SMALL_ICON = null;
|
||||||
|
public static final String VALUE_LARGE_ICON = null;
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(79);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = null;
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Acknowleges the action";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Acknowleges the action";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class OpenAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public OpenAction()
|
||||||
|
{
|
||||||
|
this("general/Open16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Open...", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "open-command");
|
||||||
|
putValue("ShortDescription", "Open the specified object.");
|
||||||
|
putValue("LongDescription", "Open the specified object.");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "open-command";
|
||||||
|
public static final String VALUE_NAME = "Open...";
|
||||||
|
public static final String VALUE_SMALL_ICON = "general/Open16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "general/Open24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(79);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(79, 2);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Open the specified object.";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Open the specified object.";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import javax.swing.KeyStroke;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class SaveAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public SaveAction()
|
||||||
|
{
|
||||||
|
this("general/Save16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public SaveAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Save", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "save-command");
|
||||||
|
putValue("ShortDescription", "Commit changes to a permanent storage area");
|
||||||
|
putValue("LongDescription", "Commit changes to a permanent storage area");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
putValue("AcceleratorKey", VALUE_ACCELERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "save-command";
|
||||||
|
public static final String VALUE_NAME = "Save";
|
||||||
|
public static final String VALUE_SMALL_ICON = "general/Save16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "general/Save24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(83);
|
||||||
|
public static final KeyStroke VALUE_ACCELERATOR = KeyStroke.getKeyStroke(83, 2);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Commit changes to a permanent storage area";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Commit changes to a permanent storage area";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction, ActionManager
|
||||||
|
|
||||||
|
public class SaveAsAction extends DelegateAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public SaveAsAction()
|
||||||
|
{
|
||||||
|
this("general/SaveAs16.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
public SaveAsAction(String iconPath)
|
||||||
|
{
|
||||||
|
super("Save As", ActionManager.getIcon(iconPath));
|
||||||
|
putValue("ActionCommandKey", "save-as-command");
|
||||||
|
putValue("ShortDescription", "Save as a new file");
|
||||||
|
putValue("LongDescription", "Saves the current object as another object");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "save-as-command";
|
||||||
|
public static final String VALUE_NAME = "Save As";
|
||||||
|
public static final String VALUE_SMALL_ICON = "general/SaveAs16.gif";
|
||||||
|
public static final String VALUE_LARGE_ICON = "general/SaveAs24.gif";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(65);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "Save as a new file";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "Saves the current object as another object";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import java.awt.event.ItemEvent;
|
||||||
|
import java.awt.event.ItemListener;
|
||||||
|
import javax.swing.Icon;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.action:
|
||||||
|
// DelegateAction
|
||||||
|
|
||||||
|
public abstract class StateChangeAction extends DelegateAction
|
||||||
|
implements ItemListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public StateChangeAction(String name)
|
||||||
|
{
|
||||||
|
super(name, null);
|
||||||
|
selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StateChangeAction(String name, Icon icon)
|
||||||
|
{
|
||||||
|
super(name, icon);
|
||||||
|
selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSelected()
|
||||||
|
{
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void setSelected(boolean newValue)
|
||||||
|
{
|
||||||
|
boolean oldValue = selected;
|
||||||
|
if(oldValue != newValue)
|
||||||
|
{
|
||||||
|
selected = newValue;
|
||||||
|
firePropertyChange("selected", Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemListener(ItemListener listener)
|
||||||
|
{
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemListener getItemListener()
|
||||||
|
{
|
||||||
|
return listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void itemStateChanged(ItemEvent evt)
|
||||||
|
{
|
||||||
|
if(evt.getStateChange() == 1)
|
||||||
|
setSelected(true);
|
||||||
|
else
|
||||||
|
setSelected(false);
|
||||||
|
if(listener != null)
|
||||||
|
listener.itemStateChanged(evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean selected;
|
||||||
|
private ItemListener listener;
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.action;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
public class ViewMenu extends AbstractAction
|
||||||
|
{
|
||||||
|
|
||||||
|
public ViewMenu()
|
||||||
|
{
|
||||||
|
super("View");
|
||||||
|
putValue("ActionCommandKey", "view-menu-command");
|
||||||
|
putValue("ShortDescription", "View operations");
|
||||||
|
putValue("LongDescription", "View operations");
|
||||||
|
putValue("MnemonicKey", VALUE_MNEMONIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent actionevent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String VALUE_COMMAND = "view-menu-command";
|
||||||
|
public static final String VALUE_NAME = "View";
|
||||||
|
public static final Integer VALUE_MNEMONIC = new Integer(86);
|
||||||
|
public static final String VALUE_SHORT_DESCRIPTION = "View operations";
|
||||||
|
public static final String VALUE_LONG_DESCRIPTION = "View operations";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import com.sun.java.swing.action.ActionManager;
|
||||||
|
import com.sun.java.swing.action.StateChangeAction;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.ui:
|
||||||
|
// ToggleActionPropertyChangeListener, StatusBar
|
||||||
|
|
||||||
|
public abstract class CommonMenuBar extends JMenuBar
|
||||||
|
{
|
||||||
|
|
||||||
|
protected CommonMenuBar(ActionManager manager)
|
||||||
|
{
|
||||||
|
this(manager, StatusBar.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CommonMenuBar(ActionManager manager, StatusBar status)
|
||||||
|
{
|
||||||
|
this.manager = manager;
|
||||||
|
statusBar = status;
|
||||||
|
configureMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void configureMenu();
|
||||||
|
|
||||||
|
protected void configureToggleMenuItem(JMenuItem menuItem, Action action)
|
||||||
|
{
|
||||||
|
configureMenuItem(menuItem, action);
|
||||||
|
action.addPropertyChangeListener(new ToggleActionPropertyChangeListener(menuItem));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void configureMenuItem(JMenuItem menuItem, Action action)
|
||||||
|
{
|
||||||
|
menuItem.addMouseListener(statusBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected JMenu createMenu(String name, char mnemonic)
|
||||||
|
{
|
||||||
|
JMenu menu = new JMenu(name);
|
||||||
|
menu.setMnemonic(mnemonic);
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addMenuItem(JMenu menu, Action action)
|
||||||
|
{
|
||||||
|
JMenuItem menuItem = menu.add(action);
|
||||||
|
configureMenuItem(menuItem, action);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a)
|
||||||
|
{
|
||||||
|
addCheckBoxMenuItem(menu, a, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
|
||||||
|
{
|
||||||
|
JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
|
||||||
|
mi.addItemListener(a);
|
||||||
|
mi.setSelected(selected);
|
||||||
|
menu.add(mi);
|
||||||
|
configureToggleMenuItem(mi, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a)
|
||||||
|
{
|
||||||
|
addRadioButtonMenuItem(menu, group, a, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
|
||||||
|
{
|
||||||
|
JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
|
||||||
|
mi.addItemListener(a);
|
||||||
|
mi.setSelected(selected);
|
||||||
|
menu.add(mi);
|
||||||
|
if(group != null)
|
||||||
|
group.add(mi);
|
||||||
|
configureToggleMenuItem(mi, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ActionManager manager;
|
||||||
|
private StatusBar statusBar;
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import com.sun.java.swing.action.ActionManager;
|
||||||
|
import com.sun.java.swing.action.StateChangeAction;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.ui:
|
||||||
|
// ToggleActionPropertyChangeListener, StatusBar, CommonUI
|
||||||
|
|
||||||
|
public abstract class CommonToolBar extends JToolBar
|
||||||
|
{
|
||||||
|
|
||||||
|
protected CommonToolBar(ActionManager manager)
|
||||||
|
{
|
||||||
|
this(manager, StatusBar.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CommonToolBar(ActionManager manager, StatusBar status)
|
||||||
|
{
|
||||||
|
this.manager = manager;
|
||||||
|
statusBar = status;
|
||||||
|
buttonSize = new Dimension(CommonUI.buttconPrefSize);
|
||||||
|
buttonInsets = new Insets(0, 0, 0, 0);
|
||||||
|
addComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void addComponents();
|
||||||
|
|
||||||
|
protected void addButton(Action action)
|
||||||
|
{
|
||||||
|
javax.swing.JButton button = add(action);
|
||||||
|
configureButton(button, action);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addToggleButton(StateChangeAction a)
|
||||||
|
{
|
||||||
|
addToggleButton(a, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
|
||||||
|
{
|
||||||
|
JToggleButton button = new JToggleButton(a);
|
||||||
|
button.addItemListener(a);
|
||||||
|
button.setSelected(a.isSelected());
|
||||||
|
if(group != null)
|
||||||
|
group.add(button);
|
||||||
|
add(button);
|
||||||
|
configureToggleButton(button, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void configureToggleButton(JToggleButton button, Action action)
|
||||||
|
{
|
||||||
|
configureButton(button, action);
|
||||||
|
action.addPropertyChangeListener(new ToggleActionPropertyChangeListener(button));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void configureButton(AbstractButton button, Action action)
|
||||||
|
{
|
||||||
|
button.setToolTipText((String)action.getValue("Name"));
|
||||||
|
button.setText("");
|
||||||
|
button.addMouseListener(statusBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ActionManager manager;
|
||||||
|
private Dimension buttonSize;
|
||||||
|
private Insets buttonInsets;
|
||||||
|
private StatusBar statusBar;
|
||||||
|
}
|
|
@ -0,0 +1,392 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.KeyListener;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
import java.util.Vector;
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.border.Border;
|
||||||
|
import javax.swing.text.*;
|
||||||
|
|
||||||
|
public class CommonUI
|
||||||
|
{
|
||||||
|
private static class NumberDocument extends PlainDocument
|
||||||
|
{
|
||||||
|
|
||||||
|
public void insertString(int offs, String str, AttributeSet atts)
|
||||||
|
throws BadLocationException
|
||||||
|
{
|
||||||
|
if(!Character.isDigit(str.charAt(0)))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
super.insertString(offs, str, atts);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private NumberDocument()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CommonUI()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JLabel createLabel(String text, int mnemonic, Component comp)
|
||||||
|
{
|
||||||
|
JLabel label = new JLabel(" " + text);
|
||||||
|
label.setMinimumSize(labelPrefSize);
|
||||||
|
if(mnemonic != -1)
|
||||||
|
label.setDisplayedMnemonic(mnemonic);
|
||||||
|
if(comp != null)
|
||||||
|
label.setLabelFor(comp);
|
||||||
|
if(text.length() == 0)
|
||||||
|
label.setPreferredSize(labelPrefSize);
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JLabel createLabel(String text)
|
||||||
|
{
|
||||||
|
return createLabel(text, -1, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JTextField createTextField(String text, KeyListener listener, boolean numbers)
|
||||||
|
{
|
||||||
|
JTextField field = new JTextField(text);
|
||||||
|
field.setMinimumSize(textPrefSize);
|
||||||
|
if(text.length() == 0)
|
||||||
|
field.setPreferredSize(textPrefSize);
|
||||||
|
if(listener != null)
|
||||||
|
field.addKeyListener(listener);
|
||||||
|
if(numbers)
|
||||||
|
field.setDocument(new NumberDocument());
|
||||||
|
return field;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JTextField createTextField(String text, boolean numbers)
|
||||||
|
{
|
||||||
|
return createTextField(text, null, numbers);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JTextField createTextField(String text, KeyListener listener)
|
||||||
|
{
|
||||||
|
return createTextField(text, listener, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JTextField createTextField(String text)
|
||||||
|
{
|
||||||
|
return createTextField(text, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JRadioButton createRadioButton(String text, int mnemonic, ActionListener listener, boolean selected)
|
||||||
|
{
|
||||||
|
JRadioButton button = new JRadioButton(text);
|
||||||
|
button.setMnemonic(mnemonic);
|
||||||
|
button.setSelected(selected);
|
||||||
|
button.setMinimumSize(labelPrefSize);
|
||||||
|
if(listener != null)
|
||||||
|
button.addActionListener(listener);
|
||||||
|
if(text.length() == 0)
|
||||||
|
button.setPreferredSize(labelPrefSize);
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JRadioButton createRadioButton(String text, int mnemonic, boolean selected)
|
||||||
|
{
|
||||||
|
return createRadioButton(text, mnemonic, null, selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JRadioButton createRadioButton(String text, int mnemonic, ActionListener listener)
|
||||||
|
{
|
||||||
|
return createRadioButton(text, mnemonic, listener, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JRadioButton createRadioButton(String text, int mnemonic)
|
||||||
|
{
|
||||||
|
return createRadioButton(text, mnemonic, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JRadioButton createRadioButton(String text)
|
||||||
|
{
|
||||||
|
return createRadioButton(text, -1, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JCheckBox createCheckBox(String text, int mnemonic, ActionListener listener, boolean selected)
|
||||||
|
{
|
||||||
|
JCheckBox checkbox = new JCheckBox(text);
|
||||||
|
checkbox.setMinimumSize(labelPrefSize);
|
||||||
|
if(mnemonic != -1)
|
||||||
|
checkbox.setMnemonic(mnemonic);
|
||||||
|
checkbox.setSelected(selected);
|
||||||
|
if(text.length() == 0)
|
||||||
|
checkbox.setPreferredSize(labelPrefSize);
|
||||||
|
if(listener != null)
|
||||||
|
checkbox.addActionListener(listener);
|
||||||
|
return checkbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JCheckBox createCheckBox(String text, int mnemonic, ActionListener listener)
|
||||||
|
{
|
||||||
|
return createCheckBox(text, mnemonic, listener, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JCheckBox createCheckBox(String text, int mnemonic, boolean selected)
|
||||||
|
{
|
||||||
|
return createCheckBox(text, mnemonic, null, selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JCheckBox createCheckBox(String text, int mnemonic)
|
||||||
|
{
|
||||||
|
return createCheckBox(text, mnemonic, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JCheckBox createCheckBox(String text)
|
||||||
|
{
|
||||||
|
return createCheckBox(text, -1, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JComboBox createComboBox(Object items[], ActionListener listener, boolean editable)
|
||||||
|
{
|
||||||
|
JComboBox comboBox = new JComboBox(items);
|
||||||
|
if(listener != null)
|
||||||
|
comboBox.addActionListener(listener);
|
||||||
|
comboBox.setEditable(editable);
|
||||||
|
return comboBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JComboBox createComboBox(Object items[], boolean editable)
|
||||||
|
{
|
||||||
|
return createComboBox(items, null, editable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JComboBox createComboBox(Vector items, ActionListener listener, boolean editable)
|
||||||
|
{
|
||||||
|
JComboBox comboBox = new JComboBox(items);
|
||||||
|
if(listener != null)
|
||||||
|
comboBox.addActionListener(listener);
|
||||||
|
comboBox.setEditable(editable);
|
||||||
|
return comboBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JComboBox createComboBox(Vector items, boolean editable)
|
||||||
|
{
|
||||||
|
return createComboBox(items, null, editable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JButton createButton(Action action)
|
||||||
|
{
|
||||||
|
JButton button = new JButton(action);
|
||||||
|
setButtonSize(button, buttonPrefSize);
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JButton createButton(String text, ActionListener listener, int mnemonic)
|
||||||
|
{
|
||||||
|
JButton button = new JButton(text);
|
||||||
|
if(listener != null)
|
||||||
|
button.addActionListener(listener);
|
||||||
|
if(mnemonic != -1)
|
||||||
|
button.setMnemonic(mnemonic);
|
||||||
|
setButtonSize(button, buttonPrefSize);
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setButtonSize(JButton button, Dimension size)
|
||||||
|
{
|
||||||
|
String text = button.getText();
|
||||||
|
button.setMinimumSize(size);
|
||||||
|
if(text.length() == 0)
|
||||||
|
{
|
||||||
|
button.setPreferredSize(size);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Dimension psize = button.getPreferredSize();
|
||||||
|
if(psize.width < size.width)
|
||||||
|
button.setPreferredSize(size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JButton createButton(String text, ActionListener listener)
|
||||||
|
{
|
||||||
|
return createButton(text, listener, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JButton createSmallButton(String text, ActionListener listener, int mnemonic)
|
||||||
|
{
|
||||||
|
JButton button = createButton(text, listener, mnemonic);
|
||||||
|
setButtonSize(button, smbuttonPrefSize);
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JButton createSmallButton(String text, ActionListener listener)
|
||||||
|
{
|
||||||
|
return createSmallButton(text, listener, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Border createBorder(String text)
|
||||||
|
{
|
||||||
|
Border border = BorderFactory.createEtchedBorder();
|
||||||
|
return BorderFactory.createTitledBorder(border, text, 0, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Border createBorder()
|
||||||
|
{
|
||||||
|
return BorderFactory.createEmptyBorder(4, 4, 4, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JScrollPane createListPane(JList list, String text)
|
||||||
|
{
|
||||||
|
JScrollPane pane = new JScrollPane(list);
|
||||||
|
pane.setBorder(BorderFactory.createCompoundBorder(createBorder(text), BorderFactory.createLoweredBevelBorder()));
|
||||||
|
return pane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void centerComponent(Component source, Component parent)
|
||||||
|
{
|
||||||
|
Dimension dim = source.getSize();
|
||||||
|
Rectangle rect;
|
||||||
|
if(parent != null)
|
||||||
|
{
|
||||||
|
rect = parent.getBounds();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
|
rect = new Rectangle(0, 0, d.width, d.height);
|
||||||
|
}
|
||||||
|
int x = rect.x + (rect.width - dim.width) / 2;
|
||||||
|
int y = rect.y + (rect.height - dim.height) / 2;
|
||||||
|
source.setLocation(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void centerComponent(Component source)
|
||||||
|
{
|
||||||
|
centerComponent(source, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JFrame getParentFrame(Component source)
|
||||||
|
{
|
||||||
|
Container parent;
|
||||||
|
for(parent = source.getParent(); parent != null; parent = parent.getParent())
|
||||||
|
if(parent instanceof JFrame)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if(parent == null)
|
||||||
|
return null;
|
||||||
|
else
|
||||||
|
return (JFrame)parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer msToSec(Integer ms)
|
||||||
|
{
|
||||||
|
int value = ms.intValue();
|
||||||
|
value /= 1000;
|
||||||
|
return new Integer(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer secToMs(Integer sec)
|
||||||
|
{
|
||||||
|
int value = sec.intValue();
|
||||||
|
value *= 1000;
|
||||||
|
return new Integer(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String stringFromStringArray(String strings[], String delim)
|
||||||
|
{
|
||||||
|
String string = "";
|
||||||
|
String separator;
|
||||||
|
if(delim == null || delim.equals(""))
|
||||||
|
separator = " ";
|
||||||
|
else
|
||||||
|
separator = delim;
|
||||||
|
for(int i = 0; i < strings.length; i++)
|
||||||
|
{
|
||||||
|
string = string + strings[i];
|
||||||
|
string = string + separator;
|
||||||
|
}
|
||||||
|
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String stringFromStringArray(String strings[])
|
||||||
|
{
|
||||||
|
return stringFromStringArray(strings, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String[] stringArrayFromString(String string, String delim)
|
||||||
|
{
|
||||||
|
StringTokenizer st;
|
||||||
|
if(delim == null || delim.equals(""))
|
||||||
|
st = new StringTokenizer(string);
|
||||||
|
else
|
||||||
|
st = new StringTokenizer(string, delim);
|
||||||
|
int numTokens = st.countTokens();
|
||||||
|
String strings[] = new String[numTokens];
|
||||||
|
int index = 0;
|
||||||
|
while(st.hasMoreTokens())
|
||||||
|
strings[index++] = st.nextToken();
|
||||||
|
return strings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String[] stringArrayFromString(String string)
|
||||||
|
{
|
||||||
|
return stringArrayFromString(string, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setWaitCursor(Component comp)
|
||||||
|
{
|
||||||
|
comp.setCursor(Cursor.getPredefinedCursor(3));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setDefaultCursor(Component comp)
|
||||||
|
{
|
||||||
|
comp.setCursor(Cursor.getPredefinedCursor(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int BUTTON_WIDTH = 100;
|
||||||
|
public static final int BUTTON_HEIGHT = 26;
|
||||||
|
public static final int BUTTCON_WIDTH = 28;
|
||||||
|
public static final int BUTTCON_HEIGHT = 28;
|
||||||
|
public static final int SM_BUTTON_WIDTH = 72;
|
||||||
|
public static final int SM_BUTTON_HEIGHT = 26;
|
||||||
|
public static final int LABEL_WIDTH = 100;
|
||||||
|
public static final int LABEL_HEIGHT = 20;
|
||||||
|
public static final int TEXT_WIDTH = 150;
|
||||||
|
public static final int TEXT_HEIGHT = 20;
|
||||||
|
public static Dimension buttonPrefSize = new Dimension(100, 26);
|
||||||
|
public static Dimension buttconPrefSize = new Dimension(28, 28);
|
||||||
|
public static Dimension smbuttonPrefSize = new Dimension(72, 26);
|
||||||
|
public static Dimension labelPrefSize = new Dimension(100, 20);
|
||||||
|
public static Dimension textPrefSize = new Dimension(150, 20);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import com.sun.java.swing.action.*;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.ui:
|
||||||
|
// CommonUI
|
||||||
|
|
||||||
|
public class OkCancelButtonPanel extends JPanel
|
||||||
|
{
|
||||||
|
|
||||||
|
public OkCancelButtonPanel(ActionListener listener)
|
||||||
|
{
|
||||||
|
DelegateAction okAction = new OkAction();
|
||||||
|
okAction.addActionListener(listener);
|
||||||
|
DelegateAction cancelAction = new CancelAction();
|
||||||
|
cancelAction.addActionListener(listener);
|
||||||
|
add(CommonUI.createButton(okAction));
|
||||||
|
add(CommonUI.createButton(cancelAction));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String OK_COMMAND = "ok-command";
|
||||||
|
public static final String CANCEL_COMMAND = "cancel-command";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Container;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.ui:
|
||||||
|
// OkCancelButtonPanel, CommonUI
|
||||||
|
|
||||||
|
public class OkCancelDialog extends JDialog
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public OkCancelDialog(String title, JPanel panel)
|
||||||
|
{
|
||||||
|
this(title, panel, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OkCancelDialog(String title, JPanel panel, boolean modal)
|
||||||
|
{
|
||||||
|
setTitle(title);
|
||||||
|
setModal(modal);
|
||||||
|
Container pane = getContentPane();
|
||||||
|
pane.setLayout(new BorderLayout());
|
||||||
|
pane.add(panel, "Center");
|
||||||
|
pane.add(new OkCancelButtonPanel(this), "South");
|
||||||
|
pack();
|
||||||
|
CommonUI.centerComponent(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOk()
|
||||||
|
{
|
||||||
|
return okPressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
String command = evt.getActionCommand();
|
||||||
|
if(command.equals("ok-command"))
|
||||||
|
{
|
||||||
|
okPressed = true;
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
} else
|
||||||
|
if(command.equals("cancel-command"))
|
||||||
|
{
|
||||||
|
okPressed = false;
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean okPressed;
|
||||||
|
}
|
|
@ -0,0 +1,85 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
|
||||||
|
public class SplashScreen extends Window
|
||||||
|
{
|
||||||
|
|
||||||
|
public SplashScreen(Frame f)
|
||||||
|
{
|
||||||
|
super(f);
|
||||||
|
setBackground(Color.white);
|
||||||
|
java.net.URL url = getClass().getResource("/images/SplashScreen.jpg");
|
||||||
|
if(url != null)
|
||||||
|
{
|
||||||
|
screen = new ImageIcon(url);
|
||||||
|
MediaTracker mt = new MediaTracker(this);
|
||||||
|
mt.addImage(screen.getImage(), 0);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mt.waitForAll();
|
||||||
|
}
|
||||||
|
catch(Exception ex) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisible(boolean val)
|
||||||
|
{
|
||||||
|
if(screen == null)
|
||||||
|
return;
|
||||||
|
if(val)
|
||||||
|
{
|
||||||
|
setSize(screen.getIconWidth(), screen.getIconHeight());
|
||||||
|
setLocation(-500, -500);
|
||||||
|
super.setVisible(true);
|
||||||
|
Dimension d = getToolkit().getScreenSize();
|
||||||
|
Insets i = getInsets();
|
||||||
|
int w = screen.getIconWidth() + i.left + i.right;
|
||||||
|
int h = screen.getIconHeight() + i.top + i.bottom;
|
||||||
|
setSize(w, h);
|
||||||
|
setLocation(d.width / 2 - w / 2, d.height / 2 - h / 2);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
super.setVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void paint(Graphics g)
|
||||||
|
{
|
||||||
|
if(screen != null)
|
||||||
|
{
|
||||||
|
Dimension d = getSize();
|
||||||
|
g.setColor(Color.black);
|
||||||
|
g.drawRect(0, 0, d.width - 1, d.height - 1);
|
||||||
|
g.drawImage(screen.getImage(), 1, 1, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ImageIcon screen;
|
||||||
|
}
|
|
@ -0,0 +1,178 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.*;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
public class StatusBar extends JPanel
|
||||||
|
implements ActionListener, MouseListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public StatusBar()
|
||||||
|
{
|
||||||
|
setLayout(new FlowLayout(0));
|
||||||
|
setBorder(BorderFactory.createEtchedBorder());
|
||||||
|
progressBar = new JProgressBar(0, 0, 100);
|
||||||
|
progressBar.setPreferredSize(new Dimension(60, progressBar.getPreferredSize().height + 2));
|
||||||
|
progressBar.setVisible(false);
|
||||||
|
label = new JLabel(" ");
|
||||||
|
preferredSize = new Dimension(getWidth(label.getText()), 2 * getFontHeight());
|
||||||
|
add(progressBar);
|
||||||
|
add(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StatusBar getInstance()
|
||||||
|
{
|
||||||
|
if(statusBar == null)
|
||||||
|
statusBar = new StatusBar();
|
||||||
|
return statusBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setInstance(StatusBar sb)
|
||||||
|
{
|
||||||
|
statusBar = sb;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getWidth(String s)
|
||||||
|
{
|
||||||
|
FontMetrics fm = getFontMetrics(getFont());
|
||||||
|
if(fm == null)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return fm.stringWidth(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getFontHeight()
|
||||||
|
{
|
||||||
|
FontMetrics fm = getFontMetrics(getFont());
|
||||||
|
if(fm == null)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return fm.getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dimension getPreferredSize()
|
||||||
|
{
|
||||||
|
return preferredSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message)
|
||||||
|
{
|
||||||
|
label.setText(message);
|
||||||
|
label.repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startBusyBar()
|
||||||
|
{
|
||||||
|
forward = true;
|
||||||
|
if(timer == null)
|
||||||
|
{
|
||||||
|
setMessage("");
|
||||||
|
progressBar.setVisible(true);
|
||||||
|
timer = new Timer(15, this);
|
||||||
|
timer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopBusyBar()
|
||||||
|
{
|
||||||
|
if(timer != null)
|
||||||
|
{
|
||||||
|
timer.stop();
|
||||||
|
timer = null;
|
||||||
|
}
|
||||||
|
setMessage("");
|
||||||
|
progressBar.setVisible(false);
|
||||||
|
progressBar.setValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
int value = progressBar.getValue();
|
||||||
|
if(forward)
|
||||||
|
{
|
||||||
|
if(value < 100)
|
||||||
|
{
|
||||||
|
progressBar.setValue(value + 1);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
forward = false;
|
||||||
|
progressBar.setValue(value - 1);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if(value > 0)
|
||||||
|
{
|
||||||
|
progressBar.setValue(value - 1);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
forward = true;
|
||||||
|
progressBar.setValue(value + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseClicked(MouseEvent mouseevent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mousePressed(MouseEvent mouseevent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseReleased(MouseEvent mouseevent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseExited(MouseEvent evt)
|
||||||
|
{
|
||||||
|
setMessage("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseEntered(MouseEvent evt)
|
||||||
|
{
|
||||||
|
if(evt.getSource() instanceof AbstractButton)
|
||||||
|
{
|
||||||
|
AbstractButton button = (AbstractButton)evt.getSource();
|
||||||
|
Action action = button.getAction();
|
||||||
|
if(action != null)
|
||||||
|
{
|
||||||
|
String message = (String)action.getValue("LongDescription");
|
||||||
|
setMessage(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int PROGRESS_MAX = 100;
|
||||||
|
private static final int PROGRESS_MIN = 0;
|
||||||
|
private JLabel label;
|
||||||
|
private Dimension preferredSize;
|
||||||
|
private JProgressBar progressBar;
|
||||||
|
private Timer timer;
|
||||||
|
private boolean forward;
|
||||||
|
private static StatusBar statusBar;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,221 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import com.sun.java.swing.action.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.Vector;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.ui:
|
||||||
|
// CommonUI
|
||||||
|
|
||||||
|
public class TabsDlg extends JDialog
|
||||||
|
{
|
||||||
|
private class ApplyListener
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
if(applyListener != null)
|
||||||
|
{
|
||||||
|
applyListener.actionPerformed(evt);
|
||||||
|
enableApplyButton(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApplyListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class CancelListener
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
if(cancelListener != null)
|
||||||
|
cancelListener.actionPerformed(evt);
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CancelListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class OkListener
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
if(okListener != null)
|
||||||
|
okListener.actionPerformed(evt);
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private OkListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public TabsDlg(String title, Vector panels)
|
||||||
|
{
|
||||||
|
super(new JFrame(), title, true);
|
||||||
|
okListener = null;
|
||||||
|
cancelListener = null;
|
||||||
|
applyListener = null;
|
||||||
|
Container pane = getContentPane();
|
||||||
|
pane.setLayout(new BorderLayout());
|
||||||
|
tabsPanel = new JTabbedPane();
|
||||||
|
int numPanels = panels.size();
|
||||||
|
for(int i = 0; i < numPanels; i++)
|
||||||
|
{
|
||||||
|
JPanel panel = (JPanel)panels.elementAt(i);
|
||||||
|
tabsPanel.addTab(panel.getName(), panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
pane.add(tabsPanel, "Center");
|
||||||
|
pane.add(createButtonPanel(), "South");
|
||||||
|
pack();
|
||||||
|
CommonUI.centerComponent(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String args[])
|
||||||
|
{
|
||||||
|
JPanel p1 = new JPanel();
|
||||||
|
p1.add(new JButton("One"));
|
||||||
|
p1.setName("One");
|
||||||
|
JPanel p2 = new JPanel();
|
||||||
|
p2.add(new JButton("Two"));
|
||||||
|
p2.setName("Two");
|
||||||
|
JPanel p3 = new JPanel();
|
||||||
|
p3.add(new JButton("Three"));
|
||||||
|
p3.setName("Three");
|
||||||
|
JPanel p4 = new JPanel();
|
||||||
|
p4.add(new JButton("Four"));
|
||||||
|
p4.setName("Four");
|
||||||
|
Vector panels = new Vector();
|
||||||
|
panels.addElement(p1);
|
||||||
|
panels.addElement(p2);
|
||||||
|
panels.addElement(p3);
|
||||||
|
panels.addElement(p4);
|
||||||
|
tabsDlg = new TabsDlg("Test Dialog", panels);
|
||||||
|
tabsDlg.addOkListener(new ActionListener() {
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
tabsDlg.addCancelListener(new ActionListener() {
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
tabsDlg.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private JPanel createButtonPanel()
|
||||||
|
{
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
okAction = new OkAction();
|
||||||
|
cancelAction = new CancelAction();
|
||||||
|
applyAction = new ApplyAction();
|
||||||
|
okAction.addActionListener(new OkListener());
|
||||||
|
cancelAction.addActionListener(new CancelListener());
|
||||||
|
applyAction.addActionListener(new ApplyListener());
|
||||||
|
panel.add(CommonUI.createButton(okAction));
|
||||||
|
panel.add(CommonUI.createButton(cancelAction));
|
||||||
|
panel.add(CommonUI.createButton(applyAction));
|
||||||
|
JPanel p2 = new JPanel(new BorderLayout());
|
||||||
|
p2.add(panel, "Center");
|
||||||
|
p2.add(new JSeparator(), "North");
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enableApplyButton(boolean enabled)
|
||||||
|
{
|
||||||
|
applyAction.setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void addOkListener(ActionListener l)
|
||||||
|
{
|
||||||
|
okListener = AWTEventMulticaster.add(okListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void removeOkListener(ActionListener l)
|
||||||
|
{
|
||||||
|
okListener = AWTEventMulticaster.remove(okListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void addCancelListener(ActionListener l)
|
||||||
|
{
|
||||||
|
cancelListener = AWTEventMulticaster.add(cancelListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void removeCancelListener(ActionListener l)
|
||||||
|
{
|
||||||
|
cancelListener = AWTEventMulticaster.remove(cancelListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void addApplyListener(ActionListener l)
|
||||||
|
{
|
||||||
|
applyListener = AWTEventMulticaster.add(applyListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void removeApplyListener(ActionListener l)
|
||||||
|
{
|
||||||
|
applyListener = AWTEventMulticaster.remove(applyListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
private JTabbedPane tabsPanel;
|
||||||
|
private DelegateAction okAction;
|
||||||
|
private DelegateAction cancelAction;
|
||||||
|
private DelegateAction applyAction;
|
||||||
|
private ActionListener okListener;
|
||||||
|
private ActionListener cancelListener;
|
||||||
|
private ActionListener applyListener;
|
||||||
|
private static TabsDlg tabsDlg;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import java.beans.PropertyChangeEvent;
|
||||||
|
import java.beans.PropertyChangeListener;
|
||||||
|
import javax.swing.AbstractButton;
|
||||||
|
|
||||||
|
public class ToggleActionPropertyChangeListener
|
||||||
|
implements PropertyChangeListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public ToggleActionPropertyChangeListener(AbstractButton button)
|
||||||
|
{
|
||||||
|
this.button = button;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void propertyChange(PropertyChangeEvent evt)
|
||||||
|
{
|
||||||
|
String propertyName = evt.getPropertyName();
|
||||||
|
if(propertyName.equals("selected"))
|
||||||
|
{
|
||||||
|
Boolean selected = (Boolean)evt.getNewValue();
|
||||||
|
button.setSelected(selected.booleanValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private AbstractButton button;
|
||||||
|
}
|
|
@ -0,0 +1,336 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
* have any questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package com.sun.java.swing.ui;
|
||||||
|
|
||||||
|
import com.sun.java.swing.action.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.Vector;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
// Referenced classes of package com.sun.java.swing.ui:
|
||||||
|
// CommonUI
|
||||||
|
|
||||||
|
public class WizardDlg extends JDialog
|
||||||
|
{
|
||||||
|
private class CancelListener
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
if(cancelListener != null)
|
||||||
|
cancelListener.actionPerformed(evt);
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CancelListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class FinishListener
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
if(finishListener != null)
|
||||||
|
finishListener.actionPerformed(evt);
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private FinishListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class NextListener
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
cardShowing++;
|
||||||
|
if(cardShowing > numCards)
|
||||||
|
cardShowing = numCards;
|
||||||
|
else
|
||||||
|
panesLayout.next(panesPanel);
|
||||||
|
if(nextListener != null)
|
||||||
|
nextListener.actionPerformed(evt);
|
||||||
|
enableBackNextButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
private NextListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class BackListener
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
cardShowing--;
|
||||||
|
if(cardShowing < 1)
|
||||||
|
cardShowing = 1;
|
||||||
|
else
|
||||||
|
panesLayout.previous(panesPanel);
|
||||||
|
if(backListener != null)
|
||||||
|
backListener.actionPerformed(evt);
|
||||||
|
enableBackNextButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
private BackListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public WizardDlg(JFrame frame, String title, Vector panels, Vector images)
|
||||||
|
{
|
||||||
|
super(frame, title, true);
|
||||||
|
this.title = title;
|
||||||
|
this.images = images;
|
||||||
|
Container pane = getContentPane();
|
||||||
|
pane.setLayout(new BorderLayout());
|
||||||
|
panesLayout = new CardLayout();
|
||||||
|
panesPanel = new JPanel(panesLayout);
|
||||||
|
pane.add(panesPanel, "Center");
|
||||||
|
pane.add(createButtonPanel(), "South");
|
||||||
|
setPanels(panels);
|
||||||
|
pack();
|
||||||
|
CommonUI.centerComponent(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WizardDlg(JFrame frame, String title, Vector panels)
|
||||||
|
{
|
||||||
|
this(frame, title, panels, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WizardDlg(String title, Vector panels)
|
||||||
|
{
|
||||||
|
this(new JFrame(), title, panels, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPanels(Vector panels)
|
||||||
|
{
|
||||||
|
numCards = panels.size();
|
||||||
|
cardShowing = 1;
|
||||||
|
this.panels = panels;
|
||||||
|
panesPanel.removeAll();
|
||||||
|
for(int i = 0; i < numCards; i++)
|
||||||
|
panesPanel.add((JPanel)panels.elementAt(i), (new Integer(i)).toString());
|
||||||
|
|
||||||
|
validate();
|
||||||
|
enableBackNextButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset()
|
||||||
|
{
|
||||||
|
cardShowing = 1;
|
||||||
|
panesLayout.first(panesPanel);
|
||||||
|
enableBackNextButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWestPanel(JPanel panel)
|
||||||
|
{
|
||||||
|
Container pane = getContentPane();
|
||||||
|
pane.add(panel, "West");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String args[])
|
||||||
|
{
|
||||||
|
JPanel p1 = new JPanel();
|
||||||
|
p1.add(new JButton("One"));
|
||||||
|
JPanel p2 = new JPanel();
|
||||||
|
p2.add(new JButton("Two"));
|
||||||
|
JPanel p3 = new JPanel();
|
||||||
|
p3.add(new JButton("Three"));
|
||||||
|
JPanel p4 = new JPanel();
|
||||||
|
p4.add(new JButton("Four"));
|
||||||
|
Vector panels = new Vector();
|
||||||
|
panels.addElement(p1);
|
||||||
|
panels.addElement(p2);
|
||||||
|
panels.addElement(p3);
|
||||||
|
panels.addElement(p4);
|
||||||
|
wizardDlg = new WizardDlg("Test Dialog", panels);
|
||||||
|
wizardDlg.addFinishListener(new ActionListener() {
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
wizardDlg.addCancelListener(new ActionListener() {
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
wizardDlg.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private JPanel createButtonPanel()
|
||||||
|
{
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
backAction = new BackAction();
|
||||||
|
nextAction = new NextAction();
|
||||||
|
finishAction = new FinishAction();
|
||||||
|
cancelAction = new CancelAction();
|
||||||
|
backAction.setEnabled(false);
|
||||||
|
finishAction.setEnabled(false);
|
||||||
|
backAction.addActionListener(new BackListener());
|
||||||
|
nextAction.addActionListener(new NextListener());
|
||||||
|
finishAction.addActionListener(new FinishListener());
|
||||||
|
cancelAction.addActionListener(new CancelListener());
|
||||||
|
panel.add(CommonUI.createButton(backAction));
|
||||||
|
panel.add(CommonUI.createButton(nextAction));
|
||||||
|
panel.add(CommonUI.createButton(finishAction));
|
||||||
|
panel.add(CommonUI.createButton(cancelAction));
|
||||||
|
JPanel p2 = new JPanel(new BorderLayout());
|
||||||
|
p2.add(panel, "Center");
|
||||||
|
p2.add(new JSeparator(), "North");
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void enableBackNextButtons()
|
||||||
|
{
|
||||||
|
if(cardShowing == 1)
|
||||||
|
{
|
||||||
|
backAction.setEnabled(false);
|
||||||
|
finishAction.setEnabled(false);
|
||||||
|
if(numCards > 1)
|
||||||
|
{
|
||||||
|
nextAction.setEnabled(true);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
finishAction.setEnabled(true);
|
||||||
|
nextAction.setEnabled(false);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if(cardShowing == numCards)
|
||||||
|
{
|
||||||
|
nextAction.setEnabled(false);
|
||||||
|
finishAction.setEnabled(true);
|
||||||
|
if(numCards > 1)
|
||||||
|
backAction.setEnabled(true);
|
||||||
|
else
|
||||||
|
backAction.setEnabled(false);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
backAction.setEnabled(true);
|
||||||
|
nextAction.setEnabled(true);
|
||||||
|
finishAction.setEnabled(false);
|
||||||
|
}
|
||||||
|
setTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setTitle()
|
||||||
|
{
|
||||||
|
JPanel panel = (JPanel)panels.elementAt(cardShowing - 1);
|
||||||
|
String newTitle = title;
|
||||||
|
String panelTitle = panel.getName();
|
||||||
|
if(panelTitle != null && panelTitle.equals(""))
|
||||||
|
{
|
||||||
|
newTitle = newTitle + " - ";
|
||||||
|
newTitle = newTitle + panelTitle;
|
||||||
|
}
|
||||||
|
super.setTitle(newTitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void addFinishListener(ActionListener l)
|
||||||
|
{
|
||||||
|
finishListener = AWTEventMulticaster.add(finishListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void removeFinishListener(ActionListener l)
|
||||||
|
{
|
||||||
|
finishListener = AWTEventMulticaster.remove(finishListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void addCancelListener(ActionListener l)
|
||||||
|
{
|
||||||
|
cancelListener = AWTEventMulticaster.add(cancelListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void removeCancelListener(ActionListener l)
|
||||||
|
{
|
||||||
|
cancelListener = AWTEventMulticaster.remove(cancelListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void addNextListener(ActionListener l)
|
||||||
|
{
|
||||||
|
nextListener = AWTEventMulticaster.add(nextListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void removeNextListener(ActionListener l)
|
||||||
|
{
|
||||||
|
nextListener = AWTEventMulticaster.remove(nextListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void addBackListener(ActionListener l)
|
||||||
|
{
|
||||||
|
backListener = AWTEventMulticaster.add(backListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void removeBackListener(ActionListener l)
|
||||||
|
{
|
||||||
|
backListener = AWTEventMulticaster.remove(backListener, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CardLayout panesLayout;
|
||||||
|
private JPanel panesPanel;
|
||||||
|
private DelegateAction backAction;
|
||||||
|
private DelegateAction nextAction;
|
||||||
|
private DelegateAction finishAction;
|
||||||
|
private DelegateAction cancelAction;
|
||||||
|
private ActionListener finishListener;
|
||||||
|
private ActionListener cancelListener;
|
||||||
|
private ActionListener nextListener;
|
||||||
|
private ActionListener backListener;
|
||||||
|
private int numCards;
|
||||||
|
private int cardShowing;
|
||||||
|
private String title;
|
||||||
|
private Vector panels;
|
||||||
|
private Vector images;
|
||||||
|
private static WizardDlg wizardDlg;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
After Width: | Height: | Size: 636 B |
After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 644 B |
After Width: | Height: | Size: 797 B |
After Width: | Height: | Size: 208 B |
After Width: | Height: | Size: 249 B |
After Width: | Height: | Size: 434 B |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 677 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 778 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 206 B |
After Width: | Height: | Size: 266 B |
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 348 B |
After Width: | Height: | Size: 303 B |
After Width: | Height: | Size: 304 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 185 B |
After Width: | Height: | Size: 184 B |
After Width: | Height: | Size: 163 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 165 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 165 B |
After Width: | Height: | Size: 178 B |
|
@ -193,9 +193,13 @@ public class HeapSummary extends Tool {
|
||||||
|
|
||||||
private static final double FACTOR = 1024*1024;
|
private static final double FACTOR = 1024*1024;
|
||||||
private void printValMB(String title, long value) {
|
private void printValMB(String title, long value) {
|
||||||
|
if (value < 0) {
|
||||||
|
System.out.println(alignment + title + (value >>> 20) + " MB");
|
||||||
|
} else {
|
||||||
double mb = value/FACTOR;
|
double mb = value/FACTOR;
|
||||||
System.out.println(alignment + title + value + " (" + mb + "MB)");
|
System.out.println(alignment + title + value + " (" + mb + "MB)");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void printValue(String title, long value) {
|
private void printValue(String title, long value) {
|
||||||
System.out.println(alignment + title + value);
|
System.out.println(alignment + title + value);
|
||||||
|
|
|
@ -266,45 +266,51 @@ public class PermStat extends Tool {
|
||||||
out.println();
|
out.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static long objectSize(Oop oop) {
|
||||||
|
return oop == null ? 0L : oop.getObjectSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't count the shared empty arrays
|
||||||
|
private static long arraySize(Array arr) {
|
||||||
|
return arr.getLength() != 0L ? arr.getObjectSize() : 0L;
|
||||||
|
}
|
||||||
|
|
||||||
private long computeSize(InstanceKlass k) {
|
private long computeSize(InstanceKlass k) {
|
||||||
long size = 0L;
|
long size = 0L;
|
||||||
// InstanceKlass object size
|
// the InstanceKlass object itself
|
||||||
size += k.getObjectSize();
|
size += k.getObjectSize();
|
||||||
|
|
||||||
// add ConstantPool size
|
// Constant pool
|
||||||
size += k.getConstants().getObjectSize();
|
ConstantPool cp = k.getConstants();
|
||||||
|
size += cp.getObjectSize();
|
||||||
|
size += objectSize(cp.getCache());
|
||||||
|
size += objectSize(cp.getTags());
|
||||||
|
|
||||||
// add ConstantPoolCache, if any
|
// Interfaces
|
||||||
ConstantPoolCache cpCache = k.getConstants().getCache();
|
size += arraySize(k.getLocalInterfaces());
|
||||||
if (cpCache != null) {
|
size += arraySize(k.getTransitiveInterfaces());
|
||||||
size += cpCache.getObjectSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
// add interfaces size
|
// Inner classes
|
||||||
ObjArray interfaces = k.getLocalInterfaces();
|
size += objectSize(k.getInnerClasses());
|
||||||
size += (interfaces.getLength() != 0L)? interfaces.getObjectSize() : 0L;
|
|
||||||
ObjArray transitiveInterfaces = k.getTransitiveInterfaces();
|
|
||||||
size += (transitiveInterfaces.getLength() != 0L)? transitiveInterfaces.getObjectSize() : 0L;
|
|
||||||
|
|
||||||
// add inner classes size
|
// Fields
|
||||||
TypeArray innerClasses = k.getInnerClasses();
|
size += objectSize(k.getFields());
|
||||||
size += innerClasses.getObjectSize();
|
|
||||||
|
|
||||||
// add fields size
|
// Methods
|
||||||
size += k.getFields().getObjectSize();
|
|
||||||
|
|
||||||
// add methods size
|
|
||||||
ObjArray methods = k.getMethods();
|
ObjArray methods = k.getMethods();
|
||||||
size += (methods.getLength() != 0L)? methods.getObjectSize() : 0L;
|
int nmethods = (int) methods.getLength();
|
||||||
TypeArray methodOrdering = k.getMethodOrdering();
|
if (nmethods != 0L) {
|
||||||
size += (methodOrdering.getLength() != 0L)? methodOrdering.getObjectSize() : 0;
|
size += methods.getObjectSize();
|
||||||
|
for (int i = 0; i < nmethods; ++i) {
|
||||||
// add each method's size
|
|
||||||
int numMethods = (int) methods.getLength();
|
|
||||||
for (int i = 0; i < numMethods; i++) {
|
|
||||||
Method m = (Method) methods.getObjAt(i);
|
Method m = (Method) methods.getObjAt(i);
|
||||||
size += m.getObjectSize();
|
size += m.getObjectSize();
|
||||||
|
size += objectSize(m.getConstMethod());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MethodOrdering - an int array that records the original
|
||||||
|
// ordering of methods in the class file
|
||||||
|
size += arraySize(k.getMethodOrdering());
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,24 @@
|
||||||
#
|
#
|
||||||
# Copyright 2006-2008 Sun Microsystems, Inc. All rights reserved.
|
# Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
#
|
||||||
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License version 2 only, as
|
||||||
|
# published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
# version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
# accompanied this code).
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License version
|
||||||
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
#
|
||||||
|
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||||
|
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||||
|
# have any questions.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2008
|
||||||
|
|
||||||
HS_MAJOR_VER=14
|
HS_MAJOR_VER=14
|
||||||
HS_MINOR_VER=0
|
HS_MINOR_VER=0
|
||||||
HS_BUILD_NUMBER=01
|
HS_BUILD_NUMBER=03
|
||||||
|
|
||||||
JDK_MAJOR_VER=1
|
JDK_MAJOR_VER=1
|
||||||
JDK_MINOR_VER=7
|
JDK_MINOR_VER=7
|
||||||
|
|
|
@ -77,9 +77,7 @@ if [ "${osname}" = SunOS ] ; then
|
||||||
# All jdk6 builds use SS11
|
# All jdk6 builds use SS11
|
||||||
compiler_name=SS11
|
compiler_name=SS11
|
||||||
else
|
else
|
||||||
# FIXUP: Change to SS12 once it has been validated.
|
compiler_name=SS12
|
||||||
#compiler_name=SS12
|
|
||||||
compiler_name=SS11
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
|
||||||
if [ $$? = 0 ] ; then \
|
if [ $$? = 0 ] ; then \
|
||||||
/usr/bin/chcon -t textrel_shlib_t $@; \
|
/usr/bin/chcon -t textrel_shlib_t $@; \
|
||||||
if [ $$? != 0 ]; then \
|
if [ $$? != 0 ]; then \
|
||||||
echo "ERROR: Cannot chcon $@"; exit 1; \
|
echo "ERROR: Cannot chcon $@"; \
|
||||||
fi \
|
fi \
|
||||||
fi \
|
fi \
|
||||||
fi \
|
fi \
|
||||||
|
|
|
@ -38,6 +38,8 @@ OPT_CFLAGS/SLOWER = -xO2
|
||||||
|
|
||||||
# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876)
|
# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876)
|
||||||
ifeq ($(COMPILER_REV), 5.9)
|
ifeq ($(COMPILER_REV), 5.9)
|
||||||
|
# To avoid jvm98 crash
|
||||||
|
OPT_CFLAGS/instanceKlass.o = $(OPT_CFLAGS/SLOWER)
|
||||||
# Not clear this workaround could be skipped in some cases.
|
# Not clear this workaround could be skipped in some cases.
|
||||||
OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER)
|
OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER)
|
||||||
OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER)
|
OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER)
|
||||||
|
|
|
@ -51,12 +51,9 @@ ifeq ($(JDK_MINOR_VERSION),6)
|
||||||
VALIDATED_COMPILER_REV := 5.8
|
VALIDATED_COMPILER_REV := 5.8
|
||||||
VALIDATED_C_COMPILER_REV := 5.8
|
VALIDATED_C_COMPILER_REV := 5.8
|
||||||
else
|
else
|
||||||
# FIXUP: Change to SS12 (5.9) once it has been validated.
|
|
||||||
# Validated compiler for JDK7 is SS12 (5.9)
|
# Validated compiler for JDK7 is SS12 (5.9)
|
||||||
#VALIDATED_COMPILER_REV := 5.9
|
VALIDATED_COMPILER_REV := 5.9
|
||||||
#VALIDATED_C_COMPILER_REV := 5.9
|
VALIDATED_C_COMPILER_REV := 5.9
|
||||||
VALIDATED_COMPILER_REV := 5.8
|
|
||||||
VALIDATED_C_COMPILER_REV := 5.8
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Warning messages about not using the above validated version
|
# Warning messages about not using the above validated version
|
||||||
|
|
|
@ -107,7 +107,7 @@ ifeq ($(USING_CYGWIN), true)
|
||||||
ABS_OUTPUTDIR := $(subst /,\\,$(shell /bin/cygpath -m -a "$(OUTPUTDIR)"))
|
ABS_OUTPUTDIR := $(subst /,\\,$(shell /bin/cygpath -m -a "$(OUTPUTDIR)"))
|
||||||
ABS_BOOTDIR := $(subst /,\\,$(shell /bin/cygpath -m -a "$(BOOTDIR)"))
|
ABS_BOOTDIR := $(subst /,\\,$(shell /bin/cygpath -m -a "$(BOOTDIR)"))
|
||||||
ABS_GAMMADIR := $(subst /,\\,$(shell /bin/cygpath -m -a "$(GAMMADIR)"))
|
ABS_GAMMADIR := $(subst /,\\,$(shell /bin/cygpath -m -a "$(GAMMADIR)"))
|
||||||
ABS_OS_MAKEFILE := $(shell /bin/cygpath -m -a "$(HS_BUILD_DIR)/$(OSNAME)")/build.make
|
ABS_OS_MAKEFILE := $(shell /bin/cygpath -m -a "$(HS_MAKE_DIR)/$(OSNAME)")/build.make
|
||||||
else
|
else
|
||||||
ABS_OUTPUTDIR := $(subst /,\\,$(shell $(CD) $(OUTPUTDIR);$(PWD)))
|
ABS_OUTPUTDIR := $(subst /,\\,$(shell $(CD) $(OUTPUTDIR);$(PWD)))
|
||||||
ABS_BOOTDIR := $(subst /,\\,$(shell $(CD) $(BOOTDIR);$(PWD)))
|
ABS_BOOTDIR := $(subst /,\\,$(shell $(CD) $(BOOTDIR);$(PWD)))
|
||||||
|
|
|
@ -779,9 +779,9 @@ class StubGenerator: public StubCodeGenerator {
|
||||||
__ shrl(end, CardTableModRefBS::card_shift);
|
__ shrl(end, CardTableModRefBS::card_shift);
|
||||||
__ subl(end, start); // end --> count
|
__ subl(end, start); // end --> count
|
||||||
__ BIND(L_loop);
|
__ BIND(L_loop);
|
||||||
ExternalAddress base((address)ct->byte_map_base);
|
intptr_t disp = (intptr_t) ct->byte_map_base;
|
||||||
Address index(start, count, Address::times_1, 0);
|
Address cardtable(start, count, Address::times_1, disp);
|
||||||
__ movbyte(ArrayAddress(base, index), 0);
|
__ movb(cardtable, 0);
|
||||||
__ decrement(count);
|
__ decrement(count);
|
||||||
__ jcc(Assembler::greaterEqual, L_loop);
|
__ jcc(Assembler::greaterEqual, L_loop);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1222,8 +1222,16 @@ class StubGenerator: public StubCodeGenerator {
|
||||||
__ shrq(end, CardTableModRefBS::card_shift);
|
__ shrq(end, CardTableModRefBS::card_shift);
|
||||||
__ subq(end, start); // number of bytes to copy
|
__ subq(end, start); // number of bytes to copy
|
||||||
|
|
||||||
|
intptr_t disp = (intptr_t) ct->byte_map_base;
|
||||||
|
if (__ is_simm32(disp)) {
|
||||||
|
Address cardtable(noreg, noreg, Address::no_scale, disp);
|
||||||
|
__ lea(scratch, cardtable);
|
||||||
|
} else {
|
||||||
|
ExternalAddress cardtable((address)disp);
|
||||||
|
__ lea(scratch, cardtable);
|
||||||
|
}
|
||||||
|
|
||||||
const Register count = end; // 'end' register contains bytes count now
|
const Register count = end; // 'end' register contains bytes count now
|
||||||
__ lea(scratch, ExternalAddress((address)ct->byte_map_base));
|
|
||||||
__ addq(start, scratch);
|
__ addq(start, scratch);
|
||||||
__ BIND(L_loop);
|
__ BIND(L_loop);
|
||||||
__ movb(Address(start, count, Address::times_1), 0);
|
__ movb(Address(start, count, Address::times_1), 0);
|
||||||
|
|
|
@ -94,6 +94,9 @@ static pid_t _initial_pid = 0;
|
||||||
static int SR_signum = SIGUSR2;
|
static int SR_signum = SIGUSR2;
|
||||||
sigset_t SR_sigset;
|
sigset_t SR_sigset;
|
||||||
|
|
||||||
|
/* Used to protect dlsym() calls */
|
||||||
|
static pthread_mutex_t dl_mutex;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// utility functions
|
// utility functions
|
||||||
|
|
||||||
|
@ -1493,6 +1496,24 @@ const char* os::dll_file_extension() { return ".so"; }
|
||||||
|
|
||||||
const char* os::get_temp_directory() { return "/tmp/"; }
|
const char* os::get_temp_directory() { return "/tmp/"; }
|
||||||
|
|
||||||
|
void os::dll_build_name(
|
||||||
|
char* buffer, size_t buflen, const char* pname, const char* fname) {
|
||||||
|
// copied from libhpi
|
||||||
|
const size_t pnamelen = pname ? strlen(pname) : 0;
|
||||||
|
|
||||||
|
/* Quietly truncate on buffer overflow. Should be an error. */
|
||||||
|
if (pnamelen + strlen(fname) + 10 > (size_t) buflen) {
|
||||||
|
*buffer = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pnamelen == 0) {
|
||||||
|
sprintf(buffer, "lib%s.so", fname);
|
||||||
|
} else {
|
||||||
|
sprintf(buffer, "%s/lib%s.so", pname, fname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const char* os::get_current_directory(char *buf, int buflen) {
|
const char* os::get_current_directory(char *buf, int buflen) {
|
||||||
return getcwd(buf, buflen);
|
return getcwd(buf, buflen);
|
||||||
}
|
}
|
||||||
|
@ -1742,7 +1763,17 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* glibc-2.0 libdl is not MT safe. If you are building with any glibc,
|
||||||
|
* chances are you might want to run the generated bits against glibc-2.0
|
||||||
|
* libdl.so, so always use locking for any version of glibc.
|
||||||
|
*/
|
||||||
|
void* os::dll_lookup(void* handle, const char* name) {
|
||||||
|
pthread_mutex_lock(&dl_mutex);
|
||||||
|
void* res = dlsym(handle, name);
|
||||||
|
pthread_mutex_unlock(&dl_mutex);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool _print_ascii_file(const char* filename, outputStream* st) {
|
bool _print_ascii_file(const char* filename, outputStream* st) {
|
||||||
|
@ -2278,7 +2309,7 @@ void os::Linux::libnuma_init() {
|
||||||
dlsym(RTLD_DEFAULT, "sched_getcpu")));
|
dlsym(RTLD_DEFAULT, "sched_getcpu")));
|
||||||
|
|
||||||
if (sched_getcpu() != -1) { // Does it work?
|
if (sched_getcpu() != -1) { // Does it work?
|
||||||
void *handle = dlopen("libnuma.so", RTLD_LAZY);
|
void *handle = dlopen("libnuma.so.1", RTLD_LAZY);
|
||||||
if (handle != NULL) {
|
if (handle != NULL) {
|
||||||
set_numa_node_to_cpus(CAST_TO_FN_PTR(numa_node_to_cpus_func_t,
|
set_numa_node_to_cpus(CAST_TO_FN_PTR(numa_node_to_cpus_func_t,
|
||||||
dlsym(handle, "numa_node_to_cpus")));
|
dlsym(handle, "numa_node_to_cpus")));
|
||||||
|
@ -3581,6 +3612,7 @@ void os::init(void) {
|
||||||
|
|
||||||
Linux::clock_init();
|
Linux::clock_init();
|
||||||
initial_time_count = os::elapsed_counter();
|
initial_time_count = os::elapsed_counter();
|
||||||
|
pthread_mutex_init(&dl_mutex, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// To install functions for atexit system call
|
// To install functions for atexit system call
|
||||||
|
|
|
@ -71,7 +71,7 @@ static intptr_t compare_and_exchange_current_callback (
|
||||||
if (VM_Version::supports_compare_and_exchange()) {
|
if (VM_Version::supports_compare_and_exchange()) {
|
||||||
return Atomic::cmpxchg_ptr(callback, addr, compare_value);
|
return Atomic::cmpxchg_ptr(callback, addr, compare_value);
|
||||||
} else {
|
} else {
|
||||||
MutexLockerEx(sync, Mutex::_no_safepoint_check_flag);
|
MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
|
||||||
if (*addr == compare_value) {
|
if (*addr == compare_value) {
|
||||||
*addr = callback;
|
*addr = callback;
|
||||||
return compare_value;
|
return compare_value;
|
||||||
|
@ -86,7 +86,7 @@ static intptr_t exchange_current_callback(intptr_t callback, intptr_t *addr, Mut
|
||||||
if (VM_Version::supports_compare_and_exchange()) {
|
if (VM_Version::supports_compare_and_exchange()) {
|
||||||
return Atomic::xchg_ptr(callback, addr);
|
return Atomic::xchg_ptr(callback, addr);
|
||||||
} else {
|
} else {
|
||||||
MutexLockerEx(sync, Mutex::_no_safepoint_check_flag);
|
MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
|
||||||
intptr_t cb = *addr;
|
intptr_t cb = *addr;
|
||||||
*addr = callback;
|
*addr = callback;
|
||||||
return cb;
|
return cb;
|
||||||
|
|
|
@ -1783,6 +1783,24 @@ const char* os::dll_file_extension() { return ".so"; }
|
||||||
|
|
||||||
const char* os::get_temp_directory() { return "/tmp/"; }
|
const char* os::get_temp_directory() { return "/tmp/"; }
|
||||||
|
|
||||||
|
void os::dll_build_name(
|
||||||
|
char* buffer, size_t buflen, const char* pname, const char* fname) {
|
||||||
|
// copied from libhpi
|
||||||
|
const size_t pnamelen = pname ? strlen(pname) : 0;
|
||||||
|
|
||||||
|
/* Quietly truncate on buffer overflow. Should be an error. */
|
||||||
|
if (pnamelen + strlen(fname) + 10 > (size_t) buflen) {
|
||||||
|
*buffer = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pnamelen == 0) {
|
||||||
|
sprintf(buffer, "lib%s.so", fname);
|
||||||
|
} else {
|
||||||
|
sprintf(buffer, "%s/lib%s.so", pname, fname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const char* os::get_current_directory(char *buf, int buflen) {
|
const char* os::get_current_directory(char *buf, int buflen) {
|
||||||
return getcwd(buf, buflen);
|
return getcwd(buf, buflen);
|
||||||
}
|
}
|
||||||
|
@ -2034,6 +2052,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* os::dll_lookup(void* handle, const char* name) {
|
||||||
|
return dlsym(handle, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool _print_ascii_file(const char* filename, outputStream* st) {
|
bool _print_ascii_file(const char* filename, outputStream* st) {
|
||||||
|
@ -2658,6 +2679,12 @@ size_t os::numa_get_leaf_groups(int *ids, size_t size) {
|
||||||
top += r;
|
top += r;
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
|
if (bottom == 0) {
|
||||||
|
// Handle a situation, when the OS reports no memory available.
|
||||||
|
// Assume UMA architecture.
|
||||||
|
ids[0] = 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return bottom;
|
return bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4581,7 +4608,7 @@ void os::Solaris::synchronization_init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::Solaris::liblgrp_init() {
|
void os::Solaris::liblgrp_init() {
|
||||||
void *handle = dlopen("liblgrp.so", RTLD_LAZY);
|
void *handle = dlopen("liblgrp.so.1", RTLD_LAZY);
|
||||||
if (handle != NULL) {
|
if (handle != NULL) {
|
||||||
os::Solaris::set_lgrp_home(CAST_TO_FN_PTR(lgrp_home_func_t, dlsym(handle, "lgrp_home")));
|
os::Solaris::set_lgrp_home(CAST_TO_FN_PTR(lgrp_home_func_t, dlsym(handle, "lgrp_home")));
|
||||||
os::Solaris::set_lgrp_init(CAST_TO_FN_PTR(lgrp_init_func_t, dlsym(handle, "lgrp_init")));
|
os::Solaris::set_lgrp_init(CAST_TO_FN_PTR(lgrp_init_func_t, dlsym(handle, "lgrp_init")));
|
||||||
|
|
|
@ -985,6 +985,28 @@ const char * os::get_temp_directory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void os::dll_build_name(char *holder, size_t holderlen,
|
||||||
|
const char* pname, const char* fname)
|
||||||
|
{
|
||||||
|
// copied from libhpi
|
||||||
|
const size_t pnamelen = pname ? strlen(pname) : 0;
|
||||||
|
const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0;
|
||||||
|
|
||||||
|
/* Quietly truncates on buffer overflow. Should be an error. */
|
||||||
|
if (pnamelen + strlen(fname) + 10 > holderlen) {
|
||||||
|
*holder = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pnamelen == 0) {
|
||||||
|
sprintf(holder, "%s.dll", fname);
|
||||||
|
} else if (c == ':' || c == '\\') {
|
||||||
|
sprintf(holder, "%s%s.dll", pname, fname);
|
||||||
|
} else {
|
||||||
|
sprintf(holder, "%s\\%s.dll", pname, fname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Needs to be in os specific directory because windows requires another
|
// Needs to be in os specific directory because windows requires another
|
||||||
// header file <direct.h>
|
// header file <direct.h>
|
||||||
const char* os::get_current_directory(char *buf, int buflen) {
|
const char* os::get_current_directory(char *buf, int buflen) {
|
||||||
|
@ -1248,6 +1270,10 @@ bool os::dll_address_to_function_name(address addr, char *buf,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* os::dll_lookup(void* handle, const char* name) {
|
||||||
|
return GetProcAddress((HMODULE)handle, name);
|
||||||
|
}
|
||||||
|
|
||||||
// save the start and end address of jvm.dll into param[0] and param[1]
|
// save the start and end address of jvm.dll into param[0] and param[1]
|
||||||
static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,
|
static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,
|
||||||
unsigned size, void * param) {
|
unsigned size, void * param) {
|
||||||
|
@ -1421,6 +1447,10 @@ void os::print_dll_info(outputStream *st) {
|
||||||
enumerate_modules(pid, _print_module, (void *)st);
|
enumerate_modules(pid, _print_module, (void *)st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function pointer to Windows API "GetNativeSystemInfo".
|
||||||
|
typedef void (WINAPI *GetNativeSystemInfo_func_type)(LPSYSTEM_INFO);
|
||||||
|
static GetNativeSystemInfo_func_type _GetNativeSystemInfo;
|
||||||
|
|
||||||
void os::print_os_info(outputStream* st) {
|
void os::print_os_info(outputStream* st) {
|
||||||
st->print("OS:");
|
st->print("OS:");
|
||||||
|
|
||||||
|
@ -1434,15 +1464,46 @@ void os::print_os_info(outputStream* st) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int os_vers = osvi.dwMajorVersion * 1000 + osvi.dwMinorVersion;
|
int os_vers = osvi.dwMajorVersion * 1000 + osvi.dwMinorVersion;
|
||||||
|
|
||||||
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
|
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
|
||||||
switch (os_vers) {
|
switch (os_vers) {
|
||||||
case 3051: st->print(" Windows NT 3.51"); break;
|
case 3051: st->print(" Windows NT 3.51"); break;
|
||||||
case 4000: st->print(" Windows NT 4.0"); break;
|
case 4000: st->print(" Windows NT 4.0"); break;
|
||||||
case 5000: st->print(" Windows 2000"); break;
|
case 5000: st->print(" Windows 2000"); break;
|
||||||
case 5001: st->print(" Windows XP"); break;
|
case 5001: st->print(" Windows XP"); break;
|
||||||
case 5002: st->print(" Windows Server 2003 family"); break;
|
case 5002:
|
||||||
case 6000: st->print(" Windows Vista"); break;
|
case 6000: {
|
||||||
|
// Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could
|
||||||
|
// find out whether we are running on 64 bit processor or not.
|
||||||
|
SYSTEM_INFO si;
|
||||||
|
ZeroMemory(&si, sizeof(SYSTEM_INFO));
|
||||||
|
// Check to see if _GetNativeSystemInfo has been initialized.
|
||||||
|
if (_GetNativeSystemInfo == NULL) {
|
||||||
|
HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
|
||||||
|
_GetNativeSystemInfo =
|
||||||
|
CAST_TO_FN_PTR(GetNativeSystemInfo_func_type,
|
||||||
|
GetProcAddress(hKernel32,
|
||||||
|
"GetNativeSystemInfo"));
|
||||||
|
if (_GetNativeSystemInfo == NULL)
|
||||||
|
GetSystemInfo(&si);
|
||||||
|
} else {
|
||||||
|
_GetNativeSystemInfo(&si);
|
||||||
|
}
|
||||||
|
if (os_vers == 5002) {
|
||||||
|
if (osvi.wProductType == VER_NT_WORKSTATION &&
|
||||||
|
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||||
|
st->print(" Windows XP x64 Edition");
|
||||||
|
else
|
||||||
|
st->print(" Windows Server 2003 family");
|
||||||
|
} else { // os_vers == 6000
|
||||||
|
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||||
|
st->print(" Windows Vista");
|
||||||
|
else
|
||||||
|
st->print(" Windows Server 2008");
|
||||||
|
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||||
|
st->print(" , 64 bit");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: // future windows, print out its major and minor versions
|
default: // future windows, print out its major and minor versions
|
||||||
st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||||
}
|
}
|
||||||
|
@ -1455,7 +1516,6 @@ void os::print_os_info(outputStream* st) {
|
||||||
st->print(" Windows %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
st->print(" Windows %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
st->print(" Build %d", osvi.dwBuildNumber);
|
st->print(" Build %d", osvi.dwBuildNumber);
|
||||||
st->print(" %s", osvi.szCSDVersion); // service pack
|
st->print(" %s", osvi.szCSDVersion); // service pack
|
||||||
st->cr();
|
st->cr();
|
||||||
|
|
|
@ -3825,6 +3825,8 @@ int MatchRule::is_expensive() const {
|
||||||
strcmp(opType,"ConvL2D")==0 ||
|
strcmp(opType,"ConvL2D")==0 ||
|
||||||
strcmp(opType,"ConvL2F")==0 ||
|
strcmp(opType,"ConvL2F")==0 ||
|
||||||
strcmp(opType,"ConvL2I")==0 ||
|
strcmp(opType,"ConvL2I")==0 ||
|
||||||
|
strcmp(opType,"DecodeN")==0 ||
|
||||||
|
strcmp(opType,"EncodeP")==0 ||
|
||||||
strcmp(opType,"RoundDouble")==0 ||
|
strcmp(opType,"RoundDouble")==0 ||
|
||||||
strcmp(opType,"RoundFloat")==0 ||
|
strcmp(opType,"RoundFloat")==0 ||
|
||||||
strcmp(opType,"ReverseBytesI")==0 ||
|
strcmp(opType,"ReverseBytesI")==0 ||
|
||||||
|
|
|
@ -351,7 +351,7 @@ void ciBlock::set_exception_range(int start_bci, int limit_bci) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
static char *flagnames[] = {
|
static const char *flagnames[] = {
|
||||||
"Processed",
|
"Processed",
|
||||||
"Handler",
|
"Handler",
|
||||||
"MayThrow",
|
"MayThrow",
|
||||||
|
|
|
@ -649,8 +649,8 @@ jlong java_lang_Thread::thread_id(oop java_thread) {
|
||||||
}
|
}
|
||||||
|
|
||||||
oop java_lang_Thread::park_blocker(oop java_thread) {
|
oop java_lang_Thread::park_blocker(oop java_thread) {
|
||||||
assert(JDK_Version::supports_thread_park_blocker() && _park_blocker_offset != 0,
|
assert(JDK_Version::current().supports_thread_park_blocker() &&
|
||||||
"Must support parkBlocker field");
|
_park_blocker_offset != 0, "Must support parkBlocker field");
|
||||||
|
|
||||||
if (_park_blocker_offset > 0) {
|
if (_park_blocker_offset > 0) {
|
||||||
return java_thread->obj_field(_park_blocker_offset);
|
return java_thread->obj_field(_park_blocker_offset);
|
||||||
|
|
|
@ -188,10 +188,6 @@ void OopMap::set_derived_oop(VMReg reg, VMReg derived_from_local_register ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OopMap::set_stack_obj(VMReg reg) {
|
|
||||||
set_xxx(reg, OopMapValue::stack_obj, VMRegImpl::Bad());
|
|
||||||
}
|
|
||||||
|
|
||||||
// OopMapSet
|
// OopMapSet
|
||||||
|
|
||||||
OopMapSet::OopMapSet() {
|
OopMapSet::OopMapSet() {
|
||||||
|
@ -399,8 +395,7 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
|
||||||
if ( loc != NULL ) {
|
if ( loc != NULL ) {
|
||||||
if ( omv.type() == OopMapValue::oop_value ) {
|
if ( omv.type() == OopMapValue::oop_value ) {
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
if (COMPILER2_PRESENT(!DoEscapeAnalysis &&)
|
if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
|
||||||
(((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
|
|
||||||
!Universe::heap()->is_in_or_null(*loc)) {
|
!Universe::heap()->is_in_or_null(*loc)) {
|
||||||
tty->print_cr("# Found non oop pointer. Dumping state at failure");
|
tty->print_cr("# Found non oop pointer. Dumping state at failure");
|
||||||
// try to dump out some helpful debugging information
|
// try to dump out some helpful debugging information
|
||||||
|
@ -431,17 +426,6 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef COMPILER2
|
|
||||||
if (DoEscapeAnalysis) {
|
|
||||||
for (OopMapStream oms(map, OopMapValue::stack_obj); !oms.is_done(); oms.next()) {
|
|
||||||
omv = oms.current();
|
|
||||||
assert(omv.is_stack_loc(), "should refer to stack location");
|
|
||||||
oop loc = (oop) fr->oopmapreg_to_location(omv.reg(),reg_map);
|
|
||||||
oop_fn->do_oop(&loc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // COMPILER2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -540,9 +524,6 @@ void print_register_type(OopMapValue::oop_types x, VMReg optional,
|
||||||
st->print("Derived_oop_" );
|
st->print("Derived_oop_" );
|
||||||
optional->print_on(st);
|
optional->print_on(st);
|
||||||
break;
|
break;
|
||||||
case OopMapValue::stack_obj:
|
|
||||||
st->print("Stack");
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constants
|
// Constants
|
||||||
enum { type_bits = 6,
|
enum { type_bits = 5,
|
||||||
register_bits = BitsPerShort - type_bits };
|
register_bits = BitsPerShort - type_bits };
|
||||||
|
|
||||||
enum { type_shift = 0,
|
enum { type_shift = 0,
|
||||||
|
@ -63,8 +63,7 @@ public:
|
||||||
value_value = 2,
|
value_value = 2,
|
||||||
narrowoop_value = 4,
|
narrowoop_value = 4,
|
||||||
callee_saved_value = 8,
|
callee_saved_value = 8,
|
||||||
derived_oop_value= 16,
|
derived_oop_value= 16 };
|
||||||
stack_obj = 32 };
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
OopMapValue () { set_value(0); set_content_reg(VMRegImpl::Bad()); }
|
OopMapValue () { set_value(0); set_content_reg(VMRegImpl::Bad()); }
|
||||||
|
@ -93,14 +92,12 @@ public:
|
||||||
bool is_narrowoop() { return mask_bits(value(), type_mask_in_place) == narrowoop_value; }
|
bool is_narrowoop() { return mask_bits(value(), type_mask_in_place) == narrowoop_value; }
|
||||||
bool is_callee_saved() { return mask_bits(value(), type_mask_in_place) == callee_saved_value; }
|
bool is_callee_saved() { return mask_bits(value(), type_mask_in_place) == callee_saved_value; }
|
||||||
bool is_derived_oop() { return mask_bits(value(), type_mask_in_place) == derived_oop_value; }
|
bool is_derived_oop() { return mask_bits(value(), type_mask_in_place) == derived_oop_value; }
|
||||||
bool is_stack_obj() { return mask_bits(value(), type_mask_in_place) == stack_obj; }
|
|
||||||
|
|
||||||
void set_oop() { set_value((value() & register_mask_in_place) | oop_value); }
|
void set_oop() { set_value((value() & register_mask_in_place) | oop_value); }
|
||||||
void set_value() { set_value((value() & register_mask_in_place) | value_value); }
|
void set_value() { set_value((value() & register_mask_in_place) | value_value); }
|
||||||
void set_narrowoop() { set_value((value() & register_mask_in_place) | narrowoop_value); }
|
void set_narrowoop() { set_value((value() & register_mask_in_place) | narrowoop_value); }
|
||||||
void set_callee_saved() { set_value((value() & register_mask_in_place) | callee_saved_value); }
|
void set_callee_saved() { set_value((value() & register_mask_in_place) | callee_saved_value); }
|
||||||
void set_derived_oop() { set_value((value() & register_mask_in_place) | derived_oop_value); }
|
void set_derived_oop() { set_value((value() & register_mask_in_place) | derived_oop_value); }
|
||||||
void set_stack_obj() { set_value((value() & register_mask_in_place) | stack_obj); }
|
|
||||||
|
|
||||||
VMReg reg() const { return VMRegImpl::as_VMReg(mask_bits(value(), register_mask_in_place) >> register_shift); }
|
VMReg reg() const { return VMRegImpl::as_VMReg(mask_bits(value(), register_mask_in_place) >> register_shift); }
|
||||||
oop_types type() const { return (oop_types)mask_bits(value(), type_mask_in_place); }
|
oop_types type() const { return (oop_types)mask_bits(value(), type_mask_in_place); }
|
||||||
|
@ -180,7 +177,6 @@ class OopMap: public ResourceObj {
|
||||||
void set_dead ( VMReg local);
|
void set_dead ( VMReg local);
|
||||||
void set_callee_saved( VMReg local, VMReg caller_machine_register );
|
void set_callee_saved( VMReg local, VMReg caller_machine_register );
|
||||||
void set_derived_oop ( VMReg local, VMReg derived_from_local_register );
|
void set_derived_oop ( VMReg local, VMReg derived_from_local_register );
|
||||||
void set_stack_obj( VMReg local);
|
|
||||||
void set_xxx(VMReg reg, OopMapValue::oop_types x, VMReg optional);
|
void set_xxx(VMReg reg, OopMapValue::oop_types x, VMReg optional);
|
||||||
|
|
||||||
int heap_size() const;
|
int heap_size() const;
|
||||||
|
|