本文整理汇总了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();
}
示例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...");
}
}
示例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...");
}
}
示例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();
}
示例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"));
}
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}