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


Java ConfigurationErrorQuickFix类代码示例

本文整理汇总了Java中com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationErrorQuickFix类的具体用法?Java ConfigurationErrorQuickFix怎么用?Java ConfigurationErrorQuickFix使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConfigurationErrorQuickFix类属于com.intellij.openapi.roots.ui.configuration.projectRoot.daemon包,在下文中一共展示了ConfigurationErrorQuickFix类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateProblems

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public void updateProblems(@Nullable ProjectStructureProblemsHolderImpl holder) {
  myErrorPanel.clearError();
  myProblemsForNodes.clear();
  myProblems.clear();
  if (holder != null) {
    final List<ProjectStructureProblemDescription> problemDescriptions = holder.getProblemDescriptions();
    if (problemDescriptions != null) {
      for (ProjectStructureProblemDescription description : problemDescriptions) {
        final String message = description.getMessage(false);
        List<? extends ConfigurationErrorQuickFix> quickFixes = Collections.emptyList();
        if (description instanceof ArtifactProblemDescription) {
          final ArtifactProblemDescription artifactProblem = (ArtifactProblemDescription)description;
          quickFixes = artifactProblem.getFixes();
          if (artifactProblem.getPathToPlace() != null) {
            myProblems.add(artifactProblem);
            showProblemInTree(artifactProblem);
          }
        }
        myErrorPanel.showError(message, quickFixes);
      }
    }
  }
  myArtifactEditor.getLayoutTreeComponent().updateTreeNodesPresentation();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ArtifactValidationManagerImpl.java

示例2: showError

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public void showError(@NotNull String message, @NotNull List<? extends ConfigurationErrorQuickFix> quickFixes) {
  myErrorLabel.setVisible(true);
  final String errorText = XmlStringUtil.wrapInHtml(message);
  if (myErrorLabel.isShowing()) {
    myErrorLabel.setText(errorText);
  }
  else {
    myErrorText = errorText;
  }
  myMainPanel.setVisible(true);
  myCurrentQuickFixes = quickFixes;
  myFixButton.setVisible(!quickFixes.isEmpty());
  if (!quickFixes.isEmpty()) {
    myFixButton.setText(quickFixes.size() == 1 ? ContainerUtil.getFirstItem(quickFixes, null).getActionName() : "Fix...");
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ArtifactErrorPanel.java

示例3: showError

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public void showError(@Nonnull String message, @Nonnull List<? extends ConfigurationErrorQuickFix> quickFixes) {
  myErrorLabel.setVisible(true);
  final String errorText = XmlStringUtil.wrapInHtml(message);
  if (myErrorLabel.isShowing()) {
    myErrorLabel.setText(errorText);
  }
  else {
    myErrorText = errorText;
  }
  myMainPanel.setVisible(true);
  myCurrentQuickFixes = quickFixes;
  myFixButton.setVisible(!quickFixes.isEmpty());
  if (!quickFixes.isEmpty()) {
    myFixButton.setText(quickFixes.size() == 1 ? ContainerUtil.getFirstItem(quickFixes, null).getActionName() : "Fix...");
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:ArtifactErrorPanel.java

示例4: ArtifactErrorPanel

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public ArtifactErrorPanel(final ArtifactEditorImpl artifactEditor) {
  myErrorLabel.setIcon(AllIcons.RunConfigurations.ConfigurationWarning);
  new UiNotifyConnector(myMainPanel, new Activatable.Adapter() {
    @Override
    public void showNotify() {
      if (myErrorText != null) {
        myErrorLabel.setText(myErrorText);
        myErrorText = null;
      }
    }
  });
  myFixButton.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      if (!myCurrentQuickFixes.isEmpty()) {
        if (myCurrentQuickFixes.size() == 1) {
          performFix(ContainerUtil.getFirstItem(myCurrentQuickFixes, null), artifactEditor);
        }
        else {
          JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<ConfigurationErrorQuickFix>(null, myCurrentQuickFixes) {
            @NotNull
            @Override
            public String getTextFor(ConfigurationErrorQuickFix value) {
              return value.getActionName();
            }

            @Override
            public PopupStep onChosen(ConfigurationErrorQuickFix selectedValue, boolean finalChoice) {
              performFix(selectedValue, artifactEditor);
              return FINAL_CHOICE;
            }
          }).showUnderneathOf(myFixButton);
        }
      }
    }
  });
  clearError();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:ArtifactErrorPanel.java

示例5: showError

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public void showError(@NotNull String message, @NotNull List<? extends ConfigurationErrorQuickFix> quickFixes) {
  myErrorLabel.setVisible(true);
  final String errorText = XmlStringUtil.wrapInHtml(message);
  if (myErrorLabel.isShowing()) {
    myErrorLabel.setText(errorText);
  }
  myErrorText = errorText;
  myMainPanel.setVisible(true);
  myCurrentQuickFixes = quickFixes;
  myFixButton.setVisible(!quickFixes.isEmpty());
  if (!quickFixes.isEmpty()) {
    myFixButton.setText(quickFixes.size() == 1 ? ContainerUtil.getFirstItem(quickFixes, null).getActionName() : IdeBundle.message("button.fix"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ArtifactErrorPanel.java

示例6: convertQuickFixes

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
private List<ConfigurationErrorQuickFix> convertQuickFixes(ArtifactProblemQuickFix[] quickFixes) {
  final List<ConfigurationErrorQuickFix> result = new SmartList<ConfigurationErrorQuickFix>();
  for (final ArtifactProblemQuickFix fix : quickFixes) {
    result.add(new ConfigurationErrorQuickFix(fix.getActionName()) {
      @Override
      public void performFix() {
        final ArtifactEditor editor = myContext.getOrCreateEditor(myOriginalArtifact);
        fix.performFix(((ArtifactEditorEx)editor).getContext());
      }
    });
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ArtifactProblemsHolderImpl.java

示例7: ArtifactErrorPanel

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public ArtifactErrorPanel(final ArtifactEditorImpl artifactEditor) {
  myErrorLabel.setIcon(AllIcons.RunConfigurations.ConfigurationWarning);
  new UiNotifyConnector(myMainPanel, new Activatable.Adapter() {
    @Override
    public void showNotify() {
      if (myErrorText != null) {
        myErrorLabel.setText(myErrorText);
        myErrorText = null;
      }
    }
  });
  myFixButton.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      if (!myCurrentQuickFixes.isEmpty()) {
        if (myCurrentQuickFixes.size() == 1) {
          performFix(ContainerUtil.getFirstItem(myCurrentQuickFixes, null), artifactEditor);
        }
        else {
          JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<ConfigurationErrorQuickFix>(null, myCurrentQuickFixes) {
            @Nonnull
            @Override
            public String getTextFor(ConfigurationErrorQuickFix value) {
              return value.getActionName();
            }

            @Override
            public PopupStep onChosen(ConfigurationErrorQuickFix selectedValue, boolean finalChoice) {
              performFix(selectedValue, artifactEditor);
              return FINAL_CHOICE;
            }
          }).showUnderneathOf(myFixButton);
        }
      }
    }
  });
  clearError();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:39,代码来源:ArtifactErrorPanel.java

示例8: performFix

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
private static void performFix(ConfigurationErrorQuickFix quickFix, ArtifactEditorImpl artifactEditor) {
  quickFix.performFix();
  artifactEditor.queueValidation();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ArtifactErrorPanel.java

示例9: ArtifactProblemDescription

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public ArtifactProblemDescription(@NotNull String message, @NotNull ProjectStructureProblemType problemType,
                                  @Nullable List<PackagingElement<?>> pathToPlace, @NotNull PlaceInArtifact place,
                                  final List<ConfigurationErrorQuickFix> quickFixList) {
  super(message, null, place, problemType, quickFixList);
  myPathToPlace = pathToPlace;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ArtifactProblemDescription.java

示例10: ArtifactProblemDescription

import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ConfigurationErrorQuickFix; //导入依赖的package包/类
public ArtifactProblemDescription(@Nonnull String message, @Nonnull ProjectStructureProblemType problemType,
                                  @Nullable List<PackagingElement<?>> pathToPlace, @Nonnull PlaceInArtifact place,
                                  final List<ConfigurationErrorQuickFix> quickFixList) {
  super(message, null, place, problemType, quickFixList);
  myPathToPlace = pathToPlace;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:ArtifactProblemDescription.java


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