ToolbarDecorator () { ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTable) .setAddAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { doAdd(); } }) .setRemoveAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { doRemove(); } }) .setEditAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { if (myTable.isEditing()) { myTable.getCellEditor().stopCellEditing(); return; } doEdit(); } }); if (isUpDownSupported()) { decorator .setMoveUpAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { doUp(); }}) .setMoveDownAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { doDown(); } }); } else { decorator.disableUpAction().disableDownAction(); } return decorator; }