当前位置: 首页>>代码示例>>Java>>正文


Java DomElement.isValid方法代码示例

本文整理汇总了Java中com.intellij.util.xml.DomElement.isValid方法的典型用法代码示例。如果您正苦于以下问题:Java DomElement.isValid方法的具体用法?Java DomElement.isValid怎么用?Java DomElement.isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.xml.DomElement的用法示例。


在下文中一共展示了DomElement.isValid方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProblemHolder

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
@Override
@NotNull
public DomElementsProblemsHolder getProblemHolder(DomElement element) {
  if (element == null || !element.isValid()) return EMPTY_PROBLEMS_HOLDER;
  final DomFileElement<DomElement> fileElement = DomUtil.getFileElement(element);

  synchronized (LOCK) {
    final XmlTag tag = fileElement.getRootElement().getXmlTag();
    if (tag != null) {
      final DomElementsProblemsHolder readyHolder = tag.getUserData(DOM_PROBLEM_HOLDER_KEY);
      if (readyHolder != null) {
        return readyHolder;
      }
    }
    return EMPTY_PROBLEMS_HOLDER;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DomElementAnnotationsManagerImpl.java

示例2: navigate

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
public void navigate(final DomElement element) {
  if (element != null && element.isValid()) {
    final DomElement copy = element.createStableCopy();
    final Project project = element.getManager().getProject();
    final DomElementNavigationProvider navigateProvider = getNavigationProviderName(project);

    if (navigateProvider != null && navigateProvider.canNavigate(copy)) {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          if (!project.isDisposed()) {
            doNavigate(navigateProvider, copy);
          }
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GenerateDomElementProvider.java

示例3: update

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e, DomModelTreeView treeView) {
  final SimpleNode selectedNode = treeView.getTree().getSelectedNode();

  if (selectedNode instanceof DomFileElementNode) {
    e.getPresentation().setVisible(false);
    return;
  }

  boolean enabled = false;
  if (selectedNode instanceof BaseDomElementNode) {
    final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();
    if (domElement.isValid() && DomUtil.hasXml(domElement) && !(domElement.getParent() instanceof DomFileElement)) {
      enabled = true;
    }
  }

  e.getPresentation().setEnabled(enabled);


  if (enabled) {
    e.getPresentation().setText(getPresentationText(selectedNode, ApplicationBundle.message("action.remove")));
  }
  else {
    e.getPresentation().setText(ApplicationBundle.message("action.remove"));
  }

  e.getPresentation().setIcon(AllIcons.General.Remove);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:DeleteDomElement.java

示例4: getProblems

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
@Override
public List<DomElementProblemDescriptor> getProblems(final DomElement domElement,
                                                     final boolean includeXmlProblems,
                                                     final boolean withChildren) {
  if (!withChildren || domElement == null || !domElement.isValid()) {
    return getProblems(domElement);
  }

  return ContainerUtil.concat(getProblemsMap(domElement).values());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DomElementsProblemsHolderImpl.java

示例5: createDomHighlighter

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
@Override
public BackgroundEditorHighlighter createDomHighlighter(final Project project, final PerspectiveFileEditor editor, final DomElement element) {
  return new BackgroundEditorHighlighter() {
    @Override
    @NotNull
    public HighlightingPass[] createPassesForEditor() {
      if (!element.isValid()) return HighlightingPass.EMPTY_ARRAY;
      
      final XmlFile psiFile = DomUtil.getFile(element);

      final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);
      final Document document = psiDocumentManager.getDocument(psiFile);
      if (document == null) return HighlightingPass.EMPTY_ARRAY;

      editor.commit();

      psiDocumentManager.commitAllDocuments();

      GeneralHighlightingPass ghp = new GeneralHighlightingPass(project, psiFile, document, 0, document.getTextLength(),
                                                                true, new ProperTextRange(0, document.getTextLength()), null, new DefaultHighlightInfoProcessor());
      LocalInspectionsPass lip = new LocalInspectionsPass(psiFile, document, 0,
                                                          document.getTextLength(), LocalInspectionsPass.EMPTY_PRIORITY_RANGE, true,
                                                          new DefaultHighlightInfoProcessor());
      return new HighlightingPass[]{ghp, lip};
    }

    @Override
    @NotNull
    public HighlightingPass[] createPassesForVisibleArea() {
      return createPassesForEditor();
    }
  };

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:DomUIFactoryImpl.java

示例6: setSelectionInTextEditor

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
public void setSelectionInTextEditor(final TextEditor textEditor, final DomElement element) {
  if (element != null && element.isValid()) {
    final XmlTag tag = element.getXmlTag();
    if (tag == null) return;

    final PsiFile file = tag.getContainingFile();
    if (file == null) return;

    final Document document = getDocumentManager().getDocument(file);
    if (document == null || !document.equals(textEditor.getEditor().getDocument())) return;

    textEditor.getEditor().getCaretModel().moveToOffset(tag.getTextOffset());
    textEditor.getEditor().getScrollingModel().scrollToCaret(ScrollType.CENTER);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PerspectiveFileEditor.java

示例7: wrapValueSetting

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
@Override
protected void wrapValueSetting(@NotNull final DomElement domElement, final Runnable valueSetter) {
  if (domElement.isValid()) {
    new WriteCommandAction(getProject(), DomUtil.getFile(domElement)) {
      @Override
      protected void run(@NotNull final Result result) throws Throwable {
        valueSetter.run();
      }
    }.execute();
    fireChanged();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DomTableView.java

示例8: areValid

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
private boolean areValid() {
  for (final DomElement domElement : myDomElements) {
    if (!domElement.isValid()) return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:DomElementsErrorPanel.java

示例9: getValue

import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
@Override
public T getValue() throws IllegalAccessException, InvocationTargetException {
  final DomElement element = getWrappedElement();
  return element.isValid() ? (T)DomUIFactory.GET_VALUE_METHOD.invoke(element) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:DomFixedWrapper.java


注:本文中的com.intellij.util.xml.DomElement.isValid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。