private HorizontalPanel mainPanel = new HorizontalPanel();
public ThemeManager(DreamCalc calc, String[] themes) {
this.calc = calc;
Button button;
PickupDragController dragController = new PickupDragController(
RootPanel.get(), false);
// themes buttons don't disappear
dragController.setBehaviorDragProxy(true);
for (String theme : themes) {
button = new Button(theme);
mainPanel.add(button);
dragController.makeDraggable(button);
}
SimpleDropController dropController = new SimpleDropController(calc
.getMainPanel()) {
public void onDrop(DragContext context) {
super.onDrop(context);
Button b = (Button) context.draggable;
setStyle(b.getText());
}
};
dragController.registerDropController(dropController);
}