This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.64</specification-version>
<specification-version>1.67</specification-version>
</run-dependency>
</dependency>
<dependency>
@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
<!-- ACTUAL CHANGES BEGIN HERE: -->
<changes>
<change id="Actions.checkbox.default">
<summary>EditorActionRegistration has preferencesDefault</summary>
<version major="1" minor="67"/>
<date day="18" month="9" year="2012"/>
<author login="jlahoda"/>
<compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes"/>
<description>
<p>
EditorActionRegistration has preferencesDefault to specify the default for the preferences value.
</p>
</description>
<issue number="217978"/>
</change>
<change id="UndoableEditWrapper">
<summary>UndoableEditWrapper interface added</summary>
<version major="1" minor="60"/>
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
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
<build-prerequisite/>
<specification-version>7.17</specification-version>
<specification-version>7.53</specification-version>
String preferencesKey() default "";
/**
* Whether or not the action should be in checked state by default.
* <br/>
* 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}.
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
<apidef name="awt">AWT API</apidef>
</apidefs>
<api name="awt"/>
<summary>The value in Preferences for Actions.checkbox can have a default</summary>
<version major="7" minor="53"/>
<compatibility addition="yes" binary="compatible" semantic="compatible" deprecation="no" deletion="no" modification="no"/>
A default value can be specified for a preference value for Actions.checkbox.
<class package="org.openide.awt" name="Actions"/>
<change id="BrowserExtensions">
<summary>Minor API extensions to allow better integration of embedded browsers.</summary>
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
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);
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;
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);
<attr name='preferencesKey' stringvalue='myKey'/>
<attr name='preferencesNode' stringvalue='user:/myNode'/>
</file>
<file name="testPreferencesDefault.instance">
<attr name='instanceCreate' methodvalue='org.openide.awt.Actions.checkbox'/>
<attr name='delegate' methodvalue='org.openide.awt.AlwaysEnabledActionTest.preferencesAction'/>
<attr name='preferencesDefault' boolvalue='true'/>
<file name="testNbPreferences.instance">