private MasterView newMasterView() { MasterView mv; mv = new MasterView(); mv.setPropertyMapper(new BlocPropertyMapper()); Column column = new Column("draganddrop", "", false, "10px", true); HTML html = new HTML("[drop]"); if (controller != null) { controller.clearRegistration(GROUPNAME); controller.registerDrop(html, new BlocClipboard(null), GROUPNAME); } // column.setWidget(html); if (!isReadOnly()) { mv.append(column); } mv.append(new Column("content", contentColumnName, true)); if (!isReadOnly()) { mv.append(new Column("action", "Supprimer", false, "15px", true)); } mv.setFilteringEnabled(false); mv.setWidth("100%"); return mv; }
@Override protected Widget newWidget() { // clear all FlowPanel main = new FlowPanel(); // add // main.add(newActionContainer(false)); // build inner data DDPanel ddp = new DDPanel(); main.add(ddp); panel = new FlowPanel(); ddp.add(panel); controller = ddp; controller.addValueChangeHandler( new ValueChangeHandler<DragInformation>() { @Override public void onValueChange(ValueChangeEvent<DragInformation> event) { if (!isReadOnly()) { Bloc source = ((BlocClipboard) event.getValue().getSource()).getValue(); Bloc dropTarget = ((BlocClipboard) event.getValue().getDropTarget()).getValue(); removeItem(source); if (dropTarget != null) { addItem(indexOfItem(dropTarget), source); } else { addItem(0, source); } refreshWidget(); } } }); view = newMasterView(); panel.add(view); // add main.add(newActionContainer(true)); return main; }