*/
public void prepareGeneralActionsButtons() {
//Figure out the index to place the buttons, in order to put them between separator 2 and the boxGlue.
int index = controlToolbar.getComponentIndex(boxGlue);
final DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();
JButton button;
for (final GeneralActionsManipulator m : dlh.getGeneralActionsManipulators()) {
button = new JButton(m.getName(), m.getIcon());
if (m.getDescription() != null && !m.getDescription().isEmpty()) {
button.setToolTipText(m.getDescription());
}
if (m.canExecute()) {
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dlh.executeManipulator(m);
}
});
} else {
button.setEnabled(false);
}
controlToolbar.add(button, index);
index++;
generalActionsButtons.add(button);
}
//Add plugin general actions as a drop down list:
final PluginGeneralActionsManipulator[] plugins = dlh.getPluginGeneralActionsManipulators();
if (plugins != null && plugins.length > 0) {
JCommandButton pluginsButton = new JCommandButton(NbBundle.getMessage(DataTableTopComponent.class, "DataTableTopComponent.general.actions.plugins.button.text"), ImageWrapperResizableIcon.getIcon(ImageUtilities.loadImage("org/gephi/desktop/datalab/resources/puzzle--arrow.png", true), new Dimension(16, 16)));
pluginsButton.setDisplayState(CommandButtonDisplayState.MEDIUM);
pluginsButton.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
pluginsButton.setPopupCallback(new PopupPanelCallback() {