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


Java SimpleColoredComponent.setIcon方法代码示例

本文整理汇总了Java中com.intellij.ui.SimpleColoredComponent.setIcon方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleColoredComponent.setIcon方法的具体用法?Java SimpleColoredComponent.setIcon怎么用?Java SimpleColoredComponent.setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.SimpleColoredComponent的用法示例。


在下文中一共展示了SimpleColoredComponent.setIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FixedHotfixGroupElement

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public FixedHotfixGroupElement(String name, Object data, VirtualFile file) {
  super(name, data, file);
  myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
    public void customizeCellRenderer(SimpleColoredComponent renderer,
                                      JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      renderer.setIcon(AllIcons.General.Information);
      renderer.append("Fixed: ", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
      final String[] text = getText();
      final String checkedText = ((text != null) && (text.length > 0)) ? text[0] : "";
      renderer.append(checkedText, SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FixedHotfixGroupElement.java

示例2: HotfixGroupElement

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public HotfixGroupElement(final String name, final Object data, final VirtualFile file, final Consumer<HotfixGate> hotfix,
                          final String fixDescription, final MutableErrorTreeView view) {
  super(name, data, file);
  myHotfix = hotfix;
  myFixDescription = fixDescription;
  myView = view;
  myLeftTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
    public void customizeCellRenderer(SimpleColoredComponent renderer,
                                      JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      renderer.setIcon(AllIcons.General.Error);

      final String[] text = getText();
      final String errorText = ((text != null) && (text.length > 0)) ? text[0] : "";
      renderer.append("Error: " + errorText, SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
  };
  myRightTreeCellRenderer = new MyRightRenderer();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:HotfixGroupElement.java

示例3: SetValueInplaceEditor

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
private SetValueInplaceEditor(final XValueNodeImpl node, @NotNull final String nodeName) {
  super(node, "setValue");
  myValueNode = node;
  myModifier = myValueNode.getValueContainer().getModifier();

  myEditorPanel = new JPanel();
  myEditorPanel.setLayout(new BorderLayout(0, 0));
  SimpleColoredComponent nameLabel = new SimpleColoredComponent();
  nameLabel.setIcon(getNode().getIcon());
  nameLabel.append(nodeName, XDebuggerUIConstants.VALUE_NAME_ATTRIBUTES);
  XValuePresentation presentation = node.getValuePresentation();
  if (presentation != null) {
    XValuePresentationUtil.appendSeparator(nameLabel, presentation.getSeparator());
  }
  myEditorPanel.add(nameLabel, BorderLayout.WEST);

  myEditorPanel.add(myExpressionEditor.getComponent(), BorderLayout.CENTER);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SetValueInplaceEditor.java

示例4: appendGroupText

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
private void appendGroupText(final GroupNode node, JPanel panel, Color fileBgColor) {
  UsageGroup group = node == null ? null : node.getGroup();
  if (group == null) return;
  GroupNode parentGroup = (GroupNode)node.getParent();
  appendGroupText(parentGroup, panel, fileBgColor);
  if (node.canNavigateToSource()) {
    SimpleColoredComponent renderer = new SimpleColoredComponent();

    renderer.setIcon(group.getIcon(false));
    SimpleTextAttributes attributes = deriveAttributesWithColor(SimpleTextAttributes.REGULAR_ATTRIBUTES, fileBgColor);
    renderer.append(group.getText(myUsageView), attributes);
    renderer.append(" ", attributes);
    renderer.setIpad(new Insets(0,0,0,0));
    renderer.setBorder(null);
    panel.add(renderer);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ShowUsagesTableCellRenderer.java

示例5: SetValueInplaceEditor

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public SetValueInplaceEditor(final XValueNodeImpl node, @NotNull final String nodeName) {
  super(node, "setValue");
  myValueNode = node;
  myModifier = myValueNode.getValueContainer().getModifier();

  myEditorPanel = new JPanel();
  myEditorPanel.setLayout(new BorderLayout(0, 0));
  SimpleColoredComponent nameLabel = new SimpleColoredComponent();
  nameLabel.setIcon(getNode().getIcon());
  nameLabel.append(nodeName, XDebuggerUIConstants.VALUE_NAME_ATTRIBUTES);
  final String separator = node.getSeparator();
  if (separator != null) {
    nameLabel.append(separator, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }

  myEditorPanel.add(nameLabel, BorderLayout.WEST);

  myEditorPanel.add(myExpressionEditor.getComponent(), BorderLayout.CENTER);
  final String value = myModifier != null ? myModifier.getInitialValueEditorText() : null;
  myExpressionEditor.setText(value != null ? value : "");
  myExpressionEditor.selectAll();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:SetValueInplaceEditor.java

示例6: appendGroupText

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
private void appendGroupText(final GroupNode node, JPanel panel, Color fileBgColor) {
  UsageGroup group = node == null ? null : node.getGroup();
  if (group == null) return;
  GroupNode parentGroup = (GroupNode) node.getParent();
  appendGroupText(parentGroup, panel, fileBgColor);
  if (node.canNavigateToSource()) {
    SimpleColoredComponent renderer = new SimpleColoredComponent();

    renderer.setIcon(group.getIcon(false));
    SimpleTextAttributes attributes =
        deriveAttributesWithColor(SimpleTextAttributes.REGULAR_ATTRIBUTES, fileBgColor);
    renderer.append(group.getText(myUsageView), attributes);
    renderer.append(" ", attributes);
    renderer.setIpad(new Insets(0, 0, 0, 0));
    renderer.setBorder(null);
    panel.add(renderer);
  }
}
 
开发者ID:square,项目名称:dagger-intellij-plugin,代码行数:19,代码来源:ShowUsagesTableCellRenderer.java

示例7: SetValueInplaceEditor

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
private SetValueInplaceEditor(final XValueNodeImpl node, @Nonnull final String nodeName) {
  super(node, "setValue");
  myValueNode = node;
  myModifier = myValueNode.getValueContainer().getModifier();

  SimpleColoredComponent nameLabel = new SimpleColoredComponent();
  nameLabel.getIpad().right = 0;
  nameLabel.getIpad().left = 0;
  nameLabel.setIcon(myNode.getIcon());
  nameLabel.append(nodeName, XDebuggerUIConstants.VALUE_NAME_ATTRIBUTES);
  XValuePresentation presentation = node.getValuePresentation();
  if (presentation != null) {
    XValuePresentationUtil.appendSeparator(nameLabel, presentation.getSeparator());
  }
  myNameOffset = nameLabel.getPreferredSize().width;
  myEditorPanel = JBUI.Panels.simplePanel(myExpressionEditor.getComponent());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:SetValueInplaceEditor.java

示例8: customize

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public void customize(@NotNull SimpleColoredComponent component) {
  synchronized (mySections) {
    for (TextSection section : mySections) {
      final TextAttributes attributes = section.getTextAttributes();
      component.append(section.getText(), SimpleTextAttributes.fromTextAttributes(attributes));
    }
    component.setIcon(myIcon);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CompositeAppearance.java

示例9: customize

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public void customize(@NotNull final SimpleColoredComponent component) {
  component.setIcon(getIcon());
  component.append(getPrimaryText(), myTextAttributes);
  final String secondaryText = getSecondaryText();
  if (!StringUtil.isEmptyOrSpaces(secondaryText)) {
    component.append(" (" + secondaryText + ")", myCommentAttributes);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BaseTextCommentCellAppearance.java

示例10: MyNavigatableWithDataElement

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
private MyNavigatableWithDataElement(final Project project,
                                     @NotNull ErrorTreeElementKind kind,
                                     GroupingElement parent,
                                     String[] message,
                                     @NotNull final VirtualFile vf,
                                     String exportText,
                                     String rendererTextPrefix) {
  super(kind, parent, message, new OpenFileDescriptor(project, vf, -1, -1), exportText, rendererTextPrefix);
  myVf = vf;
  myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
    @Override
    public void customizeCellRenderer(SimpleColoredComponent renderer,
                                      JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      final Icon icon = myVf.getFileType().getIcon();
      renderer.setIcon(icon);
      final String[] messages = getText();
      final String text = messages == null || messages.length == 0 ? vf.getPath() : messages[0];
      renderer.append(text);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ErrorViewStructure.java

示例11: setupGenericRenderer

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public void setupGenericRenderer(SimpleColoredComponent renderer, boolean plainView) {
  if (plainView) {
    renderer.setIcon(getIcon());
  }
  final SimpleTextAttributes attributes =
    myBreakpoint.isEnabled() ? SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES;
  renderer.append(StringUtil.notNullize(getDisplayText()), attributes);
  String description = getUserDescription();
  if (!StringUtil.isEmpty(description)) {
    renderer.append(" (" + description + ")", SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:XBreakpointItem.java

示例12: customizeReference

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void customizeReference(AntReference antReference, SimpleColoredComponent component, GlobalAntConfiguration configuration) {
  AntInstallation antInstallation = antReference.find(configuration);
  if (antInstallation != null) customizeAnt(antInstallation.getProperties(), component);
  else {
    component.setIcon(PlatformIcons.INVALID_ENTRY_ICON);
    component.append(antReference.getName(), SimpleTextAttributes.ERROR_ATTRIBUTES);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AntUIUtil.java

示例13: customizeAnt

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void customizeAnt(AbstractProperty.AbstractPropertyContainer antProperties, SimpleColoredComponent component) {
  component.setIcon(AntIcons.AntInstallation);
  String name = AntInstallation.NAME.get(antProperties);
  component.append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  String versionString = AntInstallation.VERSION.get(antProperties);
  if (name.indexOf(versionString) == -1)
    component.append(" (" + versionString + ")", SimpleTextAttributes.SYNTHETIC_ATTRIBUTES);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AntUIUtil.java

示例14: setupGenericRenderer

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
@Override
public void setupGenericRenderer(SimpleColoredComponent renderer, boolean plainView) {
  if (plainView) {
    renderer.setIcon(myBreakpoint.getIcon());
  }
  renderer.append(plainView ? StringUtil.shortenTextWithEllipsis(myBreakpoint.getShortName(), 60, 0) : myBreakpoint.getDisplayName(),
                  isEnabled() ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.GRAY_ATTRIBUTES);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:JavaBreakpointItem.java

示例15: setupGenericRenderer

import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public void setupGenericRenderer(SimpleColoredComponent renderer, boolean plainView) {
  if (plainView) {
    renderer.setIcon(getIcon());
  }
  final SimpleTextAttributes attributes =
    myBreakpoint.isEnabled() ? SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES;
  renderer.append(getDisplayText(), attributes);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:XBreakpointItem.java


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