diff -r bb7113655d03 editor.breadcrumbs/nbproject/project.xml --- a/editor.breadcrumbs/nbproject/project.xml Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.breadcrumbs/nbproject/project.xml Tue Sep 11 14:19:40 2012 +0200 @@ -38,7 +38,7 @@ 1 - 1.64 + 1.67 diff -r bb7113655d03 editor.breadcrumbs/src/org/netbeans/modules/editor/breadcrumbs/MenuAction.java --- a/editor.breadcrumbs/src/org/netbeans/modules/editor/breadcrumbs/MenuAction.java Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.breadcrumbs/src/org/netbeans/modules/editor/breadcrumbs/MenuAction.java Tue Sep 11 14:19:40 2012 +0200 @@ -52,7 +52,8 @@ @EditorActionRegistration(name="toggle-breadcrumbs-view", menuPath="View", menuPosition=887, - preferencesKey=SideBarFactoryImpl.KEY_BREADCRUMBS) + preferencesKey=SideBarFactoryImpl.KEY_BREADCRUMBS, + preferencesDefault=true) public class MenuAction extends AbstractAction { @Override diff -r bb7113655d03 editor.lib2/apichanges.xml --- a/editor.lib2/apichanges.xml Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.lib2/apichanges.xml Tue Sep 11 14:19:40 2012 +0200 @@ -107,6 +107,20 @@ + + EditorActionRegistration has preferencesDefault + + + + + +

+ EditorActionRegistration has preferencesDefault to specify the default for the preferences value. +

+
+ +
+ UndoableEditWrapper interface added diff -r bb7113655d03 editor.lib2/manifest.mf --- a/editor.lib2/manifest.mf Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.lib2/manifest.mf Tue Sep 11 14:19:40 2012 +0200 @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.lib2/1 -OpenIDE-Module-Implementation-Version: 33 +OpenIDE-Module-Implementation-Version: 34 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/lib2/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/editor/lib2/resources/layer.xml OpenIDE-Module-Needs: org.netbeans.modules.editor.actions diff -r bb7113655d03 editor.lib2/nbproject/project.properties --- a/editor.lib2/nbproject/project.properties Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.lib2/nbproject/project.properties Tue Sep 11 14:19:40 2012 +0200 @@ -43,7 +43,7 @@ is.autoload=true javac.source=1.6 javac.compilerargs=-Xlint:unchecked -spec.version.base=1.65.0 +spec.version.base=1.67.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff -r bb7113655d03 editor.lib2/nbproject/project.xml --- a/editor.lib2/nbproject/project.xml Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.lib2/nbproject/project.xml Tue Sep 11 14:19:40 2012 +0200 @@ -99,7 +99,7 @@ - 7.17 + 7.53
diff -r bb7113655d03 editor.lib2/src/org/netbeans/api/editor/EditorActionRegistration.java --- a/editor.lib2/src/org/netbeans/api/editor/EditorActionRegistration.java Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.lib2/src/org/netbeans/api/editor/EditorActionRegistration.java Tue Sep 11 14:19:40 2012 +0200 @@ -179,6 +179,16 @@ String preferencesKey() default ""; /** + * Whether or not the action should be in checked state by default. + *
+ * If the preference should default to true or to false. Only valid in conjunction + * with {@link #preferencesKey() }. + * + * @since 1.67 + */ + boolean preferencesDefault() default false; + + /** * Allows to make an override of an action by adding a "weight" attribute * into a generated file object in the system filesystem * - see {@link org.openide.filesystems.MultiFileSystem}. diff -r bb7113655d03 editor.lib2/src/org/netbeans/modules/editor/lib2/EditorActionRegistrationProcessor.java --- a/editor.lib2/src/org/netbeans/modules/editor/lib2/EditorActionRegistrationProcessor.java Tue Sep 11 11:55:57 2012 +0200 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/EditorActionRegistrationProcessor.java Tue Sep 11 14:19:40 2012 +0200 @@ -302,6 +302,7 @@ if (preferencesKey.length() > 0) { file.stringvalue("preferencesKey", preferencesKey); file.methodvalue("preferencesNode", EditorActionUtilities.class.getName(), "getGlobalPreferences"); + file.boolvalue("preferencesDefault", annotation.preferencesDefault()); } // Deafult helpID is action's name diff -r bb7113655d03 openide.awt/apichanges.xml --- a/openide.awt/apichanges.xml Tue Sep 11 11:55:57 2012 +0200 +++ b/openide.awt/apichanges.xml Tue Sep 11 14:19:40 2012 +0200 @@ -50,6 +50,19 @@ AWT API + + + The value in Preferences for Actions.checkbox can have a default + + + + + + A default value can be specified for a preference value for Actions.checkbox. + + + + Minor API extensions to allow better integration of embedded browsers. diff -r bb7113655d03 openide.awt/manifest.mf --- a/openide.awt/manifest.mf Tue Sep 11 11:55:57 2012 +0200 +++ b/openide.awt/manifest.mf Tue Sep 11 14:19:40 2012 +0200 @@ -2,5 +2,5 @@ OpenIDE-Module: org.openide.awt OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 7.52 +OpenIDE-Module-Specification-Version: 7.53 diff -r bb7113655d03 openide.awt/src/org/openide/awt/AlwaysEnabledAction.java --- a/openide.awt/src/org/openide/awt/AlwaysEnabledAction.java Tue Sep 11 11:55:57 2012 +0200 +++ b/openide.awt/src/org/openide/awt/AlwaysEnabledAction.java Tue Sep 11 14:19:40 2012 +0200 @@ -91,6 +91,7 @@ private static final String PREFERENCES_NODE = "preferencesNode"; // NOI18N private static final String PREFERENCES_KEY = "preferencesKey"; // NOI18N + private static final String PREFERENCES_DEFAULT = "preferencesDefault"; // NOI18N static AlwaysEnabledAction create(Map m) { return (m.containsKey(PREFERENCES_KEY)) ? new CheckBox(m) : new AlwaysEnabledAction(m); @@ -403,7 +404,8 @@ Preferences prefs = prefs(); boolean value; if (key != null && prefs != null) { - value = prefs.getBoolean(key, false); + Object defaultValue = getValue(PREFERENCES_DEFAULT); + value = prefs.getBoolean(key, defaultValue instanceof Boolean ? (Boolean) defaultValue : false); synchronized (this) { if (!prefsListening) { prefsListening = true; diff -r bb7113655d03 openide.awt/test/unit/src/org/openide/awt/AlwaysEnabledActionTest.java --- a/openide.awt/test/unit/src/org/openide/awt/AlwaysEnabledActionTest.java Tue Sep 11 11:55:57 2012 +0200 +++ b/openide.awt/test/unit/src/org/openide/awt/AlwaysEnabledActionTest.java Tue Sep 11 14:19:40 2012 +0200 @@ -413,6 +413,16 @@ checkPreferencesAction("testNbPreferences.instance", "", NbPreferences.root()); checkPreferencesAction("testCustomPreferences.instance", "user:", Preferences.userRoot()); // customPreferences() uses "myNode" subnode } + + public void testPreferencesDefaultAction() throws Exception { + Action a = readAction("testPreferencesDefault.instance"); + assertNotNull(a); + Preferences prefsNode = Preferences.userRoot().node("myNode"); + prefsNode.remove("myKey"); + assertNull("Expected null as preference value", prefsNode.get("myKey", null)); + JMenuItem item = ((Presenter.Menu) a).getMenuPresenter(); + TestCase.assertTrue("Expected to be selected", item.isSelected()); + } private void checkPreferencesAction(String actionFileName, String preferencesNodePrefix, Preferences prefsRoot) throws Exception { Action a = readAction(actionFileName); diff -r bb7113655d03 openide.awt/test/unit/src/org/openide/awt/test-layer.xml --- a/openide.awt/test/unit/src/org/openide/awt/test-layer.xml Tue Sep 11 11:55:57 2012 +0200 +++ b/openide.awt/test/unit/src/org/openide/awt/test-layer.xml Tue Sep 11 14:19:40 2012 +0200 @@ -113,6 +113,13 @@ + + + + + + +