Package com.intellij.util.xml

Examples of com.intellij.util.xml.DomElement


  @Nullable
  public abstract T generate(final Project project, final Editor editor, final PsiFile file);

  public void navigate(final DomElement element) {
    if (element != null && element.isValid()) {
      final DomElement copy = element.createStableCopy();
      final DomElementNavigationProvider navigateProvider = getNavigationProviderName(element.getManager().getProject());

      if (navigateProvider != null && navigateProvider.canNavigate(copy)) {
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          public void run() {
View Full Code Here


  public GenerateDomElementAction(final GenerateDomElementProvider generateProvider) {
    super(new CodeInsightActionHandler() {
      public void invoke(final Project project, final Editor editor, final PsiFile file) {
        new WriteCommandAction(project, file) {
          protected void run(final Result result) throws Throwable {
            final DomElement element = generateProvider.generate(project, editor, file);
            generateProvider.navigate(element);
          }
        }.execute();
      }
View Full Code Here

    myProvider = generateProvider;
  }

  protected boolean isValidForFile(final Project project, final Editor editor, final PsiFile file) {
    final DomElement element = DomUtil.getContextElement(editor);
    return element != null && myProvider.isAvailableForElement(element);
  }
View Full Code Here

  private static int getCollectionIndex(final DomElement parent, final DomCollectionChildDescription childDescription, final Editor editor) {
    int offset = editor.getCaretModel().getOffset();

    for (int i = 0; i < childDescription.getValues(parent).size(); i++) {
      DomElement element = childDescription.getValues(parent).get(i);
      XmlElement xmlElement = element.getXmlElement();
      if (xmlElement != null && xmlElement.getTextRange().getStartOffset() >= offset) {
          return i;
      }
    }
View Full Code Here

TOP

Related Classes of com.intellij.util.xml.DomElement

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.