-
Notifications
You must be signed in to change notification settings - Fork 1
DevFaqHideShowToolbar
To hide/show a toolbar dynamically in the NetBeans Platform, you should predefine a toolbar configuration first, then activate it.
-
Define toolbar configuration files alongside the module’s layer:
Standard.xml
:
<?xml version="1.0"?>
<!DOCTYPE Configuration PUBLIC "-//NetBeans IDE//DTD toolbar//EN"
"http://www.netbeans.org/dtds/toolbar.dtd">
<Configuration>
<Row>
<Toolbar name="View" />
<Toolbar name="Control" />
<Toolbar name="Indicator" />
<Toolbar name="Draw" />
<Toolbar name="Memory" />
</Row>
<Row>
<Toolbar name="File" position="2" visible="false" />
<Toolbar name="Edit" position="2" visible="false" />
<Toolbar name="Build" position="2" visible="false" />
<Toolbar name="Debug" position="2" visible="false" />
<Toolbar name="Versioning" position="2" visible="false" />
</Row>
</Configuration>
Developing.xml
:
<?xml version="1.0"?>
<!DOCTYPE Configuration PUBLIC "-//NetBeans IDE//DTD toolbar//EN"
"http://www.netbeans.org/dtds/toolbar.dtd">
<Configuration>
<Row>
<Toolbar name="View" />
<Toolbar name="Control" />
<Toolbar name="Indicator" />
<Toolbar name="Draw" />
<Toolbar name="Memory" />
</Row>
<Row>
<Toolbar name="File" position="2" />
<Toolbar name="Edit" position="2" />
<Toolbar name="Build" position="2" />
<Toolbar name="Debug" position="2" visible="false" />
<Toolbar name="Versioning" position="2" visible="false" />
</Row>
</Configuration>
-
Register the configuration files in
layer.xml
:
<?xml version="1.0"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.0//EN"
"http://www.netbeans.org/dtds/filesystem-1_0.dtd">
<filesystem>
<folder name="Toolbars">
<file name="Standard.xml" url="Standard.xml"/>
<file name="Developing.xml" url="Developing.xml"/>
</folder>
</filesystem>
-
At runtime, set the toolbar configuration that you want:
ToolbarPool.getDefault().setConfiguration("Developing");
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DevFaqHideShowToolbar , that was last modified by NetBeans user Tjansson on 2010-11-04T19:40:00Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-01-26, and needs to be reviewed.
Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF).
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
This wiki is an experiment pending Apache NetBeans Community approval.