Package com.intellij.util.xml.highlighting

Examples of com.intellij.util.xml.highlighting.DomElementAnnotationsManager


    }
  }

  private boolean hasErrors() {
    for (DomElement domElement : myChildDescription.getStableValues(myParentElement)) {
      final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(getProject());
      final DomElementsProblemsHolder holder = annotationsManager.getCachedProblemHolder(domElement);
      final List<DomElementProblemDescriptor> problems = holder.getProblems(domElement, true, HighlightSeverity.ERROR);
      if (problems.size() > 0) return true;
    }

    return false;
View Full Code Here


    if (project.isDisposed()) return;

    setUniformIcon(getNodeIcon());
    clearColoredText();

    final DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
    final DomElementsProblemsHolder holder = manager.getCachedProblemHolder(myDomElement);
    final List<DomElementProblemDescriptor> problems =
      holder.getProblems(myDomElement, highlightIfChildrenHaveProblems(), HighlightSeverity.ERROR);

    if (problems.size() > 0) {
      final String toolTip = TooltipUtils.getTooltipText(problems);
View Full Code Here

  }

  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    final Component component = myRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

    final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(myRowDomElement.getManager().getProject());
    final DomElementsProblemsHolder holder = annotationsManager.getCachedProblemHolder(myCellValueDomElement);
    final List<DomElementProblemDescriptor> errorProblems = holder.getProblems(myCellValueDomElement);
    final List<DomElementProblemDescriptor> warningProblems = new ArrayList<DomElementProblemDescriptor>(holder.getProblems(myCellValueDomElement, true, HighlightSeverity.WARNING));
    warningProblems.removeAll(errorProblems);

    final boolean hasErrors = errorProblems.size() > 0;
    if (hasErrors) {
      component.setForeground(Color.RED);
      if (component instanceof JComponent) {
        ((JComponent)component).setToolTipText(TooltipUtils.getTooltipText(errorProblems));
      }
    }
    else {
      component.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
      if (component instanceof JComponent) {
        ((JComponent)component).setToolTipText(null);
      }
    }

    // highlight empty cell with errors
    if (hasErrors && (value == null || value.toString().trim().length() == 0)) {
      component.setBackground(BaseControl.ERROR_BACKGROUND);
    }
    else if (warningProblems.size() > 0) {
      component.setBackground(BaseControl.WARNING_BACKGROUND);
      if(isSelected) component.setForeground(Color.BLACK);
    }

    final List<DomElementProblemDescriptor> errorDescriptors =
      annotationsManager.getCachedProblemHolder(myRowDomElement).getProblems(myRowDomElement, true, true);

    if (table.getModel().getColumnCount() - 1 == column) {
      if (errorDescriptors.size() > 0) {
        final JPanel wrapper = new JPanel(new BorderLayout());
        wrapper.add(component, BorderLayout.CENTER);
View Full Code Here

        if (!getDomWrapper().isValid()) return;

        final DomElement domElement = getDomElement();
        if (domElement == null || !domElement.isValid()) return;

        final DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
        final DomElementsProblemsHolder holder = manager.getCachedProblemHolder(domElement);
        final List<DomElementProblemDescriptor> errorProblems = holder.getProblems(domElement);
        final List<DomElementProblemDescriptor> warningProblems = holder.getProblems(domElement, true, HighlightSeverity.WARNING);

        Color background = getDefaultBackground();
        comboBox.setToolTipText(null);
View Full Code Here

TOP

Related Classes of com.intellij.util.xml.highlighting.DomElementAnnotationsManager

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.