simplePanel.setWidth("30px");
simplePanel.add(buttonPanel);
if (i != 1) {
// up image
final PImage upImage = new PImage(ARROW_UP_IMAGE_URL);
upImage.setTitle("Move column up");
buttonPanel.add(upImage);
buttonPanel.setCellHorizontalAlignment(upImage, PHorizontalAlignment.ALIGN_LEFT);
upImage.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
final int index = labels.indexOf(label) - 1;
labels.remove(label);
labels.add(index, label);
fireColumnMoved();
for (int row = 1; row <= labels.size(); row++) {
labelPanel.getRowFormatter().removeStyleName(row, PonySDKTheme.SIMPLELIST_SELECTEDROW);
}
labelPanel.getRowFormatter().addStyleName(index + 1, PonySDKTheme.SIMPLELIST_SELECTEDROW);
}
});
}
if (i != labels.size()) {
// down image
final PImage downImage = new PImage(ARROW_DOWN_IMAGE_URL);
downImage.setTitle("Move column down");
buttonPanel.add(downImage);
buttonPanel.setCellHorizontalAlignment(downImage, PHorizontalAlignment.ALIGN_RIGHT);
downImage.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
final int index = labels.indexOf(label) + 1;
labels.remove(label);