Package org.eclipse.wst.xml.core.internal.document

Examples of org.eclipse.wst.xml.core.internal.document.AttrImpl


        .getChildNodes());
    IDOMNode nestedBeanNode = QuickfixTestUtil.getFirstNode(BeansSchemaConstants.ELEM_BEAN, constructorArgNode
        .getChildNodes());
    IDOMNode propertyNode = QuickfixTestUtil.getFirstNode(BeansSchemaConstants.ELEM_PROPERTY, nestedBeanNode
        .getChildNodes());
    AttrImpl refAttr = (AttrImpl) propertyNode.getAttributes().getNamedItem(BeansSchemaConstants.ATTR_REF);

    applyProposal(refAttr, nestedBeanNode, "balance");
    assertNotNull("Expects new bean account to be created", QuickfixTestUtil.getNode(
        BeansSchemaConstants.ELEM_BEAN, "balance", beansNode.getChildNodes()));
  }
View Full Code Here


  }

  public void testCreateNewBeanInNonBean() {
    IDOMNode node = QuickfixTestUtil.getNode("task:scheduled-tasks", 0, beansNode.getChildNodes());
    IDOMNode taskNode = QuickfixTestUtil.getFirstNode("task:scheduled", node.getChildNodes());
    AttrImpl refAttr = (AttrImpl) taskNode.getAttributes().getNamedItem(BeansSchemaConstants.ATTR_REF);
    applyProposal(refAttr, node, "target2");
    assertNotNull("Expects new bean target2 to be created", QuickfixTestUtil.getNode(
        BeansSchemaConstants.ELEM_BEAN, "target2", beansNode.getChildNodes()));
  }
View Full Code Here

        model.beginRecording(this);
      }

      Document ownerDocument = beanNode.getOwnerDocument();

      AttrImpl attrNode = (AttrImpl) ownerDocument.createAttribute(BeansSchemaConstants.ATTR_FACTORY_METHOD);
      beanNode.getAttributes().setNamedItem(attrNode);

      FormatProcessorXML formatter = new FormatProcessorXML();
      formatter.formatNode(beanNode);

      if (model != null) {
        model.endRecording(this);
      }

      LinkedModeModel linkModel = new LinkedModeModel();
      LinkedPositionGroup group = new LinkedPositionGroup();
      attrNode = ((AttrImpl) beanNode.getAttributes().getNamedItem(BeansSchemaConstants.ATTR_FACTORY_METHOD));

      try {
        group.addPosition(new LinkedPosition(document, attrNode.getValueRegionStartOffset() + 1, 0));
        linkModel.addGroup(group);

      }
      catch (BadLocationException e) {
        StatusHandler.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.document.AttrImpl

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.