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


Java ConfigurationError类代码示例

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


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

示例1: getListCellRendererComponent

import com.intellij.openapi.roots.ui.configuration.ConfigurationError; //导入依赖的package包/类
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
  ConfigurationError error = (ConfigurationError)value;
  myList = list;
  mySelected = isSelected;
  myHasFocus = cellHasFocus;
  myFixGroup.setVisible(error.canBeFixed());
  myText.setText(error.getDescription());
  setBackground(error.isIgnored() ? MessageType.WARNING.getPopupBackground() : MessageType.ERROR.getPopupBackground());
  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ConfigurationErrorsPanel.java

示例2: wrapLabel

import com.intellij.openapi.roots.ui.configuration.ConfigurationError; //导入依赖的package包/类
private JComponent wrapLabel(@NotNull JLabel label, @NotNull ConfigurationError configurationError) {
JPanel result = new JPanel(new BorderLayout());
result.setBackground(label.getBackground());
result.add(label, BorderLayout.CENTER);

JPanel buttonsPanel = new JPanel();
buttonsPanel.setOpaque(false);
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS));

if (configurationError.canBeFixed()) {
  buttonsPanel.add(new ToolbarAlikeButton(AllIcons.Actions.QuickfixBulb) {
    {
      setToolTipText("Fix error");
    }

    @Override
    public void onClick(MouseEvent e) {
      Object o = myModel.getElementAt(0);
      if (o instanceof ConfigurationError) {
        ((ConfigurationError)o).fix(this, new RelativePoint(e));
        updateView();
        Container ancestor = SwingUtilities.getAncestorOfClass(ConfigurationErrorsPanel.class, this);
        if (ancestor != null && ancestor instanceof JComponent) {
          ((JComponent)ancestor).revalidate();
          ancestor.repaint();
        }
      }
    }
  });

  buttonsPanel.add(Box.createHorizontalStrut(3));
}

buttonsPanel.add(new ToolbarAlikeButton(AllIcons.General.AutoscrollToSource) {
  {
    setToolTipText("Navigate to error");
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:ConfigurationErrorsPanel.java

示例3: onClick

import com.intellij.openapi.roots.ui.configuration.ConfigurationError; //导入依赖的package包/类
@Override
public void onClick(MouseEvent e) {
  Object o = myModel.getElementAt(0);
  if (o instanceof ConfigurationError) {
    ((ConfigurationError)o).navigate();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ConfigurationErrorsPanel.java

示例4: removeErrors

import com.intellij.openapi.roots.ui.configuration.ConfigurationError; //导入依赖的package包/类
private void removeErrors(@Nullable Collection<ConfigurationError> errors) {
  if (errors == null) return;
  for (ConfigurationError error : errors) {
    ConfigurationErrors.Bus.removeError(error, myContext.getProject());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ProjectConfigurationProblems.java

示例5: processListMouseEvent

import com.intellij.openapi.roots.ui.configuration.ConfigurationError; //导入依赖的package包/类
private void processListMouseEvent(@NotNull MouseEvent e, boolean wasClicked) {
  int index = myList.locationToIndex(e.getPoint());
  if (index > -1) {
    Object value = myList.getModel().getElementAt(index);
    if (value instanceof ConfigurationError) {
      ConfigurationError error = (ConfigurationError)value;
      Component renderer = myList.getCellRenderer().getListCellRendererComponent(myList, value, index, false, false);
      if (renderer instanceof ErrorListRenderer) {
        Rectangle bounds = myList.getCellBounds(index, index);
        renderer.setBounds(bounds);
        renderer.doLayout();

        Point point = e.getPoint();
        point.translate(-bounds.x, -bounds.y);

        Component deepestComponentAt = SwingUtilities.getDeepestComponentAt(renderer, point.x, point.y);
        if (deepestComponentAt instanceof ToolbarAlikeButton) {
          String name = ((ToolbarAlikeButton)deepestComponentAt).getButtonName();
          if (wasClicked) {
            if (FIX_ACTION_NAME.equals(name)) {
              onClickFix(error, (JComponent)deepestComponentAt, e);
            }
            else if (NAVIGATE_ACTION_NAME.equals(name)) {
              error.navigate();
            }
          }
          else {
            String toolTip = "";
            if (FIX_ACTION_NAME.equals(name)) {
              toolTip = "Fix";
            }
            else if (NAVIGATE_ACTION_NAME.equals(name)) {
              toolTip = "Navigate to the problem";
            }
            myList.setToolTipText(toolTip);
            return;
          }
        }
        else if (e.getClickCount() == 2) {
          error.navigate();
        }
      }
    }
  }

  myList.setToolTipText(null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:ConfigurationErrorsPanel.java

示例6: onClickFix

import com.intellij.openapi.roots.ui.configuration.ConfigurationError; //导入依赖的package包/类
private static void onClickFix(@NotNull ConfigurationError error, @NotNull JComponent component, @NotNull MouseEvent e) {
  error.fix(component, new RelativePoint(e));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ConfigurationErrorsPanel.java


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