當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。