提交 1a51213e 编写于 作者: O ohair

6627817: Remove ^M characters in all files (Makefiles too)

Summary: Some files included the use of the ^M character, which has been deleted.
Reviewed-by: xdono
上级 e9906ea2
...@@ -1572,31 +1572,31 @@ ifeq ($(ARCH_DATA_MODEL), 32) ...@@ -1572,31 +1572,31 @@ ifeq ($(ARCH_DATA_MODEL), 32)
endif endif
###################################################### ######################################################
# SECURITY_BASELINE_142 test # SECURITY_BASELINE_142 test
###################################################### ######################################################
security_baseline_142: security_baseline_142:
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
@if [ -z "$(SECURITY_BASELINE_142)" ]; then \ @if [ -z "$(SECURITY_BASELINE_142)" ]; then \
$(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \ $(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \
" Setting it to the default value of 1.4.2_10.\n" \ " Setting it to the default value of 1.4.2_10.\n" \
" It is recommended to set SECURITY_BASELINE_142.\n" \ " It is recommended to set SECURITY_BASELINE_142.\n" \
"" >> $(WARNING_FILE) ; \ "" >> $(WARNING_FILE) ; \
fi fi
endif endif
###################################################### ######################################################
# SECURITY_BASELINE_150 test # SECURITY_BASELINE_150 test
###################################################### ######################################################
security_baseline_150: security_baseline_150:
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
@if [ -z "$(SECURITY_BASELINE_150)" ]; then \ @if [ -z "$(SECURITY_BASELINE_150)" ]; then \
$(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \ $(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \
" Setting it to the default value of 1.5.0_07.\n" \ " Setting it to the default value of 1.5.0_07.\n" \
" It is recommended to set SECURITY_BASELINE_150.\n" \ " It is recommended to set SECURITY_BASELINE_150.\n" \
"" >> $(WARNING_FILE) ; \ "" >> $(WARNING_FILE) ; \
fi fi
endif endif
###################################################### ######################################################
......
...@@ -49,8 +49,8 @@ EXCLUDE_PKGS = \ ...@@ -49,8 +49,8 @@ EXCLUDE_PKGS = \
# ACTIVE_JSR_PKGS are packages that are part of an active JSR process-- # ACTIVE_JSR_PKGS are packages that are part of an active JSR process--
# one that is doing its own review. These packages are not included when # one that is doing its own review. These packages are not included when
# creating diff pages for the platform's JCP process. # creating diff pages for the platform's JCP process.
# #
# (see /java/pubs/apisrc/jdk/6.0/beta/make/docs/active_jsr_pkgs) # (see /java/pubs/apisrc/jdk/6.0/beta/make/docs/active_jsr_pkgs)
# Note: # Note:
# This is a list of regular expressions. So foo.* matches "foo" and "foo.bar". # This is a list of regular expressions. So foo.* matches "foo" and "foo.bar".
# #
...@@ -72,13 +72,13 @@ ACTIVE_JSR_PKGS= \ ...@@ -72,13 +72,13 @@ ACTIVE_JSR_PKGS= \
# CORE_PKGS is the list of packages that form the # CORE_PKGS is the list of packages that form the
# Java API Specification. # Java API Specification.
# #
### ***IMPORTANT NOTE*** ### ***IMPORTANT NOTE***
### There is also a "REGEXP" variable in the docs/makefile that ### There is also a "REGEXP" variable in the docs/makefile that
### determines which table the packages go in on the main page. ### determines which table the packages go in on the main page.
### Currently, there is only table ("Platform Packages") and ### Currently, there is only table ("Platform Packages") and
### everything goes in it, so REGEXP is "*". But if that policy ### everything goes in it, so REGEXP is "*". But if that policy
### changes, packages added will need to be reflected in that ### changes, packages added will need to be reflected in that
### list of wildcard expressions, as well. ### list of wildcard expressions, as well.
### ###
CORE_PKGS = \ CORE_PKGS = \
java.applet \ java.applet \
......
# #
# Default Input method display names for Indic input methods # Default Input method display names for Indic input methods
# #
DisplayName.Devanagari = Devanagari Input Method DisplayName.Devanagari = Devanagari Input Method
# #
# Default Input method display names for Thai input methods # Default Input method display names for Thai input methods
# #
DisplayName.Thai = Thai Input Method DisplayName.Thai = Thai Input Method
<?xml version='1.0' encoding='UTF-8' ?> <?xml version='1.0' encoding='UTF-8' ?>
<!ELEMENT Configuration (CanonicalizationMethods , TransformAlgorithms , JCEAlgorithmMappings , Log4J , ResourceBundles , UnitTests , ResourceResolvers , KeyResolvers)> <!ELEMENT Configuration (CanonicalizationMethods , TransformAlgorithms , JCEAlgorithmMappings , Log4J , ResourceBundles , UnitTests , ResourceResolvers , KeyResolvers)>
<!ATTLIST Configuration xmlns CDATA #FIXED 'http://www.xmlsecurity.org/NS/#configuration' <!ATTLIST Configuration xmlns CDATA #FIXED 'http://www.xmlsecurity.org/NS/#configuration'
target CDATA #IMPLIED> target CDATA #IMPLIED>
<!ELEMENT CanonicalizationMethods (CanonicalizationMethod+)> <!ELEMENT CanonicalizationMethods (CanonicalizationMethod+)>
<!ATTLIST CanonicalizationMethods JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.c14n.Canonicalizer' > <!ATTLIST CanonicalizationMethods JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.c14n.Canonicalizer' >
<!ELEMENT CanonicalizationMethod EMPTY> <!ELEMENT CanonicalizationMethod EMPTY>
<!ATTLIST CanonicalizationMethod URI CDATA #REQUIRED <!ATTLIST CanonicalizationMethod URI CDATA #REQUIRED
JAVACLASS CDATA #REQUIRED > JAVACLASS CDATA #REQUIRED >
<!ELEMENT TransformAlgorithms (TransformAlgorithm+)> <!ELEMENT TransformAlgorithms (TransformAlgorithm+)>
<!ATTLIST TransformAlgorithms JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.transforms.Transform' > <!ATTLIST TransformAlgorithms JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.transforms.Transform' >
<!ELEMENT TransformAlgorithm EMPTY> <!ELEMENT TransformAlgorithm EMPTY>
<!ATTLIST TransformAlgorithm URI CDATA #REQUIRED <!ATTLIST TransformAlgorithm URI CDATA #REQUIRED
JAVACLASS CDATA #REQUIRED > JAVACLASS CDATA #REQUIRED >
<!ELEMENT JCEAlgorithmMappings (Providers , Algorithms)> <!ELEMENT JCEAlgorithmMappings (Providers , Algorithms)>
<!ELEMENT Providers (Provider+)> <!ELEMENT Providers (Provider+)>
<!ELEMENT Provider EMPTY> <!ELEMENT Provider EMPTY>
<!ATTLIST Provider Id ID #REQUIRED <!ATTLIST Provider Id ID #REQUIRED
Class CDATA #REQUIRED Class CDATA #REQUIRED
Info CDATA #IMPLIED Info CDATA #IMPLIED
ProviderURL CDATA #IMPLIED > ProviderURL CDATA #IMPLIED >
<!ELEMENT Algorithms (Algorithm+)> <!ELEMENT Algorithms (Algorithm+)>
<!ELEMENT Algorithm (ProviderAlgo+)> <!ELEMENT Algorithm (ProviderAlgo+)>
<!ATTLIST Algorithm URI CDATA #REQUIRED <!ATTLIST Algorithm URI CDATA #REQUIRED
Description CDATA #IMPLIED Description CDATA #IMPLIED
AlgorithmClass CDATA #IMPLIED > AlgorithmClass CDATA #IMPLIED >
<!ELEMENT ProviderAlgo EMPTY> <!ELEMENT ProviderAlgo EMPTY>
<!ATTLIST ProviderAlgo ProviderId IDREF #REQUIRED <!ATTLIST ProviderAlgo ProviderId IDREF #REQUIRED
JCEName CDATA #REQUIRED JCEName CDATA #REQUIRED
JCEAlias CDATA #IMPLIED > JCEAlias CDATA #IMPLIED >
<!ELEMENT Log4J EMPTY> <!ELEMENT Log4J EMPTY>
<!ATTLIST Log4J configFile CDATA 'data/log4j.xml' > <!ATTLIST Log4J configFile CDATA 'data/log4j.xml' >
<!ELEMENT ResourceBundles (ResourceBundle+)> <!ELEMENT ResourceBundles (ResourceBundle+)>
<!ATTLIST ResourceBundles defaultLanguageCode CDATA 'de' <!ATTLIST ResourceBundles defaultLanguageCode CDATA 'de'
defaultCountryCode CDATA 'DE' > defaultCountryCode CDATA 'DE' >
<!ELEMENT ResourceBundle EMPTY> <!ELEMENT ResourceBundle EMPTY>
<!ATTLIST ResourceBundle LanguageCode CDATA #REQUIRED <!ATTLIST ResourceBundle LanguageCode CDATA #REQUIRED
CountryCode CDATA #REQUIRED CountryCode CDATA #REQUIRED
LOCATION CDATA #REQUIRED > LOCATION CDATA #REQUIRED >
<!ELEMENT UnitTests (UnitTest+)> <!ELEMENT UnitTests (UnitTest+)>
<!ATTLIST UnitTests JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.test.AllTests' > <!ATTLIST UnitTests JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.test.AllTests' >
<!ELEMENT ResourceResolvers (Resolver+)> <!ELEMENT ResourceResolvers (Resolver+)>
<!ELEMENT Resolver EMPTY> <!ELEMENT Resolver EMPTY>
<!ATTLIST Resolver JAVACLASS CDATA #REQUIRED <!ATTLIST Resolver JAVACLASS CDATA #REQUIRED
DESCRIPTION CDATA #IMPLIED > DESCRIPTION CDATA #IMPLIED >
<!ELEMENT KeyResolvers (KeyResolver+)> <!ELEMENT KeyResolvers (KeyResolver+)>
<!ATTLIST KeyResolvers JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.keys.KeyResolver' > <!ATTLIST KeyResolvers JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.keys.KeyResolver' >
<!ELEMENT KeyResolver EMPTY> <!ELEMENT KeyResolver EMPTY>
<!ATTLIST KeyResolver URI CDATA #REQUIRED <!ATTLIST KeyResolver URI CDATA #REQUIRED
JAVACLASS CDATA #REQUIRED > JAVACLASS CDATA #REQUIRED >
<!ELEMENT UnitTest (#PCDATA)> <!ELEMENT UnitTest (#PCDATA)>
<!ATTLIST UnitTest JAVACLASS CDATA #REQUIRED > <!ATTLIST UnitTest JAVACLASS CDATA #REQUIRED >
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
type (idref|boolean|dimension|insets|integer|string) "idref" type (idref|boolean|dimension|insets|integer|string) "idref"
value CDATA #REQUIRED value CDATA #REQUIRED
> >
<!ELEMENT defaultsProperty EMPTY> <!ELEMENT defaultsProperty EMPTY>
<!ATTLIST defaultsProperty <!ATTLIST defaultsProperty
key CDATA #REQUIRED key CDATA #REQUIRED
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html> <html>
<head> <head>
<!-- <!--
Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
...@@ -27,151 +27,151 @@ have any questions. ...@@ -27,151 +27,151 @@ have any questions.
--> -->
</head> </head>
<body bgcolor="white"> <body bgcolor="white">
<p> <p>
Synth is a skinnable look and feel in which all painting is Synth is a skinnable look and feel in which all painting is
delegated. Synth does not provide a default look. In delegated. Synth does not provide a default look. In
order to use Synth you need to specify a order to use Synth you need to specify a
<a href="doc-files/synthFileFormat.html">file</a>, or <a href="doc-files/synthFileFormat.html">file</a>, or
provide a {@link provide a {@link
javax.swing.plaf.synth.SynthStyleFactory}. Both javax.swing.plaf.synth.SynthStyleFactory}. Both
configuration options require an configuration options require an
understanding of the synth architecture, which is described understanding of the synth architecture, which is described
below, as well as an understanding of Swing's architecture. below, as well as an understanding of Swing's architecture.
</p> </p>
<p> <p>
Unless otherwise specified null is not a legal value to any of Unless otherwise specified null is not a legal value to any of
the methods defined in the synth package and if passed in will the methods defined in the synth package and if passed in will
result in a <code>NullPointerException</code>. result in a <code>NullPointerException</code>.
<h2>Synth</h2> <h2>Synth</h2>
<p> <p>
Each {@link javax.swing.plaf.ComponentUI} implementation in Synth associates Each {@link javax.swing.plaf.ComponentUI} implementation in Synth associates
itself with one {@link itself with one {@link
javax.swing.plaf.synth.SynthStyle} per {@link javax.swing.plaf.synth.SynthStyle} per {@link
javax.swing.plaf.synth.Region}, most javax.swing.plaf.synth.Region}, most
<code>Components</code> only have one <code>Region</code> and <code>Components</code> only have one <code>Region</code> and
therefor only one <code>SynthStyle</code>. therefor only one <code>SynthStyle</code>.
<code>SynthStyle</code> <code>SynthStyle</code>
is used to access all style related properties: fonts, colors is used to access all style related properties: fonts, colors
and other <code>Component</code> properties. In addition and other <code>Component</code> properties. In addition
<code>SynthStyle</code>s are used to obtain <code>SynthStyle</code>s are used to obtain
{@link javax.swing.plaf.synth.SynthPainter}s for painting the background, border, {@link javax.swing.plaf.synth.SynthPainter}s for painting the background, border,
focus and other portions of a <code>Component</code>. The <code>ComponentUI</code>s obtain focus and other portions of a <code>Component</code>. The <code>ComponentUI</code>s obtain
<code>SynthStyle</code>s from a <code>SynthStyle</code>s from a
{@link javax.swing.plaf.synth.SynthStyleFactory}. {@link javax.swing.plaf.synth.SynthStyleFactory}.
A <code>SynthStyleFactory</code> A <code>SynthStyleFactory</code>
can be provided directly by way of can be provided directly by way of
{@link javax.swing.plaf.synth.SynthLookAndFeel#setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory)}, {@link javax.swing.plaf.synth.SynthLookAndFeel#setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory)},
or indirectly by way of or indirectly by way of
{@link javax.swing.plaf.synth.SynthLookAndFeel#load}. The {@link javax.swing.plaf.synth.SynthLookAndFeel#load}. The
following example uses the <code>SynthLookAndFeel.load()</code> following example uses the <code>SynthLookAndFeel.load()</code>
method to configure a <code>SynthLookAndFeel</code> and sets it method to configure a <code>SynthLookAndFeel</code> and sets it
as the current look and feel: as the current look and feel:
</p> </p>
<div class="example"> <div class="example">
<pre> <pre>
SynthLookAndFeel laf = new SynthLookAndFeel(); SynthLookAndFeel laf = new SynthLookAndFeel();
laf.load(MyClass.class.getResourceAsStream("laf.xml"), MyClass.class); laf.load(MyClass.class.getResourceAsStream("laf.xml"), MyClass.class);
UIManager.setLookAndFeel(laf); UIManager.setLookAndFeel(laf);
</pre> </pre>
</div> </div>
<p> <p>
Many <code>JComponent</code>s are broken down into smaller Many <code>JComponent</code>s are broken down into smaller
pieces and identified by the type safe enumeration in pieces and identified by the type safe enumeration in
{@link javax.swing.plaf.synth.Region}. For example, a <code>JTabbedPane</code> {@link javax.swing.plaf.synth.Region}. For example, a <code>JTabbedPane</code>
consists of a <code>Region</code> for the consists of a <code>Region</code> for the
<code>JTabbedPane</code> ({@link <code>JTabbedPane</code> ({@link
javax.swing.plaf.synth.Region#TABBED_PANE}), the content javax.swing.plaf.synth.Region#TABBED_PANE}), the content
area ({@link area ({@link
javax.swing.plaf.synth.Region#TABBED_PANE_CONTENT}), the javax.swing.plaf.synth.Region#TABBED_PANE_CONTENT}), the
area behind the tabs ({@link area behind the tabs ({@link
javax.swing.plaf.synth.Region#TABBED_PANE_TAB_AREA}), and the javax.swing.plaf.synth.Region#TABBED_PANE_TAB_AREA}), and the
tabs ({@link tabs ({@link
javax.swing.plaf.synth.Region#TABBED_PANE_TAB}). Each javax.swing.plaf.synth.Region#TABBED_PANE_TAB}). Each
<code>Region</code> of each <code>Region</code> of each
<code>JComponent</code> will have a <code>JComponent</code> will have a
<code>SynthStyle</code>. This allows <code>SynthStyle</code>. This allows
you to customize individual pieces of each region of each you to customize individual pieces of each region of each
<code>JComponent</code>. <code>JComponent</code>.
<p> <p>
Many of the Synth methods take a {@link javax.swing.plaf.synth.SynthContext}. This Many of the Synth methods take a {@link javax.swing.plaf.synth.SynthContext}. This
is used to provide information about the current is used to provide information about the current
<code>Component</code> and includes: the <code>Component</code> and includes: the
{@link javax.swing.plaf.synth.SynthStyle} associated with the current {@link javax.swing.plaf.synth.SynthStyle} associated with the current
{@link javax.swing.plaf.synth.Region}, the state of the <code>Component</code> {@link javax.swing.plaf.synth.Region}, the state of the <code>Component</code>
as a bitmask (refer to {@link as a bitmask (refer to {@link
javax.swing.plaf.synth.SynthConstants} for the valid javax.swing.plaf.synth.SynthConstants} for the valid
states), and a {@link javax.swing.plaf.synth.Region} identifying the portion of states), and a {@link javax.swing.plaf.synth.Region} identifying the portion of
the <code>Component</code> being painted. the <code>Component</code> being painted.
<p> <p>
All text rendering by non-<code>JTextComponent</code>s is All text rendering by non-<code>JTextComponent</code>s is
delegated to a {@link delegated to a {@link
javax.swing.plaf.synth.SynthGraphicsUtils}, which is javax.swing.plaf.synth.SynthGraphicsUtils}, which is
obtained using the {@link javax.swing.plaf.synth.SynthStyle} method obtained using the {@link javax.swing.plaf.synth.SynthStyle} method
{@link javax.swing.plaf.synth.SynthStyle#getGraphicsUtils}. You can {@link javax.swing.plaf.synth.SynthStyle#getGraphicsUtils}. You can
customize text rendering customize text rendering
by supplying your own {@link javax.swing.plaf.synth.SynthGraphicsUtils}. by supplying your own {@link javax.swing.plaf.synth.SynthGraphicsUtils}.
</p> </p>
<h2>Notes on specific components</h2> <h2>Notes on specific components</h2>
<h3>JTree</h3> <h3>JTree</h3>
<p> <p>
Synth provides a region for the cells of a tree: Synth provides a region for the cells of a tree:
<code>Region.TREE_CELL</code>. To specify the colors of the <code>Region.TREE_CELL</code>. To specify the colors of the
renderer you'll want to provide a style for the renderer you'll want to provide a style for the
<code>TREE_CELL</code> region. The following illustrates this: <code>TREE_CELL</code> region. The following illustrates this:
<pre> <pre>
&lt;style id="treeCellStyle"> &lt;style id="treeCellStyle">
&lt;opaque value="TRUE"/> &lt;opaque value="TRUE"/>
&lt;state> &lt;state>
&lt;color value="WHITE" type="TEXT_FOREGROUND"/> &lt;color value="WHITE" type="TEXT_FOREGROUND"/>
&lt;color value="RED" type="TEXT_BACKGROUND"/> &lt;color value="RED" type="TEXT_BACKGROUND"/>
&lt;/state> &lt;/state>
&lt;state value="SELECTED"> &lt;state value="SELECTED">
&lt;color value="RED" type="TEXT_FOREGROUND"/> &lt;color value="RED" type="TEXT_FOREGROUND"/>
&lt;color value="WHITE" type="BACKGROUND"/> &lt;color value="WHITE" type="BACKGROUND"/>
&lt;/state> &lt;/state>
&lt;/style> &lt;/style>
&lt;bind style="treeCellStyle" type="region" key="TreeCell"/> &lt;bind style="treeCellStyle" type="region" key="TreeCell"/>
</pre> </pre>
<p> <p>
This specifies a color combination of red on white, when This specifies a color combination of red on white, when
selected, and white on red when not selected. To see the selected, and white on red when not selected. To see the
background you need to specify that labels are not opaque. The background you need to specify that labels are not opaque. The
following XML fragment does that: following XML fragment does that:
<pre> <pre>
&lt;style id="labelStyle"> &lt;style id="labelStyle">
&lt;opaque value="FALSE"/> &lt;opaque value="FALSE"/>
&lt;/style> &lt;/style>
&lt;bind style="labelStyle" type="region" key="Label"/> &lt;bind style="labelStyle" type="region" key="Label"/>
</pre> </pre>
<h3>JList and JTable</h3> <h3>JList and JTable</h3>
<p> <p>
The colors that the renderers for JList and JTable use are The colors that the renderers for JList and JTable use are
specified by way of the list and table Regions. The following specified by way of the list and table Regions. The following
XML fragment illustrates how to specify red on white, when XML fragment illustrates how to specify red on white, when
selected, and white on red when not selected: selected, and white on red when not selected:
<pre> <pre>
&lt;style id="style"> &lt;style id="style">
&lt;opaque value="TRUE"/> &lt;opaque value="TRUE"/>
&lt;state> &lt;state>
&lt;color value="WHITE" type="TEXT_FOREGROUND"/> &lt;color value="WHITE" type="TEXT_FOREGROUND"/>
&lt;color value="RED" type="TEXT_BACKGROUND"/> &lt;color value="RED" type="TEXT_BACKGROUND"/>
&lt;color value="RED" type="BACKGROUND"/> &lt;color value="RED" type="BACKGROUND"/>
&lt;/state> &lt;/state>
&lt;state value="SELECTED"> &lt;state value="SELECTED">
&lt;color value="RED" type="TEXT_FOREGROUND"/> &lt;color value="RED" type="TEXT_FOREGROUND"/>
&lt;color value="WHITE" type="TEXT_BACKGROUND"/> &lt;color value="WHITE" type="TEXT_BACKGROUND"/>
&lt;/state> &lt;/state>
&lt;/style> &lt;/style>
&lt;bind style="style" type="region" key="Table"/> &lt;bind style="style" type="region" key="Table"/>
&lt;bind style="style" type="region" key="List"/> &lt;bind style="style" type="region" key="List"/>
</pre> </pre>
</body> </body>
</html> </html>
# #
# Resource strings for Notepad example # Resource strings for Notepad example
Title=Notepad Title=Notepad
ElementTreeFrameTitle=Elements ElementTreeFrameTitle=Elements
ViewportBackingStore=false ViewportBackingStore=false
# menubar definition # menubar definition
# #
# Each of the strings that follow form a key to be # Each of the strings that follow form a key to be
# used to the actual menu definition. # used to the actual menu definition.
menubar=file edit debug menubar=file edit debug
# file Menu definition # file Menu definition
# #
# Each of the strings that follow form a key to be # Each of the strings that follow form a key to be
# used as the basis of a menu item definition. # used as the basis of a menu item definition.
# #
# open -> Notepad.openAction # open -> Notepad.openAction
# new -> Notepad.newAction # new -> Notepad.newAction
# save -> Notepad.saveAction # save -> Notepad.saveAction
# exit -> Notepad.exitAction # exit -> Notepad.exitAction
file=new open save - exit file=new open save - exit
fileLabel=File fileLabel=File
openLabel=Open openLabel=Open
openImage=resources/open.gif openImage=resources/open.gif
newLabel=New newLabel=New
newImage=resources/new.gif newImage=resources/new.gif
saveLabel=Save saveLabel=Save
saveImage=resources/save.gif saveImage=resources/save.gif
exitLabel=Exit exitLabel=Exit
# #
# edit Menu definition # edit Menu definition
# #
# cut -> JTextComponent.cutAction # cut -> JTextComponent.cutAction
# copy -> JTextComponent.copyAction # copy -> JTextComponent.copyAction
# paste -> JTextComponent.pasteAction # paste -> JTextComponent.pasteAction
edit=cut copy paste - undo redo edit=cut copy paste - undo redo
editLabel=Edit editLabel=Edit
cutLabel=Cut cutLabel=Cut
cutAction=cut-to-clipboard cutAction=cut-to-clipboard
cutImage=resources/cut.gif cutImage=resources/cut.gif
copyLabel=Copy copyLabel=Copy
copyAction=copy-to-clipboard copyAction=copy-to-clipboard
copyImage=resources/copy.gif copyImage=resources/copy.gif
pasteLabel=Paste pasteLabel=Paste
pasteAction=paste-from-clipboard pasteAction=paste-from-clipboard
pasteImage=resources/paste.gif pasteImage=resources/paste.gif
undoLabel=Undo undoLabel=Undo
undoAction=Undo undoAction=Undo
redoLabel=Redo redoLabel=Redo
redoAction=Redo redoAction=Redo
# #
# debug Menu definition # debug Menu definition
# #
debug=dump showElementTree debug=dump showElementTree
debugLabel=Debug debugLabel=Debug
dumpLabel=Dump model to System.err dumpLabel=Dump model to System.err
dumpAction=dump-model dumpAction=dump-model
showElementTreeLabel=Show Elements showElementTreeLabel=Show Elements
# toolbar definition # toolbar definition
# #
# Each of the strings that follow form a key to be # Each of the strings that follow form a key to be
# used as the basis of the tool definition. Actions # used as the basis of the tool definition. Actions
# are of course sharable, and in this case are shared # are of course sharable, and in this case are shared
# with the menu items. # with the menu items.
toolbar=new open save - cut copy paste toolbar=new open save - cut copy paste
newTooltip=Create a new file newTooltip=Create a new file
openTooltip=Open a file openTooltip=Open a file
saveTooltip=Save to a file saveTooltip=Save to a file
cutTooltip=Move selection to clipboard cutTooltip=Move selection to clipboard
copyTooltip=Copy selection to clipboard copyTooltip=Copy selection to clipboard
pasteTooltip=Paste clipboard to selection pasteTooltip=Paste clipboard to selection
...@@ -29,16 +29,16 @@ ...@@ -29,16 +29,16 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
all: jinvoker.dll invoked.class invoker.exe all: jinvoker.dll invoked.class invoker.exe
jinvoker.dll: jinvoker.obj Makefile jinvoker.dll: jinvoker.obj Makefile
cl /LD /o jinvoker.dll jinvoker.obj cl /LD /o jinvoker.dll jinvoker.obj
jinvoker.obj: jinvoker.cpp jinvokerExp.h Makefile jinvoker.obj: jinvoker.cpp jinvokerExp.h Makefile
cl /Fojinvoker.obj /DJINVOKEREEXPORT /c jinvoker.cpp cl /Fojinvoker.obj /DJINVOKEREEXPORT /c jinvoker.cpp
invoked.class: invoked.java Makefile invoked.class: invoked.java Makefile
javac invoked.java javac invoked.java
invoker.exe: invoker.cs Makefile invoker.exe: invoker.cs Makefile
csc /unsafe invoker.cs csc /unsafe invoker.cs
This sample provides Java "Hello World" program that is invoked This sample provides Java "Hello World" program that is invoked
from C# application in the same process. from C# application in the same process.
The problem of direct call of the JVM API from CLR applications The problem of direct call of the JVM API from CLR applications
by PInvoke interface is the JVM API functions do not have static by PInvoke interface is the JVM API functions do not have static
adresses, they need to be got by JNI_CreateJavaVM() call. adresses, they need to be got by JNI_CreateJavaVM() call.
The sample contains C++ libraty that wraps JVM API calls by the The sample contains C++ libraty that wraps JVM API calls by the
static functions that are called from the C# application by static functions that are called from the C# application by
PInvoke interface. PInvoke interface.
The sample contains the following files: The sample contains the following files:
Makefile - make file Makefile - make file
README.txt - this readme README.txt - this readme
invoked.java - the invoked HelloWorld Java program invoked.java - the invoked HelloWorld Java program
invoker.cs - C# invoker application invoker.cs - C# invoker application
jinvoker.cpp - C++ wrapper jinvoker.cpp - C++ wrapper
jinvokerExp.h - wrapper library exports jinvokerExp.h - wrapper library exports
After the success making the following files are produced: After the success making the following files are produced:
invoked.class - the compiled HelloWorld class invoked.class - the compiled HelloWorld class
invoker.exe - the executable .NET program that invokes Java invoker.exe - the executable .NET program that invokes Java
jinvoker.dll - the wrapper library jinvoker.dll - the wrapper library
The following environment needs to be set for the correct sample The following environment needs to be set for the correct sample
build and execution: build and execution:
INCLUDE must contain the paths to: INCLUDE must contain the paths to:
1. MS Visual C++ standard include 1. MS Visual C++ standard include
2. .NET SDK include 2. .NET SDK include
3. Java includes 3. Java includes
Example: %MSDEV%/VC98/Include;%DOTNET%/Include;%JAVA_HOME%/include;%JAVA_HOME%/include/win32 Example: %MSDEV%/VC98/Include;%DOTNET%/Include;%JAVA_HOME%/include;%JAVA_HOME%/include/win32
LIB must contain the paths to: LIB must contain the paths to:
1. MS Visual C++ standard libraries 1. MS Visual C++ standard libraries
2. .NET SDK libraries 2. .NET SDK libraries
3. jvm.dll 3. jvm.dll
Example: %MSDEV%/VC98/Lib;%DOTNET%/Lib;%JAVA_HOME%/jre/bin/client Example: %MSDEV%/VC98/Lib;%DOTNET%/Lib;%JAVA_HOME%/jre/bin/client
PATH must contain the paths to: PATH must contain the paths to:
1. MS Visual C++ standard bin 1. MS Visual C++ standard bin
2. MS Dev common bin 2. MS Dev common bin
3. .NET SDK libraries 3. .NET SDK libraries
4. Java bin 4. Java bin
5. jvm.dll 5. jvm.dll
Example: %MSDEV%/VC98/Bin;%MSDEV%/Common/MSDev98/Bin;%DOTNET%/Lib;%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin/client;%PATH% Example: %MSDEV%/VC98/Bin;%MSDEV%/Common/MSDev98/Bin;%DOTNET%/Lib;%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin/client;%PATH%
To run the sample please do: To run the sample please do:
invoker.exe invoked invoker.exe invoked
--Dmitry Ryashchentsev --Dmitry Ryashchentsev
...@@ -29,30 +29,30 @@ ...@@ -29,30 +29,30 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/* /*
*/ */
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
class jinvoker{ class jinvoker{
public static int Main(string[] aArgs){ public static int Main(string[] aArgs){
// Print Hello to show we are in CLR // Print Hello to show we are in CLR
Console.WriteLine("Hello from C#"); Console.WriteLine("Hello from C#");
if(aArgs.Length > 0) if(aArgs.Length > 0)
// invoke JVM // invoke JVM
return InvokeMain(aArgs[0]); return InvokeMain(aArgs[0]);
else else
return -1; return -1;
} }
// Link the JVM API functions and the wrappers // Link the JVM API functions and the wrappers
[DllImport("jvm.dll")] public unsafe static extern int JNI_CreateJavaVM(void** ppVm, void** ppEnv, void* pArgs); [DllImport("jvm.dll")] public unsafe static extern int JNI_CreateJavaVM(void** ppVm, void** ppEnv, void* pArgs);
[DllImport("jinvoker.dll")] public unsafe static extern int MakeJavaVMInitArgs( void** ppArgs ); [DllImport("jinvoker.dll")] public unsafe static extern int MakeJavaVMInitArgs( void** ppArgs );
[DllImport("jinvoker.dll")] public unsafe static extern void FreeJavaVMInitArgs( void* pArgs ); [DllImport("jinvoker.dll")] public unsafe static extern void FreeJavaVMInitArgs( void* pArgs );
[DllImport("jinvoker.dll")] public unsafe static extern int FindClass( void* pEnv, String sClass, void** ppClass ); [DllImport("jinvoker.dll")] public unsafe static extern int FindClass( void* pEnv, String sClass, void** ppClass );
[DllImport("jinvoker.dll")] public unsafe static extern int GetStaticMethodID( void* pEnv, [DllImport("jinvoker.dll")] public unsafe static extern int GetStaticMethodID( void* pEnv,
void* pClass, void* pClass,
...@@ -73,7 +73,7 @@ class jinvoker{ ...@@ -73,7 +73,7 @@ class jinvoker{
[DllImport("jinvoker.dll")] public unsafe static extern int DestroyJavaVM( void* pJVM ); [DllImport("jinvoker.dll")] public unsafe static extern int DestroyJavaVM( void* pJVM );
public unsafe static int InvokeMain( String sClass ){ public unsafe static int InvokeMain( String sClass ){
void* pJVM; // JVM struct void* pJVM; // JVM struct
void* pEnv; // JVM environment void* pEnv; // JVM environment
void* pVMArgs; // VM args void* pVMArgs; // VM args
...@@ -81,23 +81,23 @@ class jinvoker{ ...@@ -81,23 +81,23 @@ class jinvoker{
void* pMethod; // The executed method struct void* pMethod; // The executed method struct
void* pArgs; // The executed method arguments struct void* pArgs; // The executed method arguments struct
// Fill the pVMArgs structs // Fill the pVMArgs structs
MakeJavaVMInitArgs( &pVMArgs ); MakeJavaVMInitArgs( &pVMArgs );
// Create JVM // Create JVM
int nRes = JNI_CreateJavaVM( &pJVM, &pEnv, pVMArgs ); int nRes = JNI_CreateJavaVM( &pJVM, &pEnv, pVMArgs );
if( nRes == 0 ){ if( nRes == 0 ){
// Find the executed method class // Find the executed method class
if(FindClass( pEnv, sClass, &pClass) == 0 ) if(FindClass( pEnv, sClass, &pClass) == 0 )
// Find the executed method // Find the executed method
if( GetStaticMethodID( pEnv, pClass, "main", "([Ljava/lang/String;)V", &pMethod ) == 0 ) if( GetStaticMethodID( pEnv, pClass, "main", "([Ljava/lang/String;)V", &pMethod ) == 0 )
// Create empty String[] array to pass to the main() // Create empty String[] array to pass to the main()
if( NewObjectArray( pEnv, 0, "java/lang/String", &pArgs ) == 0 ){ if( NewObjectArray( pEnv, 0, "java/lang/String", &pArgs ) == 0 ){
// Call main() // Call main()
nRes = CallStaticVoidMethod( pEnv, pClass, pMethod, pArgs ); nRes = CallStaticVoidMethod( pEnv, pClass, pMethod, pArgs );
if( nRes != -1 ) if( nRes != -1 )
Console.WriteLine("Result:"+nRes); Console.WriteLine("Result:"+nRes);
...@@ -116,16 +116,16 @@ class jinvoker{ ...@@ -116,16 +116,16 @@ class jinvoker{
Console.WriteLine("can not find class:"+sClass); Console.WriteLine("can not find class:"+sClass);
nRes = -102; nRes = -102;
} }
// Destroy the JVM // Destroy the JVM
DestroyJavaVM( pJVM ); DestroyJavaVM( pJVM );
}else }else
Console.WriteLine("Can not create Java VM"); Console.WriteLine("Can not create Java VM");
// Free the JVM args structs // Free the JVM args structs
FreeJavaVMInitArgs(pVMArgs); FreeJavaVMInitArgs(pVMArgs);
return nRes; return nRes;
} }
} }
...@@ -42,10 +42,10 @@ PATH must contain the paths to: ...@@ -42,10 +42,10 @@ PATH must contain the paths to:
3. .NET SDK libraries 3. .NET SDK libraries
4. Java bin 4. Java bin
Example: %MSDEV%/VC98/Bin;%MSDEV%/Common/MSDev98/Bin;%DOTNET%/Lib;%JAVA_HOME%/bin;%PATH% Example: %MSDEV%/VC98/Bin;%MSDEV%/Common/MSDev98/Bin;%DOTNET%/Lib;%JAVA_HOME%/bin;%PATH%
To run the sample please do: To run the sample please do:
java invoker invoked.exe java invoker invoked.exe
--Dmitry Ryashchentsev --Dmitry Ryashchentsev
...@@ -29,17 +29,17 @@ ...@@ -29,17 +29,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/* /*
*/ */
using System; using System;
class App{ class App{
public static int Main(){ public static int Main(){
// Print Hello to show we are in CLR // Print Hello to show we are in CLR
Console.WriteLine("Hello from C#!!!"); Console.WriteLine("Hello from C#!!!");
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册