}
@Nullable
@Override
public JComponent createComponent() {
ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer<TwigPath>() {
@Override
public TwigPath createElement() {
//IdeFocusManager.getInstance(TwigSettingsForm.this.project).requestFocus(TwigNamespaceDialog.getWindows(), true);
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public boolean canCreateElement() {
return true; //To change body of implemented methods use File | Settings | File Templates.
}
});
tablePanel.setEditAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton anActionButton) {
TwigSettingsForm.this.openTwigPathDialog(TwigSettingsForm.this.tableView.getSelectedObject());
}
});
tablePanel.setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton anActionButton) {
TwigSettingsForm.this.openTwigPathDialog(null);
}
});
tablePanel.setEditActionUpdater(new AnActionButtonUpdater() {
@Override
public boolean isEnabled(AnActionEvent e) {
TwigPath twigPath = TwigSettingsForm.this.tableView.getSelectedObject();
return twigPath != null && twigPath.isCustomPath();
}
});
tablePanel.setRemoveActionUpdater(new AnActionButtonUpdater() {
@Override
public boolean isEnabled(AnActionEvent e) {
TwigPath twigPath = TwigSettingsForm.this.tableView.getSelectedObject();
return twigPath != null && twigPath.isCustomPath();
}
});
tablePanel.disableUpAction();
tablePanel.disableDownAction();
this.panelTableView.add(tablePanel.createPanel());
return this.panel1;
}