X

Geertjan's Blog

  • April 7, 2014

Multiple Rows of Toolbars

Geertjan Wielenga
Product Manager

Realized today that toolbars can be placed in different rows:

The above is a result of a file I named "All.xml" that has this content and is found in the same package as the layer.xml file:

<?xml version="1.0"?>
<!DOCTYPE Configuration PUBLIC "-//NetBeans IDE//DTD toolbar//EN"
"http://www.netbeans.org/dtds/toolbar.dtd">
<Configuration>
<Row>
<Toolbar name="File" />
</Row>
<Row>
<Toolbar name="UndoRedo" />
<Toolbar name="Clipboard"/>
</Row>
<Row>
<Toolbar name="Memory"/>
</Row>
</Configuration>

It is registered as follows in the layer.xml file:

<folder name="Toolbars">
<file name="All.xml" url="All.xml"/>
</folder>

And then, as a handy final step, here's code in one of my TopComponents for switching between different toolbar definitions:

@Override
protected void componentActivated() {
    ToolbarPool.getDefault().setConfiguration("All");
}
@Override
public void componentDeactivated() {
    ToolbarPool.getDefault().setConfiguration("Standard");
}

Here's some related reading:

Join the discussion

Comments ( 1 )
  • slawek mikula Tuesday, April 8, 2014

    Hi ! Geertjan nice to see You coming back with code snippets show. I was missing it :)

    Most of the posts if not exactly a perfect solution to some development ideas, then they serves as a nice indication where to search for more.

    And now a small question: Ordering of the toolbars in row is also kept with this definition ? I want to reorder toolbars with branding module and keep it in one row.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.