[Japi-cvs] SF.net SVN: japi: [446] libs/swing-action/trunk/src
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2007-06-25 20:06:55
|
Revision: 446 http://svn.sourceforge.net/japi/?rev=446&view=rev Author: christianhujer Date: 2007-06-25 13:06:53 -0700 (Mon, 25 Jun 2007) Log Message: ----------- Fixed checkstyle issues. Modified Paths: -------------- libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java libs/swing-action/trunk/src/net/sf/japi/swing/IconManager.java libs/swing-action/trunk/src/net/sf/japi/swing/action.properties libs/swing-action/trunk/src/net/sf/japi/swing/action_de.properties libs/swing-action/trunk/src/test/net/sf/japi/swing/ActionFactoryTest.java libs/swing-action/trunk/src/test/net/sf/japi/swing/ReflectionActionTest.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-06-25 20:00:34 UTC (rev 445) +++ libs/swing-action/trunk/src/net/sf/japi/swing/ActionFactory.java 2007-06-25 20:06:53 UTC (rev 446) @@ -190,6 +190,7 @@ /** 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>(); /** Get an ActionFactory. @@ -430,10 +431,10 @@ 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) { + 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()); @@ -444,7 +445,7 @@ 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) { + if ((value = getString(key + ".icon")) != null) { final Icon image = getDefaultIconManager().getIcon(value); if (image != null) { action.putValue(SMALL_ICON, image); Modified: libs/swing-action/trunk/src/net/sf/japi/swing/IconManager.java =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/IconManager.java 2007-06-25 20:00:34 UTC (rev 445) +++ libs/swing-action/trunk/src/net/sf/japi/swing/IconManager.java 2007-06-25 20:06:53 UTC (rev 446) @@ -65,7 +65,7 @@ * Key: short name for icon, which is likely to be used as a relative file name. * Value: Icon */ - private final Map<String,Icon> smallCache = new WeakHashMap<String,Icon>(); + private final Map<String, Icon> smallCache = new WeakHashMap<String, Icon>(); /** The paths to search icons in. */ private final List<String> iconPaths = new ArrayList<String>(); Modified: libs/swing-action/trunk/src/net/sf/japi/swing/action.properties =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/action.properties 2007-06-25 20:00:34 UTC (rev 445) +++ libs/swing-action/trunk/src/net/sf/japi/swing/action.properties 2007-06-25 20:06:53 UTC (rev 446) @@ -19,4 +19,4 @@ dialogDontShowAgain=Show this dialog again next time. -ReflectionAction.nonPublicMethod=Action Methods must be accessible public. That means the declaring class as well as the method must be public.\n{0} \ No newline at end of file +ReflectionAction.nonPublicMethod=Action Methods must be accessible public. That means the declaring class as well as the method must be public.\n{0} Modified: libs/swing-action/trunk/src/net/sf/japi/swing/action_de.properties =================================================================== --- libs/swing-action/trunk/src/net/sf/japi/swing/action_de.properties 2007-06-25 20:00:34 UTC (rev 445) +++ libs/swing-action/trunk/src/net/sf/japi/swing/action_de.properties 2007-06-25 20:06:53 UTC (rev 446) @@ -19,3 +19,4 @@ dialogDontShowAgain=Show this dialog again next time. +ReflectionAction.nonPublicMethod=Action Methoden m\xFCssen public zugreifbar sein. Das hei\xDFt, die deklarierende Klasse muss auch public sein.\n{0} Modified: libs/swing-action/trunk/src/test/net/sf/japi/swing/ActionFactoryTest.java =================================================================== --- libs/swing-action/trunk/src/test/net/sf/japi/swing/ActionFactoryTest.java 2007-06-25 20:00:34 UTC (rev 445) +++ libs/swing-action/trunk/src/test/net/sf/japi/swing/ActionFactoryTest.java 2007-06-25 20:06:53 UTC (rev 446) @@ -25,9 +25,8 @@ import javax.swing.JMenuItem; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.DummyAction; -import org.junit.Before; -import org.junit.Test; import org.junit.Assert; +import org.junit.Test; /** * Test for {@link ActionFactory}. @@ -36,22 +35,11 @@ */ public class ActionFactoryTest { - private ActionFactory actionFactory; - /** - * Creates an ActionFactory. - * @throws Exception (unexpected) - */ - @Before - public void setUp() throws Exception { - actionFactory = new ActionFactory(); - } - - /** * Tests whether {@link ActionFactory#find(JMenuBar, Action)} works. * @throws Exception (unexpected) */ - @Test(expected=NullPointerException.class) + @Test(expected = NullPointerException.class) public void testFindNullBar() throws Exception { //noinspection ConstantConditions ActionFactory.find((JMenuBar) null, createSimple("item")); @@ -61,7 +49,7 @@ * Tests whether {@link ActionFactory#find(JMenuBar, Action)} works. * @throws Exception (unexpected) */ - @Test(expected=NullPointerException.class) + @Test(expected = NullPointerException.class) public void testFindNullActionInMenuBar() throws Exception { //noinspection ConstantConditions ActionFactory.find(new JMenuBar(), (Action) null); @@ -71,7 +59,7 @@ * Tests whether {@link ActionFactory#find(JMenuBar, Action)} works. * @throws Exception (unexpected) */ - @Test(expected=NullPointerException.class) + @Test(expected = NullPointerException.class) public void testFindNullMenu() throws Exception { //noinspection ConstantConditions ActionFactory.find((JMenu) null, createSimple("item")); @@ -81,7 +69,7 @@ * Tests whether {@link ActionFactory#find(JMenuBar, Action)} works. * @throws Exception (expected) */ - @Test(expected=NullPointerException.class) + @Test(expected = NullPointerException.class) public void testFindNullActionInMenu() throws Exception { //noinspection ConstantConditions ActionFactory.find(new JMenu(), null); @@ -115,4 +103,5 @@ action.putValue(Action.ACTION_COMMAND_KEY, key); return action; } -} // class ActionFactoryTest \ No newline at end of file + +} // class ActionFactoryTest 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-06-25 20:00:34 UTC (rev 445) +++ libs/swing-action/trunk/src/test/net/sf/japi/swing/ReflectionActionTest.java 2007-06-25 20:06:53 UTC (rev 446) @@ -146,7 +146,7 @@ * Tests whether {@link ReflectionAction#actionPerformed(ActionEvent)} works. * @throws Exception (unexpected) */ - @Test(expected=Exception.class) + @Test(expected = Exception.class) public void testActionPerformedException() throws Exception { actionMock.setThrowException(true); testling.putValue(ReflectionAction.REFLECTION_TARGET, actionMock); @@ -217,7 +217,7 @@ * Sets whether an exception should be thrown when executing {@link #someAction()}. * @param throwException <code>true</code> for throwing an exception, otherwise <code>false</code>. */ - public void setThrowException(boolean throwException) { + public void setThrowException(final boolean throwException) { this.throwException = throwException; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |