use of com.haulmont.cuba.web.widgets.addons.dragdroplayouts.DDPanel in project cuba by cuba-platform.
the class DefaultPanelDropHandler method handleHTML5Drop.
@Override
protected void handleHTML5Drop(DragAndDropEvent event) {
PanelTargetDetails details = (PanelTargetDetails) event.getTargetDetails();
DDPanel panel = (DDPanel) details.getTarget();
panel.setContent(resolveComponentFromHTML5Drop(event));
}
use of com.haulmont.cuba.web.widgets.addons.dragdroplayouts.DDPanel in project cuba by cuba-platform.
the class DefaultPanelDropHandler method handleDropFromLayout.
@Override
protected void handleDropFromLayout(DragAndDropEvent event) {
LayoutBoundTransferable transferable = (LayoutBoundTransferable) event.getTransferable();
PanelTargetDetails details = (PanelTargetDetails) event.getTargetDetails();
Component component = transferable.getComponent();
DDPanel panel = (DDPanel) details.getTarget();
// Detach from old source
Component source = transferable.getSourceComponent();
if (source instanceof ComponentContainer) {
((ComponentContainer) source).removeComponent(component);
} else if (source instanceof SingleComponentContainer) {
((SingleComponentContainer) source).setContent(null);
}
// Attach to new source
panel.setContent(component);
}
Aggregations