com.google.gwt.user.client.ui.WidgetCollection Java Examples

The following examples show how to use com.google.gwt.user.client.ui.WidgetCollection. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VDDHorizontalLayout.java    From cuba with Apache License 2.0 5 votes vote down vote up
/**
 * Updates the drop details while dragging. This is needed to ensure client
 * side criterias can validate the drop location.
 * 
 * @param widget
 *            The container which we are hovering over
 * @param event
 *            The drag event
 */
protected void updateDragDetails(Widget widget, VDragEvent event) {
    if (widget == null) {
        return;
    }

    /*
     * The horizontal position within the cell{
     */
    event.getDropDetails().put(
            Constants.DROP_DETAIL_HORIZONTAL_DROP_LOCATION,
            getHorizontalDropLocation(widget, event));

    /*
     * The index over which the drag is. Can be used by a client side
     * criteria to verify that a drag is over a certain index.
     */
    int index = -1;
    if (widget instanceof Slot) {
        WidgetCollection captionsAndSlots = getChildren();
        index = VDragDropUtil.findSlotIndex(captionsAndSlots,
                (Slot) widget);
    }

    event.getDropDetails().put(Constants.DROP_DETAIL_TO, index);

    // Add mouse event details
    MouseEventDetails details = MouseEventDetailsBuilder
            .buildMouseEventDetails(event.getCurrentGwtEvent(),
                    getElement());
    event.getDropDetails().put(Constants.DROP_DETAIL_MOUSE_EVENT,
            details.serialize());
}
 
Example #2
Source File: VDDVerticalLayout.java    From cuba with Apache License 2.0 5 votes vote down vote up
/**
 * Updates the drop details while dragging. This is needed to ensure client
 * side criterias can validate the drop location.
 * 
 * @param widget
 *            The container which we are hovering over
 * @param event
 *            The drag event
 */
protected void updateDragDetails(Widget widget, VDragEvent event) {
    if (widget == null) {
        return;
    }

    /*
     * The horizontal position within the cell{
     */
    event.getDropDetails().put(Constants.DROP_DETAIL_VERTICAL_DROP_LOCATION,
            getVerticalDropLocation(widget, event));

    /*
     * The index over which the drag is. Can be used by a client side
     * criteria to verify that a drag is over a certain index.
     */
    int index = -1;
    if (widget instanceof Slot) {
        WidgetCollection captionsAndSlots = getChildren();
        index = VDragDropUtil.findSlotIndex(captionsAndSlots,
                (Slot) widget);
    }

    event.getDropDetails().put(Constants.DROP_DETAIL_TO, index);

    // Add mouse event details
    MouseEventDetails details = MouseEventDetailsBuilder
            .buildMouseEventDetails(event.getCurrentGwtEvent(),
                    getElement());
    event.getDropDetails().put(Constants.DROP_DETAIL_MOUSE_EVENT,
            details.serialize());
}
 
Example #3
Source File: VDragDropUtil.java    From cuba with Apache License 2.0 5 votes vote down vote up
/**
 * Finds a slots index in a collection of slots and captions
 * 
 * @param children
 *            the children.
 * @param slot
 *            the slot to find.
 * @return the index of the slot
 */
public static int findSlotIndex(WidgetCollection children, Slot slot) {
    int index = -1;
    for (int i = 0; i < children.size(); i++) {
        Widget w = children.get(i);
        if (w instanceof Slot) {
            index++;
            if (w == slot) {
                break;
            }
        }
    }
    return index;
}
 
Example #4
Source File: VDDHorizontalLayout.java    From cuba with Apache License 2.0 5 votes vote down vote up
/**
 * Updates the drop details while dragging. This is needed to ensure client
 * side criterias can validate the drop location.
 * 
 * @param widget
 *            The container which we are hovering over
 * @param event
 *            The drag event
 */
protected void updateDragDetails(Widget widget, VDragEvent event) {
    if (widget == null) {
        return;
    }

    /*
     * The horizontal position within the cell{
     */
    event.getDropDetails().put(
            Constants.DROP_DETAIL_HORIZONTAL_DROP_LOCATION,
            getHorizontalDropLocation(widget, event));

    /*
     * The index over which the drag is. Can be used by a client side
     * criteria to verify that a drag is over a certain index.
     */
    int index = -1;
    if (widget instanceof Slot) {
        WidgetCollection captionsAndSlots = getChildren();
        index = VDragDropUtil.findSlotIndex(captionsAndSlots,
                (Slot) widget);
    }

    event.getDropDetails().put(Constants.DROP_DETAIL_TO, index);

    // Add mouse event details
    MouseEventDetails details = MouseEventDetailsBuilder
            .buildMouseEventDetails(event.getCurrentGwtEvent(),
                    getElement());
    event.getDropDetails().put(Constants.DROP_DETAIL_MOUSE_EVENT,
            details.serialize());
}
 
Example #5
Source File: VDDVerticalLayout.java    From cuba with Apache License 2.0 5 votes vote down vote up
/**
 * Updates the drop details while dragging. This is needed to ensure client
 * side criterias can validate the drop location.
 * 
 * @param widget
 *            The container which we are hovering over
 * @param event
 *            The drag event
 */
protected void updateDragDetails(Widget widget, VDragEvent event) {
    if (widget == null) {
        return;
    }

    /*
     * The horizontal position within the cell{
     */
    event.getDropDetails().put(Constants.DROP_DETAIL_VERTICAL_DROP_LOCATION,
            getVerticalDropLocation(widget, event));

    /*
     * The index over which the drag is. Can be used by a client side
     * criteria to verify that a drag is over a certain index.
     */
    int index = -1;
    if (widget instanceof Slot) {
        WidgetCollection captionsAndSlots = getChildren();
        index = VDragDropUtil.findSlotIndex(captionsAndSlots,
                (Slot) widget);
    }

    event.getDropDetails().put(Constants.DROP_DETAIL_TO, index);

    // Add mouse event details
    MouseEventDetails details = MouseEventDetailsBuilder
            .buildMouseEventDetails(event.getCurrentGwtEvent(),
                    getElement());
    event.getDropDetails().put(Constants.DROP_DETAIL_MOUSE_EVENT,
            details.serialize());
}
 
Example #6
Source File: ImplPanel.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@Override
public WidgetCollection getChildren() {
  return super.getChildren();
}
 
Example #7
Source File: ImplPanel.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
@Override
public WidgetCollection getChildren() {
  return super.getChildren();
}