this.getContentPane().setLayout(new FormLayout("fill:pref:grow", "pref, 3dlu, fill:min:grow, 3dlu, pref, 3dlu, pref"));
((JPanel) this.getContentPane()).setBorder(BorderFactory.createEmptyBorder(
0, 6, 2, 6));
// Initialize the buttonPanel and fill the vectors with the actions.
final DefaultToolBarModel toolbarModel = DefaultToolBarModel.getInstance();
Action[] currentActions = toolbarModel.getActions();
ArrayList<Action> notSelectedActionsList = new ArrayList<Action>(Arrays.asList(toolbarModel
.getAvailableActions()));
for (Action a : currentActions) {
mCurrentActions.addElement(a);
}
for (Action a : currentActions) {
if (notSelectedActionsList.contains(a)) {
notSelectedActionsList.remove(a);
}
}
Action[] availableActions = new Action[notSelectedActionsList.size()];
notSelectedActionsList.toArray(availableActions);
for (Action a : availableActions) {
mAvailableActions.addElement(a);
}
mAvailableActions.insertElementAt(toolbarModel.getSeparatorAction(), 0);
mAvailableActions.insertElementAt(toolbarModel.getGlueAction(), 1);
mAvailableActions.insertElementAt(toolbarModel.getSpaceAction(), 2);
// Initialize the Panel with the available Buttons
mButtonPanel = new JPanel();
mButtonPanel.setLayout(new GridLayout(0, 4, 2, 2));
mButtonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);