本文整理汇总了Java中com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureProblemsHolderImpl类的典型用法代码示例。如果您正苦于以下问题:Java ProjectStructureProblemsHolderImpl类的具体用法?Java ProjectStructureProblemsHolderImpl怎么用?Java ProjectStructureProblemsHolderImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProjectStructureProblemsHolderImpl类属于com.intellij.openapi.roots.ui.configuration.projectRoot.daemon包,在下文中一共展示了ProjectStructureProblemsHolderImpl类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateProblems
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureProblemsHolderImpl; //导入依赖的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();
}
示例2: customizeCellRenderer
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureProblemsHolderImpl; //导入依赖的package包/类
@Override
public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
if (value instanceof MasterDetailsComponent.MyNode) {
final MasterDetailsComponent.MyNode node = (MasterDetailsComponent.MyNode)value;
final NamedConfigurable namedConfigurable = node.getConfigurable();
if (namedConfigurable == null) {
return;
}
final String displayName = node.getDisplayName();
final Icon icon = namedConfigurable.getIcon(expanded);
setIcon(icon);
setToolTipText(null);
setFont(UIUtil.getTreeFont());
SimpleTextAttributes textAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
if (node.isDisplayInBold()) {
textAttributes = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
}
else if (namedConfigurable instanceof ProjectStructureElementConfigurable) {
final ProjectStructureElement projectStructureElement =
((ProjectStructureElementConfigurable)namedConfigurable).getProjectStructureElement();
if (projectStructureElement != null) {
final ProjectStructureDaemonAnalyzer daemonAnalyzer = myContext.getDaemonAnalyzer();
final ProjectStructureProblemsHolderImpl problemsHolder = daemonAnalyzer.getProblemsHolder(projectStructureElement);
if (problemsHolder != null && problemsHolder.containsProblems()) {
final boolean isUnused = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.UNUSED);
final boolean haveWarnings = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.WARNING);
final boolean haveErrors = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.ERROR);
Color foreground = isUnused ? UIUtil.getInactiveTextColor() : null;
final int style = haveWarnings || haveErrors ? SimpleTextAttributes.STYLE_WAVED : -1;
final Color waveColor = haveErrors ? JBColor.RED : haveWarnings ? JBColor.GRAY : null;
textAttributes = textAttributes.derive(style, foreground, null, waveColor);
setToolTipText(problemsHolder.composeTooltipMessage());
}
append(displayName, textAttributes);
String description = projectStructureElement.getDescription();
if (description != null) {
append(" (" + description + ")", SimpleTextAttributes.GRAY_ATTRIBUTES, false);
}
return;
}
}
append(displayName, textAttributes);
}
}
示例3: updateProblems
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureProblemsHolderImpl; //导入依赖的package包/类
private void updateProblems(Artifact originalArtifact, ArtifactEditorImpl artifactEditor) {
final ProjectStructureProblemsHolderImpl holder = myContext.getDaemonAnalyzer().getProblemsHolder(getOrCreateArtifactElement(originalArtifact));
artifactEditor.getValidationManager().updateProblems(holder);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ArtifactsStructureConfigurableContextImpl.java