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

Examples of org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement


    List<Activity> registry = getDiagram().getModelRegistry();
    NodeList transitions = getInput().getChildNodes();
    for (int i = 0; i < transitions.getLength(); i++) {
      Node node = transitions.item(i);
      if (node instanceof IDOMElement && node.getLocalName().equals(WebFlowSchemaConstants.ELEM_IF)) {
        IDOMElement transition = (IDOMElement) node;
        String state = transition.getAttribute(WebFlowSchemaConstants.ATTR_THEN);
        if (state != null && state.trim().length() > 0) {
          Node stateRef = getDiagram().getReferencedNode(state);
          if (stateRef instanceof IDOMElement) {
            for (Activity activity : registry) {
              if (!(activity instanceof ParallelActivity) && activity.getInput().equals(stateRef)) {
                Transition trans = new IfThenTransition(this, activity, transition);
                list.add(trans);
              }
            }
          }
        }
        state = transition.getAttribute(WebFlowSchemaConstants.ATTR_ELSE);
        if (state != null && state.trim().length() > 0) {
          Node stateRef = getDiagram().getReferencedNode(state);
          if (stateRef instanceof IDOMElement) {
            for (Activity activity : registry) {
              if (!(activity instanceof ParallelActivity) && activity.getInput().equals(stateRef)) {
View Full Code Here


    return false;
  }

  @Override
  public void execute() {
    IDOMElement interceptor = null;
    NodeList iNodes = sourceElement.getChildNodes();
    for (int i = 0; i < iNodes.getLength(); i++) {
      Node iNode = iNodes.item(i);
      if (iNode instanceof IDOMElement
          && iNode.getLocalName().equals(IntegrationSchemaConstants.ELEM_INTERCEPTORS)) {
        interceptor = (IDOMElement) iNode;
        break;
      }
    }

    IDOMDocument document = (IDOMDocument) sourceElement.getOwnerDocument();
    IDOMModel model = document.getModel();
    if (model != null) {
      model.beginRecording(this);
      if (interceptor == null) {
        interceptor = (IDOMElement) document.createElement(IntegrationSchemaConstants.ELEM_INTERCEPTORS);
        interceptor.setPrefix(ConfigCoreUtils
            .getPrefixForNamespaceUri(document, IntegrationSchemaConstants.URI));
        sourceElement.appendChild(interceptor);
        processor.insertDefaultAttributes(interceptor);
        formatter.formatNode(interceptor);
        formatter.formatNode(sourceElement);
      }

      IDOMElement wiretap = (IDOMElement) document.createElement(IntegrationSchemaConstants.ELEM_WIRE_TAP);
      wiretap.setPrefix(ConfigCoreUtils.getPrefixForNamespaceUri(document, IntegrationSchemaConstants.URI));
      interceptor.appendChild(wiretap);
      processor.insertDefaultAttributes(wiretap);
      formatter.formatNode(wiretap);
      formatter.formatNode(interceptor);
      wiretap.setAttribute(IntegrationSchemaConstants.ATTR_CHANNEL, targetId);
      model.endRecording(this);
    }
  }
View Full Code Here

  public void run() {
    IWorkbenchPart editor = getWorkbenchPart();
    ActivityPart part = (ActivityPart) getSelectedObjects().get(0);
    if (editor instanceof AbstractConfigGraphicalEditor) {
      AbstractConfigGraphicalEditor graph = (AbstractConfigGraphicalEditor) editor;
      IDOMElement element = part.getModelElement().getInput();
      int start = element.getStartOffset();
      int length = element.getLength();
      graph.getEditor().getSourcePage().selectAndReveal(start, length);
    }
  }
View Full Code Here

    fireStructureChange(CHILDREN, child);
  }

  protected void extendedAddChild(Activity child, int index) {
    IDOMDocument document = (IDOMDocument) getInput().getOwnerDocument();
    IDOMElement childElem = child.getInput();
    if (childElem == null) {
      childElem = (IDOMElement) document.createElement(child.getInputName());
      childElem.setPrefix(ConfigCoreUtils.getPrefixForNamespaceUri(document, getDiagram().getNamespaceUri()));
    }

    IDOMModel model = document.getModel();
    if (model != null) {
      model.beginRecording(this);
      getInput().appendChild(childElem);
      getDiagram().getXmlProcessor().insertDefaultAttributes(childElem);
      formatter.formatNode(childElem);
      formatter.formatNode(childElem.getParentNode());
      model.endRecording(this);
    }
  }
View Full Code Here

    }
  }

  protected void extendedRemoveChild(Activity child) {
    IDOMDocument document = (IDOMDocument) getInput().getOwnerDocument();
    IDOMElement childElem = child.getInput();
    if (childElem != null) {
      IDOMModel model = document.getModel();
      Node parent = childElem.getParentNode();
      if (model != null && parent != null) {
        model.beginRecording(this);
        parent.removeChild(childElem);
        formatter.formatNode(parent);
        model.endRecording(this);
View Full Code Here

    List<Activity> list = new ArrayList<Activity>();
    NodeList children = getInput().getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
      Node child = children.item(i);
      if (child instanceof IDOMElement) {
        IDOMElement childElem = (IDOMElement) child;
        if (defaultUri != null && defaultUri.equals(child.getNamespaceURI())) {
          getDiagram().getModelFactory().getChildrenFromXml(list, childElem, this);
        }
        else {
          for (IConfigurationElement config : getDiagram().getGraphicalEditor().getAdapterDefinitions()) {
View Full Code Here

        if (shell != null && !shell.isDisposed()) {
          BeanWizardDialog dialog = BeanWizardDialog.createBeanWizardDialog(shell, sourceFile, false);
          dialog.create();
          dialog.setBlockOnOpen(true);
          if (dialog.open() == Window.OK) {
            IDOMElement element = dialog.getNewBean();
            getViewer().setSelection(new StructuredSelection(element));
          }
        }
      }
    });
View Full Code Here

    IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
    StructuredTextViewer textView = getConfigEditor().getTextViewer();
    if (!selection.isEmpty()) {
      Object obj = selection.getFirstElement();
      if (obj != null && obj instanceof IDOMElement) {
        IDOMElement node = (IDOMElement) obj;
        createNodeInsertActions(manager, node);
        manager.add(new Separator());
        manager.add(new DeleteNodeAction(textView, node));
      }
    }
View Full Code Here

  public void execute() {
    IDOMDocument document = (IDOMDocument) sourceElement.getOwnerDocument();
    IDOMModel model = document.getModel();
    if (model != null) {
      model.beginRecording(this);
      IDOMElement mapping = (IDOMElement) document.createElement(IntegrationSchemaConstants.ELEM_MAPPING);
      mapping.setPrefix(ConfigCoreUtils.getPrefixForNamespaceUri(document, IntegrationSchemaConstants.URI));
      sourceElement.appendChild(mapping);
      processor.insertDefaultAttributes(mapping);
      formatter.formatNode(mapping);
      formatter.formatNode(sourceElement);
      mapping.setAttribute(IntegrationSchemaConstants.ATTR_CHANNEL, targetId);
      model.endRecording(this);
    }
  }
View Full Code Here

  public void execute() {
    IDOMDocument document = (IDOMDocument) sourceElement.getOwnerDocument();
    IDOMModel model = document.getModel();
    if (model != null) {
      model.beginRecording(this);
      IDOMElement recipient = (IDOMElement) document.createElement(IntegrationSchemaConstants.ELEM_RECIPIENT);
      recipient.setPrefix(ConfigCoreUtils.getPrefixForNamespaceUri(document, IntegrationSchemaConstants.URI));
      sourceElement.appendChild(recipient);
      processor.insertDefaultAttributes(recipient);
      formatter.formatNode(recipient);
      formatter.formatNode(sourceElement);
      recipient.setAttribute(IntegrationSchemaConstants.ATTR_CHANNEL, targetId);
      model.endRecording(this);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement

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.