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