japi-cvs Mailing List for JAPI (Page 34)
Status: Beta
Brought to you by:
christianhujer
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(115) |
May
(11) |
Jun
(5) |
Jul
(2) |
Aug
(10) |
Sep
(35) |
Oct
(14) |
Nov
(49) |
Dec
(27) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(57) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(25) |
Jun
(134) |
Jul
(76) |
Aug
(34) |
Sep
(27) |
Oct
(5) |
Nov
|
Dec
(1) |
2008 |
Jan
(3) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(63) |
Nov
(30) |
Dec
(43) |
2009 |
Jan
(10) |
Feb
(420) |
Mar
(67) |
Apr
(3) |
May
(61) |
Jun
(21) |
Jul
(19) |
Aug
|
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
(7) |
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <chr...@us...> - 2007-08-20 20:22:53
|
Revision: 585 http://japi.svn.sourceforge.net/japi/?rev=585&view=rev Author: christianhujer Date: 2007-08-20 13:22:39 -0700 (Mon, 20 Aug 2007) Log Message: ----------- cosmetic: Removed unnecessary this. Modified Paths: -------------- libs/taglets/trunk/src/net/sf/japi/taglets/BlockListTaglet.java Modified: libs/taglets/trunk/src/net/sf/japi/taglets/BlockListTaglet.java =================================================================== --- libs/taglets/trunk/src/net/sf/japi/taglets/BlockListTaglet.java 2007-08-18 20:05:33 UTC (rev 584) +++ libs/taglets/trunk/src/net/sf/japi/taglets/BlockListTaglet.java 2007-08-20 20:22:39 UTC (rev 585) @@ -46,8 +46,8 @@ */ protected BlockListTaglet(@NotNull final String name, @NotNull final String title) { this.name = name; - this.singularTitle = title; - this.pluralTitle = title; + singularTitle = title; + pluralTitle = title; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-18 20:05:39
|
Revision: 584 http://japi.svn.sourceforge.net/japi/?rev=584&view=rev Author: christianhujer Date: 2007-08-18 13:05:33 -0700 (Sat, 18 Aug 2007) Log Message: ----------- Updated module and project files for IntelliJ IDEA 7.0M2. Modified Paths: -------------- common/trunk/common.iml historic/trunk/historic.iml japi.ipr libs/argparser/trunk/libs-argparser.iml libs/finance/trunk/libs-finance.iml libs/io/trunk/libs-io.iml libs/lang/trunk/libs-lang.iml libs/logging/trunk/libs-logging.iml libs/net/trunk/libs-net.iml libs/registry/trunk/libs-registry.iml libs/swing-about/trunk/libs-swing-about.iml libs/swing-action/trunk/libs-swing-action.iml libs/swing-app/trunk/libs-swing-app.iml libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml libs/swing-extlib/trunk/libs-swing-extlib.iml libs/swing-font/trunk/libs-swing-font.iml libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml libs/swing-list/trunk/libs-swing-list.iml libs/swing-misc/trunk/libs-swing-misc.iml libs/swing-prefs/trunk/libs-swing-prefs.iml libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml libs/swing-recent/trunk/libs-swing-recent.iml libs/swing-tod/trunk/libs-swing-tod.iml libs/swing-treetable/trunk/libs-swing-treetable.iml libs/taglets/trunk/libs-taglets.iml libs/util/trunk/libs-util.iml libs/xml/trunk/libs-xml.iml progs/jeduca/trunk/JEduca.iml site/trunk/site.iml tools/cstyle/trunk/cstyle.iml tools/findLongestPath/trunk/findLongestPath.iml tools/fontbrowser/trunk/fontbrowser.iml tools/jwget/trunk/jwget.iml tools/keystrokes/trunk/keystrokes.iml tools/prefsbrowser/trunk/prefsbrowser.iml tools/string2bytes/trunk/string2bytes.iml Modified: common/trunk/common.iml =================================================================== --- common/trunk/common.iml 2007-08-17 19:26:01 UTC (rev 583) +++ common/trunk/common.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: historic/trunk/historic.iml =================================================================== --- historic/trunk/historic.iml 2007-08-17 19:26:01 UTC (rev 583) +++ historic/trunk/historic.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: japi.ipr =================================================================== --- japi.ipr 2007-08-17 19:26:01 UTC (rev 583) +++ japi.ipr 2007-08-18 20:05:33 UTC (rev 584) @@ -6,7 +6,6 @@ <component name="BuildJarProjectSettings"> <option name="BUILD_JARS_ON_MAKE" value="false" /> </component> - <component name="ClearCase" /> <component name="CodeStyleProjectProfileManger"> <option name="PROJECT_PROFILE" /> <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" /> @@ -98,11 +97,12 @@ </wildcardResourcePatterns> </component> <component name="CppTools.Loader" warnedAboutFileOutOfSourceRoot="true" /> - <component name="DataSourceManagerImpl" /> <component name="DependenciesAnalyzeManager"> <option name="myForwardDirection" value="false" /> </component> - <component name="DependencyValidationManager" /> + <component name="DependencyValidationManager"> + <option name="SKIP_IMPORT_STATEMENTS" value="false" /> + </component> <component name="EclipseCompilerSettings"> <option name="DEBUGGING_INFO" value="true" /> <option name="GENERATE_NO_WARNINGS" value="true" /> @@ -125,7 +125,6 @@ <option name="OPEN_IN_BROWSER" value="false" /> <option name="OUTPUT_DIRECTORY" /> </component> - <component name="GUI Designer component loader factory" /> <component name="IdProvider" IDEtalkID="5E780004B4DFE6EEB324A7B925C9624D" /> <component name="InspectionProjectProfileManager"> <option name="PROJECT_PROFILE" value="Project Default" /> @@ -135,24 +134,6 @@ <profile version="1.0" is_locked="false"> <option name="myName" value="Project Default" /> <option name="myLocal" value="false" /> - <used_levels> - <error> - <option name="myName" value="ERROR" /> - <option name="myVal" value="400" /> - </error> - <warning> - <option name="myName" value="WARNING" /> - <option name="myVal" value="300" /> - </warning> - <information> - <option name="myName" value="INFO" /> - <option name="myVal" value="200" /> - </information> - <server> - <option name="myName" value="SERVER PROBLEM" /> - <option name="myVal" value="100" /> - </server> - </used_levels> <inspection_tool class="JavaDoc" level="WARNING" enabled="true"> <option name="TOP_LEVEL_CLASS_OPTIONS"> <value> @@ -244,6 +225,12 @@ <inspection_tool class="UnnecessaryQualifierForThis" level="WARNING" enabled="true" /> </profile> </profiles> + <list size="4"> + <item index="0" class="java.lang.String" itemvalue="SERVER PROBLEM" /> + <item index="1" class="java.lang.String" itemvalue="INFO" /> + <item index="2" class="java.lang.String" itemvalue="WARNING" /> + <item index="3" class="java.lang.String" itemvalue="ERROR" /> + </list> </component> <component name="InspectorGeneralConfiguration"> <option name="MAKE_CLASSES_AND_METHODS_FINAL_IF_NOT_OVERRIDDEN" value="false" /> @@ -301,7 +288,6 @@ <option name="FILTER_INFO" value="true" /> <option name="CUSTOM_FILTER" /> </component> - <component name="Monitor.Log4jWindowPlugin" /> <component name="Palette2"> <group name="Swing"> <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> @@ -423,6 +409,7 @@ </item> </group> </component> + <component name="ProjectFileVersion" converted="true" /> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/progs/jeduca/trunk/JEduca.iml" filepath="$PROJECT_DIR$/progs/jeduca/trunk/JEduca.iml" group="progs" /> @@ -465,7 +452,6 @@ <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/classes" /> </component> - <component name="ProjectRunConfigurationManager" /> <component name="ResourceManagerContainer"> <option name="myResourceBundles"> <value> @@ -480,12 +466,9 @@ <option name="GENERATE_IIOP_STUBS" value="false" /> <option name="ADDITIONAL_OPTIONS_STRING" value="" /> </component> - <component name="StarteamVcsAdapter" /> - <component name="SvnBranchConfigurationManager" /> <component name="VcsDirectoryMappings"> <mapping directory="" vcs="svn" /> </component> - <component name="VssVcs" /> <component name="com.intellij.jsf.UserDefinedFacesConfigs"> <option name="USER_DEFINED_CONFIGS"> <value> @@ -715,6 +698,5 @@ <SOURCES /> </library> </component> - <component name="uidesigner-configuration" /> </project> Modified: libs/argparser/trunk/libs-argparser.iml =================================================================== --- libs/argparser/trunk/libs-argparser.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/argparser/trunk/libs-argparser.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/finance/trunk/libs-finance.iml =================================================================== --- libs/finance/trunk/libs-finance.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/finance/trunk/libs-finance.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/io/trunk/libs-io.iml =================================================================== --- libs/io/trunk/libs-io.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/io/trunk/libs-io.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/lang/trunk/libs-lang.iml =================================================================== --- libs/lang/trunk/libs-lang.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/lang/trunk/libs-lang.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/logging/trunk/libs-logging.iml =================================================================== --- libs/logging/trunk/libs-logging.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/logging/trunk/libs-logging.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/net/trunk/libs-net.iml =================================================================== --- libs/net/trunk/libs-net.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/net/trunk/libs-net.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/registry/trunk/libs-registry.iml =================================================================== --- libs/registry/trunk/libs-registry.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/registry/trunk/libs-registry.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-about/trunk/libs-swing-about.iml =================================================================== --- libs/swing-about/trunk/libs-swing-about.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-about/trunk/libs-swing-about.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-action/trunk/libs-swing-action.iml =================================================================== --- libs/swing-action/trunk/libs-swing-action.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-action/trunk/libs-swing-action.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-app/trunk/libs-swing-app.iml =================================================================== --- libs/swing-app/trunk/libs-swing-app.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-app/trunk/libs-swing-app.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml =================================================================== --- libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-extlib/trunk/libs-swing-extlib.iml =================================================================== --- libs/swing-extlib/trunk/libs-swing-extlib.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-extlib/trunk/libs-swing-extlib.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-font/trunk/libs-swing-font.iml =================================================================== --- libs/swing-font/trunk/libs-swing-font.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-font/trunk/libs-swing-font.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml =================================================================== --- libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-list/trunk/libs-swing-list.iml =================================================================== --- libs/swing-list/trunk/libs-swing-list.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-list/trunk/libs-swing-list.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-misc/trunk/libs-swing-misc.iml =================================================================== --- libs/swing-misc/trunk/libs-swing-misc.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-misc/trunk/libs-swing-misc.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-prefs/trunk/libs-swing-prefs.iml =================================================================== --- libs/swing-prefs/trunk/libs-swing-prefs.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-prefs/trunk/libs-swing-prefs.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml =================================================================== --- libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-recent/trunk/libs-swing-recent.iml =================================================================== --- libs/swing-recent/trunk/libs-swing-recent.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-recent/trunk/libs-swing-recent.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-tod/trunk/libs-swing-tod.iml =================================================================== --- libs/swing-tod/trunk/libs-swing-tod.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-tod/trunk/libs-swing-tod.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/swing-treetable/trunk/libs-swing-treetable.iml =================================================================== --- libs/swing-treetable/trunk/libs-swing-treetable.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/swing-treetable/trunk/libs-swing-treetable.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/taglets/trunk/libs-taglets.iml =================================================================== --- libs/taglets/trunk/libs-taglets.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/taglets/trunk/libs-taglets.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/util/trunk/libs-util.iml =================================================================== --- libs/util/trunk/libs-util.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/util/trunk/libs-util.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: libs/xml/trunk/libs-xml.iml =================================================================== --- libs/xml/trunk/libs-xml.iml 2007-08-17 19:26:01 UTC (rev 583) +++ libs/xml/trunk/libs-xml.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: progs/jeduca/trunk/JEduca.iml =================================================================== --- progs/jeduca/trunk/JEduca.iml 2007-08-17 19:26:01 UTC (rev 583) +++ progs/jeduca/trunk/JEduca.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -43,6 +43,27 @@ <option name="fileLocation" value="1" /> <option name="useAlternate" value="false" /> </LanguageOptions> + <LanguageOptions name="CSS"> + <option name="templateOptions"> + <value> + <option name="block" value="true" /> + <option name="separateBefore" value="false" /> + <option name="separateAfter" value="false" /> + <option name="prefixLines" value="true" /> + <option name="lenBefore" value="80" /> + <option name="lenAfter" value="80" /> + <option name="box" value="false" /> + <option name="filler" value=" " /> + </value> + </option> + <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> + <option name="keyword" value="Copyright" /> + <option name="fileTypeOverride" value="2" /> + <option name="relativeBefore" value="true" /> + <option name="addBlankAfter" value="true" /> + <option name="fileLocation" value="1" /> + <option name="useAlternate" value="false" /> + </LanguageOptions> <LanguageOptions name="HTML"> <option name="templateOptions"> <value> Modified: site/trunk/site.iml =================================================================== --- site/trunk/site.iml 2007-08-17 19:26:01 UTC (rev 583) +++ site/trunk/site.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: tools/cstyle/trunk/cstyle.iml =================================================================== --- tools/cstyle/trunk/cstyle.iml 2007-08-17 19:26:01 UTC (rev 583) +++ tools/cstyle/trunk/cstyle.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: tools/findLongestPath/trunk/findLongestPath.iml =================================================================== --- tools/findLongestPath/trunk/findLongestPath.iml 2007-08-17 19:26:01 UTC (rev 583) +++ tools/findLongestPath/trunk/findLongestPath.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: tools/fontbrowser/trunk/fontbrowser.iml =================================================================== --- tools/fontbrowser/trunk/fontbrowser.iml 2007-08-17 19:26:01 UTC (rev 583) +++ tools/fontbrowser/trunk/fontbrowser.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: tools/jwget/trunk/jwget.iml =================================================================== --- tools/jwget/trunk/jwget.iml 2007-08-17 19:26:01 UTC (rev 583) +++ tools/jwget/trunk/jwget.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: tools/keystrokes/trunk/keystrokes.iml =================================================================== --- tools/keystrokes/trunk/keystrokes.iml 2007-08-17 19:26:01 UTC (rev 583) +++ tools/keystrokes/trunk/keystrokes.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: tools/prefsbrowser/trunk/prefsbrowser.iml =================================================================== --- tools/prefsbrowser/trunk/prefsbrowser.iml 2007-08-17 19:26:01 UTC (rev 583) +++ tools/prefsbrowser/trunk/prefsbrowser.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> Modified: tools/string2bytes/trunk/string2bytes.iml =================================================================== --- tools/string2bytes/trunk/string2bytes.iml 2007-08-17 19:26:01 UTC (rev 583) +++ tools/string2bytes/trunk/string2bytes.iml 2007-08-18 20:05:33 UTC (rev 584) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-17 19:26:05
|
Revision: 583 http://japi.svn.sourceforge.net/japi/?rev=583&view=rev Author: christianhujer Date: 2007-08-17 12:26:01 -0700 (Fri, 17 Aug 2007) Log Message: ----------- Replaced AboutGUI with AboutDialog. Modified Paths: -------------- progs/jeduca/trunk/JEduca.iml progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action.properties progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action_de.properties Removed Paths: ------------- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/AboutGUI.java Modified: progs/jeduca/trunk/JEduca.iml =================================================================== --- progs/jeduca/trunk/JEduca.iml 2007-08-17 19:00:49 UTC (rev 582) +++ progs/jeduca/trunk/JEduca.iml 2007-08-17 19:26:01 UTC (rev 583) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> @@ -16,6 +15,7 @@ <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="library" name="jlfgr-1_0" level="project" /> <orderEntry type="library" name="junit" level="project" /> + <orderEntry type="module" module-name="libs-swing-about" /> <orderEntryProperties /> </component> <component name="copyright"> @@ -43,27 +43,6 @@ <option name="fileLocation" value="1" /> <option name="useAlternate" value="false" /> </LanguageOptions> - <LanguageOptions name="CSS"> - <option name="templateOptions"> - <value> - <option name="block" value="true" /> - <option name="separateBefore" value="false" /> - <option name="separateAfter" value="false" /> - <option name="prefixLines" value="true" /> - <option name="lenBefore" value="80" /> - <option name="lenAfter" value="80" /> - <option name="box" value="false" /> - <option name="filler" value=" " /> - </value> - </option> - <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." /> - <option name="keyword" value="Copyright" /> - <option name="fileTypeOverride" value="2" /> - <option name="relativeBefore" value="true" /> - <option name="addBlankAfter" value="true" /> - <option name="fileLocation" value="1" /> - <option name="useAlternate" value="false" /> - </LanguageOptions> <LanguageOptions name="HTML"> <option name="templateOptions"> <value> Deleted: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/AboutGUI.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/AboutGUI.java 2007-08-17 19:00:49 UTC (rev 582) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/AboutGUI.java 2007-08-17 19:26:01 UTC (rev 583) @@ -1,82 +0,0 @@ -/* JAPI - (Yet another (hopefully) useful) Java API - * - * Copyright (C) 2004-2006 Christian Hujer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -package net.sf.japi.progs.jeduca.jtest.gui; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import javax.swing.JComponent; -import javax.swing.JEditorPane; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; - -/** Component to show an about dialog. - * @author $Author: chris $ - * @version $Id: AboutGUI.java,v 1.5 2006/01/31 23:09:18 chris Exp $ - * @todo fix layout - * @todo i18n - * @todo l10n - * @todo add tabbed pane - * @todo add tab with generic information and url - * @todo add tab with authors - * @todo add tab with translations - * @todo add tab with license - */ -public class AboutGUI extends JComponent { - - /** HTML for about. */ - private static final String ABOUT_HTML = "<html><head><meta http-equiv='Content-Type' content='text/html'></meta><title>Über</title></head><body><h1>Über</h1><p>JTest Version 1.0</p><p>© 2004 Chrsitian Hujer. Alle Rechte vorbehalten.</p></body></html>"; - - /** HTML for bugs. */ - private static final String BUGS_HTML = "<html><head><meta http-equiv='Content-Type' content='text/html'></meta><title>Bugs</title></head><body><h1>Bugs</h1><p>Berichten Sie Bugs und Wünsche an: <a href='http://japi.sourceforge.net/'>http://japi.sourceforge.net/</a> oder per Mail an den Autor: <a href='mailto:ch...@ri...'>ch...@ri...</a></p></body></html>"; - - /** HTML for authors. */ - private static final String AUTHORS_HTML = "<html><head><meta http-equiv='Content-Type' content='text/html'></meta><title>Autoren</title></head><body><h1>Autoren</h1><p>JTest Version 1.0 wurde entwickelt von:</p><ul><li><a href='mailto:ch...@ri...'>Chrsitian Hujer</a></li></ul></body></html>"; - - /** HTML for license. */ - private static final String LICENSE_HTML = "License: TODO"; // TODO - - /** Create an AboutGUI. */ - public AboutGUI() { - setLayout(new BorderLayout()); - final JTabbedPane tabs = new JTabbedPane(); - tabs.add("DummyAbout", createPanelComponent(ABOUT_HTML)); - tabs.add("DummyBugs", createPanelComponent(BUGS_HTML)); - tabs.add("DummyAuthors", createPanelComponent(AUTHORS_HTML)); - tabs.add("DummyLicense", createPanelComponent(LICENSE_HTML)); - add(tabs); - //setMinimumSize(getPreferredSize()); - //setSize(getPreferredSize()); - //setMinimumSize(new Dimension(200, 200)); - setPreferredSize(new Dimension(300, 200)); - //setSize(new Dimension(200, 200)); - } - - /** Create a panel component. - * @param text Text to display - * @return panel component - */ - private static JComponent createPanelComponent(final String text) { - final JEditorPane panelComp = new JEditorPane("text/html", text); - panelComp.setEditable(false); - return new JScrollPane(panelComp); - } - -} // class AboutGUI Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java 2007-08-17 19:00:49 UTC (rev 582) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java 2007-08-17 19:26:01 UTC (rev 583) @@ -39,7 +39,6 @@ import javax.swing.JMenuItem; import javax.swing.JOptionPane; import static javax.swing.JOptionPane.ERROR_MESSAGE; -import static javax.swing.JOptionPane.INFORMATION_MESSAGE; import static javax.swing.JOptionPane.YES_NO_OPTION; import static javax.swing.JOptionPane.YES_OPTION; import javax.swing.JToolBar; @@ -58,6 +57,7 @@ import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.LookAndFeelManager; import net.sf.japi.swing.ToolBarLayout; +import net.sf.japi.swing.about.AboutDialog; import net.sf.japi.swing.bookmarks.BookmarkManager; import net.sf.japi.swing.bookmarks.Bookmarkable; import org.jetbrains.annotations.NotNull; @@ -277,9 +277,12 @@ } } + /** The AboutDialog. */ + private final AboutDialog aboutDialog = new AboutDialog(ACTION_BUILDER); + /** About Action. */ public void about() { - JOptionPane.showMessageDialog(this, new AboutGUI(), RES.getString("about.text"), INFORMATION_MESSAGE); + aboutDialog.showAboutDialog(this); } /** Action for doc. Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action.properties =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action.properties 2007-08-17 19:00:49 UTC (rev 582) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action.properties 2007-08-17 19:26:01 UTC (rev 583) @@ -181,3 +181,6 @@ delete.mnemonic=D selectFile.icon=general/Open16 + +about=<html><head><meta http-equiv='Content-Type' content='text/html'></meta><title>About</title></head><body><h1>About</h1><p>JEduca Version 1.0</p><p>\xA9 2004-2007 Chrsitian Hujer. All rights reserved.</p></body></html> +application.name=JEduca Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action_de.properties =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action_de.properties 2007-08-17 19:00:49 UTC (rev 582) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/action_de.properties 2007-08-17 19:26:01 UTC (rev 583) @@ -181,3 +181,5 @@ delete.mnemonic=L #selectFile.icon= +about=<html><head><meta http-equiv='Content-Type' content='text/html'></meta><title>\xDCber</title></head><body><h1>\xDCber</h1><p>JEduca Version 1.0</p><p>\xA9 2004-2007 Chrsitian Hujer. Alle Rechte vorbehalten.</p></body></html> +application.name=JEduca This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-17 19:00:54
|
Revision: 582 http://japi.svn.sourceforge.net/japi/?rev=582&view=rev Author: christianhujer Date: 2007-08-17 12:00:49 -0700 (Fri, 17 Aug 2007) Log Message: ----------- Add key as information to the NPE thrown by format(). Modified Paths: -------------- libs/swing-action/trunk/src/net/sf/japi/swing/DefaultActionBuilder.java Modified: libs/swing-action/trunk/src/net/sf/japi/swing/DefaultActionBuilder.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/DefaultActionBuilder.java 2007-08-15 16:41:40 UTC (rev 581) +++ libs/swing-action/trunk/src/net/sf/japi/swing/DefaultActionBuilder.java 2007-08-17 19:00:49 UTC (rev 582) @@ -907,7 +907,11 @@ * @see MessageFormat#format(String,Object...) */ public String format(@NotNull final String key, final Object... args) { - return MessageFormat.format(getString(key), args); + try { + return MessageFormat.format(getString(key), args); + } catch (final NullPointerException e) { + throw new NullPointerException("No format for key " + key + " (" + e + ")"); + } } /** Show a localized confirmation dialog which the user can suppress in future (remembering his choice). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-15 16:41:43
|
Revision: 581 http://japi.svn.sourceforge.net/japi/?rev=581&view=rev Author: christianhujer Date: 2007-08-15 09:41:40 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Added missing @NotNull / @Nullable annotations. Modified Paths: -------------- libs/lang/trunk/src/net/sf/japi/lang/PropertyComparator.java libs/lang/trunk/src/net/sf/japi/lang/SuperClassIterator.java libs/net/trunk/src/net/sf/japi/net/Forwarder.java Modified: libs/lang/trunk/src/net/sf/japi/lang/PropertyComparator.java =================================================================== --- libs/lang/trunk/src/net/sf/japi/lang/PropertyComparator.java 2007-08-15 16:40:40 UTC (rev 580) +++ libs/lang/trunk/src/net/sf/japi/lang/PropertyComparator.java 2007-08-15 16:41:40 UTC (rev 581) @@ -42,7 +42,7 @@ @Nullable private final Comparator<T> delegate; /** The name of the property to get. */ - private final String propertyName; + @NotNull private final String propertyName; /** The getter to read the property. */ @Nullable private final Method getter; @@ -113,7 +113,7 @@ /** Returns the property name of the property that's compared by this PropertyComparator. * @return Property name. */ - public String getPropertyName() { + @NotNull public String getPropertyName() { return propertyName; } Modified: libs/lang/trunk/src/net/sf/japi/lang/SuperClassIterator.java =================================================================== --- libs/lang/trunk/src/net/sf/japi/lang/SuperClassIterator.java 2007-08-15 16:40:40 UTC (rev 580) +++ libs/lang/trunk/src/net/sf/japi/lang/SuperClassIterator.java 2007-08-15 16:41:40 UTC (rev 581) @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -47,7 +48,7 @@ } /** {@inheritDoc} */ - public Class<?> next() { + @NotNull public Class<?> next() { if (nextClass == null) { throw new NoSuchElementException(); } @@ -64,7 +65,7 @@ } /** {@inheritDoc} */ - public Iterator<Class<?>> iterator() { + @NotNull public Iterator<Class<?>> iterator() { return this; } Modified: libs/net/trunk/src/net/sf/japi/net/Forwarder.java =================================================================== --- libs/net/trunk/src/net/sf/japi/net/Forwarder.java 2007-08-15 16:40:40 UTC (rev 580) +++ libs/net/trunk/src/net/sf/japi/net/Forwarder.java 2007-08-15 16:41:40 UTC (rev 581) @@ -25,6 +25,7 @@ import java.net.ServerSocket; import java.net.Socket; import net.sf.japi.io.Copier; +import org.jetbrains.annotations.NotNull; /** This class forwards incoming TCP connections to another host and port. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -55,16 +56,16 @@ } /** First socket. */ - private final Socket s1; + @NotNull private final Socket s1; /** Second socket. */ - private final Socket s2; + @NotNull private final Socket s2; /** Create a new Forwarder. * @param s1 first socket * @param s2 second socket */ - public Forwarder(final Socket s1, final Socket s2) { + public Forwarder(@NotNull final Socket s1, @NotNull final Socket s2) { this.s1 = s1; this.s2 = s2; } @@ -86,10 +87,8 @@ } catch (final IOException e) { e.printStackTrace(); //TODO } finally { - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { s1.close(); } catch (final Exception ignore) { /* ignore */ } - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { s2.close(); } catch (final Exception ignore) { /* ignore */ } + try { s1.close(); } catch (final IOException ignore) { /* ignore */ } + try { s2.close(); } catch (final IOException ignore) { /* ignore */ } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-15 16:40:42
|
Revision: 580 http://japi.svn.sourceforge.net/japi/?rev=580&view=rev Author: christianhujer Date: 2007-08-15 09:40:40 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Allow null as array element in array concatenation. Modified Paths: -------------- libs/util/trunk/src/net/sf/japi/util/Arrays2.java Modified: libs/util/trunk/src/net/sf/japi/util/Arrays2.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/Arrays2.java 2007-08-15 16:11:00 UTC (rev 579) +++ libs/util/trunk/src/net/sf/japi/util/Arrays2.java 2007-08-15 16:40:40 UTC (rev 580) @@ -51,12 +51,19 @@ @NotNull public static double[] concat(@NotNull final double[]... a) { int ns = 0; for (final double[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final double[] na = new double[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final double[] anA : a) { + if (anA != null) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; + } } + assert ns == np; return na; } @@ -67,12 +74,19 @@ @NotNull public static float[] concat(@NotNull final float[]... a) { int ns = 0; for (final float[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final float[] na = new float[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final float[] anA : a) { + if (anA != null) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; + } } + assert ns == np; return na; } @@ -83,12 +97,17 @@ @NotNull public static long[] concat(@NotNull final long[]... a) { int ns = 0; for (final long[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final long[] na = new long[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final long[] anA : a) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; } + assert ns == np; return na; } @@ -99,12 +118,17 @@ @NotNull public static int[] concat(@NotNull final int[]... a) { int ns = 0; for (final int[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final int[] na = new int[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final int[] anA : a) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; } + assert ns == np; return na; } @@ -115,12 +139,17 @@ @NotNull public static short[] concat(@NotNull final short[]... a) { int ns = 0; for (final short[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final short[] na = new short[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final short[] anA : a) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; } + assert ns == np; return na; } @@ -131,12 +160,17 @@ @NotNull public static char[] concat(@NotNull final char[]... a) { int ns = 0; for (final char[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final char[] na = new char[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final char[] anA : a) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; } + assert ns == np; return na; } @@ -147,12 +181,17 @@ @NotNull public static byte[] concat(@NotNull final byte[]... a) { int ns = 0; for (final byte[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final byte[] na = new byte[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final byte[] anA : a) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; } + assert ns == np; return na; } @@ -163,12 +202,17 @@ @NotNull public static boolean[] concat(@NotNull final boolean[]... a) { int ns = 0; for (final boolean[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } final boolean[] na = new boolean[ns]; - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final boolean[] anA : a) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; } + assert ns == np; return na; } @@ -179,13 +223,18 @@ @NotNull public static <T> T[] concat(@NotNull final T[]... a) { int ns = 0; for (final T[] anA : a) { - ns += anA.length; + if (anA != null) { + ns += anA.length; + } } //noinspection unchecked final T[] na = (T[]) Array.newInstance(a[0].getClass().getComponentType(), ns); - for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { - System.arraycopy(a[i], 0, na, np, a[i].length); + int np = 0; + for (final T[] anA : a) { + System.arraycopy(anA, 0, na, np, anA.length); + np += anA.length; } + assert ns == np; return na; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-15 16:11:08
|
Revision: 579 http://japi.svn.sourceforge.net/japi/?rev=579&view=rev Author: christianhujer Date: 2007-08-15 09:11:00 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Changed global libraries to module libraries. Modified Paths: -------------- libs/finance/trunk/libs-finance.iml libs/io/trunk/libs-io.iml libs/lang/trunk/libs-lang.iml libs/logging/trunk/libs-logging.iml libs/net/trunk/libs-net.iml libs/registry/trunk/libs-registry.iml libs/swing-about/trunk/libs-swing-about.iml libs/swing-action/trunk/libs-swing-action.iml libs/swing-app/trunk/libs-swing-app.iml libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml libs/swing-extlib/trunk/libs-swing-extlib.iml libs/swing-font/trunk/libs-swing-font.iml libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml libs/swing-list/trunk/libs-swing-list.iml libs/swing-misc/trunk/libs-swing-misc.iml libs/swing-prefs/trunk/libs-swing-prefs.iml libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml libs/swing-recent/trunk/libs-swing-recent.iml libs/swing-tod/trunk/libs-swing-tod.iml libs/swing-treetable/trunk/libs-swing-treetable.iml libs/taglets/trunk/libs-taglets.iml libs/util/trunk/libs-util.iml libs/xml/trunk/libs-xml.iml progs/jeduca/trunk/JEduca.iml Modified: libs/finance/trunk/libs-finance.iml =================================================================== --- libs/finance/trunk/libs-finance.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/finance/trunk/libs-finance.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,7 +8,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/io/trunk/libs-io.iml =================================================================== --- libs/io/trunk/libs-io.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/io/trunk/libs-io.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -17,6 +17,15 @@ <SOURCES /> </library> </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/lang/trunk/libs-lang.iml =================================================================== --- libs/lang/trunk/libs-lang.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/lang/trunk/libs-lang.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,10 +9,18 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="module-library"> <library> <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> </CLASSES> <JAVADOC /> Modified: libs/logging/trunk/libs-logging.iml =================================================================== --- libs/logging/trunk/libs-logging.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/logging/trunk/libs-logging.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,7 +8,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/net/trunk/libs-net.iml =================================================================== --- libs/net/trunk/libs-net.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/net/trunk/libs-net.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,6 +9,24 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-io" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/registry/trunk/libs-registry.iml =================================================================== --- libs/registry/trunk/libs-registry.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/registry/trunk/libs-registry.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,7 +8,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-about/trunk/libs-swing-about.iml =================================================================== --- libs/swing-about/trunk/libs-swing-about.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-about/trunk/libs-swing-about.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,7 +9,24 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-swing-action" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-action/trunk/libs-swing-action.iml =================================================================== --- libs/swing-action/trunk/libs-swing-action.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-action/trunk/libs-swing-action.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -10,8 +10,24 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-lang" /> - <orderEntry type="library" name="annotations" level="project" /> - <orderEntry type="library" name="junit" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-app/trunk/libs-swing-app.iml =================================================================== --- libs/swing-app/trunk/libs-swing-app.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-app/trunk/libs-swing-app.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,7 +8,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml =================================================================== --- libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-bookmarks/trunk/libs-swing-bookmarks.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -11,7 +11,24 @@ <orderEntry type="module" module-name="libs-swing-action" /> <orderEntry type="module" module-name="libs-util" /> <orderEntry type="module" module-name="libs-swing-app" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-extlib/trunk/libs-swing-extlib.iml =================================================================== --- libs/swing-extlib/trunk/libs-swing-extlib.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-extlib/trunk/libs-swing-extlib.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,7 +9,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-font/trunk/libs-swing-font.iml =================================================================== --- libs/swing-font/trunk/libs-swing-font.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-font/trunk/libs-swing-font.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,7 +9,24 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-swing-action" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml =================================================================== --- libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-keyprefs/trunk/libs-swing-keyprefs.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -11,7 +11,24 @@ <orderEntry type="module" module-name="libs-swing-action" /> <orderEntry type="module" module-name="libs-swing-prefs" /> <orderEntry type="module" module-name="libs-swing-treetable" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-list/trunk/libs-swing-list.iml =================================================================== --- libs/swing-list/trunk/libs-swing-list.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-list/trunk/libs-swing-list.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,9 +9,25 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> - <orderEntry type="library" name="junit" level="project" /> <orderEntry type="module" module-name="libs-swing-action" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-misc/trunk/libs-swing-misc.iml =================================================================== --- libs/swing-misc/trunk/libs-swing-misc.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-misc/trunk/libs-swing-misc.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,7 +9,24 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-swing-action" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-prefs/trunk/libs-swing-prefs.iml =================================================================== --- libs/swing-prefs/trunk/libs-swing-prefs.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-prefs/trunk/libs-swing-prefs.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -10,7 +10,24 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-swing-action" /> <orderEntry type="module" module-name="libs-swing-extlib" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml =================================================================== --- libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-proxyprefs/trunk/libs-swing-proxyprefs.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -10,7 +10,24 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-swing-action" /> <orderEntry type="module" module-name="libs-swing-prefs" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-recent/trunk/libs-swing-recent.iml =================================================================== --- libs/swing-recent/trunk/libs-swing-recent.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-recent/trunk/libs-swing-recent.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,7 +8,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-tod/trunk/libs-swing-tod.iml =================================================================== --- libs/swing-tod/trunk/libs-swing-tod.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-tod/trunk/libs-swing-tod.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,7 +9,24 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="libs-swing-action" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/swing-treetable/trunk/libs-swing-treetable.iml =================================================================== --- libs/swing-treetable/trunk/libs-swing-treetable.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/swing-treetable/trunk/libs-swing-treetable.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,7 +8,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/taglets/trunk/libs-taglets.iml =================================================================== --- libs/taglets/trunk/libs-taglets.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/taglets/trunk/libs-taglets.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,8 +8,25 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="library" name="tools" level="application" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/util/trunk/libs-util.iml =================================================================== --- libs/util/trunk/libs-util.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/util/trunk/libs-util.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -9,8 +9,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> - <orderEntry type="library" name="junit" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/xml/trunk/libs-xml.iml =================================================================== --- libs/xml/trunk/libs-xml.iml 2007-08-15 15:41:53 UTC (rev 578) +++ libs/xml/trunk/libs-xml.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -8,7 +8,24 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="annotations" level="project" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: progs/jeduca/trunk/JEduca.iml =================================================================== --- progs/jeduca/trunk/JEduca.iml 2007-08-15 15:41:53 UTC (rev 578) +++ progs/jeduca/trunk/JEduca.iml 2007-08-15 16:11:00 UTC (rev 579) @@ -11,10 +11,11 @@ <orderEntry type="module" module-name="libs-swing-action" /> <orderEntry type="module" module-name="libs-swing-extlib" /> <orderEntry type="module" module-name="libs-swing-bookmarks" /> - <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="module" module-name="libs-swing-app" /> <orderEntry type="module" module-name="libs-xml" /> + <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="library" name="jlfgr-1_0" level="project" /> + <orderEntry type="library" name="junit" level="project" /> <orderEntryProperties /> </component> <component name="copyright"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-15 15:41:55
|
Revision: 578 http://japi.svn.sourceforge.net/japi/?rev=578&view=rev Author: christianhujer Date: 2007-08-15 08:41:53 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Added missing @NotNull / @Nullable annotations. Modified Paths: -------------- libs/io/trunk/libs-io.iml libs/io/trunk/src/net/sf/japi/io/Copier.java Modified: libs/io/trunk/libs-io.iml =================================================================== --- libs/io/trunk/libs-io.iml 2007-08-15 13:10:25 UTC (rev 577) +++ libs/io/trunk/libs-io.iml 2007-08-15 15:41:53 UTC (rev 578) @@ -8,6 +8,15 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/common/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="copyright"> Modified: libs/io/trunk/src/net/sf/japi/io/Copier.java =================================================================== --- libs/io/trunk/src/net/sf/japi/io/Copier.java 2007-08-15 13:10:25 UTC (rev 577) +++ libs/io/trunk/src/net/sf/japi/io/Copier.java 2007-08-15 15:41:53 UTC (rev 578) @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import org.jetbrains.annotations.NotNull; /** A Runnable that copies from an InputStream to an OutputStream. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -40,10 +41,10 @@ public static final boolean DEFAULT_AUTO_CLOSE = true; /** The InputStream to read from. */ - private final InputStream in; + @NotNull private final InputStream in; /** The OutputStream to write to. */ - private final OutputStream out; + @NotNull private final OutputStream out; /** The buffer size to use. */ private final int bufSize; @@ -58,7 +59,7 @@ * @param in the InputStream to read from * @param out the OutputStream to write to */ - public Copier(final InputStream in, final OutputStream out) { + public Copier(@NotNull final InputStream in, @NotNull final OutputStream out) { this(in, out, DEFAULT_BUF_SIZE, DEFAULT_AUTO_FLUSH, DEFAULT_AUTO_CLOSE); } @@ -67,7 +68,7 @@ * @param out the OutputStream to write to * @param bufSize buffer size to use while copying */ - public Copier(final InputStream in, final OutputStream out, final int bufSize) { + public Copier(@NotNull final InputStream in, @NotNull final OutputStream out, final int bufSize) { this(in, out, bufSize, DEFAULT_AUTO_FLUSH, DEFAULT_AUTO_CLOSE); } @@ -78,7 +79,7 @@ * @param autoFlush whether to flush automatically (true for automatic flush, false for flush on close) * @param autoClose whether to close the streams automatically (true for automatic close, false for no close) */ - public Copier(final InputStream in, final OutputStream out, final int bufSize, final boolean autoFlush, final boolean autoClose) { + public Copier(@NotNull final InputStream in, @NotNull final OutputStream out, final int bufSize, final boolean autoFlush, final boolean autoClose) { this.in = in; this.out = out; this.bufSize = bufSize; @@ -89,7 +90,7 @@ /** Start the copier in a new thread. * @return the newly created thread */ - public Thread start() { + @NotNull public Thread start() { final Thread thread = new Thread(this); thread.start(); return thread; @@ -108,13 +109,10 @@ } catch (final IOException e) { System.err.println(e); } finally { - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { out.flush(); } catch (final Exception ignore) { /* ignore */ } + try { out.flush(); } catch (final IOException ignore) { /* ignore */ } if (autoClose) { - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { out.close(); } catch (final Exception ignore) { /* ignore */ } - //noinspection CatchGenericClass,OverlyBroadCatchBlock - try { in.close(); } catch (final Exception ignore) { /* ignore */ } + try { out.close(); } catch (final IOException ignore) { /* ignore */ } + try { in.close(); } catch (final IOException ignore) { /* ignore */ } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-15 13:10:27
|
Revision: 577 http://japi.svn.sourceforge.net/japi/?rev=577&view=rev Author: christianhujer Date: 2007-08-15 06:10:25 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Updated taglets lib. Modified Paths: -------------- common/trunk/antlib/japi-lib-taglets-trunk.jar Modified: common/trunk/antlib/japi-lib-taglets-trunk.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-15 13:00:39
|
Revision: 576 http://japi.svn.sourceforge.net/japi/?rev=576&view=rev Author: christianhujer Date: 2007-08-15 06:00:38 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Renamed @precondition to @pre and @postcondition to @post to be more compatible with Doxygen. Modified Paths: -------------- libs/taglets/trunk/CHANGES libs/taglets/trunk/src/doc/start.xhtml libs/taglets/trunk/src/net/sf/japi/taglets/PostconditionTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/PreconditionTaglet.java Modified: libs/taglets/trunk/CHANGES =================================================================== --- libs/taglets/trunk/CHANGES 2007-08-15 11:14:37 UTC (rev 575) +++ libs/taglets/trunk/CHANGES 2007-08-15 13:00:38 UTC (rev 576) @@ -1,6 +1,11 @@ JAPI TAGLETS CHANGLOG --------------------- +2007-08-15 + Christian Hujer: + * Renamed @precondition to @pre to be compatible with Doxygen. + * Renamed @postcondition to @post to be compatible with Doxygen. + 2007 Christian Hujer: * Creation Modified: libs/taglets/trunk/src/doc/start.xhtml =================================================================== --- libs/taglets/trunk/src/doc/start.xhtml 2007-08-15 11:14:37 UTC (rev 575) +++ libs/taglets/trunk/src/doc/start.xhtml 2007-08-15 13:00:38 UTC (rev 576) @@ -55,8 +55,8 @@ Contract Taglets <ul> <li><a href="#tl_invariant"><code>@invariant</code></a></li> - <li><a href="#tl_precondition"><code>@precondition</code></a></li> - <li><a href="#tl_postcondition"><code>@postcondition</code></a></li> + <li><a href="#tl_pre"><code>@pre</code></a></li> + <li><a href="#tl_post"><code>@post</code></a></li> <li><a href="#tl_retval"><code>@retval</code></a></li> </ul> </li> @@ -100,26 +100,26 @@ <p> The <code>@note</code> taglet can be used to highlight notes for users of a symbol. </p> - <h3 id="tl_postcondition"><code>@postcondition</code></h3> + <h3 id="tl_post"><code>@post</code></h3> <p> - The <code>@postcondition</code> taglet can be used to denote postconditions for an operation's contract. + The <code>@post</code> taglet can be used to denote postconditions for an operation's contract. </p> <h4>Example</h4> <pre><![CDATA[ /** Sorts a list in ascending order. * @param list List to sort - * @postcondition <var>list</var> is sorted in ascending order + * @post <var>list</var> is sorted in ascending order */ public static void sort(final List<? extends Comparable> list) { /* ... */}]]></pre> - <h3 id="tl_precondition"><code>@precondition</code></h3> + <h3 id="tl_pre"><code>@pre</code></h3> <p> - The <code>@precondition</code> taglet can be used to denote preconditions for an operation's contract. + The <code>@pre</code> taglet can be used to denote preconditions for an operation's contract. </p> <h4>Example</h4> <pre><![CDATA[ /** Performs a binary search over a list to search the desired element. * @param list List to perform binary search on * @param element Element to search for * @return index of <var>element</var> in <var>list</var> or <code>-1</code> if not found - * @precondition <var>list</var> is sorted in ascending order + * @pre <var>list</var> is sorted in ascending order */ public static <T> int binarySearch(final List<T> list, final T element) { /* ... */ }]]></pre> <h3 id="tl_retval"><code>@retval</code></h3> Modified: libs/taglets/trunk/src/net/sf/japi/taglets/PostconditionTaglet.java =================================================================== --- libs/taglets/trunk/src/net/sf/japi/taglets/PostconditionTaglet.java 2007-08-15 11:14:37 UTC (rev 575) +++ libs/taglets/trunk/src/net/sf/japi/taglets/PostconditionTaglet.java 2007-08-15 13:00:38 UTC (rev 576) @@ -34,7 +34,7 @@ * Create a PostconditionTaglet. */ private PostconditionTaglet() { - super("postcondition", "Postcondition", "Postconditions"); + super("post", "Postcondition", "Postconditions"); } /** {@inheritDoc} */ Modified: libs/taglets/trunk/src/net/sf/japi/taglets/PreconditionTaglet.java =================================================================== --- libs/taglets/trunk/src/net/sf/japi/taglets/PreconditionTaglet.java 2007-08-15 11:14:37 UTC (rev 575) +++ libs/taglets/trunk/src/net/sf/japi/taglets/PreconditionTaglet.java 2007-08-15 13:00:38 UTC (rev 576) @@ -34,7 +34,7 @@ * Create a PreconditionTaglet. */ private PreconditionTaglet() { - super("precondition", "Precondition", "Preconditions"); + super("pre", "Precondition", "Preconditions"); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-15 11:14:40
|
Revision: 575 http://japi.svn.sourceforge.net/japi/?rev=575&view=rev Author: christianhujer Date: 2007-08-15 04:14:37 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Added DummyActionBuilder for unit testing. Added Paths: ----------- libs/swing-action/trunk/src/net/sf/japi/swing/DummyActionBuilder.java Added: libs/swing-action/trunk/src/net/sf/japi/swing/DummyActionBuilder.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/DummyActionBuilder.java (rev 0) +++ libs/swing-action/trunk/src/net/sf/japi/swing/DummyActionBuilder.java 2007-08-15 11:14:37 UTC (rev 575) @@ -0,0 +1,246 @@ +/* + * JAPI libs-swing-action is a library for creating and managing javax.swing.Action objects. + * Copyright (C) 2007 Christian Hujer. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.sf.japi.swing; + +import java.awt.Component; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.prefs.Preferences; +import javax.swing.Action; +import javax.swing.ActionMap; +import javax.swing.Icon; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.JToolBar; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** The DummyActionBuilder is an implementation of {@link ActionBuilder} that actually does not provide any features. + * All methods are implemented empty. + * The purpose of the DummyActionBuilder is to be subclassed for the creation of MockActionBuilders for unit testing. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class DummyActionBuilder implements ActionBuilder { + + /** The ActionMap. + * The DummyActionBuilder at least needs an ActionMap to fulfil the contract of ActionBuilder regarding nullability. + */ + private ActionMap actionMap = new ActionMap(); + + /** {@inheritDoc} */ + public void addBundle(@NotNull final String baseName) { + } + + /** {@inheritDoc} */ + @NotNull public ActionMap getActionMap() { + return actionMap; + } + + /** {@inheritDoc} */ + public void addBundle(@NotNull final ResourceBundle bundle) throws NullPointerException { + } + + /** {@inheritDoc} */ + public void addParent(@NotNull final ActionBuilder parent) throws NullPointerException { + } + + /** {@inheritDoc} */ + public void addPref(@NotNull final Preferences pref) throws NullPointerException { + } + + /** {@inheritDoc} */ + public void addPref(@NotNull final Class<?> clazz) { + } + + /** {@inheritDoc} */ + public Action[] createActions(final boolean store, @NotNull final String... keys) throws NullPointerException { + return new Action[0];//To change body of implemented methods use File | Settings | File Templates. + } + + /** {@inheritDoc} */ + public Action createAction(final boolean store, @NotNull final String key) throws NullPointerException { + return null; + } + + /** {@inheritDoc} */ + @SuppressWarnings({"NestedAssignment"}) @NotNull + public Action initAction(final boolean store, @NotNull final Action action, @NotNull final String key) throws NullPointerException { + return action; + } + + /** {@inheritDoc} */ + @Nullable public String getString(@NotNull final String key) throws NullPointerException { + return null; + } + + /** {@inheritDoc} */ + @Nullable public String getStringFromPrefs(@NotNull final String key) throws NullPointerException { + return null; + } + + /** {@inheritDoc} */ + @Nullable public String getStringFromBundles(@NotNull final String key) throws NullPointerException { + return null; + } + + /** {@inheritDoc} */ + public Action[] createActions(final boolean store, final Object target, final String... keys) throws NullPointerException { + return new Action[0];//To change body of implemented methods use File | Settings | File Templates. + } + + /** {@inheritDoc} */ + public Action createAction(final boolean store, final String key, final Object object) throws NullPointerException { + return null; + } + + /** {@inheritDoc} */ + public JMenu createMenu(final boolean store, final String menuKey, final String... keys) throws Error { + return null; + } + + /** {@inheritDoc} */ + @Nullable public Action getAction(@NotNull final String key) { + return null; + } + + /** {@inheritDoc} */ + @NotNull public JMenuBar createMenuBar(final boolean store, final String barKey) throws NullPointerException { + return new JMenuBar(); + } + + /** {@inheritDoc} */ + @NotNull public JPopupMenu createPopupMenu(final boolean store, final String popupKey) throws MissingResourceException { + return new JPopupMenu(); + } + + /** {@inheritDoc} */ + public JMenu createMenu(final boolean store, final String menuKey) throws MissingResourceException { + return null; + } + + /** {@inheritDoc} */ + public JMenuBar createMenuBar(final boolean store, final String barKey, final Object target) throws MissingResourceException { + return null; + } + + /** {@inheritDoc} */ + public JPopupMenu createPopupMenu(final boolean store, final String popupKey, final Object target) throws MissingResourceException { + return null; + } + + /** {@inheritDoc} */ + public JMenu createMenu(final boolean store, final String menuKey, final Object target) throws Error { + return null; + } + + /** {@inheritDoc} */ + public void createToggles(final boolean store, final Object target, final String... keys) throws NullPointerException { + } + + /** {@inheritDoc} */ + public Action createToggle(final boolean store, final String key, final Object object) throws NullPointerException { + return null; + } + + /** {@inheritDoc} */ + public JToolBar createToolBar(final String... keys) { + return null; + } + + /** {@inheritDoc} */ + public JToolBar createToolBar(final String barKey) throws MissingResourceException { + return null; + } + + /** {@inheritDoc} */ + public JToolBar createToolBar(final Object object, final String... keys) { + return null; + } + + /** {@inheritDoc} */ + public JToolBar createToolBar(final Object object, final String barKey) throws MissingResourceException { + return null; + } + + /** {@inheritDoc} */ + @Nullable public JMenuItem find(@NotNull final JMenuBar menuBar, @NotNull final String key) { + return null; + } + + /** {@inheritDoc} */ + public Icon getIcon(final String key) { + return null; + } + + /** {@inheritDoc} */ + @Deprecated public void showMessageDialog(final Component parentComponent, final int messageType, final String key, final Object... args) { + } + + /** {@inheritDoc} */ + public void showMessageDialog(@Nullable final Component parentComponent, @NotNull final String key, final Object... args) { + } + + /** {@inheritDoc} */ + public int getMessageType(@NotNull final String dialogKey) { + return 0; + } + + /** {@inheritDoc} */ + public String format(@NotNull final String key, final Object... args) { + return null; + } + + /** {@inheritDoc} */ + public int showOnetimeConfirmDialog(@Nullable final Component parentComponent, final int optionType, final int messageType, @NotNull final String key, final Object... args) throws IllegalStateException { + return 0; + } + + /** {@inheritDoc} */ + public void showOnetimeMessageDialog(@Nullable final Component parentComponent, final int messageType, @NotNull final String key, final Object... args) throws IllegalStateException { + } + + /** {@inheritDoc} */ + public boolean showQuestionDialog(final Component parentComponent, final String key, final Object... args) { + return false; + } + + /** {@inheritDoc} */ + public int showConfirmDialog(final Component parentComponent, final int optionType, final int messageType, final String key, final Object... args) { + return 0; + } + + /** {@inheritDoc} */ + public JLabel createLabel(final String key, final Object... args) { + return null; + } + + /** {@inheritDoc} */ + public JLabel createLabel(final Component component, final String key, final Object... args) { + return null; + } + + /** {@inheritDoc} */ + public void addActionProvider(final ActionProvider actionProvider) { + } + +} // class DummyActionBuilder Property changes on: libs/swing-action/trunk/src/net/sf/japi/swing/DummyActionBuilder.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-12 20:46:27
|
Revision: 574 http://japi.svn.sourceforge.net/japi/?rev=574&view=rev Author: christianhujer Date: 2007-08-12 13:46:18 -0700 (Sun, 12 Aug 2007) Log Message: ----------- Extracted implementation DefaultActionBuilder from class ActionBuilder. ActionBuilder now is an interface. Optimized imports. Modified Paths: -------------- historic/trunk/src/app/net/sf/japi/io/ARGV.java historic/trunk/src/app/net/sf/japi/io/IOHelper.java historic/trunk/src/app/net/sf/japi/sql/CachedResultSetTableModel.java historic/trunk/src/app/net/sf/japi/sql/DatabaseTreeModel.java historic/trunk/src/app/net/sf/japi/sql/ScrollResultSetTableModel.java historic/trunk/src/app/net/sf/japi/swing/ColumnLayout.java historic/trunk/src/app/net/sf/japi/swing/IconManager.java historic/trunk/src/app/net/sf/japi/swing/JFileField.java historic/trunk/src/app/net/sf/japi/swing/JPropertyEditor.java historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkDropTargetAdapter.java historic/trunk/src/app/net/sf/japi/swing/font/FontFamilyListCellRenderer.java historic/trunk/src/app/net/sf/japi/swing/prefs/AbstractPrefs.java historic/trunk/src/app/net/sf/japi/swing/treetable/TreeTableModelTreeModelAdapter.java historic/trunk/src/app/net/sf/japi/util/Arrays2.java historic/trunk/src/app/net/sf/japi/util/Collections2.java historic/trunk/src/app/net/sf/japi/util/Service.java historic/trunk/src/app/net/sf/japi/util/filter/file/RegexFileFilter.java historic/trunk/src/doc/guide/io/src/CatJAPI.java historic/trunk/src/doc/guide/io/src/SortPlain.java libs/argparser/trunk/src/doc/examples/Recode.java libs/argparser/trunk/src/doc/examples/Uniq.java libs/argparser/trunk/src/net/sf/japi/io/args/LogCommand.java libs/argparser/trunk/src/net/sf/japi/io/args/OptionType.java libs/argparser/trunk/src/net/sf/japi/io/args/converter/BooleanConverter.java libs/argparser/trunk/src/net/sf/japi/io/args/converter/IntegerConverter.java libs/argparser/trunk/src/net/sf/japi/io/args/converter/LogLevelConverter.java libs/argparser/trunk/src/net/sf/japi/io/args/converter/StringConverter.java libs/argparser/trunk/src/test/net/sf/japi/io/args/CommandDummy.java libs/argparser/trunk/src/test/net/sf/japi/io/args/RBMockCommand.java libs/argparser/trunk/src/test/net/sf/japi/io/args/TokenReaderTest.java libs/argparser/trunk/src/test/net/sf/japi/io/args/converter/BooleanConverterTest.java libs/logging/trunk/src/net/sf/japi/log/LoggerFactory.java libs/registry/trunk/src/net/sf/japi/registry/NamedRegistry.java libs/registry/trunk/src/net/sf/japi/registry/NamedService.java libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilderFactory.java libs/swing-action/trunk/src/net/sf/japi/swing/ActionMethod.java libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkDropTargetAdapter.java libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/Bookmarkable.java libs/swing-extlib/trunk/src/net/sf/japi/swing/RowLayout.java libs/swing-extlib/trunk/src/net/sf/japi/swing/VerticalFlowLayout.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/LocaleListCellRenderer.java libs/swing-treetable/trunk/src/net/sf/japi/swing/treetable/TreeTableModelTreeModelAdapter.java libs/taglets/trunk/src/net/sf/japi/taglets/FixmeTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/InvariantTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/NoteTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/PostconditionTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/PreconditionTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/TodoTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/WarningTaglet.java libs/taglets/trunk/src/net/sf/japi/taglets/XxxTaglet.java libs/util/trunk/src/net/sf/japi/util/Collections2.java libs/util/trunk/src/net/sf/japi/util/LocaleComparator.java libs/util/trunk/src/net/sf/japi/util/filter/file/RegexFileFilter.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/Program.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/Settings.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/FirstSettingsModule.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/GUIOptionsSettingsModule.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ListSelectionActionAdapter.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionGUI.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/io/JTestSer.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/io/JTestV1.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/io/KEduca.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/HelpManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/io/AbstractCachingImporter.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/list/ActionListCellRenderer.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBranchNode.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/CodecStepsListModel.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/EntityCodec.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/IdentityCodec.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/JavaBytesCodec.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/URLEncodeCodec.java Added Paths: ----------- libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java libs/swing-action/trunk/src/net/sf/japi/swing/DefaultActionBuilder.java libs/swing-action/trunk/src/test/net/sf/japi/swing/DefaultActionBuilderTest.java Removed Paths: ------------- libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java libs/swing-action/trunk/src/test/net/sf/japi/swing/ActionBuilderTest.java Modified: historic/trunk/src/app/net/sf/japi/io/ARGV.java =================================================================== --- historic/trunk/src/app/net/sf/japi/io/ARGV.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/io/ARGV.java 2007-08-12 20:46:18 UTC (rev 574) @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.Iterator; import java.util.NoSuchElementException; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** A special delegate of ARGV Reader supplying lines via an Iterator. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Modified: historic/trunk/src/app/net/sf/japi/io/IOHelper.java =================================================================== --- historic/trunk/src/app/net/sf/japi/io/IOHelper.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/io/IOHelper.java 2007-08-12 20:46:18 UTC (rev 574) @@ -20,8 +20,8 @@ package net.sf.japi.io; +import java.io.IOException; import java.io.InputStream; -import java.io.IOException; import java.io.OutputStream; /** A class with helper methods for In- and Output. Modified: historic/trunk/src/app/net/sf/japi/sql/CachedResultSetTableModel.java =================================================================== --- historic/trunk/src/app/net/sf/japi/sql/CachedResultSetTableModel.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/sql/CachedResultSetTableModel.java 2007-08-12 20:46:18 UTC (rev 574) @@ -24,8 +24,8 @@ import java.sql.SQLException; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableModel; +import net.sf.japi.util.ThrowableHandler; import org.jetbrains.annotations.Nullable; -import net.sf.japi.util.ThrowableHandler; /** An implementation of <code>javax.swing.TableModel</code> for an SQL ResultSet. * In contrast to @see ResultSetTableModel this implementation reads all data upon setting the ResultSet. Modified: historic/trunk/src/app/net/sf/japi/sql/DatabaseTreeModel.java =================================================================== --- historic/trunk/src/app/net/sf/japi/sql/DatabaseTreeModel.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/sql/DatabaseTreeModel.java 2007-08-12 20:46:18 UTC (rev 574) @@ -20,16 +20,16 @@ package net.sf.japi.sql; -import java.sql.SQLException; import java.sql.DatabaseMetaData; import java.sql.ResultSet; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.swing.event.EventListenerList; +import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; -import javax.swing.event.TreeModelEvent; +import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; -import javax.swing.tree.TreeModel; /** A TreeModel displaying the catalogs of a database (usually tables and views) as tree. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Modified: historic/trunk/src/app/net/sf/japi/sql/ScrollResultSetTableModel.java =================================================================== --- historic/trunk/src/app/net/sf/japi/sql/ScrollResultSetTableModel.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/sql/ScrollResultSetTableModel.java 2007-08-12 20:46:18 UTC (rev 574) @@ -39,8 +39,8 @@ import javax.swing.JTable; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableModel; +import net.sf.japi.util.ThrowableHandler; import org.jetbrains.annotations.Nullable; -import net.sf.japi.util.ThrowableHandler; /** An implementation of <code>javax.swing.TableModel</code> for an SQL ResultSet. * It is required that the ResultSet is absolutely navigatable. Modified: historic/trunk/src/app/net/sf/japi/swing/ColumnLayout.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/ColumnLayout.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/ColumnLayout.java 2007-08-12 20:46:18 UTC (rev 574) @@ -20,10 +20,10 @@ package net.sf.japi.swing; +import java.awt.Component; +import java.awt.Container; import java.awt.Dimension; import java.awt.Insets; -import java.awt.Component; -import java.awt.Container; import java.awt.LayoutManager; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: historic/trunk/src/app/net/sf/japi/swing/IconManager.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/IconManager.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/IconManager.java 2007-08-12 20:46:18 UTC (rev 574) @@ -21,13 +21,13 @@ package net.sf.japi.swing; import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.WeakHashMap; -import java.util.List; -import java.util.ArrayList; -import java.util.Iterator; -import java.security.AccessController; -import java.security.PrivilegedAction; import javax.swing.Icon; import javax.swing.ImageIcon; import org.jetbrains.annotations.Nullable; Modified: historic/trunk/src/app/net/sf/japi/swing/JFileField.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/JFileField.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/JFileField.java 2007-08-12 20:46:18 UTC (rev 574) @@ -23,8 +23,8 @@ import java.awt.BorderLayout; import java.io.File; import javax.swing.JComponent; +import javax.swing.JFileChooser; import javax.swing.JTextField; -import javax.swing.JFileChooser; /** A class that displays a textfield for a file and a button for choosing the file. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Modified: historic/trunk/src/app/net/sf/japi/swing/JPropertyEditor.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/JPropertyEditor.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/JPropertyEditor.java 2007-08-12 20:46:18 UTC (rev 574) @@ -20,21 +20,21 @@ package net.sf.japi.swing; +import java.awt.Component; +import java.awt.GridBagConstraints; import static java.awt.GridBagConstraints.REMAINDER; +import java.awt.GridBagLayout; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.beans.PropertyEditor; import java.beans.PropertyEditorManager; -import java.awt.Component; -import java.awt.GridBagLayout; -import java.awt.GridBagConstraints; import java.util.HashMap; import java.util.Map; +import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JLabel; -import javax.swing.JCheckBox; import javax.swing.JTextField; /** User Interface component for editing properties. Modified: historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkDropTargetAdapter.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkDropTargetAdapter.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkDropTargetAdapter.java 2007-08-12 20:46:18 UTC (rev 574) @@ -31,8 +31,8 @@ import java.io.IOException; import javax.swing.JTree; import javax.swing.tree.TreePath; +import static net.sf.japi.swing.bookmarks.BookmarkTransferable.getBookmarkDataFlavor; import org.jetbrains.annotations.Nullable; -import static net.sf.japi.swing.bookmarks.BookmarkTransferable.getBookmarkDataFlavor; /** Class for dropping a bookmark over a JTree managing bookmarks. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Modified: historic/trunk/src/app/net/sf/japi/swing/font/FontFamilyListCellRenderer.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/font/FontFamilyListCellRenderer.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/font/FontFamilyListCellRenderer.java 2007-08-12 20:46:18 UTC (rev 574) @@ -23,8 +23,8 @@ import java.awt.Component; import java.awt.Font; import java.util.Map; +import javax.swing.DefaultListCellRenderer; import javax.swing.JList; -import javax.swing.DefaultListCellRenderer; /** List cell renderer for letting the user choose the font family. * This list cell renderer displays each font in its font. Modified: historic/trunk/src/app/net/sf/japi/swing/prefs/AbstractPrefs.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/prefs/AbstractPrefs.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/prefs/AbstractPrefs.java 2007-08-12 20:46:18 UTC (rev 574) @@ -20,12 +20,12 @@ package net.sf.japi.swing.prefs; +import java.awt.LayoutManager; import java.net.URL; -import java.awt.LayoutManager; +import javax.swing.BoxLayout; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JPanel; -import javax.swing.BoxLayout; import net.sf.japi.swing.ColumnLayout; /** Abstract preferences implementation. Modified: historic/trunk/src/app/net/sf/japi/swing/treetable/TreeTableModelTreeModelAdapter.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/treetable/TreeTableModelTreeModelAdapter.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/swing/treetable/TreeTableModelTreeModelAdapter.java 2007-08-12 20:46:18 UTC (rev 574) @@ -20,10 +20,10 @@ package net.sf.japi.swing.treetable; +import javax.swing.event.EventListenerList; +import javax.swing.event.TreeModelListener; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; -import javax.swing.event.TreeModelListener; -import javax.swing.event.EventListenerList; /** * TODO Modified: historic/trunk/src/app/net/sf/japi/util/Arrays2.java =================================================================== --- historic/trunk/src/app/net/sf/japi/util/Arrays2.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/util/Arrays2.java 2007-08-12 20:46:18 UTC (rev 574) @@ -24,8 +24,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Comparator; import java.util.List; -import java.util.Comparator; import java.util.Random; import net.sf.japi.util.filter.Filter; Modified: historic/trunk/src/app/net/sf/japi/util/Collections2.java =================================================================== --- historic/trunk/src/app/net/sf/japi/util/Collections2.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/util/Collections2.java 2007-08-12 20:46:18 UTC (rev 574) @@ -24,10 +24,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; import java.util.List; import java.util.RandomAccess; -import java.util.Iterator; -import java.util.Comparator; import net.sf.japi.util.filter.Filter; /** This class provides some additional utility methods you might miss in {@link Collections}. Modified: historic/trunk/src/app/net/sf/japi/util/Service.java =================================================================== --- historic/trunk/src/app/net/sf/japi/util/Service.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/util/Service.java 2007-08-12 20:46:18 UTC (rev 574) @@ -1,11 +1,9 @@ package net.sf.japi.util; -import static sun.misc.Service.providers; - import java.lang.reflect.InvocationTargetException; - import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import static sun.misc.Service.providers; /** * Service serves as a Proxy for {@link java.util.ServiceLoader}, using {@link sun.misc.Service} as a fallback in case {@link java.util.ServiceLoader} is unavailable. Modified: historic/trunk/src/app/net/sf/japi/util/filter/file/RegexFileFilter.java =================================================================== --- historic/trunk/src/app/net/sf/japi/util/filter/file/RegexFileFilter.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/app/net/sf/japi/util/filter/file/RegexFileFilter.java 2007-08-12 20:46:18 UTC (rev 574) @@ -21,10 +21,10 @@ package net.sf.japi.util.filter.file; import java.io.File; +import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; import static java.util.regex.Pattern.compile; -import java.util.Arrays; /** A FileFilter implementation that matches against a regular expression. * @see Pattern Modified: historic/trunk/src/doc/guide/io/src/CatJAPI.java =================================================================== --- historic/trunk/src/doc/guide/io/src/CatJAPI.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/doc/guide/io/src/CatJAPI.java 2007-08-12 20:46:18 UTC (rev 574) @@ -1,5 +1,5 @@ +import java.io.IOException; import static java.lang.System.out; -import java.io.IOException; import net.sf.japi.io.ARGVInputStream; import static net.sf.japi.io.IOHelper.copy; Modified: historic/trunk/src/doc/guide/io/src/SortPlain.java =================================================================== --- historic/trunk/src/doc/guide/io/src/SortPlain.java 2007-08-12 16:44:52 UTC (rev 573) +++ historic/trunk/src/doc/guide/io/src/SortPlain.java 2007-08-12 20:46:18 UTC (rev 574) @@ -1,3 +1,7 @@ +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; import static java.lang.System.out; import java.util.ArrayList; import static java.util.Collections.sort; @@ -2,7 +6,2 @@ import java.util.List; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.BufferedReader; -import java.io.FileReader; -import net.sf.japi.io.ARGV; Modified: libs/argparser/trunk/src/doc/examples/Recode.java =================================================================== --- libs/argparser/trunk/src/doc/examples/Recode.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/doc/examples/Recode.java 2007-08-12 20:46:18 UTC (rev 574) @@ -29,9 +29,9 @@ import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; -import java.util.List; import java.nio.channels.FileChannel; import java.nio.charset.Charset; +import java.util.List; import net.sf.japi.io.args.ArgParser; import net.sf.japi.io.args.BasicCommand; import net.sf.japi.io.args.Option; Modified: libs/argparser/trunk/src/doc/examples/Uniq.java =================================================================== --- libs/argparser/trunk/src/doc/examples/Uniq.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/doc/examples/Uniq.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,18 +19,18 @@ package examples; -import net.sf.japi.io.args.BasicCommand; -import net.sf.japi.io.args.Option; -import net.sf.japi.io.args.ArgParser; -import org.jetbrains.annotations.NotNull; -import java.util.List; -import java.io.InputStream; +import java.io.BufferedInputStream; +import java.io.BufferedReader; import java.io.FileInputStream; -import java.io.BufferedInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; -import java.io.BufferedReader; +import java.util.List; +import net.sf.japi.io.args.ArgParser; +import net.sf.japi.io.args.BasicCommand; +import net.sf.japi.io.args.Option; +import org.jetbrains.annotations.NotNull; /** Java implementation of the UNIX command <q>uniq</q> to demonstrate how to use the argparser library. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Modified: libs/argparser/trunk/src/net/sf/japi/io/args/LogCommand.java =================================================================== --- libs/argparser/trunk/src/net/sf/japi/io/args/LogCommand.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/net/sf/japi/io/args/LogCommand.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,9 +19,9 @@ package net.sf.japi.io.args; +import java.util.logging.Level; +import java.util.logging.Logger; import org.jetbrains.annotations.NotNull; -import java.util.logging.Logger; -import java.util.logging.Level; /** * Subclass of BasicCommand that provides logging through {@link java.util.logging}. Modified: libs/argparser/trunk/src/net/sf/japi/io/args/OptionType.java =================================================================== --- libs/argparser/trunk/src/net/sf/japi/io/args/OptionType.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/net/sf/japi/io/args/OptionType.java 2007-08-12 20:46:18 UTC (rev 574) @@ -18,9 +18,9 @@ */ package net.sf.japi.io.args; +import java.util.Locale; +import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.MissingResourceException; -import java.util.Locale; import org.jetbrains.annotations.NotNull; /** Modified: libs/argparser/trunk/src/net/sf/japi/io/args/converter/BooleanConverter.java =================================================================== --- libs/argparser/trunk/src/net/sf/japi/io/args/converter/BooleanConverter.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/net/sf/japi/io/args/converter/BooleanConverter.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,9 +19,9 @@ package net.sf.japi.io.args.converter; -import org.jetbrains.annotations.NotNull; import java.util.Locale; import java.util.ResourceBundle; +import org.jetbrains.annotations.NotNull; /** * Converter which converts a String into a Boolean. Modified: libs/argparser/trunk/src/net/sf/japi/io/args/converter/IntegerConverter.java =================================================================== --- libs/argparser/trunk/src/net/sf/japi/io/args/converter/IntegerConverter.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/net/sf/japi/io/args/converter/IntegerConverter.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,8 +19,8 @@ package net.sf.japi.io.args.converter; +import java.util.Locale; import org.jetbrains.annotations.NotNull; -import java.util.Locale; /** * Converter which converts a String into a an Integer. Modified: libs/argparser/trunk/src/net/sf/japi/io/args/converter/LogLevelConverter.java =================================================================== --- libs/argparser/trunk/src/net/sf/japi/io/args/converter/LogLevelConverter.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/net/sf/japi/io/args/converter/LogLevelConverter.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,8 +19,8 @@ package net.sf.japi.io.args.converter; +import java.util.Locale; import java.util.logging.Level; -import java.util.Locale; import org.jetbrains.annotations.NotNull; /** Modified: libs/argparser/trunk/src/net/sf/japi/io/args/converter/StringConverter.java =================================================================== --- libs/argparser/trunk/src/net/sf/japi/io/args/converter/StringConverter.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/net/sf/japi/io/args/converter/StringConverter.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,8 +19,8 @@ package net.sf.japi.io.args.converter; +import java.util.Locale; import org.jetbrains.annotations.NotNull; -import java.util.Locale; /** * Simple Converter which "converts" a String into a String by simply returning it. Modified: libs/argparser/trunk/src/test/net/sf/japi/io/args/CommandDummy.java =================================================================== --- libs/argparser/trunk/src/test/net/sf/japi/io/args/CommandDummy.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/test/net/sf/japi/io/args/CommandDummy.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,9 +19,9 @@ package test.net.sf.japi.io.args; +import java.util.List; import net.sf.japi.io.args.BasicCommand; import org.jetbrains.annotations.NotNull; -import java.util.List; /** * A simple BasicCommand implementation as a test mock. Modified: libs/argparser/trunk/src/test/net/sf/japi/io/args/RBMockCommand.java =================================================================== --- libs/argparser/trunk/src/test/net/sf/japi/io/args/RBMockCommand.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/test/net/sf/japi/io/args/RBMockCommand.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,9 +19,9 @@ package test.net.sf.japi.io.args; +import java.util.List; +import java.util.ResourceBundle; import net.sf.japi.io.args.BasicCommand; -import java.util.ResourceBundle; -import java.util.List; import org.jetbrains.annotations.NotNull; /** Modified: libs/argparser/trunk/src/test/net/sf/japi/io/args/TokenReaderTest.java =================================================================== --- libs/argparser/trunk/src/test/net/sf/japi/io/args/TokenReaderTest.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/test/net/sf/japi/io/args/TokenReaderTest.java 2007-08-12 20:46:18 UTC (rev 574) @@ -24,8 +24,8 @@ import java.util.NoSuchElementException; import net.sf.japi.io.args.TokenReader; import org.jetbrains.annotations.NotNull; +import org.junit.Assert; import org.junit.Test; -import org.junit.Assert; /** * Test for {@link TokenReader}. Modified: libs/argparser/trunk/src/test/net/sf/japi/io/args/converter/BooleanConverterTest.java =================================================================== --- libs/argparser/trunk/src/test/net/sf/japi/io/args/converter/BooleanConverterTest.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/argparser/trunk/src/test/net/sf/japi/io/args/converter/BooleanConverterTest.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,10 +19,10 @@ package test.net.sf.japi.io.args.converter; +import java.util.Locale; import net.sf.japi.io.args.converter.BooleanConverter; +import org.junit.Assert; import org.junit.Test; -import org.junit.Assert; -import java.util.Locale; /** * Tests for {@link BooleanConverter}. Modified: libs/logging/trunk/src/net/sf/japi/log/LoggerFactory.java =================================================================== --- libs/logging/trunk/src/net/sf/japi/log/LoggerFactory.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/logging/trunk/src/net/sf/japi/log/LoggerFactory.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,15 +19,14 @@ package net.sf.japi.log; +import static java.lang.Class.forName; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.Map; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Map; -import java.util.HashMap; -import static java.lang.Class.*; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - /** * The LoggerFactory is used to instanciate a Logger of a specific implementation. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Modified: libs/registry/trunk/src/net/sf/japi/registry/NamedRegistry.java =================================================================== --- libs/registry/trunk/src/net/sf/japi/registry/NamedRegistry.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/registry/trunk/src/net/sf/japi/registry/NamedRegistry.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,13 +19,13 @@ package net.sf.japi.registry; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; import sun.misc.Service; -import java.util.Iterator; -import java.util.Collection; -import java.util.List; -import java.util.ArrayList; /** * Lookup mechanism for {@link NamedService} implementations. Modified: libs/registry/trunk/src/net/sf/japi/registry/NamedService.java =================================================================== --- libs/registry/trunk/src/net/sf/japi/registry/NamedService.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/registry/trunk/src/net/sf/japi/registry/NamedService.java 2007-08-12 20:46:18 UTC (rev 574) @@ -19,8 +19,8 @@ package net.sf.japi.registry; +import java.util.Locale; import org.jetbrains.annotations.NotNull; -import java.util.Locale; /** * A named service can be instantiated with a public non-arg (default) constructor and provides two names. Deleted: libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java 2007-08-12 16:44:52 UTC (rev 573) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java 2007-08-12 20:46:18 UTC (rev 574) @@ -1,1147 +0,0 @@ -/* - * JAPI libs-swing-action is a library for creating and managing javax.swing.Action objects. - * Copyright (C) 2007 Christian Hujer. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package net.sf.japi.swing; - -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.lang.reflect.Field; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -import static java.util.ResourceBundle.getBundle; -import java.util.prefs.Preferences; -import static java.util.prefs.Preferences.userNodeForPackage; -import javax.swing.AbstractAction; -import javax.swing.Action; -import static javax.swing.Action.ACCELERATOR_KEY; -import static javax.swing.Action.LONG_DESCRIPTION; -import static javax.swing.Action.MNEMONIC_KEY; -import static javax.swing.Action.NAME; -import static javax.swing.Action.SHORT_DESCRIPTION; -import static javax.swing.Action.SMALL_ICON; -import javax.swing.ActionMap; -import javax.swing.Icon; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPopupMenu; -import javax.swing.JToolBar; -import javax.swing.KeyStroke; -import static javax.swing.KeyStroke.getKeyStroke; -import static net.sf.japi.swing.IconManager.getDefaultIconManager; -import static net.sf.japi.swing.ReflectionAction.REFLECTION_MESSAGE_PROVIDER; -import static net.sf.japi.swing.ReflectionAction.REFLECTION_TARGET; -import static net.sf.japi.swing.ToggleAction.REFLECTION_PROPERTY_NAME; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** Class for creating and initializing {@link Action}s that are localized, user configurable and may invoke their final methods using Reflection; - * also handles extremely much useful stuff for i18n/l10n. - * It is meant as a general service for creating Action objects that have some comfort for the programmer in several aspects: - * <ul> - * <li>Allow zero or more ResourceBundles to be used when creating Actions</li> - * <li>Allow zero or more UserPreferences to be used when creating Actions</li> - * <li>Manage an ActionMap to which created Actions are automatically added</li> - * </ul> - * You may choose to use one or more ActionBuilders, depending on the size of your application. - * You may use to spread Action configuration information accross one or more ResourceBundles and one or more Preferences, as you wish. - * When looking for values, the Preferences are queried first, in addition order, after that the ResourceBundles, again in addition order, until - * a value was found. The behaviour when no value was found is undefined. - * <h3>Usage</h3> - * The recommended usage is to - * <ol> - * <li> - * create and initialize an ActionBuilder similar as the following example code, put it somewhere at the start of your program: - * <pre> - * ActionBuilder myActionBuilder = ActionBuilder.getActionBuilder("MyApplication"); - * myActionBuilder.addBundle("com.mycompany.mypackage.myresource"); // not always required - * myActionBuilder.addPref(MyClass.class); - * </pre> - * </li> - * <li> - * then use the ActionBuilder from anywhere within the application like this: - * <pre> - * ActionBuilder myActionBuilder = ActionBuilder.getActionBuilder("MyApplication"); - * Action myAction = myActionBuilder.createAction("load", this); - * </pre> - * </li> - * </ol> - * <p> - * All actions created or initialized by an instance of this class are optionally put into that instance's {@link ActionMap}. - * If they are stored, you can use that map for later retrieval. - * </p> - * <h4>Usage Notes: Builder Name</h4> - * <ul> - * <li> - * The builder name is used to try to load a resource bundle when a bundle is created. - * The builder name is used as package name for the bundle, the bundle name itself is "action". - * Example: When calling <code>ActionBuilder.getActionBuilder("net.sf.japi.swing");</code> for the first time, it is tried to load a - * {@link ResourceBundle} named <code>net.sf.japi.swing.actions</code> for that <code>ActionBuilder</code>. - * This automatism has been implemented to save you from the need of initializing an ActionBuilder before use. - * </li> - * </ul> - * <h4>Usage Notes: Action Key / Action Name</h4> - * The key you supply as first argument of {@link #createAction(boolean, String, Object)} determines several things: - * <ul> - * <li>The base name for the different keys in the preferences / resource bundle and other known Action Keys: - * <table border="1"> - * <tr><th>What</th><th>Preferences / Bundle key</th><th>Action key if stored in an action</th></tr> - * <tr><td>An (somewhat unique) ID</td><td>(<var>basename</var> itself)</td><td>{@link #ACTION_ID}</td></tr> - * <tr><td>The icon</td><td><code><var>basename</var> + ".icon"</code></td><td>{@link Action#SMALL_ICON}</td></tr> - * <tr><td>The tooltip help</td><td><code><var>basename</var> + ".shortdescription"</code></td><td>{@link Action#SHORT_DESCRIPTION}</td></tr> - * <tr><td>The long help</td><td><code><var>basename</var> + ".longdescription"</code></td><td>{@link Action#LONG_DESCRIPTION}</td></tr> - * <tr><td>The text label</td><td><code><var>basename</var> + ".text"</code></td><td>{@link Action#NAME}</td></tr> - * <tr><td>The keyboard accelerator</td><td><code><var>basename</var> + ".accel"</code></td><td>{@link Action#ACCELERATOR_KEY}</td></tr> - * <tr><td>The alternate keyboard accelerator</td><td><code><var>basename</var> + ".accel2"</code></td><td>{@link #ACCELERATOR_KEY_2}</td></tr> - * <tr><td>The mnemonic</td><td><code><var>basename</var> + ".mnemonic"</code></td><td>{@link Action#MNEMONIC_KEY}</td></tr> - * <tr><td>The method name</td><td></td><td>{@link ReflectionAction#REFLECTION_METHOD_NAME}</td></tr> - * <tr><td>The method</td><td></td><td>{@link ReflectionAction#REFLECTION_METHOD}</td></tr> - * <tr><td>The boolean property name</td><td></td><td>{@link ToggleAction#REFLECTION_PROPERTY_NAME}</td></tr> - * <tr><td>The target instance</td><td></td><td>{@link ReflectionAction#REFLECTION_TARGET}</td></tr> - * <tr><td>Exception handler dialogs</td><td><code><var>basename</var> + ".exception." + <var>exception class name</var> + ...</code><br/>The message can be formatted with 1 parameter that will be the localized message of the thrown exception.</td><td>n/a</td></tr> - * </table> - * </li> - * </ul> - * <p>Some methods are not related to actions, yet take base keys:</p> - * <ul> - * <li>The methods for dialogs, e.g. {@link #showMessageDialog(Component, String, Object...)}: - * <table border="1"> - * <tr><th>What</th><th>Preferences / Bundle key</th></tr> - * <tr><td>Dialog title</td><td><code><var>basename</var> + ".title"</code></td></tr> - * <tr><td>Dialog message</td><td><code><var>basename</var> + ".message"</code></td></tr> - * <tr><td>Dialog messagetype </td><td><code><var>basename</var> + ".messagetype"</code><br/>The message type should be one of the message types defined in {@link JOptionPane}, e.g. {@link JOptionPane#PLAIN_MESSAGE}.</td></tr> - * </table> - * </li> - * </ul> - * <h4>Final Notes</h4> - * <ul> - * <li> - * If by having read all this you think it might often be a good idea to use a package name as a builder name: this is completely right and the - * most common way of using an ActionBuilder. - * </li> - * <li> - * If you think you're too lazy to hold your own ActionBuilder reference and instead more often call {@link ActionBuilderFactory#getActionBuilder(String)}, just go ahead - * and do so. - * Looking up created ActionBuilders is extremely fast, and of course they are initialized exactly once, not more. - * </li> - * </ul> - * @see AbstractAction - * @see Action - * @see Preferences - * @see ResourceBundle - * @todo think about toolbar interaction - * @todo think about toolbar configuration - * @todo eventually rename this ActionBuilder and provide an ActionBuilderFactory. - * @todo whether a dialog is a onetime dialog should be a property and user configurable - * @todo Implement serialization. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class ActionBuilder { - - /** The key used for storing a somewhat unique id for this Action. */ - @NotNull public static final String ACTION_ID = "ActionID"; - - /** The key used for storing an alternative accelerator for this Action. - * Currently unused. - */ - @NotNull public static final String ACCELERATOR_KEY_2 = "AcceleratorKey2"; - - /** The parent ActionBuilders. */ - @NotNull private final List<ActionBuilder> parents = new LinkedList<ActionBuilder>(); - - /** The ResourceBundles to look for. - * Type: ResourceBundle - */ - @NotNull private final List<ResourceBundle> bundles = new LinkedList<ResourceBundle>(); - - /** The Preferences to look for. - * Type: Preferences - */ - @NotNull private final List<Preferences> prefs = new LinkedList<Preferences>(); - - /** The ActionMap to which created Actions are automatically added. */ - @NotNull private final ActionMap actionMap = new NamedActionMap(); - - /** The action providers that were registered and will be queried when an action should be created / retrieved. */ - private List<ActionProvider> actionProviders = new ArrayList<ActionProvider>(); - - /** Add a ResourceBundle to the list of used bundles. - * @param baseName the base name of the resource bundle, a fully qualified class name - * @see ResourceBundle#getBundle(String) - */ - public void addBundle(@NotNull final String baseName) { - //noinspection ConstantConditions - if (baseName == null) { - throw new NullPointerException("null bundle name not allowed"); - } - @NotNull final ResourceBundle newBundle = getBundle(baseName); - addBundle(newBundle); - @Nullable final String additionalBundles = newBundle.getString("ActionBuilder.additionalBundles"); - if (additionalBundles != null) { - for (final String additionalBundle : additionalBundles.split("\\s+")) { - addBundle(additionalBundle); - } - } - } - - /** Method to find the JMenuItem for a specific Action. - * @param menuBar JMenuBar to search - * @param action Action to find JMenuItem for - * @return JMenuItem for action or <code>null</code> if none found - * @throws NullPointerException if <var>action</var> or <var>menuBar</var> is <code>null</code> - */ - @Nullable public static JMenuItem find(@NotNull final JMenuBar menuBar, @NotNull final Action action) { - //noinspection ConstantConditions - if (menuBar == null) { - throw new NullPointerException("null JMenuBar not allowed"); - } - //noinspection ConstantConditions - if (action == null) { - throw new NullPointerException("null Action not allowed"); - } - for (int i = 0; i < menuBar.getMenuCount(); i++) { - final JMenu menu = menuBar.getMenu(i); - if (menu.getAction() == action) { - return menu; - } else { - final JMenuItem ret = find(menu, action); - if (ret != null) { - return ret; - } - } - } - return null; - } - - /** Method to find the JMenuItem for a specific Action. - * @param menu JMenu to search - * @param action Action to find JMenuItem for - * @return JMenuItem for action or <code>null</code> if none found - * @throws NullPointerException if <var>menu</var> or <var>action</var> is <code>null</code> - */ - @Nullable public static JMenuItem find(@NotNull final JMenu menu, @NotNull final Action action) { - //noinspection ConstantConditions - if (menu == null) { - throw new NullPointerException("null JMenuBar not allowed"); - } - //noinspection ConstantConditions - if (action == null) { - throw new NullPointerException("null Action not allowed"); - } - for (int i = 0; i < menu.getItemCount(); i++) { - final JMenuItem item = menu.getItem(i); - if (item == null) { - // Ignore Separators - } else if (item.getAction() == action) { - return item; - } else if (item instanceof JMenu) { - final JMenuItem ret = find((JMenu) item, action); - if (ret != null) { - return ret; - } - } - } - return null; - } - - /** - * Create an ActionBuilder. - * Usually you wouldn't create an ActionBuilder yourself but use {@link ActionBuilderFactory#getActionBuilder(String)} for recycling ActionBuilders and profit of easy - * access to the same ActionBuilder from within the whole application without passing around ActionBuilder references. - * Don't use this constructor without knowing what you're doing. - * It's mainly there for testing purposes. - */ - public ActionBuilder() { - } - - /** - * Create an ActionBuilder. - * Usually you wouldn't create an ActionBuilder yourself but use {@link ActionBuilderFactory#getActionBuilder(String)} for recycling ActionBuilders and profit of easy - * access to the same ActionBuilder from within the whole application without passing around ActionBuilder references. - * Use this constructor if you explicitely need a new ActionBuilder that doesn't share information (especially the action cache) with other ActionBuilder instances. - * @param key name of ActionBuilder. - */ - public ActionBuilder(final String key) { - try { - addBundle(key + ".action"); - } catch (final MissingResourceException e) { - /* ignore */ - } - } - - /** Get the ActionMap. - * @return ActionMap - */ - @NotNull public ActionMap getActionMap() { - return actionMap; - } - - /** Add a ResourceBundle to the list of used bundles. - * @param bundle ResourceBundle to add - * @throws NullPointerException if <code>bundle == null</code> - */ - public void addBundle(@NotNull final ResourceBundle bundle) throws NullPointerException { - //noinspection ConstantConditions - if (bundle == null) { - throw new NullPointerException("null ResourceBundle not allowed"); - } - if (!bundles.contains(bundle)) { - // insert first because new bundles override old bundles - bundles.add(0, bundle); - } - } - - /** Add a parent to the list of used parents. - * @param parent Parent to use if lookups failed in this ActionBuilder - * WARNING: Adding a descendents as parents of ancestors or vice versa will result in endless recursion and thus stack overflow! - * @throws NullPointerException if <code>parent == null</code> - */ - public void addParent(@NotNull final ActionBuilder parent) throws NullPointerException { - //noinspection ConstantConditions - if (parent == null) { - throw new NullPointerException("null ActionBuilder not allowed"); - } - parents.add(parent); - } - - /** Add a Preferences to the list of used preferences. - * @param pref Preferences to add - * @throws NullPointerException if <code>pref == null</code> - */ - public void addPref(@NotNull final Preferences pref) throws NullPointerException { - //noinspection ConstantConditions - if (pref == null) { - throw new NullPointerException("null ResourceBundle not allowed"); - } - if (!prefs.contains(pref)) { - prefs.add(pref); - } - } - - /** Add a Preferences to the list of used preferences. - * @param clazz the class whose package a user preference node is desired - * @see Preferences#userNodeForPackage(Class) - * @throws NullPointerException if <code>clazz == null</code> - */ - public void addPref(@NotNull final Class<?> clazz) { - //noinspection ConstantConditions - if (clazz == null) { - throw new NullPointerException("null Class not allowed"); - } - addPref(userNodeForPackage(clazz)); - } - - /** Creates actions. - * This is a loop variant of {@link #createAction(boolean,String)}. - * The actions created can be retrieved using {@link #getAction(String)} or via the ActionMap returned by {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionBuilder - * @param keys Keys of actions to create - * @return Array with created actions - * @throws NullPointerException in case keys is or contains <code>null</code> - */ - public Action[] createActions(final boolean store, @NotNull final String... keys) throws NullPointerException { - final Action[] actions = new Action[keys.length]; - for (int i = 0; i < keys.length; i++) { - actions[i] = createAction(store, keys[i]); - } - return actions; - } - - /** Create an Action. - * The created Action is automatically stored together with all other Actions created by this Builder instance in an ActionMap, which you can - * retreive using {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionBuilder - * @param key Key for Action, which is used as basename for access to Preferences and ResourceBundles and as ActionMap key (may not be - * <code>null</code>) - * @return created Action, which is a dummy in the sense that its {@link Action#actionPerformed(ActionEvent)} method does not do anything - * @throws NullPointerException in case <var>key</var> was <code>null</code> - * @see #createAction(boolean,String,Object) - * @see #createToggle(boolean,String,Object) - * @see #initAction(boolean,Action,String) - */ - public Action createAction(final boolean store, @NotNull final String key) throws NullPointerException { - // initAction() checks for null key - return initAction(store, new DummyAction(), key); - } - - /** Initialize an Action. - * This is a convenience method for Action users which want to use the services provided by this {@link ActionBuilder} class but need more - * sophisticated Action objects they created on their own. - * So you can simply create an Action and pass it to this Initialization method to fill its data. - * The initialized Action is automatically stored together with all other Actions created by this Builder instance in an ActionMap, which you can - * retreive using {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionBuilder - * @param action Action to fill - * @param key Key for Action, which is used as basename for access to Preferences and ResourceBundles and as ActionMap key (may not be <code>null</code>) - * @return the supplied Action object (<var>action</var>) is returned for convenience - * @throws NullPointerException in case <var>key</var> was <code>null</code> - */ - @SuppressWarnings({"NestedAssignment"}) - @NotNull public Action initAction(final boolean store, @NotNull final Action action, @NotNull final String key) throws NullPointerException { - action.putValue(ACTION_ID, key); - String value; - final String text = getString(key + ".text"); - if ((value = text) != null) { action.putValue(NAME, value); } - if ((value = getString(key + ".shortdescription")) != null) { action.putValue(SHORT_DESCRIPTION, value); } - if ((value = getString(key + ".longdescription")) != null) { action.putValue(LONG_DESCRIPTION, value); } - if ((value = getString(key + ".accel")) != null) { action.putValue(ACCELERATOR_KEY, getKeyStroke(value)); } - if ((value = getString(key + ".accel2")) != null) { action.putValue(ACCELERATOR_KEY_2, getKeyStroke(value)); } - if ((value = getString(key + ".mnemonic")) != null) { - final KeyStroke keyStroke = getKeyStroke(value); - if (keyStroke != null) { - action.putValue(MNEMONIC_KEY, keyStroke.getKeyCode()); - } else { - System.err.println("Warning: Action key " + key + " has " + key + ".mnemonic value " + value + " which is a null KeyStroke."); - } - if (text == null) { - System.err.println("Warning: Action key " + key + " has " + key + ".mnemonic value " + value + " but no text. Either define " + key + ".text or remove " + key + ".mnemonic."); - } - } - if ((value = getString(key + ".icon")) != null) { - final Icon image = getDefaultIconManager().getIcon(value); - if (image != null) { - action.putValue(SMALL_ICON, image); - } else { - System.err.println("Warning: Action key " + key + " has " + key + ".icon value " + value + " but no corresponding icon was found."); - } - } - action.putValue(REFLECTION_MESSAGE_PROVIDER, this); - if (store) { - actionMap.put(key, action); - } - return action; - } - - /** Get a String. - * First looks one pref after another, in their addition order. - * Then looks one bundle after another, in their addition order. - * @param key Key to get String for - * @return the first value found or <code>null</code> if no value could be found - * @throws NullPointerException if <var>key</var> is <code>null</code> - */ - @Nullable public String getString(@NotNull final String key) throws NullPointerException { - if (key == null) { - throw new NullPointerException("null key not allowed"); - } - String value = null; - for (final Preferences pref : prefs) { - value = pref.get(key, value); - if (value != null) { - return value; - } - } - for (final ResourceBundle bundle : bundles) { - try { - value = bundle.getString(key); - return value; - } catch (final MissingResourceException e) { /* ignore */ - } catch (final ClassCastException e) { /* ignore */ - } // ignore exceptions because they don't mean errors just there's no resource, so parents are checked or null is returned. - } - for (final ActionBuilder parent : parents) { - value = parent.getString(key); - if (value != null) { - return value; - } - } - return null; - } - - /** Get a String from the preferences, ignoring the resource bundles. - * @param key Key to get String for - * @return the first value found or <code>null</code> if no value could be found - * @throws NullPointerException if <var>key</var> is <code>null</code> - */ - @Nullable public String getStringFromPrefs(@NotNull final String key) throws NullPointerException { - String value = null; - for (final Preferences pref : prefs) { - value = pref.get(key, value); - if (value != null) { - return value; - } - } - for (final ActionBuilder parent : parents) { - value = parent.getStringFromPrefs(key); - if (value != null) { - return value; - } - } - return null; - } - - /** Get a String from the resource bundles, ignoring the preferences. - * @param key Key to get String for - * @return the first value found or <code>null</code> if no value could be found - * @throws NullPointerException if <var>key</var> is <code>null</code> - */ - @Nullable public String getStringFromBundles(@NotNull final String key) throws NullPointerException { - if (key == null) { - throw new NullPointerException("null key not allowed"); - } - String value; - for (final ResourceBundle bundle : bundles) { - try { - value = bundle.getString(key); - return value; - } catch (final MissingResourceException e) { /* ignore */ - } catch (final ClassCastException e) { /* ignore */ - } // ignore exceptions because they don't mean errors just there's no resource, so parents are checked or null is returned. - } - for (final ActionBuilder parent : parents) { - value = parent.getStringFromBundles(key); - if (value != null) { - return value; - } - } - return null; - } - /** Creates actions. - * This is a loop variant of {@link #createAction(boolean,String,Object)}. - * The actions created can be retrieved using {@link #getAction(String)} or via the ActionMap returned by {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionBuilder - * @param target Target object - * @param keys Keys of actions to create - * @return Array with created actions - * @throws NullPointerException in case keys is or contains <code>null</code> - */ - public Action[] createActions(final boolean store, final Object target, final String... keys) throws NullPointerException { - final Action[] actions = new Action[keys.length]; - for (int i = 0; i < keys.length; i++) { - actions[i] = createAction(store, keys[i], target); - } - return actions; - } - - /** Create an Action. - * The created Action is automatically stored together with all other Actions created by this Builder instance in an ActionMap, which you can - * retreive using {@link #getActionMap()}. - * The supplied object needs to have a zero argument method named <var>key</var>. - * You may pass <code>null</code> as object, which means that the object the method is invoked on is not defined yet. - * You may safely use the Action, it will not throw any Exceptions upon {@link Action#actionPerformed(ActionEvent)} but simply silently do nothing. - * The desired object can be set later using <code>action.putValue({@link ReflectionAction#REFLECTION_TARGET}, <var>object</var>)</code>. - * <p /> - * Users of this method can assume that the returned object behaves quite like {@link ReflectionAction}. - * Wether or not this method returns an instance of {@link ReflectionAction} should not be relied on. - * @param store whether to store the initialized Action in the ActionMap of this ActionBuilder - * @param key Key for Action, which is used as basename for access to Preferences and ResourceBundles, as ActionMap key and as Reflection Method - * name within the supplied object (may not be <code>null</code>) - * @param object Instance to invoke method on if the Action was activated ({@link Action#actionPerformed(ActionEvent)}) - * @return created Action - * @throws NullPointerException in case <var>key</var> was <code>null</code> - * @see #createAction(boolean,String) - * @see #createToggle(boolean,String,Object) - * @see #initAction(boolean,Action,String) - */ - public Action createAction(final boolean store, final String key, final Object object) throws NullPointerException { - if (key == null) { throw new NullPointerException("null key for Action creation not allowed."); } - final Action action = new ReflectionAction(key, object); - initAction(store, action, key); - return action; - } - - /** Method for creating a Menu. - * @param store whether to store the initialized Action in the ActionMap of this ActionBuilder - * @param menuKey action key for Menu - * @param keys Action keys for menu items - * @return menu created from the menu definition found - * @throws Error in case action definitions for <var>keys</var> weren't found - */ - public JMenu createMenu(final boolean store, final String menuKey, final String... keys) throw... [truncated message content] |
From: <chr...@us...> - 2007-08-12 16:44:55
|
Revision: 573 http://japi.svn.sourceforge.net/japi/?rev=573&view=rev Author: christianhujer Date: 2007-08-12 09:44:52 -0700 (Sun, 12 Aug 2007) Log Message: ----------- Fixed some minor issues / warnings: Added missing javadoc tags. Added missing @Override annotations. Added missing @NotNull / @Nullable annotations. Added missing final modifiers. Modified Paths: -------------- libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/recent/RecentURLsMenu.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/settings/SettingsPane.java Modified: libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java =================================================================== --- libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java 2007-08-12 11:45:43 UTC (rev 572) +++ libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java 2007-08-12 16:44:52 UTC (rev 573) @@ -306,7 +306,7 @@ /** {@inheritDoc} * @return title of this Bookmark */ - @NotNull public String toString() { + @Override @NotNull public String toString() { return title; } @@ -513,7 +513,7 @@ } /** {@inheritDoc} */ - public void store(final Node n) { + @Override public void store(final Node n) { final Element e = n.getOwnerDocument().createElement("bookmark"); e.setAttribute("title", getTitle()); e.setAttribute("href", getURL()); @@ -605,7 +605,7 @@ final int pos = bookmarks.size(); bookmarks.add(bookmark); bookmark.setFolder(this); - for (JMenu menu : menus) { + for (final JMenu menu : menus) { menu.insert(bookmark.createMenu(), pos); } try { @@ -627,7 +627,7 @@ } bookmark.setFolder(this); bookmarks.add(index, bookmark); - for (JMenu menu : menus) { + for (final JMenu menu : menus) { menu.insert(bookmark.createMenu(), index); } try { @@ -660,7 +660,7 @@ @Override public void remove(final int index) { final Bookmark bookmark = bookmarks.remove(index); bookmark.folder = null; - for (JMenu menu : menus) { + for (final JMenu menu : menus) { menu.remove(index); } } @@ -669,7 +669,7 @@ @Override public JMenu createMenu() { final JMenu menu = new JMenu(getTitle()); menu.setName(getTitle()); - for (Bookmark bookmark : bookmarks) { + for (final Bookmark bookmark : bookmarks) { if (bookmark instanceof BookmarkSeparator) { menu.addSeparator(); } else { @@ -719,7 +719,7 @@ */ public void setAddBookmarkEnabled(final boolean enabled) { addBookmark.setEnabled(enabled); - for (Bookmark folder : bookmarks) { + for (final Bookmark folder : bookmarks) { if (folder instanceof BookmarkFolder) { ((BookmarkFolder) folder).setAddBookmarkEnabled(enabled); } @@ -731,13 +731,13 @@ final Element e = (n instanceof Document ? (Document) n : n.getOwnerDocument()).createElement("bookmarks"); e.setAttribute("title", getTitle()); n.appendChild(e); - for (Bookmark bookmark : bookmarks) { + for (final Bookmark bookmark : bookmarks) { bookmark.store(e); } } /** {@inheritDoc} */ - public Enumeration<Bookmark> children() { + @Override public Enumeration<Bookmark> children() { return Collections.enumeration(bookmarks); } Modified: libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java =================================================================== --- libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java 2007-08-12 11:45:43 UTC (rev 572) +++ libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java 2007-08-12 16:44:52 UTC (rev 573) @@ -102,7 +102,7 @@ /** Returns the action that is currently handled. * @return the action that is currently handled */ - public Action getAction() { + @Nullable public Action getAction() { return action; } Modified: libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java =================================================================== --- libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java 2007-08-12 11:45:43 UTC (rev 572) +++ libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java 2007-08-12 16:44:52 UTC (rev 573) @@ -40,7 +40,9 @@ ACTION_BUILDER.getString("keystroke.table.column.keystroke.title"), }; - /** Create a KeyStrokeTreeTableModel. */ + /** Create a KeyStrokeTreeTableModel. + * @param builders ActionBuilders to create a KeyStrokeTreeTableModel for. + */ public KeyStrokeTreeTableModel(final List<ActionBuilder> builders) { super(new KeyStrokeRootNode(builders)); } Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java 2007-08-12 11:45:43 UTC (rev 572) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java 2007-08-12 16:44:52 UTC (rev 573) @@ -113,6 +113,7 @@ private Settings settings; /** Create a GUI for a Collection of Questions. + * @param settings Settings to use. */ public QuestionCollectionGUI(final Settings settings) { this.settings = settings; @@ -318,7 +319,7 @@ public JMenu createNavigationMenu() { final JMenu menu = new JMenu(res.getString("nav.text")); menu.setName(res.getString("nav.text")); - for (Action action : navigationActions) { + for (final Action action : navigationActions) { menu.add(new JMenuItem(action)); } menu.setMnemonic(VK_N); Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java 2007-08-12 11:45:43 UTC (rev 572) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java 2007-08-12 16:44:52 UTC (rev 573) @@ -146,6 +146,7 @@ /** Find the Action for an component. * @param comp component to find Action for + * @return SubAction for the specified comp. */ private SubAction<?> findActionFor(final T comp) { for (final SubAction<?> action : actions) { @@ -196,7 +197,8 @@ * Subclasses may override this method if they need extended SubActions. * When overriding, you may choose to call <code>super.createSubAction(comp)</code> and modify it or create a new one, perhaps for subclassing * SubAction. - * @param comp component to create SubAction for + * @param comp Component to create SubAction for. + * @return SubAction for the specified component. */ protected SubAction<T> createSubAction(final T comp) { return new SubAction<T>(comp); @@ -287,7 +289,9 @@ } } - /** Create a JCheckBoxMenuItem for this Action. */ + /** Create a JCheckBoxMenuItem for this Action. + * @return JCheckBoxMenuItem for this Action. + */ JCheckBoxMenuItem createCheckBoxMenuItem() { final JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(this); buttons.add(new WeakReference<AbstractButton>(menuItem)); @@ -295,7 +299,9 @@ return menuItem; } - /** Create a JCheckBox for this Actin. */ + /** Create a JCheckBox for this Action. + * @return JCheckBox for this Action. + */ JCheckBox createCheckBox() { final JCheckBox checkBox = new JCheckBox(this); buttons.add(new WeakReference<AbstractButton>(checkBox)); Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/recent/RecentURLsMenu.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/recent/RecentURLsMenu.java 2007-08-12 11:45:43 UTC (rev 572) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/recent/RecentURLsMenu.java 2007-08-12 16:44:52 UTC (rev 573) @@ -76,7 +76,7 @@ /** Update the menu. */ private void updateMenu() { removeAll(); - for (String url : recent.getRecentlyURLs()) { + for (final String url : recent.getRecentlyURLs()) { add(new JMenuItem(new URLAction(url))); } } @@ -98,7 +98,9 @@ /** The URL to be opened. */ private String url; - /** Create a URLAction. */ + /** Create a URLAction. + * @param url URL to use for this action. + */ URLAction(final String url) { putValue(NAME, url); this.url = url; Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/settings/SettingsPane.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/settings/SettingsPane.java 2007-08-12 11:45:43 UTC (rev 572) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/settings/SettingsPane.java 2007-08-12 16:44:52 UTC (rev 573) @@ -96,7 +96,9 @@ /** The active module. */ private transient SettingsModule activeModule; - /** Create a SettingsPane. */ + /** Create a SettingsPane. + * @param modules SettingsModules to display. + */ public SettingsPane(final Collection<SettingsModule> modules) { this.modules.addAll(modules); settingsLayout = new CardLayout(); @@ -140,7 +142,9 @@ add(createButtonsPane(), gbc); } - /** Create the buttons pane. */ + /** Create the buttons pane. + * @return Newly created buttons pane. + */ private JComponent createButtonsPane() { final JPanel buttonsPane = new JPanel(); buttonsPane.setLayout(new GridBagLayout()); @@ -190,7 +194,7 @@ /** apply action. */ public void apply() { - for (SettingsModule module : modules) { + for (final SettingsModule module : modules) { module.apply(); } } @@ -199,8 +203,8 @@ public void cancel() { if (dialog != null) { dialog.setVisible(false); + dialog.dispose(); } - dialog.dispose(); dialog = null; if (rootFrame != null) { rootFrame.dispose(); @@ -248,7 +252,7 @@ * @param c Component to get Window for * @return Window for c */ - private static final Window getWindowForComponent(final Component c) { + private static Window getWindowForComponent(final Component c) { if (c == null) { return getRootFrame(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-12 11:45:47
|
Revision: 572 http://japi.svn.sourceforge.net/japi/?rev=572&view=rev Author: christianhujer Date: 2007-08-12 04:45:43 -0700 (Sun, 12 Aug 2007) Log Message: ----------- Moved static factory method for ActionBuilder to new factory class ActionBuilderFactory. Modified Paths: -------------- historic/trunk/src/app/net/sf/japi/swing/JFileChooserButton.java historic/trunk/src/app/net/sf/japi/swing/JSAXErrorHandler.java historic/trunk/src/app/net/sf/japi/swing/LookAndFeelManager.java historic/trunk/src/app/net/sf/japi/swing/TipOfTheDayManager.java historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkManager.java historic/trunk/src/app/net/sf/japi/swing/font/FontChooser.java historic/trunk/src/app/net/sf/japi/swing/font/FontPreview.java historic/trunk/src/app/net/sf/japi/swing/font/FontStyleListCellRenderer.java historic/trunk/src/app/net/sf/japi/swing/prefs/PreferencesPane.java historic/trunk/src/doc/guide/swing/action/basic/src/ex/Application.java historic/trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java historic/trunk/src/doc/guide/swing/prefs/keys/src/ex/PrefsExampleApp.java historic/trunk/src/doc/guide/swing/tod/src/ex/TodExampleApp.java libs/swing-about/trunk/src/net/sf/japi/swing/about/AboutDialog.java libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java libs/swing-action/trunk/src/test/net/sf/japi/swing/ReflectionActionTest.java libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java libs/swing-font/trunk/src/net/sf/japi/swing/font/FontChooser.java libs/swing-font/trunk/src/net/sf/japi/swing/font/FontPreview.java libs/swing-font/trunk/src/net/sf/japi/swing/font/FontStyleListCellRenderer.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokePrefs.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java libs/swing-list/trunk/src/net/sf/japi/swing/list/ListControlPanel.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java libs/swing-tod/trunk/src/net/sf/japi/swing/tod/TipOfTheDayManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/InternalFrameManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/MenuManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/OpenURLPane.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/ToolBarManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/recent/RecentURLsMenu.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/settings/SettingsPane.java progs/jeduca/trunk/src/net/sf/japi/swing/LookAndFeelManager.java tools/fontbrowser/trunk/src/net/sf/japi/tools/fontbrowser/FontBrowser.java tools/keystrokes/trunk/src/net/sf/japi/tools/keystrokes/KeyStrokes.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/CodecSelectionPanel.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/DoubleListController.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/ListOrderController.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/String2Bytes.java Added Paths: ----------- libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilderFactory.java Modified: historic/trunk/src/app/net/sf/japi/swing/JFileChooserButton.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/JFileChooserButton.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/JFileChooserButton.java 2007-08-12 11:45:43 UTC (rev 572) @@ -33,7 +33,7 @@ public class JFileChooserButton extends JButton { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing"); /** The JTextField to read/write the file path to. * @serial include Modified: historic/trunk/src/app/net/sf/japi/swing/JSAXErrorHandler.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/JSAXErrorHandler.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/JSAXErrorHandler.java 2007-08-12 11:45:43 UTC (rev 572) @@ -37,7 +37,7 @@ public final class JSAXErrorHandler extends JOptionPane implements ErrorHandler { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing"); /** The JTextArea which displays the errors. * @serial include Modified: historic/trunk/src/app/net/sf/japi/swing/LookAndFeelManager.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/LookAndFeelManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/LookAndFeelManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -33,8 +33,8 @@ import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JRadioButtonMenuItem; +import static javax.swing.SwingUtilities.updateComponentTreeUI; import javax.swing.UIManager; -import static javax.swing.SwingUtilities.updateComponentTreeUI; import static javax.swing.UIManager.getInstalledLookAndFeels; import static javax.swing.UIManager.getLookAndFeel; import static javax.swing.UIManager.installLookAndFeel; @@ -82,7 +82,7 @@ * @return menu with selectable look and feels */ public JMenu createMenu() { - return fillMenu(new JMenu(ActionBuilder.getActionBuilder("net.sf.japi.swing").createAction(true, "laf"))); + return fillMenu(new JMenu(ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing").createAction(true, "laf"))); } /** Fill a menu with look and feel selection items. Modified: historic/trunk/src/app/net/sf/japi/swing/TipOfTheDayManager.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/TipOfTheDayManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/TipOfTheDayManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -23,6 +23,12 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.Font; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.List; import java.util.MissingResourceException; @@ -31,12 +37,6 @@ import static java.util.ResourceBundle.getBundle; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; -import java.io.InputStream; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.security.PrivilegedAction; -import java.security.AccessController; import javax.swing.Action; import static javax.swing.Action.ACCELERATOR_KEY; import javax.swing.JButton; @@ -48,9 +48,9 @@ import javax.swing.JScrollPane; import javax.swing.KeyStroke; import static javax.swing.SwingConstants.TRAILING; -import org.jetbrains.annotations.Nullable; import static net.sf.japi.swing.ActionBuilder.ACCELERATOR_KEY_2; import static net.sf.japi.swing.IconManager.getDefaultIconManager; +import org.jetbrains.annotations.Nullable; /** Class that manages tips of the day. * The tips of the day are read from a property file. @@ -80,7 +80,7 @@ public final class TipOfTheDayManager extends JOptionPane { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing"); /** Random number generator for random tods. */ private static final Random RND = new Random(); Modified: historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkManager.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -49,6 +49,10 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; +import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; +import net.sf.japi.swing.IconManager; +import net.sf.japi.util.EmptyEnumeration; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -56,9 +60,6 @@ import org.w3c.dom.NodeList; import org.w3c.dom.ls.DOMImplementationLS; import org.xml.sax.SAXException; -import net.sf.japi.swing.ActionBuilder; -import net.sf.japi.swing.IconManager; -import net.sf.japi.util.EmptyEnumeration; /** Class for managing and displaying Bookmarks. * Usage of this class works the following way: @@ -78,7 +79,7 @@ private BookmarkFolder bookmarks = new BookmarkFolder(); /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.bookmarks"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.bookmarks"); /** The ProgramFrame this BookmarkManager manages bookmarks for. */ private Bookmarkable bookmarkable; Modified: historic/trunk/src/app/net/sf/japi/swing/font/FontChooser.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/font/FontChooser.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/font/FontChooser.java 2007-08-12 11:45:43 UTC (rev 572) @@ -47,8 +47,9 @@ import javax.swing.event.ChangeListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import org.jetbrains.annotations.Nullable; -import net.sf.japi.swing.ActionBuilder; /** Class for letting the user choose a font. * There are two possibilities to use this class: @@ -61,7 +62,7 @@ public class FontChooser extends JComponent implements ListSelectionListener, ChangeListener { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.font"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.font"); /** JList for Font Family. * @serial include Modified: historic/trunk/src/app/net/sf/japi/swing/font/FontPreview.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/font/FontPreview.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/font/FontPreview.java 2007-08-12 11:45:43 UTC (rev 572) @@ -23,6 +23,7 @@ import java.awt.Dimension; import javax.swing.JTextField; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** Font Preview. * Uses a localized text to display the font, but the user may edit the text to try out the characters she's interested in. @@ -35,7 +36,7 @@ private static final long serialVersionUID = 1L; /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.font"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.font"); /** Create a new FontPreview. */ public FontPreview() { Modified: historic/trunk/src/app/net/sf/japi/swing/font/FontStyleListCellRenderer.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/font/FontStyleListCellRenderer.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/font/FontStyleListCellRenderer.java 2007-08-12 11:45:43 UTC (rev 572) @@ -28,6 +28,7 @@ import javax.swing.DefaultListCellRenderer; import javax.swing.JList; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** ListCellRenderer for font styles. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -39,7 +40,7 @@ private static final long serialVersionUID = 1L; /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.font"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.font"); /** {@inheritDoc} */ @Override public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { Modified: historic/trunk/src/app/net/sf/japi/swing/prefs/PreferencesPane.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/prefs/PreferencesPane.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/app/net/sf/japi/swing/prefs/PreferencesPane.java 2007-08-12 11:45:43 UTC (rev 572) @@ -41,6 +41,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** Panel to display preferences. * @serial exclude This class is not intended to be serialized. @@ -50,7 +51,7 @@ public final class PreferencesPane extends JOptionPane implements ListSelectionListener { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.prefs"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.prefs"); /** A map for DIALOGS that are already displaying. * This map is used to prevent the dialog for the same PreferencesGroup be shown twice within the same application. Modified: historic/trunk/src/doc/guide/swing/action/basic/src/ex/Application.java =================================================================== --- historic/trunk/src/doc/guide/swing/action/basic/src/ex/Application.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/doc/guide/swing/action/basic/src/ex/Application.java 2007-08-12 11:45:43 UTC (rev 572) @@ -5,6 +5,7 @@ import java.awt.event.WindowEvent; import javax.swing.JFrame; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.ActionMethod; /** Example application. */ @@ -21,7 +22,7 @@ new Application(); } - private ActionBuilder actionBuilder = ActionBuilder.getActionBuilder("ex"); + private ActionBuilder actionBuilder = ActionBuilderFactory.getInstance().getActionBuilder("ex"); public Application() { frame = new JFrame(actionBuilder.getString("appWindow.title")); Modified: historic/trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java =================================================================== --- historic/trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java 2007-08-12 11:45:43 UTC (rev 572) @@ -6,8 +6,8 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.util.HashMap; import java.util.Map; -import java.util.HashMap; import javax.swing.Action; import javax.swing.JFileChooser; import static javax.swing.JFileChooser.APPROVE_OPTION; @@ -16,15 +16,16 @@ import javax.swing.JTextPane; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; import javax.swing.text.DefaultEditorKit; -import org.jetbrains.annotations.Nullable; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.ActionMethod; import net.sf.japi.swing.ActionProvider; +import org.jetbrains.annotations.Nullable; public class Editor implements ActionProvider { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.examples.editor"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.examples.editor"); /** The supported editor action names and their corresponding kit action names. */ private static final Map<String, String> editorActionNames = new HashMap<String, String>(); Modified: historic/trunk/src/doc/guide/swing/prefs/keys/src/ex/PrefsExampleApp.java =================================================================== --- historic/trunk/src/doc/guide/swing/prefs/keys/src/ex/PrefsExampleApp.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/doc/guide/swing/prefs/keys/src/ex/PrefsExampleApp.java 2007-08-12 11:45:43 UTC (rev 572) @@ -1,13 +1,14 @@ package ex; +import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; +import net.sf.japi.swing.prefs.PreferencesGroup; import static net.sf.japi.swing.prefs.PreferencesPane.showPreferencesDialog; import net.sf.japi.swing.prefs.keys.KeyStrokePrefs; -import net.sf.japi.swing.prefs.PreferencesGroup; -import net.sf.japi.swing.ActionBuilder; public class PrefsExampleApp { - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("ex"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("ex"); /** Main program. * @param args command line arguments Modified: historic/trunk/src/doc/guide/swing/tod/src/ex/TodExampleApp.java =================================================================== --- historic/trunk/src/doc/guide/swing/tod/src/ex/TodExampleApp.java 2007-08-12 09:02:36 UTC (rev 571) +++ historic/trunk/src/doc/guide/swing/tod/src/ex/TodExampleApp.java 2007-08-12 11:45:43 UTC (rev 572) @@ -1,9 +1,12 @@ package ex; + import javax.swing.JButton; import javax.swing.JFrame; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.TipOfTheDayManager; + public class TodExampleApp { public static void main(final String... args) { //System.setProperty("net.sf.japi.swing.tod", "ex.tod"); @@ -11,7 +14,7 @@ } final JFrame frame; public TodExampleApp() { - final ActionBuilder actionBuilder = ActionBuilder.getActionBuilder("ex"); + final ActionBuilder actionBuilder = ActionBuilderFactory.getInstance().getActionBuilder("ex"); frame = new JFrame(actionBuilder.getString("frame.title")); frame.add(new JButton(actionBuilder.createAction(false, "showTod", this))); frame.pack(); Modified: libs/swing-about/trunk/src/net/sf/japi/swing/about/AboutDialog.java =================================================================== --- libs/swing-about/trunk/src/net/sf/japi/swing/about/AboutDialog.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-about/trunk/src/net/sf/japi/swing/about/AboutDialog.java 2007-08-12 11:45:43 UTC (rev 572) @@ -42,6 +42,7 @@ import javax.swing.JTextArea; import javax.swing.SwingConstants; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -100,7 +101,7 @@ public class AboutDialog extends JPanel { /** Action Builder to create Actions. */ - @NotNull protected static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.about"); + @NotNull protected static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.about"); /** Default buffer size for I/O, e.g. when reading a license. */ private static final int BUF_SIZE = 4096; @@ -160,7 +161,7 @@ * @param actionBuilderName Name of the ActionBuilder to use. */ public AboutDialog(@NotNull final String actionBuilderName) { - this(ActionBuilder.getActionBuilder(actionBuilderName)); + this(ActionBuilderFactory.getInstance().getActionBuilder(actionBuilderName)); } /** Modified: libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java 2007-08-12 11:45:43 UTC (rev 572) @@ -26,11 +26,9 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; -import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import static java.util.ResourceBundle.getBundle; -import java.util.WeakHashMap; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; import javax.swing.AbstractAction; @@ -146,7 +144,7 @@ * most common way of using an ActionBuilder. * </li> * <li> - * If you think you're too lazy to hold your own ActionBuilder reference and instead more often call {@link #getActionBuilder(String)}, just go ahead + * If you think you're too lazy to hold your own ActionBuilder reference and instead more often call {@link ActionBuilderFactory#getActionBuilder(String)}, just go ahead * and do so. * Looking up created ActionBuilders is extremely fast, and of course they are initialized exactly once, not more. * </li> @@ -172,9 +170,6 @@ */ @NotNull public static final String ACCELERATOR_KEY_2 = "AcceleratorKey2"; - /** The ActionBuilders. */ - @NotNull private static final Map<String, ActionBuilder> BUILDERS = new WeakHashMap<String, ActionBuilder>(); - /** The parent ActionBuilders. */ @NotNull private final List<ActionBuilder> parents = new LinkedList<ActionBuilder>(); @@ -194,25 +189,6 @@ /** The action providers that were registered and will be queried when an action should be created / retrieved. */ private List<ActionProvider> actionProviders = new ArrayList<ActionProvider>(); - /** Get an ActionBuilder. - * If there is no ActionBuilder with name <var>key</var>, a new ActionBuilder is created and stored. - * Future invocations of this method will constantly return that ActionBuilder unless the key is garbage collected. - * If you must prevent the key from being garbage collected (and with it the ActionBuilder), you may internalize the key ({@link String#intern()}). - * A good name for a key is the application or package name. - * The <code><var>key</var></code> may be a package name, in which case it is tried to load a {@link ResourceBundle} named "action" from that - * package and add it ({@link #addBundle(ResourceBundle)}); nothing special happens if that fails. - * @param key name of ActionBuilder (which even may be <code>null</code> if you are too lazy to invent a key) - * @return ActionBuilder for given key. The builder is created in case it didn't already exist. - */ - @NotNull public static ActionBuilder getActionBuilder(@Nullable final String key) { - ActionBuilder builder = BUILDERS.get(key); - if (builder == null) { - builder = new ActionBuilder(key); - BUILDERS.put(key, builder); - } - return builder; - } - /** Add a ResourceBundle to the list of used bundles. * @param baseName the base name of the resource bundle, a fully qualified class name * @see ResourceBundle#getBundle(String) @@ -294,7 +270,7 @@ /** * Create an ActionBuilder. - * Usually you wouldn't create an ActionBuilder yourself but use {@link #getActionBuilder(String)} for recycling ActionBuilders and profit of easy + * Usually you wouldn't create an ActionBuilder yourself but use {@link ActionBuilderFactory#getActionBuilder(String)} for recycling ActionBuilders and profit of easy * access to the same ActionBuilder from within the whole application without passing around ActionBuilder references. * Don't use this constructor without knowing what you're doing. * It's mainly there for testing purposes. @@ -304,7 +280,7 @@ /** * Create an ActionBuilder. - * Usually you wouldn't create an ActionBuilder yourself but use {@link #getActionBuilder(String)} for recycling ActionBuilders and profit of easy + * Usually you wouldn't create an ActionBuilder yourself but use {@link ActionBuilderFactory#getActionBuilder(String)} for recycling ActionBuilders and profit of easy * access to the same ActionBuilder from within the whole application without passing around ActionBuilder references. * Use this constructor if you explicitely need a new ActionBuilder that doesn't share information (especially the action cache) with other ActionBuilder instances. * @param key name of ActionBuilder. Added: libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilderFactory.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilderFactory.java (rev 0) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilderFactory.java 2007-08-12 11:45:43 UTC (rev 572) @@ -0,0 +1,61 @@ +/* + * JAPI libs-swing-action is a library for creating and managing javax.swing.Action objects. + * Copyright (C) 2007 Christian Hujer. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.sf.japi.swing; + +import java.util.Map; +import java.util.ResourceBundle; +import java.util.WeakHashMap; +import org.jetbrains.annotations.NotNull; + +/** An ActionBuilderFactory provides implementations of {@link ActionBuilder}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class ActionBuilderFactory { + + /** The ActionBuilders. */ + @NotNull public final Map<String, ActionBuilder> actionBuilders = new WeakHashMap<String, ActionBuilder>(); + + /** Create an ActionBuilderFactory. + * @return An ActionBuilderFactory. + */ + public static ActionBuilderFactory getInstance() { + return new ActionBuilderFactory(); + } + + /** Get an ActionBuilder. + * If there is no ActionBuilder with name <var>key</var>, a new ActionBuilder is created and stored. + * Future invocations of this method will constantly return that ActionBuilder unless the key is garbage collected. + * If you must prevent the key from being garbage collected (and with it the ActionBuilder), you may internalize the key ({@link String#intern()}). + * A good name for a key is the application or package name. + * The <code><var>key</var></code> may be a package name, in which case it is tried to load a {@link ResourceBundle} named "action" from that + * package and add it ({@link ActionBuilder#addBundle(ResourceBundle)}); nothing special happens if that fails. + * @param baseName Name of ActionBuilder (which even may be <code>null</code> if you are too lazy to invent a key) + * @return ActionBuilder for given key. The builder is created in case it didn't already exist. + */ + @NotNull public ActionBuilder getActionBuilder(final String baseName) { + ActionBuilder builder = actionBuilders.get(baseName); + if (builder == null) { + builder = new ActionBuilder(baseName); + actionBuilders.put(baseName, builder); + } + return builder; + } + +} // class ActionBuilderFactory Property changes on: libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilderFactory.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java 2007-08-12 11:45:43 UTC (rev 572) @@ -59,7 +59,7 @@ private static final Object[] NO_ARGUMENTS = new Object[0]; /** Action Builder for reading strings. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing"); /** The key used for storing the target object to invoke the method on. * Value Type: {@link Object}. Modified: libs/swing-action/trunk/src/test/net/sf/japi/swing/ReflectionActionTest.java =================================================================== --- libs/swing-action/trunk/src/test/net/sf/japi/swing/ReflectionActionTest.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-action/trunk/src/test/net/sf/japi/swing/ReflectionActionTest.java 2007-08-12 11:45:43 UTC (rev 572) @@ -22,6 +22,7 @@ import java.awt.event.ActionEvent; import java.lang.reflect.Method; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.ActionMethod; import net.sf.japi.swing.ReflectionAction; import org.junit.After; @@ -37,7 +38,7 @@ public class ReflectionActionTest { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("test.net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("test.net.sf.japi.swing"); /** The testling: A ReflectionAction. */ private ReflectionAction testling; Modified: libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java =================================================================== --- libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -48,6 +48,11 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; +import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; +import net.sf.japi.swing.IconManager; +import net.sf.japi.util.EmptyEnumeration; +import org.jetbrains.annotations.NotNull; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -55,10 +60,6 @@ import org.w3c.dom.NodeList; import org.w3c.dom.ls.DOMImplementationLS; import org.xml.sax.SAXException; -import org.jetbrains.annotations.NotNull; -import net.sf.japi.swing.ActionBuilder; -import net.sf.japi.swing.IconManager; -import net.sf.japi.util.EmptyEnumeration; /** Class for managing and displaying Bookmarks. * Usage of this class works the following way: @@ -78,7 +79,7 @@ private BookmarkFolder bookmarks = new BookmarkFolder(); /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.bookmarks"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.bookmarks"); /** The ProgramFrame this BookmarkManager manages bookmarks for. */ private Bookmarkable bookmarkable; Modified: libs/swing-font/trunk/src/net/sf/japi/swing/font/FontChooser.java =================================================================== --- libs/swing-font/trunk/src/net/sf/japi/swing/font/FontChooser.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-font/trunk/src/net/sf/japi/swing/font/FontChooser.java 2007-08-12 11:45:43 UTC (rev 572) @@ -47,7 +47,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionBuilder; -import static net.sf.japi.swing.ActionBuilder.getActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -62,7 +62,7 @@ public class FontChooser extends JComponent implements ListSelectionListener, ChangeListener { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = getActionBuilder("net.sf.japi.swing.font"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.font"); /** JList for Font Family. * @serial include Modified: libs/swing-font/trunk/src/net/sf/japi/swing/font/FontPreview.java =================================================================== --- libs/swing-font/trunk/src/net/sf/japi/swing/font/FontPreview.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-font/trunk/src/net/sf/japi/swing/font/FontPreview.java 2007-08-12 11:45:43 UTC (rev 572) @@ -22,7 +22,7 @@ import java.awt.Dimension; import javax.swing.JTextField; import net.sf.japi.swing.ActionBuilder; -import static net.sf.japi.swing.ActionBuilder.getActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** Font Preview. * Uses a localized text to display the font, but the user may edit the text to try out the characters she's interested in. @@ -35,7 +35,7 @@ private static final long serialVersionUID = 1L; /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = getActionBuilder("net.sf.japi.swing.font"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.font"); /** Default height of the JTextField. */ private static final int DEFAULT_HEIGHT = 64; Modified: libs/swing-font/trunk/src/net/sf/japi/swing/font/FontStyleListCellRenderer.java =================================================================== --- libs/swing-font/trunk/src/net/sf/japi/swing/font/FontStyleListCellRenderer.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-font/trunk/src/net/sf/japi/swing/font/FontStyleListCellRenderer.java 2007-08-12 11:45:43 UTC (rev 572) @@ -27,6 +27,7 @@ import javax.swing.DefaultListCellRenderer; import javax.swing.JList; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -40,7 +41,7 @@ private static final long serialVersionUID = 1L; /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.font"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.font"); /** {@inheritDoc} */ @Override public Component getListCellRendererComponent(@NotNull final JList list, @Nullable final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { Modified: libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java =================================================================== --- libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java 2007-08-12 11:45:43 UTC (rev 572) @@ -19,23 +19,24 @@ package net.sf.japi.swing.prefs.keys; -import java.awt.FlowLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; -import java.awt.Component; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; -import javax.swing.JComponent; +import javax.swing.AbstractAction; +import javax.swing.Action; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JComponent; import javax.swing.JRadioButton; -import javax.swing.JButton; -import javax.swing.AbstractAction; -import javax.swing.Action; import javax.swing.KeyStroke; import javax.swing.border.LineBorder; +import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import org.jetbrains.annotations.Nullable; -import net.sf.japi.swing.ActionBuilder; /** A component for displaying the accellerators of an Action. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -44,7 +45,7 @@ public class ActionKeyDisplay extends JComponent { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.prefs.keys"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.prefs.keys"); /** The action of the button that displays the keystroke and allows changing it. */ private final ActionKeyAction actionKeyAction = new ActionKeyAction(this); Modified: libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokePrefs.java =================================================================== --- libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokePrefs.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokePrefs.java 2007-08-12 11:45:43 UTC (rev 572) @@ -26,6 +26,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.prefs.AbstractPrefs; import net.sf.japi.swing.treetable.JTreeTable; @@ -36,7 +37,7 @@ public class KeyStrokePrefs extends AbstractPrefs implements ListSelectionListener { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.prefs.keys"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.prefs.keys"); /** The ActionKeyDisplay. */ private final ActionKeyDisplay actionKeyDisplay; @@ -69,7 +70,7 @@ private static ActionBuilder[] getBuildersForNames(final String[] builderNames) { final ActionBuilder[] builders = new ActionBuilder[builderNames.length]; for (int i = 0; i < builderNames.length; i++) { - builders[i] = ActionBuilder.getActionBuilder(builderNames[i]); + builders[i] = ActionBuilderFactory.getInstance().getActionBuilder(builderNames[i]); } return builders; } Modified: libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java =================================================================== --- libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java 2007-08-12 11:45:43 UTC (rev 572) @@ -21,6 +21,7 @@ import java.util.List; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.treetable.AbstractTreeTableModel; import net.sf.japi.swing.treetable.TreeTableModel; @@ -31,7 +32,7 @@ public class KeyStrokeTreeTableModel extends AbstractTreeTableModel<KeyStrokeRootNode, AbstractSimpleNode<AbstractSimpleNode>> { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.prefs.keys"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.prefs.keys"); /** Column names. */ private static final String[] COLUMN_NAMES = { Modified: libs/swing-list/trunk/src/net/sf/japi/swing/list/ListControlPanel.java =================================================================== --- libs/swing-list/trunk/src/net/sf/japi/swing/list/ListControlPanel.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-list/trunk/src/net/sf/japi/swing/list/ListControlPanel.java 2007-08-12 11:45:43 UTC (rev 572) @@ -27,6 +27,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.ActionMethod; import org.jetbrains.annotations.NotNull; @@ -37,7 +38,7 @@ public class ListControlPanel extends JComponent implements ListSelectionListener { /** The ActionBuilder for creating the actions. */ - @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.list"); + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.list"); /** Action for moving to top. * @serial include Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-08-12 11:45:43 UTC (rev 572) @@ -26,6 +26,7 @@ import javax.swing.JFileChooser; import javax.swing.JTextField; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.ActionMethod; /** JButton for choosing a file from hd. @@ -34,7 +35,7 @@ public class JFileChooserButton extends JButton { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing"); /** The JTextField to read/write the file path to. * @serial include Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java 2007-08-12 11:45:43 UTC (rev 572) @@ -19,16 +19,17 @@ package net.sf.japi.swing.misc; -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXParseException; -import org.xml.sax.SAXException; +import java.awt.Component; +import javax.swing.JButton; +import javax.swing.JDialog; import javax.swing.JOptionPane; +import javax.swing.JScrollPane; import javax.swing.JTextArea; -import javax.swing.JDialog; -import javax.swing.JButton; -import javax.swing.JScrollPane; -import java.awt.Component; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; /** Implementation of {@link ErrorHandler} for displaying XML parser errors on the screen. * @warning DO NOT RELY ON THE INHERITANCE! @@ -37,7 +38,7 @@ public final class JSAXErrorHandler extends JOptionPane implements ErrorHandler { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing"); /** The JTextArea which displays the errors. * @serial include Modified: libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java =================================================================== --- libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java 2007-08-12 11:45:43 UTC (rev 572) @@ -40,6 +40,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.ActionMethod; /** Panel to display preferences. @@ -50,7 +51,7 @@ public final class PreferencesPane extends JOptionPane implements ListSelectionListener { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.prefs"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.prefs"); /** Width of the horizontal struts between button groups. */ private static final int HORIZONTAL_STRUTS_WIDTH = 50; Modified: libs/swing-tod/trunk/src/net/sf/japi/swing/tod/TipOfTheDayManager.java =================================================================== --- libs/swing-tod/trunk/src/net/sf/japi/swing/tod/TipOfTheDayManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ libs/swing-tod/trunk/src/net/sf/japi/swing/tod/TipOfTheDayManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -20,9 +20,9 @@ package net.sf.japi.swing.tod; import java.awt.Component; +import java.awt.Dialog; import java.awt.Dimension; import java.awt.Font; -import java.awt.Dialog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -50,6 +50,7 @@ import static javax.swing.SwingConstants.TRAILING; import net.sf.japi.swing.ActionBuilder; import static net.sf.japi.swing.ActionBuilder.ACCELERATOR_KEY_2; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.ActionMethod; import static net.sf.japi.swing.IconManager.getDefaultIconManager; import org.jetbrains.annotations.NotNull; @@ -83,7 +84,7 @@ public final class TipOfTheDayManager extends JOptionPane { /** Action Builder. */ - @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.swing.tod"); + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.tod"); /** Random number generator for random tods. */ @NotNull private static final Random RND = new Random(); Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java 2007-08-12 09:02:36 UTC (rev 571) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java 2007-08-12 11:45:43 UTC (rev 572) @@ -45,18 +45,19 @@ import javax.swing.JToolBar; import net.sf.japi.progs.jeduca.jtest.Program; import net.sf.japi.progs.jeduca.jtest.Settings; -import net.sf.japi.progs.jeduca.swing.settings.SettingsModule; -import net.sf.japi.progs.jeduca.swing.settings.SettingsPane; -import net.sf.japi.progs.jeduca.swing.io.ImporterFileFilter; +import net.sf.japi.progs.jeduca.swing.ISwingUtilities; +import net.sf.japi.progs.jeduca.swing.InternalFrameManager; import net.sf.japi.progs.jeduca.swing.MenuManager; +import net.sf.japi.progs.jeduca.swing.OpenURLPane; import net.sf.japi.progs.jeduca.swing.ToolBarManager; -import net.sf.japi.progs.jeduca.swing.InternalFrameManager; -import net.sf.japi.progs.jeduca.swing.OpenURLPane; -import net.sf.japi.progs.jeduca.swing.ISwingUtilities; +import net.sf.japi.progs.jeduca.swing.io.ImporterFileFilter; import net.sf.japi.progs.jeduca.swing.recent.RecentURLsMenu; +import net.sf.japi.progs.jeduca.swing.settings.SettingsModule; +import net.sf.japi.progs.jeduca.swing.settings.SettingsPane; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; +import net.sf.japi.swing.LookAndFeelManager; import net.sf.japi.swing.ToolBarLayout; -import net.sf.japi.swing.LookAndFeelManager; import net.sf.japi.swing.bookmarks.BookmarkManager; import net.sf.japi.swing.bookmarks.Bookmarkable; import org.jetbrains.annotations.NotNull; @@ -83,7 +84,7 @@ private transient BookmarkManager bookmarkManager = new BookmarkManager(this); /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.jtest.gui"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.jtest.gui"); /** The JFileChooser for loading and saving files. * @serial include Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java 2007-08-12 09:02:36 UTC (rev 571) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java 2007-08-12 11:45:43 UTC (rev 572) @@ -36,6 +36,7 @@ import net.sf.japi.progs.jeduca.jtest.Settings; import net.sf.japi.progs.jeduca.swing.ISwingUtilities; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** User Interface for a Collection of Questions. * @author $Author: chris $ @@ -62,7 +63,7 @@ private static final String REVIEW = "Review"; /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.jtest.gui"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.jtest.gui"); /** Index of the currently displayed question. * The value of index is <code>questionCol.getSize() $gt; index $gt;= 0</code> or <code>-1</code> if <code>questionCol == null</code> or the Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -31,16 +31,17 @@ import javax.swing.AbstractAction; import javax.swing.AbstractButton; import javax.swing.Action; +import javax.swing.ActionMap; import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComponent; +import javax.swing.JInternalFrame; import javax.swing.JMenu; import javax.swing.JMenuItem; -import javax.swing.ActionMap; import javax.swing.JToolBar; -import javax.swing.JInternalFrame; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** Base class for Manager classes that manage visibility of components and provide corresponding menus. * <p /> @@ -82,7 +83,7 @@ protected List<JMenu> cMenus = new ArrayList<JMenu>(); /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing"); /** View Show All action. * @see #viewShowAll() Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/InternalFrameManager.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/InternalFrameManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/InternalFrameManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -22,7 +22,7 @@ import javax.swing.Action; import javax.swing.JInternalFrame; -import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** Class for managing internal Frames. * It provides a list of internal frames which can be hidden and shown along with a factory for creating a menu to show and hide these internal frames. @@ -46,10 +46,10 @@ } /** InternalFrames action. */ - private Action internalFrames = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "internalFrames"); + private Action internalFrames = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "internalFrames"); /** InternalFrames configuration action. */ - private Action configureInternalFrames = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "configureInternalFrames", this); + private Action configureInternalFrames = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "configureInternalFrames", this); /** InternalFrames configuration action. */ public void configureInternalFrames() { /* TODO */ } Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/MenuManager.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/MenuManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/MenuManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -21,9 +21,9 @@ package net.sf.japi.progs.jeduca.swing; import javax.swing.Action; +import static javax.swing.Action.NAME; import javax.swing.JMenu; -import static javax.swing.Action.NAME; -import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** Class for managing menus. * It provides a list of menus which can be hidden and shown along with a factory for creating a menu to show and hide these menus. @@ -47,10 +47,10 @@ //} /** Menus action. */ - private Action menus = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "menus"); + private Action menus = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "menus"); /** Menus configuration action. */ - private Action configureMenus = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "configureMenus", this); + private Action configureMenus = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "configureMenus", this); /** Menus configuration action. */ public void configureMenus() { /* TODO */ } Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/OpenURLPane.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/OpenURLPane.java 2007-08-12 09:02:36 UTC (rev 571) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/OpenURLPane.java 2007-08-12 11:45:43 UTC (rev 572) @@ -43,7 +43,7 @@ import javax.swing.JSeparator; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; -import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; /** Class for displaying a Dialog which requests that the user enters a URL or opens a File selection box. * It works quite like {@link JFileChooser}, even a bit simpler. @@ -111,22 +111,22 @@ /** Action for ok button. * @serial include */ - private Action ok = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "ok", this); + private Action ok = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "ok", this); /** Action for cancel button. * @serial include */ - private Action cancel = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "cancel", this); + private Action cancel = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "cancel", this); /** Action for delete button. * @serial include */ - private Action delete = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "delete", this); + private Action delete = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "delete", this); /** Action for selectFile button. * @serial include */ - private Action selectFile = ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "selectFile", this); + private Action selectFile = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").createAction(true, "selectFile", this); /** TextField with user input. * @serial include @@ -168,10 +168,10 @@ pane.fileChooser = fileChooser; final Window w = getWindowForComponent(parent); if (w instanceof Dialog) { - pane.dialog = new JDialog((Dialog)w, ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").getString("openURL"), true); + pane.dialog = new JDialog((Dialog)w, ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").getString("openURL"), true); } else { assert w instanceof Frame; - pane.dialog = new JDialog((Frame)w, ActionBuilder.getActionBuilder("net.sf.japi.progs.jeduca.swing").getString("openURL"), true); + pane.dialog = new JDialog((Frame)w, ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.progs.jeduca.swing").getString("openURL"), true); } pane.dialog.add(pane); pane.dialog.pack(); Modified: progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/ToolBarManager.java =================================================================== --- progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/ToolBarManager.java 2007-08-12 09:02:36 UTC (rev 571) +++ progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/ToolBarManager.java 2007-08-12 11:45:43 UTC (rev 572) @@ -27,6 +27,7 @@ import javax.swing.JPopupMenu; import javax.swing.JToolBar; import net.sf.japi.swing.ActionBuilder; +import net.sf.japi.swing.ActionBuilderFactory; import net.sf.japi.swing.To... [truncated message content] |
From: <chr...@us...> - 2007-08-12 09:02:40
|
Revision: 571 http://japi.svn.sourceforge.net/japi/?rev=571&view=rev Author: christianhujer Date: 2007-08-12 02:02:36 -0700 (Sun, 12 Aug 2007) Log Message: ----------- Renamed ActionFactory to ActionBuilder. Added historic examples to historic module. Removed old action source from historic. Added global IntelliJ IDEA project file for all trunk modules. Modified Paths: -------------- historic/trunk/historic.iml historic/trunk/src/app/net/sf/japi/swing/IconManager.java historic/trunk/src/app/net/sf/japi/swing/JFileChooserButton.java historic/trunk/src/app/net/sf/japi/swing/JSAXErrorHandler.java historic/trunk/src/app/net/sf/japi/swing/LookAndFeelManager.java historic/trunk/src/app/net/sf/japi/swing/TipOfTheDayManager.java historic/trunk/src/app/net/sf/japi/swing/bookmarks/BookmarkManager.java historic/trunk/src/app/net/sf/japi/swing/font/FontChooser.java historic/trunk/src/app/net/sf/japi/swing/font/FontPreview.java historic/trunk/src/app/net/sf/japi/swing/font/FontStyleListCellRenderer.java historic/trunk/src/app/net/sf/japi/swing/prefs/PreferencesPane.java historic/trunk/src/app/overview.html historic/trunk/src/doc/changes.xhtml historic/trunk/src/doc/guide/io/src/GrepJAPI.java historic/trunk/src/doc/guide/start.xhtml historic/trunk/src/doc/guide/swing/action/basic/src/ex/Application.java historic/trunk/src/doc/guide/swing/action/basic/start.xhtml historic/trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/Editor.java historic/trunk/src/doc/guide/swing/action/fromScratch/src/net/sf/japi/examples/editor/action.properties historic/trunk/src/doc/guide/swing/action/fromScratch/start.xhtml historic/trunk/src/doc/guide/swing/prefs/keys/build.xml historic/trunk/src/doc/guide/swing/tod/build.xml historic/trunk/src/doc/releasePlan.xhtml historic/trunk/src/doc/tasks.xhtml libs/argparser/trunk/src/net/sf/japi/io/args/package-info.java libs/swing-about/trunk/src/net/sf/japi/swing/about/AboutDialog.java libs/swing-action/trunk/src/net/sf/japi/swing/ActionMethod.java libs/swing-action/trunk/src/net/sf/japi/swing/DisposeAction.java libs/swing-action/trunk/src/net/sf/japi/swing/IconManager.java libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java libs/swing-action/trunk/src/test/net/sf/japi/swing/ReflectionActionTest.java libs/swing-bookmarks/trunk/src/net/sf/japi/swing/bookmarks/BookmarkManager.java libs/swing-font/trunk/src/net/sf/japi/swing/font/FontChooser.java libs/swing-font/trunk/src/net/sf/japi/swing/font/FontPreview.java libs/swing-font/trunk/src/net/sf/japi/swing/font/FontStyleListCellRenderer.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/ActionMapNode.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokePrefs.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeRootNode.java libs/swing-keyprefs/trunk/src/net/sf/japi/swing/prefs/keys/KeyStrokeTreeTableModel.java libs/swing-list/trunk/src/net/sf/japi/swing/list/ListControlPanel.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java libs/swing-tod/trunk/src/net/sf/japi/swing/tod/TipOfTheDayManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/ProgramFrame.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/QuestionCollectionGUI.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/jtest/gui/SettingsPanel.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/AbstractManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/InternalFrameManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/MenuManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/OpenURLPane.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/ToolBarManager.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/package.html progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/recent/RecentURLsMenu.java progs/jeduca/trunk/src/net/sf/japi/progs/jeduca/swing/settings/SettingsPane.java progs/jeduca/trunk/src/net/sf/japi/swing/LookAndFeelManager.java tools/fontbrowser/trunk/src/net/sf/japi/tools/fontbrowser/FontBrowser.java tools/keystrokes/trunk/src/net/sf/japi/tools/keystrokes/KeyStrokes.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsBrowser.java tools/prefsbrowser/trunk/src/net/sf/japi/tools/prefsbrowser/PrefsTreeTableModel.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/CodecSelectionPanel.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/DoubleListController.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/ListOrderController.java tools/string2bytes/trunk/src/net/sf/japi/string2bytes/String2Bytes.java Added Paths: ----------- historic/trunk/src/doc/guide/swing/prefs/keys/src/ex/PrefsExampleApp.java historic/trunk/src/doc/guide/swing/tod/src/ex/TodExampleApp.java japi.ipr libs/swing-action/trunk/src/net/sf/japi/swing/ActionBuilder.java libs/swing-action/trunk/src/test/net/sf/japi/swing/ActionBuilderTest.java Removed Paths: ------------- historic/trunk/src/app/net/sf/japi/swing/ActionFactory.java historic/trunk/src/app/net/sf/japi/swing/ActionMethod.java historic/trunk/src/app/net/sf/japi/swing/ActionProvider.java historic/trunk/src/app/net/sf/japi/swing/DisposeAction.java historic/trunk/src/app/net/sf/japi/swing/DummyAction.java historic/trunk/src/app/net/sf/japi/swing/NamedActionMap.java historic/trunk/src/app/net/sf/japi/swing/ReflectionAction.java historic/trunk/src/app/net/sf/japi/swing/ToggleAction.java historic/trunk/src/doc/guide/swing/prefs/keys/src/ex/App.java historic/trunk/src/doc/guide/swing/tod/src/ex/App.java libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java libs/swing-action/trunk/src/test/net/sf/japi/swing/ActionFactoryTest.java Modified: historic/trunk/historic.iml =================================================================== --- historic/trunk/historic.iml 2007-08-11 22:48:16 UTC (rev 570) +++ historic/trunk/historic.iml 2007-08-12 09:02:36 UTC (rev 571) @@ -5,11 +5,19 @@ <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/doc/guide/io/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/doc/guide/swing/action/basic/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/doc/guide/swing/action/fromScratch/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/doc/guide/swing/prefs/keys/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/doc/guide/swing/tod/src" isTestSource="false" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" name="annotations" level="project" /> <orderEntry type="module" module-name="libs-lang" /> + <orderEntry type="module" module-name="libs-swing-action" /> + <orderEntry type="module" module-name="libs-swing-keyprefs" /> + <orderEntry type="module" module-name="libs-argparser" /> <orderEntryProperties /> </component> <component name="copyright"> Deleted: historic/trunk/src/app/net/sf/japi/swing/ActionFactory.java =================================================================== --- historic/trunk/src/app/net/sf/japi/swing/ActionFactory.java 2007-08-11 22:48:16 UTC (rev 570) +++ historic/trunk/src/app/net/sf/japi/swing/ActionFactory.java 2007-08-12 09:02:36 UTC (rev 571) @@ -1,1099 +0,0 @@ -/* JAPI - (Yet another (hopefully) useful) Java API - * - * Copyright (C) 2004-2006 Christian Hujer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -package net.sf.japi.swing; - -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.lang.reflect.Field; -import java.text.MessageFormat; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -import static java.util.ResourceBundle.getBundle; -import java.util.WeakHashMap; -import java.util.ArrayList; -import java.util.prefs.Preferences; -import static java.util.prefs.Preferences.userNodeForPackage; -import javax.swing.AbstractAction; -import javax.swing.Action; -import static javax.swing.Action.ACCELERATOR_KEY; -import static javax.swing.Action.LONG_DESCRIPTION; -import static javax.swing.Action.MNEMONIC_KEY; -import static javax.swing.Action.NAME; -import static javax.swing.Action.SHORT_DESCRIPTION; -import static javax.swing.Action.SMALL_ICON; -import javax.swing.ActionMap; -import javax.swing.Icon; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JToolBar; -import javax.swing.JPopupMenu; -import static javax.swing.KeyStroke.getKeyStroke; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import static net.sf.japi.swing.IconManager.getDefaultIconManager; -import static net.sf.japi.swing.ReflectionAction.REFLECTION_MESSAGE_PROVIDER; -import static net.sf.japi.swing.ReflectionAction.REFLECTION_TARGET; -import static net.sf.japi.swing.ToggleAction.REFLECTION_PROPERTY_NAME; - -/** Class for creating and initializing {@link Action}s that are localized, user configurable and may invoke their final methods using Reflection; - * also handles extremely much useful stuff for i18n/l10n. - * It is meant as a general service for creating Action objects that have some comfort for the programmer in several aspects: - * <ul> - * <li>Allow zero or more ResourceBundles to be used when creating Actions</li> - * <li>Allow zero or more UserPreferences to be used when creating Actions</li> - * <li>Manage an ActionMap to which created Actions are automatically added</li> - * </ul> - * You may choose to use one or more ActionFactories, depending on the size of your application. - * You may use to spread Action configuration information accross one or more ResourceBundles and one or more Preferences, as you wish. - * When looking for values, the Preferences are queried first, in addition order, after that the ResourceBundles, again in addition order, until - * a value was found. The behaviour when no value was found is undefined. - * <h3>Usage</h3> - * The recommended usage is to - * <ol> - * <li> - * create and initialize an ActionFactory similar as the following example code, put it somewhere at the start of your program: - * <pre> - * ActionFactory myActionFactory = ActionFactory.getFactory("MyApplication"); - * myActionFactory.addBundle("com.mycompany.mypackage.myresource"); // not always required - * myActionFactory.addPref(MyClass.class); - * </pre> - * </li> - * <li> - * then use the ActionFactory from anywhere within the application like this: - * <pre> - * ActionFactory myActionFactory = ActionFactory.getFactory("MyApplication"); - * Action myAction = myActionFactory.createAction("load", this); - * </pre> - * </li> - * </ol> - * <p> - * All actions created or initialized by an instance of this class are optionally put into that instance's {@link ActionMap}. - * If they are stored, you can use that map for later retrieval. - * </p> - * <h4>Usage Notes: Factory Name</h4> - * <ul> - * <li> - * The factory name is used to try to load a resource bundle when a bundle is created. - * The factory name is used as package name for the bundle, the bundle name itself is "action". - * Example: When calling <code>ActionFactory.getFactory("net.sf.japi.swing");</code> for the first time, it is tried to load a - * {@link ResourceBundle} named <code>net.sf.japi.swing.actions</code> for that <code>ActionFactory</code>. - * This automatism has been implemented to save you from the need of initializing an ActionFactory before use. - * </li> - * </ul> - * <h4>Usage Notes: Action Key / Action Name</h4> - * The key you supply as first argument of {@link #createAction(boolean, String, Object)} determines several things: - * <ul> - * <li>The base name for the different keys in the preferences / resource bundle and other known Action Keys: - * <table border="1"> - * <tr><th>What</th><th>Preferences / Bundle key</th><th>Action key if stored in an action</th></tr> - * <tr><td>An (somewhat unique) ID</td><td>(<var>basename</var> itself)</td><td>{@link #ACTION_ID}</td></tr> - * <tr><td>The icon</td><td><code><var>basename</var> + ".icon"</code></td><td>{@link Action#SMALL_ICON}</td></tr> - * <tr><td>The tooltip help</td><td><code><var>basename</var> + ".shortdescription"</code></td><td>{@link Action#SHORT_DESCRIPTION}</td></tr> - * <tr><td>The long help</td><td><code><var>basename</var> + ".longdescription"</code></td><td>{@link Action#LONG_DESCRIPTION}</td></tr> - * <tr><td>The text label</td><td><code><var>basename</var> + ".text"</code></td><td>{@link Action#NAME}</td></tr> - * <tr><td>The keyboard accelerator</td><td><code><var>basename</var> + ".accel"</code></td><td>{@link Action#ACCELERATOR_KEY}</td></tr> - * <tr><td>The alternate keyboard accelerator</td><td><code><var>basename</var> + ".accel2"</code></td><td>{@link #ACCELERATOR_KEY_2}</td></tr> - * <tr><td>The mnemonic</td><td><code><var>basename</var> + ".mnemonic"</code></td><td>{@link Action#MNEMONIC_KEY}</td></tr> - * <tr><td>The method name</td><td></td><td>{@link ReflectionAction#REFLECTION_METHOD_NAME}</td></tr> - * <tr><td>The method</td><td></td><td>{@link ReflectionAction#REFLECTION_METHOD}</td></tr> - * <tr><td>The boolean property name</td><td></td><td>{@link ToggleAction#REFLECTION_PROPERTY_NAME}</td></tr> - * <tr><td>The target instance</td><td></td><td>{@link ReflectionAction#REFLECTION_TARGET}</td></tr> - * <tr><td>Exception handler dialogs</td><td><code><var>basename</var> + ".exception." + <var>exception class name</var> + ...</code><br/>The message can be formatted with 1 parameter that will be the localized message of the thrown exception.</td><td>n/a</td></tr> - * </table> - * </li> - * </ul> - * <p>Some methods are not related to actions, yet take base keys:</p> - * <ul> - * <li>The methods for dialogs, e.g. {@link #showMessageDialog(Component, String, Object...)}: - * <table border="1"> - * <tr><th>What</th><th>Preferences / Bundle key</th></tr> - * <tr><td>Dialog title</td><td><code><var>basename</var> + ".title"</code></td></tr> - * <tr><td>Dialog message</td><td><code><var>basename</var> + ".message"</code></td></tr> - * <tr><td>Dialog messagetype </td><td><code><var>basename</var> + ".messagetype"</code><br/>The message type should be one of the message types defined in {@link JOptionPane}, e.g. {@link JOptionPane#PLAIN_MESSAGE}.</td></tr> - * </table> - * </li> - * </ul> - * <h4>Final Notes</h4> - * <ul> - * <li> - * If by having read all this you think it might often be a good idea to use a package name as a factory name: this is completely right and the - * most common way of using an ActionFactory. - * </li> - * <li> - * If you think you're too lazy to hold your own ActionFactory reference and instead more often call {@link #getFactory(String)}, just go ahead - * and do so. - * Looking up created ActionFactories is extremely fast, and of course they are initialized exactly once, not more. - * </li> - * </ul> - * @see AbstractAction - * @see Action - * @see Preferences - * @see ResourceBundle - * @todo think about toolbar interaction - * @todo think about toolbar configuration - * @todo eventually rename this ActionBuilder and provide an ActionBuilderFactory. - * @todo whether a dialog is a onetime dialog should be a property and user configurable - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public final class ActionFactory { - - /** The key used for storing a somewhat unique id for this Action. */ - @NotNull public static final String ACTION_ID = "ActionID"; - - /** The key used for storing an alternative accelerator for this Action. - * Currently unused. - */ - @NotNull public static final String ACCELERATOR_KEY_2 = "AcceleratorKey2"; - - /** The ActionFactories. */ - @NotNull private static final Map<String, ActionFactory> FACTORIES = new WeakHashMap<String, ActionFactory>(); - - /** The parent ActionFactories. */ - @NotNull private final List<ActionFactory> parents = new LinkedList<ActionFactory>(); - - /** The ResourceBundles to look for. - * Type: ResourceBundle - */ - @NotNull private final List<ResourceBundle> bundles = new LinkedList<ResourceBundle>(); - - /** The Preferences to look for. - * Type: Preferences - */ - @NotNull private final List<Preferences> prefs = new LinkedList<Preferences>(); - - /** The ActionMap to which created Actions are automatically added. */ - @NotNull private final ActionMap actionMap = new NamedActionMap(); - - private List<ActionProvider> actionProviders = new ArrayList<ActionProvider>(); - - /** Get an ActionFactory. - * If there is no ActionFactory with name <var>key</var>, a new ActionFactory is created and stored. - * Future invocations of this method will constantly return that ActionFactory unless the key is garbage collected. - * If you must prevent the key from being garbage collected (and with it the ActionFactory), you may internalize the key ({@link String#intern()}). - * A good name for a key is the application or package name. - * The <code><var>key</var></code> may be a package name, in which case it is tried to load a {@link ResourceBundle} named "action" from that - * package and add it ({@link #addBundle(ResourceBundle)}); nothing special happens if that fails. - * @param key name of ActionFactory (which even may be <code>null</code> if you are too lazy to invent a key) - * @return ActionFactory for given key. The factory is created in case it didn't already exist. - */ - @NotNull public static ActionFactory getFactory(@Nullable final String key) { - ActionFactory factory = FACTORIES.get(key); - if (factory == null) { - factory = new ActionFactory(); - FACTORIES.put(key, factory); - try { - factory.addBundle(key + ".action"); - } catch (final MissingResourceException e) { - /* ignore */ - } - // eventually initialize factory here - } - return factory; - } - - /** Add a ResourceBundle to the list of used bundles. - * @param baseName the base name of the resource bundle, a fully qualified class name - * @see ResourceBundle#getBundle(String) - */ - public void addBundle(@NotNull final String baseName) { - //noinspection ConstantConditions - if (baseName == null) { - throw new NullPointerException("null bundle name not allowed"); - } - @NotNull final ResourceBundle newBundle = getBundle(baseName); - addBundle(newBundle); - @Nullable final String additionalBundles = newBundle.getString("ActionFactory.additionalBundles"); - if (additionalBundles != null) { - for (final String additionalBundle : additionalBundles.split("\\s+")) { - addBundle(additionalBundle); - } - } - } - - /** Method to find the JMenuItem for a specific Action. - * @param menuBar JMenuBar to search - * @param action Action to find JMenuItem for - * @return JMenuItem for action or <code>null</code> if none found - * @throws NullPointerException if <var>action</var> or <var>menuBar</var> is <code>null</code> - */ - @Nullable public static JMenuItem find(@NotNull final JMenuBar menuBar, @NotNull final Action action) { - //noinspection ConstantConditions - if (menuBar == null) { - throw new NullPointerException("null JMenuBar not allowed"); - } - //noinspection ConstantConditions - if (action == null) { - throw new NullPointerException("null Action not allowed"); - } - for (int i = 0; i < menuBar.getMenuCount(); i++) { - final JMenu menu = menuBar.getMenu(i); - if (menu.getAction() == action) { - return menu; - } else { - final JMenuItem ret = find(menu, action); - if (ret != null) { - return ret; - } - } - } - return null; - } - - /** Method to find the JMenuItem for a specific Action. - * @param menu JMenu to search - * @param action Action to find JMenuItem for - * @return JMenuItem for action or <code>null</code> if none found - * @throws NullPointerException if <var>menu</var> or <var>action</var> is <code>null</code> - */ - @Nullable public static JMenuItem find(@NotNull final JMenu menu, @NotNull final Action action) { - for (int i = 0; i < menu.getItemCount(); i++) { - final JMenuItem item = menu.getItem(i); - if (item == null) { - // Ignore Separators - } else if (item.getAction() == action) { - return item; - } else if (item instanceof JMenu) { - final JMenuItem ret = find((JMenu) item, action); - if (ret != null) { - return ret; - } - } - } - return null; - } - - /** Create an ActionFactory. - * This constructor is private to force users to use the method {@link #getFactory(String)} for recycling ActionFactories and profit of easy - * access to the same ActionFactory from within the whole application without passing around ActionFactory references. - */ - private ActionFactory() { - } - - /** Get the ActionMap. - * @return ActionMap - */ - @NotNull public ActionMap getActionMap() { - return actionMap; - } - - /** Add a ResourceBundle to the list of used bundles. - * @param bundle ResourceBundle to add - * @throws NullPointerException if <code>bundle == null</code> - */ - public void addBundle(@NotNull final ResourceBundle bundle) throws NullPointerException { - //noinspection ConstantConditions - if (bundle == null) { - throw new NullPointerException("null ResourceBundle not allowed"); - } - if (!bundles.contains(bundle)) { - // insert first because new bundles override old bundles - bundles.add(0, bundle); - } - } - - /** Add a parent to the list of used parents. - * @param parent Parent to use if lookups failed in this ActionFactory - * WARNING: Adding a descendents as parents of ancestors or vice versa will result in endless recursion and thus stack overflow! - * @throws NullPointerException if <code>parent == null</code> - */ - public void addParent(@NotNull final ActionFactory parent) throws NullPointerException { - //noinspection ConstantConditions - if (parent == null) { - throw new NullPointerException("null ActionFactory not allowed"); - } - parents.add(parent); - } - - /** Add a Preferences to the list of used preferences. - * @param pref Preferences to add - * @throws NullPointerException if <code>pref == null</code> - */ - public void addPref(@NotNull final Preferences pref) throws NullPointerException { - //noinspection ConstantConditions - if (pref == null) { - throw new NullPointerException("null ResourceBundle not allowed"); - } - if (!prefs.contains(pref)) { - prefs.add(pref); - } - } - - /** Add a Preferences to the list of used preferences. - * @param clazz the class whose package a user preference node is desired - * @see Preferences#userNodeForPackage(Class) - * @throws NullPointerException if <code>clazz == null</code> - */ - public void addPref(@NotNull final Class<?> clazz) { - //noinspection ConstantConditions - if (clazz == null) { - throw new NullPointerException("null Class not allowed"); - } - addPref(userNodeForPackage(clazz)); - } - - /** Creates actions. - * This is a loop variant of {@link #createAction(boolean,String)}. - * The actions created can be retrieved using {@link #getAction(String)} or via the ActionMap returned by {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param keys Keys of actions to create - * @return Array with created actions - * @throws NullPointerException in case keys is or contains <code>null</code> - */ - public Action[] createActions(final boolean store, @NotNull final String... keys) throws NullPointerException { - final Action[] actions = new Action[keys.length]; - for (int i = 0; i < keys.length; i++) { - actions[i] = createAction(store, keys[i]); - } - return actions; - } - - /** Create an Action. - * The created Action is automatically stored together with all other Actions created by this Factory instance in an ActionMap, which you can - * retreive using {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param key Key for Action, which is used as basename for access to Preferences and ResourceBundles and as ActionMap key (may not be - * <code>null</code>) - * @return created Action, which is a dummy in the sense that its {@link Action#actionPerformed(ActionEvent)} method does not do anything - * @throws NullPointerException in case <var>key</var> was <code>null</code> - * @see #createAction(boolean,String,Object) - * @see #createToggle(boolean,String,Object) - * @see #initAction(boolean,Action,String) - */ - public Action createAction(final boolean store, @NotNull final String key) throws NullPointerException { - // initAction() checks for null key - return initAction(store, new DummyAction(), key); - } - - /** Initialize an Action. - * This is a convenience method for Action users which want to use the services provided by this {@link ActionFactory} class but need more - * sophisticated Action objects they created on their own. - * So you can simply create an Action and pass it to this Initialization method to fill its data. - * The initialized Action is automatically stored together with all other Actions created by this Factory instance in an ActionMap, which you can - * retreive using {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param action Action to fill - * @param key Key for Action, which is used as basename for access to Preferences and ResourceBundles and as ActionMap key (may not be <code>null</code>) - * @return the supplied Action object (<var>action</var>) is returned for convenience - * @throws NullPointerException in case <var>key</var> was <code>null</code> - */ - @SuppressWarnings({"NestedAssignment"}) - public Action initAction(final boolean store, @NotNull final Action action, @NotNull final String key) throws NullPointerException { - if (key == null) { throw new NullPointerException("null key for Action initialization not allowed."); } - action.putValue(ACTION_ID, key); - String value; - if ((value = getString(key + ".text" )) != null) { action.putValue(NAME, value); } - if ((value = getString(key + ".shortdescription")) != null) { action.putValue(SHORT_DESCRIPTION, value); } - if ((value = getString(key + ".longdescription" )) != null) { action.putValue(LONG_DESCRIPTION, value); } - if ((value = getString(key + ".accel" )) != null) { action.putValue(ACCELERATOR_KEY, getKeyStroke(value)); } - if ((value = getString(key + ".accel2" )) != null) { action.putValue(ACCELERATOR_KEY_2, getKeyStroke(value)); } - if ((value = getString(key + ".mnemonic" )) != null) { action.putValue(MNEMONIC_KEY, getKeyStroke(value).getKeyCode()); } - if ((value = getString(key + ".icon" )) != null) { - final Icon image = getDefaultIconManager().getIcon(value); - if (image != null) { action.putValue(SMALL_ICON, image); } - } - action.putValue(REFLECTION_MESSAGE_PROVIDER, this); - if (store) { - actionMap.put(key, action); - } - return action; - } - - /** Get a String. - * First looks one pref after another, in their addition order. - * Then looks one bundle after another, in their addition order. - * @param key Key to get String for - * @return the first value found or <code>null</code> if no value could be found - * @throws NullPointerException if <var>key</var> is <code>null</code> - */ - @Nullable public String getString(@NotNull final String key) throws NullPointerException { - if (key == null) { - throw new NullPointerException("null key not allowed"); - } - String value = null; - for (final Preferences pref : prefs) { - value = pref.get(key, value); - if (value != null) { - return value; - } - } - for (final ResourceBundle bundle : bundles) { - try { - value = bundle.getString(key); - return value; - } catch (final MissingResourceException e) { /* ignore */ - } catch (final ClassCastException e) { /* ignore */ - } // ignore exceptions because they don't mean errors just there's no resource, so parents are checked or null is returned. - } - for (final ActionFactory parent : parents) { - value = parent.getString(key); - if (value != null) { - return value; - } - } - return null; - } - - /** Get a String from the preferences, ignoring the resource bundles. - * @param key Key to get String for - * @return the first value found or <code>null</code> if no value could be found - * @throws NullPointerException if <var>key</var> is <code>null</code> - */ - @Nullable public String getStringFromPrefs(@NotNull final String key) throws NullPointerException { - if (key == null) { - throw new NullPointerException("null key not allowed"); - } - String value = null; - for (final Preferences pref : prefs) { - value = pref.get(key, value); - if (value != null) { - return value; - } - } - for (final ActionFactory parent : parents) { - value = parent.getStringFromPrefs(key); - if (value != null) { - return value; - } - } - return null; - } - - /** Get a String from the resource bundles, ignoring the preferences. - * @param key Key to get String for - * @return the first value found or <code>null</code> if no value could be found - * @throws NullPointerException if <var>key</var> is <code>null</code> - */ - @Nullable public String getStringFromBundles(@NotNull final String key) throws NullPointerException { - if (key == null) { - throw new NullPointerException("null key not allowed"); - } - String value; - for (final ResourceBundle bundle : bundles) { - try { - value = bundle.getString(key); - return value; - } catch (final MissingResourceException e) { /* ignore */ - } catch (final ClassCastException e) { /* ignore */ - } // ignore exceptions because they don't mean errors just there's no resource, so parents are checked or null is returned. - } - for (final ActionFactory parent : parents) { - value = parent.getStringFromBundles(key); - if (value != null) { - return value; - } - } - return null; - } - /** Creates actions. - * This is a loop variant of {@link #createAction(boolean,String,Object)}. - * The actions created can be retrieved using {@link #getAction(String)} or via the ActionMap returned by {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param target Target object - * @param keys Keys of actions to create - * @return Array with created actions - * @throws NullPointerException in case keys is or contains <code>null</code> - */ - public Action[] createActions(final boolean store, final Object target, final String... keys) throws NullPointerException { - final Action[] actions = new Action[keys.length]; - for (int i = 0; i < keys.length; i++) { - actions[i] = createAction(store, keys[i], target); - } - return actions; - } - - /** Create an Action. - * The created Action is automatically stored together with all other Actions created by this Factory instance in an ActionMap, which you can - * retreive using {@link #getActionMap()}. - * The supplied object needs to have a zero argument method named <var>key</var>. - * You may pass <code>null</code> as object, which means that the object the method is invoked on is not defined yet. - * You may safely use the Action, it will not throw any Exceptions upon {@link Action#actionPerformed(ActionEvent)} but simply silently do nothing. - * The desired object can be set later using <code>action.putValue({@link ReflectionAction#REFLECTION_TARGET}, <var>object</var>)</code>. - * <p /> - * Users of this method can assume that the returned object behaves quite like {@link ReflectionAction}. - * Wether or not this method returns an instance of {@link ReflectionAction} should not be relied on. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param key Key for Action, which is used as basename for access to Preferences and ResourceBundles, as ActionMap key and as Reflection Method - * name within the supplied object (may not be <code>null</code>) - * @param object Instance to invoke method on if the Action was activated ({@link Action#actionPerformed(ActionEvent)}) - * @return created Action - * @throws NullPointerException in case <var>key</var> was <code>null</code> - * @see #createAction(boolean,String) - * @see #createToggle(boolean,String,Object) - * @see #initAction(boolean,Action,String) - */ - public Action createAction(final boolean store, final String key, final Object object) throws NullPointerException { - if (key == null) { throw new NullPointerException("null key for Action creation not allowed."); } - final Action action = new ReflectionAction(key, object); - initAction(store, action, key); - return action; - } - - /** Method for creating a Menu. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param menuKey action key for Menu - * @param keys Action keys for menu items - * @return menu created from the menu definition found - * @throws Error in case action definitions for <var>keys</var> weren't found - */ - public JMenu createMenu(final boolean store, final String menuKey, final String... keys) throws Error { - final JMenu menu = new JMenu(createAction(store, menuKey)); - for (final String key : keys) { - if (key != null && key.length() == 0) { - /* ignore this for empty menus */ - } else if (key == null || "-".equals(key) || "|".equals(key)) { - menu.addSeparator(); - } else { - final Action action = getAction(key); - if (action == null) { - throw new Error("No Action for key " + key); - } - if (action instanceof ToggleAction) { - menu.add(((ToggleAction) action).createCheckBoxMenuItem()); - } else { - menu.add(action); - } - } - } - return menu; - } - - /** Get an Action. - * For an action to be retrieved with this method, it must have been initialized with {@link #initAction(boolean,Action,String)}, either directly by - * invoking {@link #initAction(boolean,Action,String)} or indirectly by invoking one of this class' creation methods like {@link #createAction(boolean,String)}, - * {@link #createAction(boolean,String,Object)} or {@link #createToggle(boolean,String,Object)}. - * @param key Key of action to get - * @return Action for <var>key</var> - * This method does the same as <code>getActionMap().get(key)</code>. - */ - public Action getAction(final String key) { - Action action = actionMap.get(key); - if (action == null) { - for (final ActionProvider actionProvider : actionProviders) { - action = actionProvider.getAction(key); - if (action != null) { - actionMap.put(key, action); - break; - } - } - } - return action; - } - - /** Method for creating a menubar. - * @param store whether to store the initialized Actions in the ActionMap of this ActionFactory - * @param barKey Action key of menu to create - * @return JMenuBar created for <var>barKey</var> - * @throws NullPointerException if no menubar definition was found - * @todo make error handling consistent (see createMenu and others) - */ - @NotNull public JMenuBar createMenuBar(final boolean store, final String barKey) throws NullPointerException { - final JMenuBar menuBar = new JMenuBar(); - //noinspection ConstantConditions - for (final String key : getString(barKey + ".menubar").split("\\s+")) { - menuBar.add(createMenu(store, key)); - } - return menuBar; - } - - /** Method for creating a popup menu. - * @param store whether to store the initialized Actions in the ActionMap of this ActionFactory - * @param popupKey Action key of popup menu to create - * @return JPopupMenu created for <var>popupKey</var> - * @throws NullPointerException if no menubar definition was found - * @todo make error handling consistent (see createMenu and others) - */ - @NotNull public JPopupMenu createPopupMenu(final boolean store, final String popupKey) throws NullPointerException { - final JPopupMenu menu = new JPopupMenu(); - for (final String key : getString(popupKey + ".menu").split("\\s+")) { - if (key != null && key.length() == 0) { - /* ignore this for empty menus */ - } else if (key == null || "-".equals(key) || "|".equals(key)) { - menu.addSeparator(); - } else if (getString(key + ".menu") != null) { - menu.add(createMenu(store, key)); - } else { - final Action action = getAction(key); - if (action == null) { - throw new Error("No Action for key " + key); - } - if (action instanceof ToggleAction) { - menu.add(((ToggleAction) action).createCheckBoxMenuItem()); - } else { - menu.add(action); - } - } - } - return menu; - } - - /** Method for creating a Menu. - * This method assumes that the underlying properties contain an entry like <code>key + ".menu"</code> which lists the menu element's keys. - * Submenus are build recursively. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param menuKey action key for menu - * @return menu created from the menu definition found - * @throws Error in case a menu definition for <var>menuKey</var> wasn't found - */ - public JMenu createMenu(final boolean store, final String menuKey) throws Error { - final JMenu menu = new JMenu(createAction(store, menuKey)); - for (final String key : getString(menuKey + ".menu").split("\\s+")) { - if (key != null && key.length() == 0) { - /* ignore this for empty menus */ - } else if (key == null || "-".equals(key) || "|".equals(key)) { - menu.addSeparator(); - } else if (getString(key + ".menu") != null) { - menu.add(createMenu(store, key)); - } else { - final Action action = getAction(key); - if (action == null) { - throw new Error("No Action for key " + key); - } - if (action instanceof ToggleAction) { - menu.add(((ToggleAction) action).createCheckBoxMenuItem()); - } else { - menu.add(action); - } - } - } - return menu; - } - - /** Method for creating a menubar. - * @param store whether to store the initialized Actions in the ActionMap of this ActionFactory - * @param barKey Action key of menu to create - * @param target Target object - * @return JMenuBar created for <var>barKey</var> - */ - public JMenuBar createMenuBar(final boolean store, final String barKey, final Object target) { - final JMenuBar menuBar = new JMenuBar(); - final String menuBarSpec = getString(barKey + ".menubar"); - if (menuBarSpec == null) { - throw new RuntimeException("Missing Resource for " + barKey + ".menubar"); - } - for (final String key : menuBarSpec.split("\\s+")) { - menuBar.add(createMenu(store, key, target)); - } - return menuBar; - } - - /** Method for creating a popup menu. - * @param store whether to store the initialized Actions in the ActionMap of this ActionFactory - * @param popupKey Action key of popup menu to create - * @param target Target object - * @return JPopupMenu created for <var>barKey</var> - */ - public JPopupMenu createPopupMenu(final boolean store, final String popupKey, final Object target) { - final JPopupMenu menu = new JPopupMenu(); - for (final String key : getString(popupKey + ".menu").split("\\s+")) { - if (key != null && key.length() == 0) { - /* ignore this for empty menus */ - } else if (key == null || "-".equals(key) || "|".equals(key)) { - menu.addSeparator(); - } else if (getString(key + ".menu") != null) { - menu.add(createMenu(store, key, target)); - } else { - Action action = null; - if (store) { - action = getAction(key); - } - if (action == null) { - action = createAction(store, key, target); - } - if (action == null) { - throw new Error("No Action for key " + key); - } - if (action instanceof ToggleAction) { - menu.add(((ToggleAction) action).createCheckBoxMenuItem()); - } else { - menu.add(action); - } - } - } - return menu; - } - - /** Method for creating a Menu. - * This method assumes that the underlying properties contain an entry like <code>key + ".menu"</code> which lists the menu element's keys. - * Submenus are build recursively. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param menuKey action key for menu - * @param target Target object - * @return menu created from the menu definition found - * @throws Error in case a menu definition for <var>menuKey</var> wasn't found - */ - public JMenu createMenu(final boolean store, final String menuKey, final Object target) throws Error { - final JMenu menu = new JMenu(createAction(store, menuKey)); - for (final String key : getString(menuKey + ".menu").split("\\s+")) { - if (key != null && key.length() == 0) { - /* ignore this for empty menus */ - } else if (key == null || "-".equals(key) || "|".equals(key)) { - menu.addSeparator(); - } else if (getString(key + ".menu") != null) { - menu.add(createMenu(store, key, target)); - } else { - Action action = null; - if (store) { - action = getAction(key); - } - if (action == null) { - action = createAction(store, key, target); - } - if (action == null) { - throw new Error("No Action for key " + key); - } - if (action instanceof ToggleAction) { - menu.add(((ToggleAction) action).createCheckBoxMenuItem()); - } else { - menu.add(action); - } - } - } - return menu; - } - - /** Creates actions. - * This is a loop variant of {@link #createToggle(boolean,String,Object)}. - * The actions created can be retrieved using {@link #getAction(String)} or via the ActionMap returned by {@link #getActionMap()}. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param target Target object - * @param keys Keys of actions to create - * @throws NullPointerException in case <var>keys</var> was or contained <code>null</code> - */ - public void createToggles(final boolean store, final Object target, final String... keys) throws NullPointerException { - for (final String key : keys) { - createToggle(store, key, target); - } - } - - /** Create an Action. - * The created Action is automatically stored together with all other Actions created by this Factory instance in an ActionMap, which you can - * retreive using {@link #getActionMap()}. - * The supplied object needs to have a boolean return void argument getter method and a void return boolean argument setter method matching the - * <var>key</var>. - * You may pass <code>null</code> as object, which means that the object the getters and setters are invoked on is not defined yet. - * You may safely use the Action, it will not throw any Exceptions upon {@link Action#actionPerformed(ActionEvent)} but simply silently do nothing. - * The desired object can be set later using <code>action.putValue({@link ToggleAction#REFLECTION_TARGET}, <var>object</var>)</code>. - * <p /> - * Users of this method can assume that the returned object behaves quite like {@link ToggleAction}. - * Wether or not this method returns an instance of {@link ToggleAction} shuold not be relied on. - * @see #createAction(boolean,String) - * @see #createAction(boolean,String,Object) - * @see #initAction(boolean,Action,String) - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param key Key for Action, which is used as basename for access to Preferences and ResourceBundles, as ActionMap key and as Property name within - * the supplied object (may not be <code>null</code>) - * @param object Instance to invoke method on if the Action was activated ({@link Action#actionPerformed(ActionEvent)}) - * @throws NullPointerException in case <var>key</var> was <code>null</code> - * @return ToggleAction - */ - public Action createToggle(final boolean store, final String key, final Object object) throws NullPointerException { - final Action action = new ToggleAction(); - initAction(store, action, key); - action.putValue(REFLECTION_PROPERTY_NAME, key); - action.putValue(REFLECTION_TARGET, object); - return action; - } - - /** Method for creating a toolbar. - * @param keys Action keys for toolbar entries - * @return JToolBar created for <var>keys</var> - */ - public JToolBar createToolBar(final String... keys) { - final JToolBar toolBar = new JToolBar(); - for (final String key : keys) { - if (key == null || "-".equals(key) || "|".equals(key)) { - toolBar.addSeparator(); - } else { - final Action action = getAction(key); - if (action == null) { - throw new Error("No Action for key " + key); - } - toolBar.add(action); - } - } - return toolBar; - } - - /** Method for creating a toolbar. - * @param barKey Action keys of toolbar to create - * @return JToolBar created for <var>barKey</var> - */ - public JToolBar createToolBar(final String barKey) { - return createToolBar(getString(barKey + ".toolbar").split("\\s+")); - } - - /** Method for creating a toolbar. - * @param object Instance to invoke method on if the Action was activated ({@link Action#actionPerformed(ActionEvent)}) - * @param keys Action keys for toolbar entries - * @return JToolBar created for <var>keys</var> - */ - public JToolBar createToolBar(final Object object, final String... keys) { - final JToolBar toolBar = new JToolBar(); - for (final String key : keys) { - if (key == null || "-".equals(key) || "|".equals(key)) { - toolBar.addSeparator(); - } else { - Action action = getAction(key); - if (action == null) { - action = createAction(false, key, object); - } - toolBar.add(action); - } - } - return toolBar; - } - - /** Method for creating a toolbar. - * @param object Instance to invoke method on if the Action was activated ({@link Action#actionPerformed(ActionEvent)}) - * @param barKey Action keys of toolbar to create - * @return JToolBar created for <var>barKey</var> - */ - public JToolBar createToolBar(final Object object, final String barKey) { - return createToolBar(object, getString(barKey + ".toolbar").split("\\s+")); - } - - /** Method to find the JMenuItem for a specific Action key. - * @param menuBar JMenuBar to search - * @param key Key to find JMenuItem for - * @return JMenuItem for key or <code>null</code> if none found - */ - public JMenuItem find(final JMenuBar menuBar, final String key) { - return find(menuBar, getAction(key)); - } - - /** Get an icon. - * @param key i18n key for icon - * @return icon - */ - public Icon getIcon(final String key) { - return getDefaultIconManager().getIcon(getString(key)); - } - - /** Show a localized message dialog. - * @param parentComponent determines the Frame in which the dialog is displayed; if <code>null</code>, or if the <code>parentComponent</code> has - * no <code>Frame</code>, a default <code>Frame</code> is used - * @param messageType the type of message to be displayed - * @param key localization key to use for the title, the message and eventually the icon - * @param args formatting arguments for the message text - * @deprecated use {@link #showMessageDialog(Component, String, Object...)} instead and put the messagetype in the action.properties file. - */ - @Deprecated public void showMessageDialog(final Component parentComponent, final int messageType, final String key, final Object... args) { - JOptionPane.showMessageDialog(parentComponent, format(key + ".message", args), format(key + ".title", args), messageType); - } - - /** Show a localized message dialog. - * @param parentComponent determines the Frame in which the dialog is displayed; if <code>null</code>, or if the <code>parentComponent</code> has - * no <code>Frame</code>, a default <code>Frame</code> is used - * @param key localization key to use for the title, the message and eventually the icon - * @param args formatting arguments for the message text - */ - public void showMessageDialog(@Nullable final Component parentComponent, @NotNull final String key, final Object... args) { - JOptionPane.showMessageDialog(parentComponent, format(key + ".message", args), format(key + ".title", args), getMessageType(key)); - } - - /** Get the message type for a dialog. - * @param dialogKey dialog key - * @return message type - */ - public int getMessageType(@NotNull final String dialogKey) { - final String typeText = getString(dialogKey + ".messageType"); - if (typeText == null) { - return JOptionPane.PLAIN_MESSAGE; - } - if (!typeText.endsWith("_MESSAGE")) { - System.err.println("Warning: Illegal type value " + typeText + " for dialog " + dialogKey); // TODO: I18N/L10N - return JOptionPane.PLAIN_MESSAGE; - } - if ("PLAIN_MESSAGE".equals(typeText)) { - return JOptionPane.PLAIN_MESSAGE; - } else if ("QUESTION_MESSAGE".equals(typeText)) { - return JOptionPane.QUESTION_MESSAGE; - } else if ("WARNING_MESSAGE".equals(typeText)) { - return JOptionPane.WARNING_MESSAGE; - } else if ("INFORMATION_MESSAGE".equals(typeText)) { - return JOptionPane.INFORMATION_MESSAGE; - } else if ("ERROR_MESSAGE".equals(typeText)) { - return JOptionPane.ERROR_MESSAGE; - } else { - // key not known, try reflection. - try { - final Field f = JOptionPane.class.getField(typeText); - if (f.getType() == Integer.TYPE) { - return f.getInt(null); - } - } catch (final NoSuchFieldException e) { - System.err.println("Warning: Field " + typeText + " not found in JOptionPane (dialog: " + dialogKey + ")."); // TODO: I18N/L10N - e.printStackTrace(); //TODO - } catch (final IllegalAccessException e) { - System.err.println("Warning: Field " + typeText + " not accessible in JOptionPane (dialog: " + dialogKey + ")."); // TODO: I18N/L10N - e.printStackTrace(); //TODO - } - return JOptionPane.PLAIN_MESSAGE; - } - } - - /** Formats a message with parameters. - * It's a proxy method for using {@link MessageFormat}. - * @param key message key - * @param args parameters - * @return formatted String - * @see MessageFormat#format(String,Object...) - */ - public String format(@NotNull final String key, final Object... args) { - return MessageFormat.format(getString(key), args); - } - - /** Show a localized confirmation dialog which the user can suppress in future (remembering his choice). - * @param parentComponent determines the Frame in which the dialog is displayed; if <code>null</code>, or if the <code>parentComponent</code> has - * no <code>Frame</code>, a default <code>Frame</code> is used - * @param optionType the option type - * @param messageType the type of message to be displayed - * @param key localization key to use for the title, the message and eventually the icon - * @param args formatting arguments for the message text - * @return an integer indicating the option selected by the user now or eventually in a previous choice - * @throws IllegalStateException if no preferences are associated - */ - public int showOnetimeConfirmDialog(@Nullable final Component parentComponent, final int optionType, final int messageType, @NotNull final String key, final Object... args) throws IllegalStateException { - @NonNls String showString = getString(key + ".show"); - if (showString == null) { - showString = getString(key + ".showDefault"); - } - if (showString == null) { - showString = "true"; - } - final boolean show = !"false".equalsIgnoreCase(showString); // undefined should be treated true - if (!show) { - try { - return Integer.parseInt(getString(key + ".choice")); - } catch (final Exception ignore) { - /* ignore, continue with dialog then. */ - } - } - final JCheckBox dontShowAgain = new JCheckBox(getString("dialogDontShowAgain"), true); - final int result = JOptionPane.showConfirmDialog(parentComponent, new Object[] { format(key + ".message", args), dontShowAgain }, format(key + ".title", args), optionType, messageType); - if (!dontShowAgain.isSelected()) { - if (prefs.size() > 0) { - prefs.get(0).put(key + ".show", "false"); - prefs.get(0).put(key + ".choice", Integer.toString(result)); - } else { - throw new IllegalStateException("Cannot store prefs for this dialog - no Preferences associated with this ActionFactory!"); - } - } - return result; - } - - /** Show a localized message dialog which the user can suppress in future. - * @param parentComponent determines the Frame in which the dialog is displayed; if <code>null</code>, or if the <code>parentComponent</code> has - * no <code>Frame</code>, a default <code>Frame</code> is used - * @param messageType the type of message to be displayed - * @param key localization key to use for the title, the message and eventually the icon - * @param args formatting arguments for the message text - * @throws IllegalStateException if no preferences are associated - */ - public void showOnetimeMessageDialog(@Nullable final Component parentComponent, final int messageType, @NotNull final String key, final Object... args) throws IllegalStateException { - @NonNls String showString = getString(key + ".show"); - if (showString == null) { - showString = getString(key + ".showDefault"); - } - if (showString == null) { - showString = "true"; - } - final boolean show = !"false".equalsIgnoreCase(showString); // undefined should be treated true - if (show) { - final JCheckBox dontShowAgain = new JCheckBox(getString("dialogDontShowAgain"), true); - JOptionPane.showMessageDialog(parentComponent, new Object[] { format(key + ".message", args), dontShowAgain }, format(key + ".title", args), messageType); - if (!dontShowAgain.isSelected()) { - if (prefs.size() > 0) { - prefs.get(0).put(key + ".show", "f... [truncated message content] |
From: <chr...@us...> - 2007-08-11 22:48:18
|
Revision: 570 http://japi.svn.sourceforge.net/japi/?rev=570&view=rev Author: christianhujer Date: 2007-08-11 15:48:16 -0700 (Sat, 11 Aug 2007) Log Message: ----------- [ 1772452 ] ant doc should document API only Modified Paths: -------------- common/trunk/commonBuild.xml Modified: common/trunk/commonBuild.xml =================================================================== --- common/trunk/commonBuild.xml 2007-08-11 18:42:06 UTC (rev 569) +++ common/trunk/commonBuild.xml 2007-08-11 22:48:16 UTC (rev 570) @@ -226,13 +226,14 @@ <classpath refid="class.path" /> <sourcepath> <pathelement path="${user.javadoc.javasrc}" /> - <pathelement path="src" /> + <!--pathelement path="src" /--><!-- This is handled via packageset. --> </sourcepath> <packageset dir="src" defaultexcludes="yes" > <include name="net/**" /> + <exclude name="test/net/**" /> </packageset> <taglet name="net.sf.japi.taglets.FixmeTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" /> <taglet name="net.sf.japi.taglets.InvariantTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-11 18:42:08
|
Revision: 569 http://japi.svn.sourceforge.net/japi/?rev=569&view=rev Author: christianhujer Date: 2007-08-11 11:42:06 -0700 (Sat, 11 Aug 2007) Log Message: ----------- Improved handling of null values in factory methods. Modified Paths: -------------- libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java Modified: libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java 2007-08-11 17:36:04 UTC (rev 568) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java 2007-08-11 18:42:06 UTC (rev 569) @@ -426,7 +426,6 @@ */ @SuppressWarnings({"NestedAssignment"}) @NotNull public Action initAction(final boolean store, @NotNull final Action action, @NotNull final String key) throws NullPointerException { - if (key == null) { throw new NullPointerException("null key for Action initialization not allowed."); } action.putValue(ACTION_ID, key); String value; final String text = getString(key + ".text"); @@ -502,9 +501,6 @@ * @throws NullPointerException if <var>key</var> is <code>null</code> */ @Nullable public String getStringFromPrefs(@NotNull final String key) throws NullPointerException { - if (key == null) { - throw new NullPointerException("null key not allowed"); - } String value = null; for (final Preferences pref : prefs) { value = pref.get(key, value); @@ -608,7 +604,7 @@ } else { final Action action = getAction(key); if (action == null) { - throw new Error("No Action for key " + key); + throw new MissingResourceException(this + " has no definitin for action " + key, getClass().getName(), key); } if (action instanceof ToggleAction) { menu.add(((ToggleAction) action).createCheckBoxMenuItem()); @@ -668,15 +664,19 @@ } /** Method for creating a popup menu. - * @param store whether to store the initialized Actions in the ActionMap of this ActionFactory - * @param popupKey Action key of popup menu to create + * @param store Whether to store the initialized Actions in the ActionMap of this ActionFactory. + * @param popupKey Action key of popup menu to create. * @return JPopupMenu created for <var>popupKey</var> - * @throws NullPointerException if no menubar definition was found + * @throws MissingResourceException if no menubar definition was found. * @todo make error handling consistent (see createMenu and others) */ - @NotNull public JPopupMenu createPopupMenu(final boolean store, final String popupKey) throws NullPointerException { + @NotNull public JPopupMenu createPopupMenu(final boolean store, final String popupKey) throws MissingResourceException { final JPopupMenu menu = new JPopupMenu(); - for (final String key : getString(popupKey + ".menu").split("\\s+")) { + final String popupDefinition = getString(popupKey + ".menu"); + if (popupDefinition == null) { + throw new MissingResourceException(this + " has no definition for popup " + popupKey, getClass().getName(), popupKey + ".menu"); + } + for (final String key : popupDefinition.split("\\s+")) { if (key != null && key.length() == 0) { /* ignore this for empty menus */ } else if (key == null || "-".equals(key) || "|".equals(key)) { @@ -686,7 +686,7 @@ } else { final Action action = getAction(key); if (action == null) { - throw new Error("No Action for key " + key); + throw new MissingResourceException(this + " has no definitin for action " + key, getClass().getName(), key); } if (action instanceof ToggleAction) { menu.add(((ToggleAction) action).createCheckBoxMenuItem()); @@ -701,14 +701,18 @@ /** Method for creating a Menu. * This method assumes that the underlying properties contain an entry like <code>key + ".menu"</code> which lists the menu element's keys. * Submenus are build recursively. - * @param store whether to store the initialized Action in the ActionMap of this ActionFactory - * @param menuKey action key for menu - * @return menu created from the menu definition found - * @throws Error in case a menu definition for <var>menuKey</var> wasn't found + * @param store Whether to store the initialized Action in the ActionMap of this ActionFactory. + * @param menuKey Action key for menu. + * @return menu created from the menu definition found. + * @throws MissingResourceException In case a menu definition for <var>menuKey</var> wasn't found */ - public JMenu createMenu(final boolean store, final String menuKey) throws Error { + public JMenu createMenu(final boolean store, final String menuKey) throws MissingResourceException { final JMenu menu = new JMenu(createAction(store, menuKey)); - for (final String key : getString(menuKey + ".menu").split("\\s+")) { + final String menuDefinition = getString(menuKey + ".menu"); + if (menuDefinition == null) { + throw new MissingResourceException(this + " has no definition for menu " + menuKey, getClass().getName(), menuKey + ".menu"); + } + for (final String key : menuDefinition.split("\\s+")) { if (key != null && key.length() == 0) { /* ignore this for empty menus */ } else if (key == null || "-".equals(key) || "|".equals(key)) { @@ -718,7 +722,7 @@ } else { final Action action = getAction(key); if (action == null) { - throw new Error("No Action for key " + key); + throw new MissingResourceException(this + " has no definitin for action " + key, getClass().getName(), key); } if (action instanceof ToggleAction) { menu.add(((ToggleAction) action).createCheckBoxMenuItem()); @@ -735,14 +739,15 @@ * @param barKey Action key of menu to create * @param target Target object * @return JMenuBar created for <var>barKey</var> + * @throws MissingResourceException In case a menu or menubar definition was not found. */ - public JMenuBar createMenuBar(final boolean store, final String barKey, final Object target) { + public JMenuBar createMenuBar(final boolean store, final String barKey, final Object target) throws MissingResourceException { final JMenuBar menuBar = new JMenuBar(); - final String menuBarSpec = getString(barKey + ".menubar"); - if (menuBarSpec == null) { - throw new RuntimeException("Missing Resource for " + barKey + ".menubar"); + final String menuBarDefinition = getString(barKey + ".menubar"); + if (menuBarDefinition == null) { + throw new MissingResourceException(this + " has no definitin for menubar " + barKey, getClass().getName(), barKey); } - for (final String key : menuBarSpec.split("\\s+")) { + for (final String key : menuBarDefinition.split("\\s+")) { menuBar.add(createMenu(store, key, target)); } return menuBar; @@ -753,10 +758,15 @@ * @param popupKey Action key of popup menu to create * @param target Target object * @return JPopupMenu created for <var>barKey</var> + * @throws MissingResourceException In case a menu definition was not found. */ - public JPopupMenu createPopupMenu(final boolean store, final String popupKey, final Object target) { + public JPopupMenu createPopupMenu(final boolean store, final String popupKey, final Object target) throws MissingResourceException { final JPopupMenu menu = new JPopupMenu(); - for (final String key : getString(popupKey + ".menu").split("\\s+")) { + final String popupDefinition = getString(popupKey + ".menu"); + if (popupDefinition == null) { + throw new MissingResourceException(this + " has no definition for popup " + popupKey, getClass().getName(), popupKey + ".menu"); + } + for (final String key : popupDefinition.split("\\s+")) { if (key != null && key.length() == 0) { /* ignore this for empty menus */ } else if (key == null || "-".equals(key) || "|".equals(key)) { @@ -772,7 +782,7 @@ action = createAction(store, key, target); } if (action == null) { - throw new Error("No Action for key " + key); + throw new MissingResourceException(this + " has no definitin for action " + key, getClass().getName(), key); } if (action instanceof ToggleAction) { menu.add(((ToggleAction) action).createCheckBoxMenuItem()); @@ -795,7 +805,11 @@ */ public JMenu createMenu(final boolean store, final String menuKey, final Object target) throws Error { final JMenu menu = new JMenu(createAction(store, menuKey)); - for (final String key : getString(menuKey + ".menu").split("\\s+")) { + final String menuDefinition = getString(menuKey + ".menu"); + if (menuDefinition == null) { + throw new MissingResourceException(this + " has no definition for menu " + menuKey, getClass().getName(), menuKey + ".menu"); + } + for (final String key : menuDefinition.split("\\s+")) { if (key != null && key.length() == 0) { /* ignore this for empty menus */ } else if (key == null || "-".equals(key) || "|".equals(key)) { @@ -811,7 +825,7 @@ action = createAction(store, key, target); } if (action == null) { - throw new Error("No Action for key " + key); + throw new MissingResourceException(this + " has no definitin for action " + key, getClass().getName(), key); } if (action instanceof ToggleAction) { menu.add(((ToggleAction) action).createCheckBoxMenuItem()); @@ -878,7 +892,7 @@ } else { final Action action = getAction(key); if (action == null) { - throw new Error("No Action for key " + key); + throw new MissingResourceException(this + " has no definitin for action " + key, getClass().getName(), key); } toolBar.add(action); } @@ -889,9 +903,14 @@ /** Method for creating a toolbar. * @param barKey Action keys of toolbar to create * @return JToolBar created for <var>barKey</var> + * @throws MissingResourceException In case there is no definition for the requested toolbar. */ - public JToolBar createToolBar(final String barKey) { - return createToolBar(getString(barKey + ".toolbar").split("\\s+")); + public JToolBar createToolBar(final String barKey) throws MissingResourceException { + final String toolbarDefinition = getString(barKey + ".toolbar"); + if (toolbarDefinition == null) { + throw new MissingResourceException(this + " has no definition for toolbar " + barKey, getClass().getName(), barKey); + } + return createToolBar(toolbarDefinition.split("\\s+")); } /** Method for creating a toolbar. @@ -919,9 +938,14 @@ * @param object Instance to invoke method on if the Action was activated ({@link Action#actionPerformed(ActionEvent)}) * @param barKey Action keys of toolbar to create * @return JToolBar created for <var>barKey</var> + * @throws MissingResourceException In case there is no definition for the requested toolbar. */ - public JToolBar createToolBar(final Object object, final String barKey) { - return createToolBar(object, getString(barKey + ".toolbar").split("\\s+")); + public JToolBar createToolBar(final Object object, final String barKey) throws MissingResourceException { + final String toolbarDefinition = getString(barKey + ".toolbar"); + if (toolbarDefinition == null) { + throw new MissingResourceException(this + " has no definition for toolbar " + barKey, getClass().getName(), barKey); + } + return createToolBar(object, toolbarDefinition.split("\\s+")); } /** Method to find the JMenuItem for a specific Action key. @@ -1116,6 +1140,7 @@ * @note the label text will be the key if no String for the key was found */ public JLabel createLabel(final String key, final Object... args) { + //noinspection RedundantCast return createLabel((Component) null, key, args); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-11 17:36:10
|
Revision: 568 http://japi.svn.sourceforge.net/japi/?rev=568&view=rev Author: christianhujer Date: 2007-08-11 10:36:04 -0700 (Sat, 11 Aug 2007) Log Message: ----------- Made ActionFactory non-final to override for test purposes (e.g. creating mocks). Modified Paths: -------------- libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java Modified: libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java 2007-08-09 21:06:39 UTC (rev 567) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java 2007-08-11 17:36:04 UTC (rev 568) @@ -162,7 +162,7 @@ * @todo Implement serialization. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class ActionFactory { +public class ActionFactory { /** The key used for storing a somewhat unique id for this Action. */ @NotNull public static final String ACTION_ID = "ActionID"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-09 21:06:42
|
Revision: 567 http://japi.svn.sourceforge.net/japi/?rev=567&view=rev Author: christianhujer Date: 2007-08-09 14:06:39 -0700 (Thu, 09 Aug 2007) Log Message: ----------- Added missing @param tag. Modified Paths: -------------- libs/swing-treetable/trunk/src/net/sf/japi/swing/treetable/TreeTableModel.java Modified: libs/swing-treetable/trunk/src/net/sf/japi/swing/treetable/TreeTableModel.java =================================================================== --- libs/swing-treetable/trunk/src/net/sf/japi/swing/treetable/TreeTableModel.java 2007-08-07 20:19:03 UTC (rev 566) +++ libs/swing-treetable/trunk/src/net/sf/japi/swing/treetable/TreeTableModel.java 2007-08-09 21:06:39 UTC (rev 567) @@ -44,6 +44,7 @@ T getChild(T parent, int index); /** Returns the number of available children. + * @param node Node to get the number of children for. * @return number of available children * @see TreeModel#getChildCount(Object) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-08-07 20:19:09
|
Revision: 566 http://japi.svn.sourceforge.net/japi/?rev=566&view=rev Author: christianhujer Date: 2007-08-07 13:19:03 -0700 (Tue, 07 Aug 2007) Log Message: ----------- Added missing package documentation. Modified Paths: -------------- libs/swing-list/trunk/src/test/net/sf/japi/swing/list/package-info.java Modified: libs/swing-list/trunk/src/test/net/sf/japi/swing/list/package-info.java =================================================================== --- libs/swing-list/trunk/src/test/net/sf/japi/swing/list/package-info.java 2007-07-30 20:52:51 UTC (rev 565) +++ libs/swing-list/trunk/src/test/net/sf/japi/swing/list/package-info.java 2007-08-07 20:19:03 UTC (rev 566) @@ -17,4 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +/** Tests for {@link net.sf.japi.swing.list}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ package test.net.sf.japi.swing.list; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-07-30 20:52:54
|
Revision: 565 http://japi.svn.sourceforge.net/japi/?rev=565&view=rev Author: christianhujer Date: 2007-07-30 13:52:51 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Fixed checkstyle issues. Modified Paths: -------------- libs/xml/trunk/src/net/sf/japi/xml/FilteredNodeList.java libs/xml/trunk/src/net/sf/japi/xml/NodeListIterator.java Modified: libs/xml/trunk/src/net/sf/japi/xml/FilteredNodeList.java =================================================================== --- libs/xml/trunk/src/net/sf/japi/xml/FilteredNodeList.java 2007-07-30 20:51:39 UTC (rev 564) +++ libs/xml/trunk/src/net/sf/japi/xml/FilteredNodeList.java 2007-07-30 20:52:51 UTC (rev 565) @@ -19,17 +19,18 @@ package net.sf.japi.xml; -import java.util.List; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.w3c.dom.Element; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** FilteredNodeList is a NodeList implementation that allows quick iteration over an elements children. * Currently there are two ways to use FilteredNodeList: iterating over all child elements with a certain name (children, not descendants), or iterating over all children of a specific node type. + * @param <T> Node type to operate on. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class FilteredNodeList<T extends Node> implements NodeList, Iterable<T> { Modified: libs/xml/trunk/src/net/sf/japi/xml/NodeListIterator.java =================================================================== --- libs/xml/trunk/src/net/sf/japi/xml/NodeListIterator.java 2007-07-30 20:51:39 UTC (rev 564) +++ libs/xml/trunk/src/net/sf/japi/xml/NodeListIterator.java 2007-07-30 20:52:51 UTC (rev 565) @@ -24,14 +24,15 @@ import javax.xml.xpath.XPath; import static javax.xml.xpath.XPathConstants.NODESET; import javax.xml.xpath.XPathExpressionException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.w3c.dom.Element; import org.w3c.dom.Node; import static org.w3c.dom.Node.ELEMENT_NODE; import org.w3c.dom.NodeList; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** A combined iterable / iterator implementation for iterating over NodeLists. + * @param <T> Node type to operate on. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class NodeListIterator<T extends Node> implements Iterable<T>, Iterator<T> { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-07-30 20:51:42
|
Revision: 564 http://japi.svn.sourceforge.net/japi/?rev=564&view=rev Author: christianhujer Date: 2007-07-30 13:51:39 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Fixed checkstyle and inspection issues. Modified Paths: -------------- libs/util/trunk/src/net/sf/japi/util/Arrays2.java libs/util/trunk/src/net/sf/japi/util/EmptyEnumeration.java libs/util/trunk/src/net/sf/japi/util/EmptyIterator.java libs/util/trunk/src/net/sf/japi/util/EndianConverter.java libs/util/trunk/src/net/sf/japi/util/EnumerationIterator.java libs/util/trunk/src/net/sf/japi/util/IteratorEnumeration.java libs/util/trunk/src/net/sf/japi/util/IteratorIterable.java libs/util/trunk/src/net/sf/japi/util/NotNullIterator.java libs/util/trunk/src/net/sf/japi/util/ThrowableHandler.java libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForArray.java libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForIterable.java libs/util/trunk/src/net/sf/japi/util/filter/CollectionFilter.java libs/util/trunk/src/net/sf/japi/util/filter/Filter.java libs/util/trunk/src/net/sf/japi/util/filter/NotFilter.java libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForArray.java libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForIterable.java libs/util/trunk/src/net/sf/japi/util/filter/file/Factory.java libs/util/trunk/src/test/net/sf/japi/util/Arrays2Test.java Modified: libs/util/trunk/src/net/sf/japi/util/Arrays2.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/Arrays2.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/Arrays2.java 2007-07-30 20:51:39 UTC (rev 564) @@ -181,6 +181,7 @@ for (final T[] anA : a) { ns += anA.length; } + //noinspection unchecked final T[] na = (T[]) Array.newInstance(a[0].getClass().getComponentType(), ns); for (int i = 0, np = 0; i < a.length; np += a[i].length, i++) { System.arraycopy(a[i], 0, na, np, a[i].length); @@ -209,6 +210,7 @@ tl.add(t); } } + //noinspection unchecked return tl.toArray((T[]) Array.newInstance(a.getClass().getComponentType(), 0)); } // eventually add filters for primitive types and provide correspondig methods @@ -247,19 +249,21 @@ * @see Arrays#binarySearch(int[],int) * @see Arrays#sort(int[]) */ - public static int binarySearch(@NotNull final int[] a, final int key, int low, int high) { - while (low <= high) { - final int mid = low + high >> 1; + public static int binarySearch(@NotNull final int[] a, final int key, final int low, final int high) { + int currentLow = low; + int currentHigh = high; + while (currentLow <= currentHigh) { + final int mid = currentLow + currentHigh >> 1; final int midVal = a[mid]; if (midVal < key) { - low = mid + 1; + currentLow = mid + 1; } else if (midVal > key) { - high = mid - 1; + currentHigh = mid - 1; } else { return mid; // key found } } - return -(low + 1); // key not found. + return -(currentLow + 1); // key not found. } /** Perform a linear search on an array of booleans. Modified: libs/util/trunk/src/net/sf/japi/util/EmptyEnumeration.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/EmptyEnumeration.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/EmptyEnumeration.java 2007-07-30 20:51:39 UTC (rev 564) @@ -23,12 +23,14 @@ import java.util.NoSuchElementException; /** Empty Enumeration. + * @param <E> Enumeration element type. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class EmptyEnumeration<E> implements Enumeration<E> { /** Create a new EmptyEnumeration. */ - public EmptyEnumeration() {} + public EmptyEnumeration() { + } /** {@inheritDoc} */ public boolean hasMoreElements() { Modified: libs/util/trunk/src/net/sf/japi/util/EmptyIterator.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/EmptyIterator.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/EmptyIterator.java 2007-07-30 20:51:39 UTC (rev 564) @@ -23,9 +23,10 @@ import java.util.NoSuchElementException; /** An iterator that never returns elements and thus is always empty. + * @param <E> Iterator element type. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class EmptyIterator<T> implements Iterator<T> { +public class EmptyIterator<E> implements Iterator<E> { /** Create an Empty Iterator. * Please note that this class does not hold any state. @@ -41,7 +42,7 @@ } /** {@inheritDoc} */ - public T next() throws NoSuchElementException { + public E next() throws NoSuchElementException { throw new NoSuchElementException("No more elements"); } Modified: libs/util/trunk/src/net/sf/japi/util/EndianConverter.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/EndianConverter.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/EndianConverter.java 2007-07-30 20:51:39 UTC (rev 564) @@ -25,7 +25,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @SuppressWarnings({"UtilityClass", "MagicNumber"}) -public class EndianConverter { +public final class EndianConverter { /** Private constructor to prevent instantiation. */ private EndianConverter() { @@ -56,15 +56,14 @@ */ @SuppressWarnings("OverlyComplexBooleanExpression") public static long swapEndianess(final long l) { - return - (l & 0x00000000000000FFL) << 56 | - (l & 0x000000000000FF00L) << 40 | - (l & 0x0000000000FF0000L) << 24 | - (l & 0x00000000FF000000L) << 8 | - (l & 0x000000FF00000000L) >>> 8 | - (l & 0x0000FF0000000000L) >>> 24 | - (l & 0x00FF000000000000L) >>> 40 | - (l & 0xFF00000000000000L) >>> 56; + return (l & 0x00000000000000FFL) << 56 + | (l & 0x000000000000FF00L) << 40 + | (l & 0x0000000000FF0000L) << 24 + | (l & 0x00000000FF000000L) << 8 + | (l & 0x000000FF00000000L) >>> 8 + | (l & 0x0000FF0000000000L) >>> 24 + | (l & 0x00FF000000000000L) >>> 40 + | (l & 0xFF00000000000000L) >>> 56; } /** Convert an int. @@ -74,11 +73,10 @@ */ @SuppressWarnings("OverlyComplexBooleanExpression") public static int swapEndianess(final int i) { - return - (i & 0x000000FF) << 24 | - (i & 0x0000FF00) << 8 | - (i & 0x00FF0000) >>> 8 | - (i & 0xFF000000) >>> 24; + return (i & 0x000000FF) << 24 + | (i & 0x0000FF00) << 8 + | (i & 0x00FF0000) >>> 8 + | (i & 0xFF000000) >>> 24; } /** Convert a char. @@ -87,9 +85,7 @@ * @return converted char */ public static char swapEndianess(final char c) { - return (char) - ((c & 0x00FF) << 8 | - (c & 0xFF00) >>> 8); + return (char) ((c & 0x00FF) << 8 | (c & 0xFF00) >>> 8); } /** Convert a short. @@ -98,9 +94,7 @@ * @return converted short */ public static short swapEndianess(final short s) { - return (short) - ((s & 0x00FF) << 8 | - (s & 0xFF00) >>> 8); + return (short) ((s & 0x00FF) << 8 | (s & 0xFF00) >>> 8); } /** Convert a byte. Modified: libs/util/trunk/src/net/sf/japi/util/EnumerationIterator.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/EnumerationIterator.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/EnumerationIterator.java 2007-07-30 20:51:39 UTC (rev 564) @@ -19,29 +19,30 @@ package net.sf.japi.util; +import java.util.Enumeration; import java.util.Iterator; -import java.util.Enumeration; import java.util.NoSuchElementException; import org.jetbrains.annotations.NotNull; /** Combined Iterator/Iterable proxy for enumerations. * Instances are not reusable. + * @param <E> Enumeration / Iterator element type. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class EnumerationIterator<T> implements Iterable<T>, Iterator<T> { +public class EnumerationIterator<E> implements Iterable<E>, Iterator<E> { /** Enumeration to iterate over. */ - @NotNull private final Enumeration<T> enumeration; + @NotNull private final Enumeration<E> enumeration; /** Create an Iterable based on an Enumeration, useful for foreach-loops. * @param enumeration Enumeration to iterate over */ - public EnumerationIterator(@NotNull final Enumeration<T> enumeration) { + public EnumerationIterator(@NotNull final Enumeration<E> enumeration) { this.enumeration = enumeration; } /** {@inheritDoc} */ - @NotNull public Iterator<T> iterator() { + @NotNull public Iterator<E> iterator() { return this; } @@ -54,7 +55,7 @@ // SuppressWarnings here because of bug in IntelliJ. // enumeration.nextElement actually can throw a NoSuchElementException. @SuppressWarnings({"IteratorNextCanNotThrowNoSuchElementException"}) - public T next() throws NoSuchElementException { + public E next() throws NoSuchElementException { return enumeration.nextElement(); } Modified: libs/util/trunk/src/net/sf/japi/util/IteratorEnumeration.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/IteratorEnumeration.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/IteratorEnumeration.java 2007-07-30 20:51:39 UTC (rev 564) @@ -25,17 +25,18 @@ /** Enumeration proxy for Iterators. * Instances are not reusable. + * @param <E> Enumeration / Iterator element type. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class IteratorEnumeration<T> implements Enumeration<T> { +public class IteratorEnumeration<E> implements Enumeration<E> { /** Iterator to enumerate. */ - @NotNull private final Iterator<T> iterator; + @NotNull private final Iterator<E> iterator; /** Create an Enumeration for an Iterator. * @param iterator Iterator to create Enumeration for */ - public IteratorEnumeration(@NotNull final Iterator<T> iterator) { + public IteratorEnumeration(@NotNull final Iterator<E> iterator) { this.iterator = iterator; } @@ -45,7 +46,7 @@ } /** {@inheritDoc} */ - public T nextElement() { + public E nextElement() { return iterator.next(); } Modified: libs/util/trunk/src/net/sf/japi/util/IteratorIterable.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/IteratorIterable.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/IteratorIterable.java 2007-07-30 20:51:39 UTC (rev 564) @@ -24,7 +24,9 @@ /** * Iterable that wraps an Iterator. - * Note: This kind of Iterable can only be iterated over once. + * @param <T> Iterator element type. + * @note This kind of Iterable can only be iterated over once. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class IteratorIterable<T> implements Iterable<T> { Modified: libs/util/trunk/src/net/sf/japi/util/NotNullIterator.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/NotNullIterator.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/NotNullIterator.java 2007-07-30 20:51:39 UTC (rev 564) @@ -25,28 +25,31 @@ import org.jetbrains.annotations.Nullable; /** Iterator / Iterable decorator that skips elements which are <code>null</code>. + * @param <E> Iterator element type. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class NotNullIterator<T> implements Iterator<T> { +public class NotNullIterator<E> implements Iterator<E> { /** The iterator to use. */ - @NotNull private final Iterator<T> iterator; + @NotNull private final Iterator<E> iterator; /** Prefetched next element. */ - @Nullable private T next; + @Nullable private E next; /** Create a NotNullIterator over another Iterator. * @param iterator Iterator to wrap / decorate. */ - public NotNullIterator(@NotNull final Iterator<T> iterator) { + public NotNullIterator(@NotNull final Iterator<E> iterator) { this.iterator = iterator; prefetchNext(); } /** Prefetches the next element. */ private void prefetchNext() { - //noinspection NestedAssignment,ControlFlowStatementWithoutBraces,StatementWithEmptyBody - while (iterator.hasNext() && (next = iterator.next()) == null); + //noinspection NestedAssignment + while (iterator.hasNext() && (next = iterator.next()) == null) { + // nothing to do. + } } /** {@inheritDoc} */ @@ -55,7 +58,7 @@ } /** {@inheritDoc} */ - @NotNull public T next() { + @NotNull public E next() { if (next == null) { throw new NoSuchElementException(); } @@ -71,7 +74,10 @@ throw new UnsupportedOperationException(); } - /** An Iterable adapter for NotNullIterator. */ + /** An Iterable adapter for NotNullIterator. + * @param <T> Iterable element type. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ public static class NotNullIterable<T> implements Iterable<T> { /** The iterable to iterate over. */ Modified: libs/util/trunk/src/net/sf/japi/util/ThrowableHandler.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/ThrowableHandler.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/ThrowableHandler.java 2007-07-30 20:51:39 UTC (rev 564) @@ -25,6 +25,7 @@ /** Interface that is implemented by classes that handle exceptions via callbacks. * This is useful during operations that can throw more than one exception during an operation. * Even more, when these exceptions eventually are more or less recoverable. + * @param <T> Exception type handled by this handler. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public interface ThrowableHandler<T extends Throwable> extends EventListener { Modified: libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForArray.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForArray.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForArray.java 2007-07-30 20:51:39 UTC (rev 564) @@ -20,6 +20,7 @@ package net.sf.japi.util.filter; /** A Filter used to AND-combine other filters given as array. + * @param <T> Type of filter. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ final class AndFilterForArray<T> implements Filter<T> { Modified: libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForIterable.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForIterable.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/AndFilterForIterable.java 2007-07-30 20:51:39 UTC (rev 564) @@ -20,6 +20,7 @@ package net.sf.japi.util.filter; /** A Filter used to AND-combine other filters given as {@link Iterable}. + * @param <T> Type of filter. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ final class AndFilterForIterable<T> implements Filter<T> { Modified: libs/util/trunk/src/net/sf/japi/util/filter/CollectionFilter.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/CollectionFilter.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/CollectionFilter.java 2007-07-30 20:51:39 UTC (rev 564) @@ -22,17 +22,19 @@ import java.util.Collection; /** Filter for filtering elements that are contained in a collection. - * Note: The collection is not cloned. + * @param <T> Type of filter. + * @note The collection is not cloned. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -@SuppressWarnings({"AssignmentToCollectionOrArrayFieldFromParameter"}) final class CollectionFilter<T> implements Filter<T> { + /** Collection to use for filtering. */ private final Collection<T> collection; /** Create a CollectionFilter. * @param collection Collection to filter */ + @SuppressWarnings({"AssignmentToCollectionOrArrayFieldFromParameter"}) CollectionFilter(final Collection<T> collection) { this.collection = collection; } Modified: libs/util/trunk/src/net/sf/japi/util/filter/Filter.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/Filter.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/Filter.java 2007-07-30 20:51:39 UTC (rev 564) @@ -22,6 +22,7 @@ import java.util.Collection; /** This interface servers as a common interface for filters. + * @param <T> Type of filter. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public interface Filter<T> { Modified: libs/util/trunk/src/net/sf/japi/util/filter/NotFilter.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/NotFilter.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/NotFilter.java 2007-07-30 20:51:39 UTC (rev 564) @@ -20,6 +20,7 @@ package net.sf.japi.util.filter; /** A Filter that is the negation of another filter. + * @param <T> Type of filter. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ final class NotFilter<T> implements Filter<T> { Modified: libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForArray.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForArray.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForArray.java 2007-07-30 20:51:39 UTC (rev 564) @@ -20,6 +20,7 @@ package net.sf.japi.util.filter; /** A Filter used to OR-combine other filters given as array. + * @param <T> Type of filter. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ final class OrFilterForArray<T> implements Filter<T> { Modified: libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForIterable.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForIterable.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/OrFilterForIterable.java 2007-07-30 20:51:39 UTC (rev 564) @@ -20,6 +20,7 @@ package net.sf.japi.util.filter; /** A Filter used to OR-combine other filters given as {@link Iterable}. + * @param <T> Type of filter. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ final class OrFilterForIterable<T> implements Filter<T> { Modified: libs/util/trunk/src/net/sf/japi/util/filter/file/Factory.java =================================================================== --- libs/util/trunk/src/net/sf/japi/util/filter/file/Factory.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/net/sf/japi/util/filter/file/Factory.java 2007-07-30 20:51:39 UTC (rev 564) @@ -28,7 +28,7 @@ * @todo check whether this class is required or instead {@link Filter.Factory} should be used */ @SuppressWarnings({"UtilityClass", "StaticMethodNamingConvention"}) -public class Factory { +public final class Factory { /** Private Utility Class Constructor. */ private Factory() { @@ -59,16 +59,16 @@ @Override public boolean accept(final File pathname) { // XXX workaround bug in IntelliJ IDEA //noinspection RedundantCast - return !((java.io.FileFilter)filter).accept(pathname); + return !((java.io.FileFilter) filter).accept(pathname); } /** {@inheritDoc} */ @Override public String getDescription() { - return "not (" + - (filter instanceof javax.swing.filechooser.FileFilter ? - ((javax.swing.filechooser.FileFilter) filter).getDescription() : - filter.toString()) + - ')'; // TODO: I18N/L10N + return "not (" + + (filter instanceof javax.swing.filechooser.FileFilter + ? ((javax.swing.filechooser.FileFilter) filter).getDescription() + : filter.toString()) + + ')'; // TODO: I18N/L10N } } // class NotFileFilter Modified: libs/util/trunk/src/test/net/sf/japi/util/Arrays2Test.java =================================================================== --- libs/util/trunk/src/test/net/sf/japi/util/Arrays2Test.java 2007-07-30 20:34:00 UTC (rev 563) +++ libs/util/trunk/src/test/net/sf/japi/util/Arrays2Test.java 2007-07-30 20:51:39 UTC (rev 564) @@ -44,4 +44,4 @@ assertTrue("Concatenation must correctly concatenate", Arrays.equals(concatExpected, concatResult)); } -} // class Arrays2Test \ No newline at end of file +} // class Arrays2Test This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-07-30 20:34:08
|
Revision: 563 http://japi.svn.sourceforge.net/japi/?rev=563&view=rev Author: christianhujer Date: 2007-07-30 13:34:00 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Fixed javadoc and inspections issues. Modified Paths: -------------- libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java Modified: libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java =================================================================== --- libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java 2007-07-30 20:30:49 UTC (rev 562) +++ libs/swing-prefs/trunk/src/net/sf/japi/swing/prefs/PreferencesPane.java 2007-07-30 20:34:00 UTC (rev 563) @@ -40,6 +40,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.ActionMethod; /** Panel to display preferences. * @serial exclude This class is not intended to be serialized. @@ -51,6 +52,9 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.japi.swing.prefs"); + /** Width of the horizontal struts between button groups. */ + private static final int HORIZONTAL_STRUTS_WIDTH = 50; + /** A map for DIALOGS that are already displaying. * This map is used to prevent the dialog for the same PreferencesGroup be shown twice within the same application. */ @@ -160,10 +164,10 @@ return new Object[] { new JButton(helpAction), new JButton(defaultsAction), - Box.createHorizontalStrut(50), + Box.createHorizontalStrut(HORIZONTAL_STRUTS_WIDTH), new JButton(okAction), new JButton(applyAction), - Box.createHorizontalStrut(50), + Box.createHorizontalStrut(HORIZONTAL_STRUTS_WIDTH), new JButton(revertAction), new JButton(cancelAction), }; @@ -198,9 +202,8 @@ cards.show(cardPanel, Integer.toString(index)); } - /** Action method for cancel. - * @used - */ + /** Action method for cancel. */ + @ActionMethod public void cancel() { setValue(CANCEL_OPTION); } @@ -216,41 +219,36 @@ } } - /** Action method for defaults. - * @used - */ + /** Action method for defaults. */ + @ActionMethod public void defaults() { currentPref.defaults(); } - /** Action method for help. - * @used - */ + /** Action method for help. */ + @ActionMethod public void help() { // TODO } - /** Action method for ok. - * @used - */ + /** Action method for ok. */ @SuppressWarnings({"InstanceMethodNamingConvention"}) + @ActionMethod public void ok() { apply(); setValue(OK_OPTION); } - /** Action method for apply. - * @used - */ + /** Action method for apply. */ + @ActionMethod public void apply() { if (currentPref.isChanged()) { currentPref.apply(); } } - /** Action method for revert. - * @used - */ + /** Action method for revert. */ + @ActionMethod public void revert() { if (currentPref.isChanged()) { currentPref.revert(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-07-30 20:30:53
|
Revision: 562 http://japi.svn.sourceforge.net/japi/?rev=562&view=rev Author: christianhujer Date: 2007-07-30 13:30:49 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Fixed javadoc and inspections issues. Modified Paths: -------------- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java 2007-07-30 20:30:49 UTC (rev 562) @@ -32,13 +32,19 @@ */ public class CollectionsListModel<E> extends AbstractListModel implements List<E> { - /** The list to delegate to. */ + /** The list to delegate to. + * @serial include + */ private final List<E> list; /** * Creates a new CollectionsListModel. - * @param list List to delegate to + * @param list List to delegate to. + * @note This ListModel does not hold a copy of the supplied list but references it. + * All changes to the list model will be reflected in the supplied list and vice versa. + * @note In order for events to be fired, this ListModel must be used for list modifications, not the underlying list. */ + @SuppressWarnings({"AssignmentToCollectionOrArrayFieldFromParameter"}) public CollectionsListModel(final List<E> list) { this.list = list; } @@ -148,12 +154,12 @@ } /** {@inheritDoc} */ - public boolean equals(final Object o) { + @Override public boolean equals(final Object o) { return list.equals(o); } /** {@inheritDoc} */ - public int hashCode() { + @Override public int hashCode() { return list.hashCode(); } Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java 2007-07-30 20:30:49 UTC (rev 562) @@ -2,8 +2,8 @@ import java.awt.Component; import java.io.Closeable; +import java.io.Flushable; import java.io.IOException; -import java.io.Flushable; import org.jetbrains.annotations.Nullable; /** @@ -106,6 +106,7 @@ return; } try { + //noinspection MagicNumber final int prog = value * 100 / max; out.append(String.format("%3d", prog)); flush(); Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-07-30 20:30:49 UTC (rev 562) @@ -19,13 +19,14 @@ package net.sf.japi.swing.misc; +import java.awt.Insets; +import java.io.File; +import java.io.IOException; import javax.swing.JButton; +import javax.swing.JFileChooser; import javax.swing.JTextField; -import javax.swing.JFileChooser; import net.sf.japi.swing.ActionFactory; -import java.io.File; -import java.io.IOException; -import java.awt.Insets; +import net.sf.japi.swing.ActionMethod; /** JButton for choosing a file from hd. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -135,9 +136,8 @@ return chooser; } - /** Action method. - * @used - */ + /** Action method. */ + @ActionMethod public void optionsChooseFile() { final String oldFilename = textField.getText(); final File oldFile = new File(base, oldFilename); Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java 2007-07-30 20:30:49 UTC (rev 562) @@ -20,33 +20,42 @@ package net.sf.japi.swing.misc; import java.awt.FlowLayout; +import javax.swing.JComponent; +import javax.swing.JLabel; import javax.swing.JTextField; -import javax.swing.JLabel; -import javax.swing.JComponent; /** Component for selecting a file. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class JFileField extends JComponent { - /** The label. */ + /** The default number of textfield columns. */ + private static final int DEFAULT_TEXTFIELD_COLUMNS = 16; + + /** The label. + * @serial include + */ private final JLabel label; - /** The file field. */ + /** The file field. + * @serial include + */ private final JTextField fileField; - /** The button to start the JFileChooser. */ + /** The button to start the JFileChooser. + * @serial include + */ private final JFileChooserButton chooserButton; /** * Create a JFileField. - * @param labelText the text for the label - * @param initial the initial path - * @param fileSelectionMode the mode for the file selection + * @param labelText The text for the label. + * @param initial The initial path. + * @param fileSelectionMode The mode for the file selection. */ public JFileField(final String labelText, final String initial, final int fileSelectionMode) { setLayout(new FlowLayout(FlowLayout.RIGHT)); - fileField = new JTextField(initial, 16); + fileField = new JTextField(initial, DEFAULT_TEXTFIELD_COLUMNS); chooserButton = new JFileChooserButton(fileField, fileSelectionMode); label = new JLabel(labelText); add(label); Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java 2007-07-30 20:30:49 UTC (rev 562) @@ -19,17 +19,17 @@ package net.sf.japi.swing.misc; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.GridLayout; +import javax.swing.BorderFactory; import javax.swing.JDialog; -import javax.swing.JProgressBar; +import javax.swing.JFrame; import javax.swing.JLabel; -import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.BorderFactory; +import javax.swing.JProgressBar; import javax.swing.SwingConstants; -import java.awt.GridLayout; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Color; /** ProgressDisplay handles a popup dialog for the mainview * which displays a process progressBar. @@ -56,6 +56,7 @@ * @param max initial maximum of progress points * @param text the initial label text */ + @SuppressWarnings({"MagicNumber"}) public ProgressDisplay(final JFrame parent, final String title, final int max, final String text) { super(parent, title, false); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); // can't close This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-07-30 20:19:11
|
Revision: 561 http://japi.svn.sourceforge.net/japi/?rev=561&view=rev Author: christianhujer Date: 2007-07-30 13:19:09 -0700 (Mon, 30 Jul 2007) Log Message: ----------- javadoc: Added missing @serial tag, fixed broken @link. Modified Paths: -------------- libs/swing-action/trunk/src/net/sf/japi/swing/NamedActionMap.java libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java Modified: libs/swing-action/trunk/src/net/sf/japi/swing/NamedActionMap.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/NamedActionMap.java 2007-07-30 20:15:31 UTC (rev 560) +++ libs/swing-action/trunk/src/net/sf/japi/swing/NamedActionMap.java 2007-07-30 20:19:09 UTC (rev 561) @@ -26,7 +26,9 @@ */ public class NamedActionMap extends ActionMap { - /** The name. */ + /** The name. + * @serial include + */ private final String name; /** Create a NamedActionMap without providing a name. Modified: libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java 2007-07-30 20:15:31 UTC (rev 560) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ReflectionAction.java 2007-07-30 20:19:09 UTC (rev 561) @@ -27,8 +27,8 @@ import javax.swing.Icon; import net.sf.japi.lang.SuperClassIterator; import static net.sf.japi.swing.ActionFactory.ACTION_ID; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** Action implementation which invokes the desired method using Reflection. * Usage example: @@ -78,7 +78,7 @@ /** * The key used for storing the method arguments to use when invoking the method. - * Value Type: {@link Object[]} (checked). + * Value Type: {@link Object Object[]} (checked). */ public static final String REFLECTION_ARGUMENTS = "ReflectionArguments"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |