this.editorContext = editorContext;
this.wicketForgeFacet = (WicketForgeFacet) editorContext.getFacet();
reset(); // fill current items into model
final JBList listComponent = new JBList(additionalPathModel);
listComponent.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
listComponent.setCellRenderer(new AdditionalPathListCellRenderer());
listComponent.getEmptyText().setText("No additional paths defined");
listComponent.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
doEdit(listComponent.getSelectedIndex());
}
}
});
JPanel panel = ToolbarDecorator.createDecorator(listComponent)
.setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
doEdit(-1);
}
}).setEditAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
doEdit(listComponent.getSelectedIndex());
}
}).setRemoveAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
ListUtil.removeSelectedItems(listComponent);