boolean separatorPending = false;
int count = 0;
for (int i = 0; i < reportActions.length; i++)
{
final ActionPlugin actionPlugin = reportActions[i];
if (actionPlugin.isAddToToolbar() == false)
{
continue;
}
if (count > 0 && separatorPending)
{
toolBar.addSeparator();
separatorPending = false;
}
if (actionPlugin instanceof ExportActionPlugin)
{
final ExportActionPlugin exportPlugin = (ExportActionPlugin) actionPlugin;
final ExportAction action = new ExportAction(exportPlugin, pane);
toolBar.add(createButton(action, pane.getSwingGuiContext()));
count += 1;
}
else if (actionPlugin instanceof ControlActionPlugin)
{
final ControlActionPlugin controlPlugin = (ControlActionPlugin) actionPlugin;
final ControlAction action = new ControlAction(controlPlugin, pane);
toolBar.add(createButton(action, pane.getSwingGuiContext()));
count += 1;
}
else if (actionPlugin instanceof ZoomListActionPlugin)
{
final JPanel zoomPane = new JPanel();
zoomPane.setLayout(new FlowLayout(FlowLayout.LEFT));
zoomPane.add(createZoomSelector(pane));
toolBar.add(zoomPane);
count += 1;
}
if (actionPlugin.isSeparated())
{
separatorPending = true;
}
}
}