Example usage for com.google.gwt.user.client.ui Widget getParent

List of usage examples for com.google.gwt.user.client.ui Widget getParent

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Widget getParent.

Prototype

public Widget getParent() 

Source Link

Document

Gets this widget's parent panel.

Usage

From source file:org.openxdata.designer.client.view.DesignGroupView.java

public void onCopy(Widget sender) {
    selectedDragController.clearSelection();
    selectedDragController.selectWidget(sender.getParent().getParent());
    copyWidgets(false);/*ww w .j a va  2  s .c  om*/
}

From source file:org.openxdata.designer.client.view.DesignGroupView.java

public void onCut(Widget sender) {
    selectedDragController.clearSelection();
    selectedDragController.selectWidget(sender.getParent().getParent());
    cutWidgets();
}

From source file:org.openxdata.designer.client.view.DesignGroupView.java

public void onDelete(Widget sender) {
    selectedDragController.clearSelection();
    selectedDragController.selectWidget(sender.getParent().getParent());
    deleteWidgets();/*from w  w  w .  j  av  a  2 s  .com*/
}

From source file:org.openxdata.querybuilder.client.view.DisplayFieldsView.java

public void moveColumnUp(Widget sender) {
    moveItemUp(sender instanceof ColumnActionHyperlink ? columnPanel : sortPanel,
            sender.getParent().getParent());
}

From source file:org.openxdata.querybuilder.client.view.DisplayFieldsView.java

public void moveColumnDown(Widget sender) {
    moveItemDown(sender instanceof ColumnActionHyperlink ? columnPanel : sortPanel,
            sender.getParent().getParent());
}

From source file:org.openxdata.querybuilder.client.view.DisplayFieldsView.java

public void deleteColumn(Widget sender) {
    if (sender instanceof ColumnActionHyperlink) {
        DisplayColumnWidget displayColumnWidget = (DisplayColumnWidget) sender.getParent().getParent();
        columnPanel.remove(displayColumnWidget);
        dispColMap.remove(sortColMap.remove(displayColumnWidget));
    } else {//from   w  ww. j  av  a2 s . c  o m
        SortColumnWidget sortColumnWidget = (SortColumnWidget) sender.getParent().getParent();
        sortPanel.remove(sortColumnWidget);

        DisplayColumnWidget displayColumnWidget = dispColMap.remove(sortColumnWidget);
        sortColMap.remove(displayColumnWidget);
        displayColumnWidget.setSortOrder(SortField.SORT_NULL);
    }
}

From source file:org.openxdata.querybuilder.client.view.DisplayFieldsView.java

public void changeSortOrder(Widget sender, int sortOrder) {

    if (sender instanceof DisplayColumnWidget) {
        DisplayColumnWidget displayColumnWidget = (DisplayColumnWidget) sender;
        SortColumnWidget sortWidget = sortColMap.get(displayColumnWidget);

        if (sortOrder != SortField.SORT_NULL) {
            if (sortWidget == null) {
                sortWidget = new SortColumnWidget(sortOrder, this);
                sortPanel.add(sortWidget);
                sortColMap.put(displayColumnWidget, sortWidget);
                dispColMap.put(sortWidget, displayColumnWidget);
            } else
                sortWidget.setSortOrder(sortOrder);

            sortWidget.setText(displayColumnWidget.getText());
        } else if (sortPanel.getWidgetIndex(sortWidget) > -1) {
            sortPanel.remove(sortWidget);
            dispColMap.remove(sortColMap.remove(displayColumnWidget));
        }/* w  w  w.j a va  2 s .  c  o  m*/
    } else if (sender instanceof SortColumnActionHyperlink) {
        SortColumnWidget sortWidget = (SortColumnWidget) sender.getParent().getParent();
        sortWidget.setSortOrder(sortOrder);
        dispColMap.get(sortWidget).setSortOrder(sortOrder);
    } else
        dispColMap.get((SortColumnWidget) sender).setSortOrder(sortOrder);
}

From source file:org.openxdata.querybuilder.client.view.FilterConditionsView.java

public void deleteCurrentRow(Widget sender) {
    int startIndex = verticalPanel.getWidgetIndex(sender.getParent());

    ConditionActionHyperlink actionHyperlink = (ConditionActionHyperlink) sender;
    int sendIndex = verticalPanel.getWidgetIndex(actionHyperlink.getAddConditionHyperlink().getParent());

    int count = sendIndex - startIndex;
    for (int index = 0; index <= count; index++)
        verticalPanel.remove(startIndex);
}

From source file:org.openxdata.sharedlib.client.view.FormRunnerView.java

/**
 * @see org.openxdata.sharedlib.client.widget.EditListener#onMoveToNextWidget(com.google.gwt.user.client.ui.Widget)
 *//*from  ww  w .  j av  a  2s.  c  o m*/
public void onMoveToNextWidget(Widget widget) {
    if (widget.getParent().getParent() != null) {
        if (widget.getParent().getParent() instanceof RuntimeGroupWidget) {
            //Non repeating widgets in a group box
            if (((RuntimeGroupWidget) widget.getParent().getParent()).onMoveToNextWidget(widget))
                return;
            else
                widget = widget.getParent().getParent().getParent().getParent();
        } else if (widget.getParent().getParent().getParent() instanceof RuntimeGroupWidget) {
            //Repeating widgets.
            if (((RuntimeGroupWidget) widget.getParent().getParent().getParent()).onMoveToNextWidget(widget))
                return;
            else
                widget = widget.getParent().getParent().getParent().getParent().getParent();
        }
    }

    int index = selectedPanel.getWidgetIndex(widget);
    moveToNextWidget(index);
}

From source file:org.openxdata.sharedlib.client.view.FormRunnerView.java

/**
 * @see org.openxdata.sharedlib.client.widget.EditListener#onMoveToPrevWidget(com.google.gwt.user.client.ui.Widget)
 *///from  w w  w .j  a  v  a  2s . c o m
public void onMoveToPrevWidget(Widget widget) {
    boolean moved = false;

    if (widget.getParent().getParent() instanceof RuntimeGroupWidget) {
        if (((RuntimeGroupWidget) widget.getParent().getParent()).onMoveToPrevWidget(widget))
            return;
        else
            widget = widget.getParent().getParent().getParent().getParent();
    }

    int index = selectedPanel.getWidgetIndex(widget);
    while (--index > 0) {
        if (((RuntimeWidgetWrapper) selectedPanel.getWidget(index)).setFocus()) {
            moved = true;
            break;
        }
    }

    if (!moved && this.selectedTabIndex > 0)
        tabs.selectTab(--selectedTabIndex);
}