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