use of com.haulmont.cuba.web.widgets.addons.dragdroplayouts.DDVerticalSplitPanel.VerticalSplitPanelTargetDetails in project cuba by cuba-platform.
the class DefaultVerticalSplitPanelDropHandler method handleHTML5Drop.
@Override
protected void handleHTML5Drop(DragAndDropEvent event) {
VerticalSplitPanelTargetDetails details = (VerticalSplitPanelTargetDetails) event.getTargetDetails();
DDVerticalSplitPanel panel = (DDVerticalSplitPanel) details.getTarget();
if (details.getDropLocation() == VerticalDropLocation.TOP) {
// Dropped in the left area
panel.setFirstComponent(resolveComponentFromHTML5Drop(event));
} else if (details.getDropLocation() == VerticalDropLocation.BOTTOM) {
// Dropped in the right area
panel.setSecondComponent(resolveComponentFromHTML5Drop(event));
}
}
use of com.haulmont.cuba.web.widgets.addons.dragdroplayouts.DDVerticalSplitPanel.VerticalSplitPanelTargetDetails in project cuba by cuba-platform.
the class DefaultVerticalSplitPanelDropHandler method handleDropFromLayout.
@Override
protected void handleDropFromLayout(DragAndDropEvent event) {
LayoutBoundTransferable transferable = (LayoutBoundTransferable) event.getTransferable();
VerticalSplitPanelTargetDetails details = (VerticalSplitPanelTargetDetails) event.getTargetDetails();
Component component = transferable.getComponent();
DDVerticalSplitPanel panel = (DDVerticalSplitPanel) details.getTarget();
ComponentContainer source = (ComponentContainer) transferable.getSourceComponent();
// Detach from old source
if (source instanceof ComponentContainer) {
((ComponentContainer) source).removeComponent(component);
} else if (source instanceof SingleComponentContainer) {
((SingleComponentContainer) source).setContent(null);
}
if (details.getDropLocation() == VerticalDropLocation.TOP) {
// Dropped in the left area
panel.setFirstComponent(component);
} else if (details.getDropLocation() == VerticalDropLocation.BOTTOM) {
// Dropped in the right area
panel.setSecondComponent(component);
}
}
Aggregations