Example usage for org.eclipse.jface.viewers IStructuredSelection iterator

List of usage examples for org.eclipse.jface.viewers IStructuredSelection iterator

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers IStructuredSelection iterator.

Prototype

@Override
public Iterator iterator();

Source Link

Document

Returns an iterator over the elements of this selection.

Usage

From source file:com.bluexml.side.form.common.RefreshOutlineAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    selectedObject = null;//from ww  w .  j  a  v a2s . co  m
    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof FormContainer) {
            selectedObject = (FormContainer) object;
            XMIResource xmiRessource = (XMIResource) ((EObject) object).eResource();
            if (xmiRessource != null) {
                fileURI = xmiRessource.getURI();
            }
        } else {
            return false;
        }
    }

    return selectedObject != null;
}

From source file:com.bluexml.side.form.common.RestoreFormElementAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    selectedObject = null;/*from  w  ww .ja v a 2s  .co  m*/
    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof FormClass) {
            selectedObject = (FormClass) object;
        } else {
            return false;
        }
    }

    return selectedObject != null;
}

From source file:com.bluexml.side.form.common.TransformFieldAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    selectedObject = null;//ww  w. j  av a2 s  .c o m
    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof Field) {
            selectedObject = (Field) object;
        } else {
            return false;
        }
    }

    return selectedObject != null;
}

From source file:com.bluexml.side.form.search.InitializeFormSearchAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    selectedObject = null;/*from ww w . j  a  v a2 s . c  o  m*/
    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof FormSearch) {
            selectedObject = (EObject) object;
        } else {
            return false;
        }
    }

    return selectedObject != null;
}

From source file:com.bluexml.side.form.workflow.InitializeFormWorkflowAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    selectedObject = null;//from   w  w  w  .  ja  v  a2  s  . c  om
    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof WorkflowFormCollection) {
            selectedObject = (EObject) object;
        } else {
            return false;
        }
    }

    return selectedObject != null;
}

From source file:com.bluexml.side.form.workflow.ShowLinkedTaskAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    selectedObject = null;/*from www.  ja  v  a2 s  .  c  om*/
    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof FormWorkflow) {
            selectedObject = (EObject) object;
        } else {
            return false;
        }
    }

    return selectedObject != null;
}

From source file:com.bluexml.side.Requirements.modeler.views.internal.Util.java

License:Open Source License

/**
 * Return whether or not all of the elements in the selection are concrete.
 * //from w ww. j  av a 2  s.com
 * @param selection
 * @return <true>code</true> if all of the elements are concrete.
 */
public static boolean allConcreteSelection(IStructuredSelection selection) {
    if (selection != null && selection.size() > 0) {
        Iterator nodes = selection.iterator();
        while (nodes.hasNext()) {
            if (((MarkerNode) nodes.next()).isConcrete()) {
                continue;
            }
            return false;
        }
        return true;
    }
    return false;
}

From source file:com.bluexml.side.view.edit.ui.actions.AddLinkedFieldAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {

    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof Attribute) {
            toAdd = (Attribute) object;
        } else {/*  w w  w  . j  a va 2s  .c  om*/
            return false;
        }
    }

    return toAdd != null;
}

From source file:com.bluexml.side.view.edit.ui.actions.CopyColConfAction.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    if (selection.size() == 1) {
        Iterator<?> objects = selection.iterator();
        Object object = objects.next();
        if (object instanceof Col) {
            selectedObject = (Col) object;
        }/* w  w  w . ja v  a2  s .c  om*/
    }
    return selectedObject != null;
}

From source file:com.bluexml.side.view.edit.ui.actions.InitializeView.java

License:Open Source License

public boolean updateSelection(IStructuredSelection selection) {
    selectedObject = null;//w ww. j  a v  a 2 s . co  m
    for (Iterator<?> objects = selection.iterator(); objects.hasNext();) {
        Object object = objects.next();
        if (object instanceof AbstractView) {
            selectedObject = (AbstractView) object;
        } else {
            return false;
        }
    }
    return selectedObject != null;
}