Package org.eclipse.wst.xml.core.internal.contentmodel.modelquery

Examples of org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction


  private List getAvailableChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
    List modelQueryActions = getAvailableModelQueryActionsAtIndex(parent, childPosition, ModelQuery.VALIDITY_NONE);
    Iterator iterator = modelQueryActions.iterator();
    List cmnodes = new Vector();
    while (iterator.hasNext()) {
      ModelQueryAction action = (ModelQueryAction) iterator.next();
      if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
        CMNode actionCMNode = action.getCMNode();
        if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
          cmnodes.add(actionCMNode);
        }
      }
    }
View Full Code Here


  private List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
    List modelQueryActions = getAvailableModelQueryActionsAtIndex(parent, childPosition, ModelQuery.VALIDITY_STRICT);
    Iterator iterator = modelQueryActions.iterator();
    List cmnodes = new Vector();
    while (iterator.hasNext()) {
      ModelQueryAction action = (ModelQueryAction) iterator.next();
      if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
        CMNode actionCMNode = action.getCMNode();
        if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
          cmnodes.add(actionCMNode);
        }
      }
    }
View Full Code Here

  private List filterAvailableModelQueryActions(List modelQueryActions) {
    List filtered = new ArrayList(modelQueryActions.size());
 
    Iterator iterator = modelQueryActions.iterator();
    while (iterator.hasNext()) {
      ModelQueryAction action = (ModelQueryAction) iterator.next();
      if(validModelQueryNode(action.getCMNode())) {
        filtered.add(action);
      }
    }
   
    return filtered;
View Full Code Here

  protected void removeActionsNotContainingRange(List actionList, int startIndex, int endIndex)
  {
    for (int i = actionList.size() - 1; i >= 0; i--)
    {
      ModelQueryAction action = (ModelQueryAction)actionList.get(i);
      if (!isActionContainingRange(action, startIndex, endIndex))
      {
        actionList.remove(i);
      }
    }
View Full Code Here

  protected void removeActionsNotMatchingRange(List actionList, int startIndex, int endIndex)
  {
    for (int i = actionList.size() - 1; i >= 0; i--)
    {
      ModelQueryAction action = (ModelQueryAction)actionList.get(i);
      if (!isActionMatchingRange(action, startIndex, endIndex))
      {
        actionList.remove(i);
      }
    }
View Full Code Here

  protected List getAvailableChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
    List modelQueryActions = getAvailableChildrenAtIndex(parent, childPosition, ModelQuery.VALIDITY_NONE);
    Iterator iterator = modelQueryActions.iterator();
    List cmnodes = new Vector();
    while (iterator.hasNext()) {
      ModelQueryAction action = (ModelQueryAction) iterator.next();
      if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
        CMNode actionCMNode = action.getCMNode();
        if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
          cmnodes.add(actionCMNode);
        }
      }
    }
View Full Code Here


  protected void addActionHelper(IMenuManager menu, List modelQueryActionList) {
    List actionList = new Vector();
    for (Iterator i = modelQueryActionList.iterator(); i.hasNext();) {
      ModelQueryAction action = (ModelQueryAction) i.next();
      if (action.getCMNode() != null) {
        int cmNodeType = action.getCMNode().getNodeType();
        if (action.getKind() == ModelQueryAction.INSERT) {
          switch (cmNodeType) {
            case CMNode.ATTRIBUTE_DECLARATION : {
              actionList.add(createAddAttributeAction((Element) action.getParent(), (CMAttributeDeclaration) action.getCMNode()));
              break;
            }
            case CMNode.ELEMENT_DECLARATION : {
              actionList.add(createAddElementAction(action.getParent(), (CMElementDeclaration) action.getCMNode(), action.getStartIndex()));
              break;
            }
          }
        }
        else if (action.getKind() == ModelQueryAction.REPLACE) {
          if ((action.getParent() != null) && (action.getCMNode() != null)) {
            actionList.add(createReplaceAction(action.getParent(), action.getCMNode(), action.getStartIndex(), action.getEndIndex()));
          }
        }
      }
    }
    menuBuilder.populateMenu(menu, actionList, false);
View Full Code Here

  protected List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
    List modelQueryActions = getAvailableChildrenAtIndex(parent, childPosition, ModelQuery.VALIDITY_STRICT);
    Iterator iterator = modelQueryActions.iterator();
    List cmnodes = new Vector();
    while (iterator.hasNext()) {
      ModelQueryAction action = (ModelQueryAction) iterator.next();
      if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
        CMNode actionCMNode = action.getCMNode();
        if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
          cmnodes.add(actionCMNode);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.