@Override public void onEnter(DragContext context) { super.onEnter(context); PortletChrome portletWidget = (PortletChrome) context.selectedWidgets.get(0); PortletSlot slot = portletWidget.getAssociatedSlot(); if (panel != slot.getParent()) { PortalLayoutConnector originalConnector = ((PortalLayoutConnector) Util.findConnectorFor(slot.getParent())); originalConnector.setOutcomingPortletCandidate(portletWidget); portalConnector.setIncomingPortletCandidate(portletWidget); } configurePostionerSlot(context, slot); }
@Override public void onDrop(DragContext context) { super.onDrop(context); PortletChrome portletWidget = (PortletChrome) context.selectedWidgets.get(0); if (positionerSlot != null) { positionerSlot.setWidget(portletWidget); } Widget contentWidget = portletWidget.getContentWidget(); ComponentConnector contentConnector = Util.findConnectorFor(contentWidget); PortalLayoutConnector originalConnector = (PortalLayoutConnector) contentConnector.getParent(); if (originalConnector != portalConnector) { portalConnector.propagateHierarchyChangesToServer(); originalConnector.propagateHierarchyChangesToServer(); } else { portalConnector.updatePortletPositionOnServer(contentConnector); } }
@Override public void onMove(DragContext context) { super.onMove(context); int targetIndex = DOMUtil.findIntersect( panel, new CoordinateLocation(context.mouseX, context.mouseY), getLocationWidgetComparator()); // check that positioner not already in the correct location int positionerIndex = panel.getWidgetIndex(positionerSlot); if (positionerIndex != targetIndex && (positionerIndex != targetIndex - 1 || targetIndex == 0)) { if (positionerIndex == 0 && panel.getWidgetCount() == 1) { } else if (targetIndex == -1) { } else { panel.insert(positionerSlot, targetIndex); } } }
@Override public void onPreviewDrop(DragContext context) throws VetoDragException { super.onPreviewDrop(context); }