Examples of DomElement


Examples of com.intellij.util.xml.DomElement

  protected int getIconFlags() {
    return 0;
  }

  protected Icon getIcon(final PsiElement element) {
    final DomElement domElement = getDomElement((XmlTag) element);
    if (domElement != null) {
      final Icon icon = domElement.getPresentation().getIcon();
      if (icon != null) {
        return icon;
      }
    }
View Full Code Here

Examples of com.intellij.util.xml.DomElement

  @NotNull
  public PsiReference[] createReferences(final GenericDomValue<List<BeanProperty>> listGenericDomValue,
                                         final PsiElement psiElement,
                                         final ConvertContext convertContext) {
    final DomElement paramsElement = findEnclosingTag(convertContext);
    if (paramsElement == null) {
      return PsiReference.EMPTY_ARRAY;
    }

    for (ParamNameCustomConverter customConverter : Extensions.getExtensions(EP_NAME)) {
View Full Code Here

Examples of com.intellij.util.xml.DomElement

   * @param psiElement Current element.
   * @return {@code null} on XML errors or if {@link #matchesResultType(String)} returns {@code false}.
   */
  @Nullable
  protected final String getNamespace(@NotNull final PsiElement psiElement) {
    final DomElement resultElement = DomUtil.getDomElement(psiElement);
    if (resultElement == null) {
      return null; // XML syntax error
    }

    assert resultElement instanceof HasResultType : "not instance of HasResultType: " + resultElement +
                                                    ", text: " + psiElement.getText();

    final ResultType effectiveResultType = ((HasResultType) resultElement).getEffectiveResultType();
    if (effectiveResultType == null) {
      return null;
    }

    final String resultType = effectiveResultType.getName().getStringValue();
    if (resultType == null ||
        !matchesResultType(resultType)) {
      return null;
    }

    final StrutsPackage strutsPackage = resultElement.getParentOfType(StrutsPackage.class, true);
    if (strutsPackage == null) {
      return null; // XML syntax error
    }

    return strutsPackage.searchNamespace();
View Full Code Here

Examples of com.intellij.util.xml.DomElement

  public static MavenDomDependency getDependency(XmlTag xmltag) {
    // avoid going through the dom for each and every tag.
    if (!"dependency".equals(xmltag.getName())) {
      return null;
    }
    DomElement dom = DomManager.getDomManager(xmltag.getProject()).getDomElement(xmltag);
    if (dom != null) {
      return dom.getParentOfType(MavenDomDependency.class, false);
    }
    return null;
  }
View Full Code Here

Examples of com.intellij.util.xml.DomElement

    final PsiReference psiReference = myFixture.getReferenceAtCaretPositionWithAssertion(filename);
    final PsiElement psiElement = psiReference.resolve();
    assertNotNull("no resolve element " + actionName, psiElement);
    assertTrue(psiElement instanceof XmlTag);

    final DomElement actionElement = DomManager.getDomManager(getProject()).getDomElement((XmlTag)psiElement);
    assertNotNull(actionElement);
    assertInstanceOf(actionElement, Action.class);
    assertEquals("Action name differs for " + actionName,
                 actionName, ((Action)actionElement).getName().getStringValue());
  }
View Full Code Here

Examples of com.intellij.util.xml.DomElement

    return createUnitsAndTypeMapper(unitSet, type);
  }

  public static PersistenceModelBrowser createSameUnitsModelBrowser(final DomElement sourceDom, final PersistenceClassRoleEnum type) {
    final Set<PersistencePackage> unitSet;
    final DomElement rootElement;
    if (sourceDom == null || !((rootElement = sourceDom.getRoot().getRootElement()) instanceof PersistenceMappings)) {
      unitSet = null;
    }
    else {
      unitSet = new THashSet<PersistencePackage>(PersistenceHelper.getHelper().getSharedModelBrowser().getPersistenceUnits((PersistenceMappings)rootElement));
View Full Code Here

Examples of de.umass.xml.DomElement

   * @param entry An entry
   * @param element XML source element
   */
  protected static void loadStandardInfo(MusicEntry entry, DomElement element) {
    // playcount & listeners
    DomElement statsChild = element.getChild("stats");
    String playcountString;
    String userPlaycountString;
    String listenersString;
    if (statsChild != null) {
      playcountString = statsChild.getChildText("playcount");
      userPlaycountString = statsChild.getChildText("userplaycount");
      listenersString = statsChild.getChildText("listeners");
    } else {
      playcountString = element.getChildText("playcount");
      userPlaycountString = element.getChildText("userplaycount");
      listenersString = element.getChildText("listeners");
    }
    if (element.hasChild("id")) {
      entry.id = element.getChildText("id");
    }
    // percentagechange in getHype() responses
    if (element.hasChild("percentagechange")) {
      entry.percentageChange = Integer.parseInt(element.getChildText("percentagechange"));
    }
    int playcount = playcountString == null || playcountString.length() == 0 ? -1 : Integer
        .parseInt(playcountString);
    int userPlaycount = userPlaycountString == null || userPlaycountString.length() == 0 ? -1 : Integer
        .parseInt(userPlaycountString);
    int listeners = listenersString == null || listenersString.length() == 0 ? -1 : Integer
        .parseInt(listenersString);
    // streamable
    String s = element.getChildText("streamable");
    boolean streamable = s != null && s.length() != 0 && Integer.parseInt(s) == 1;
    // copy
    entry.name = element.getChildText("name");
    entry.url = element.getChildText("url");
    entry.mbid = element.getChildText("mbid");
    entry.playcount = playcount;
    entry.userPlaycount = userPlaycount;
    entry.listeners = listeners;
    entry.streamable = streamable;
    // tags
    DomElement tags = element.getChild("tags");
    if (tags == null)
      tags = element.getChild("toptags");
    if (tags != null) {
      for (DomElement tage : tags.getChildren("tag")) {
        entry.tags.add(tage.getChildText("name"));
      }
    }
    // wiki
    DomElement wiki = element.getChild("bio");
    if (wiki == null)
      wiki = element.getChild("wiki");
    if (wiki != null) {
      String publishedText = wiki.getChildText("published");
      try {
        entry.wikiLastChanged = DATE_FORMAT.parse(publishedText);
      } catch (ParseException e) {
        // try parsing it with current locale
        try {
          DateFormat clFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss ZZZZ", Locale.getDefault());
          entry.wikiLastChanged = clFormat.parse(publishedText);
        } catch (ParseException e2) {
          // cannot parse date, wrong locale. wait for last.fm to fix.
        }
      }
      entry.wikiSummary = wiki.getChildText("summary");
      entry.wikiText = wiki.getChildText("content");
    }
    // images
    ImageHolder.loadImages(entry, element);
  }
View Full Code Here

Examples of net.roarsoftware.xml.DomElement

  public List<String> getRecentStations(String user, Session session) {
    List<String> recentStations = new ArrayList<String>();
    Result result = Caller.getInstance().call("user.getRecentStations", session, "user", user);
    if (!result.isSuccessful())
      return Collections.emptyList();
    DomElement element = result.getContentElement();
    for (DomElement stationElement : element.getChildren("station")) {
      // for (DomElement lista : stationElement.getChildren()) {
      // LOGGER.debug(lista.getTagName());
      // }
      // for (DomElement urlElement : stationElement.getChildren("name"))
      // {
View Full Code Here

Examples of org.camunda.bpm.model.xml.instance.DomElement

      public boolean retainAll(Collection<?> c) {
        throw new UnsupportedModelOperationException("retainAll()", "not implemented");
      }

      public void clear() {
        DomElement domElement = getDomElement();
        List<DomElement> childElements = domElement.getChildElements();
        for (DomElement childElement : childElements) {
          domElement.removeChild(childElement);
        }
      }
    };
  }
View Full Code Here

Examples of org.camunda.bpm.model.xml.instance.DomElement

      return (T) ModelUtil.getModelElement(childElements.get(0), modelInstance);
    }
  }

  public void removeValue() {
    DomElement domElement = getDomElement();
    List<DomElement> childElements = domElement.getChildElements();
    for (DomElement childElement : childElements) {
      domElement.removeChild(childElement);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.