本文整理汇总了Java中com.intellij.ui.SimpleColoredComponent.append方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleColoredComponent.append方法的具体用法?Java SimpleColoredComponent.append怎么用?Java SimpleColoredComponent.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.SimpleColoredComponent
的用法示例。
在下文中一共展示了SimpleColoredComponent.append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendFragmentsForSpeedSearch
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void appendFragmentsForSpeedSearch(@NotNull JComponent speedSearchEnabledComponent,
@NotNull String text,
@NotNull SimpleTextAttributes attributes,
boolean selected,
@NotNull SimpleColoredComponent simpleColoredComponent) {
final SpeedSearchSupply speedSearch = SpeedSearchSupply.getSupply(speedSearchEnabledComponent);
if (speedSearch != null) {
final Iterable<TextRange> fragments = speedSearch.matchingFragments(text);
if (fragments != null) {
final Color fg = attributes.getFgColor();
final Color bg = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground();
final int style = attributes.getStyle();
final SimpleTextAttributes plain = new SimpleTextAttributes(style, fg);
final SimpleTextAttributes highlighted = new SimpleTextAttributes(bg, fg, null, style | SimpleTextAttributes.STYLE_SEARCH_MATCH);
appendColoredFragments(simpleColoredComponent, text, fragments, plain, highlighted);
return;
}
}
simpleColoredComponent.append(text, attributes);
}
示例2: appendColoredFragmentForMatcher
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void appendColoredFragmentForMatcher(@NotNull String text,
SimpleColoredComponent component,
@NotNull final SimpleTextAttributes attributes,
Matcher matcher,
Color selectedBg,
boolean selected) {
if (!(matcher instanceof MinusculeMatcher) || (Registry.is("ide.highlight.match.in.selected.only") && !selected)) {
component.append(text, attributes);
return;
}
final Iterable<TextRange> iterable = ((MinusculeMatcher)matcher).matchingFragments(text);
if (iterable != null) {
final Color fg = attributes.getFgColor();
final int style = attributes.getStyle();
final SimpleTextAttributes plain = new SimpleTextAttributes(style, fg);
final SimpleTextAttributes highlighted = new SimpleTextAttributes(selectedBg, fg, null, style | SimpleTextAttributes.STYLE_SEARCH_MATCH);
appendColoredFragments(component, text, iterable, plain, highlighted);
}
else {
component.append(text, attributes);
}
}
示例3: 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);
}
};
}
示例4: decorateTree
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
@Override
public void decorateTree(SimpleColoredComponent renderer, AttributeWrapper wrapper) {
XmlTag tag = getTag();
StringBuilder value = new StringBuilder(" (");
String namespace = getGridLayoutNamespace(this);
String rowCount = tag.getAttributeValue(ATTR_ROW_COUNT, namespace);
value.append(StringUtil.isEmpty(rowCount) ? "?" : rowCount).append(", ");
String columnCount = tag.getAttributeValue(ATTR_COLUMN_COUNT, namespace);
value.append(StringUtil.isEmpty(columnCount) ? "?" : columnCount).append(", ");
value.append(isHorizontal() ? VALUE_HORIZONTAL : VALUE_VERTICAL);
renderer.append(value.append(")").toString(), wrapper.getAttribute(SimpleTextAttributes.REGULAR_ATTRIBUTES));
}
示例5: 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();
}
示例6: 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);
}
示例7: getFindUsagesDialog
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
@NotNull
@Override
public AbstractFindUsagesDialog getFindUsagesDialog(boolean isSingleFile, boolean toShowInNewTab, boolean mustOpenInNewTab) {
return new CommonFindUsagesDialog(myElement,
getProject(),
getFindUsagesOptions(),
toShowInNewTab,
mustOpenInNewTab,
isSingleFile,
this) {
@Override
public void configureLabelComponent(@NotNull final SimpleColoredComponent coloredComponent) {
coloredComponent.append(myElement instanceof PsiDirectory ? "Package " : "Module ");
coloredComponent.append(myElement.getName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
}
};
}
示例8: 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);
}
}
示例9: appendFragmentsForSpeedSearch
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void appendFragmentsForSpeedSearch(@NotNull final JComponent speedSearchEnabledComponent, @NotNull final String text,
@NotNull final SimpleTextAttributes attributes, final boolean selected,
@NotNull final SimpleColoredComponent simpleColoredComponent) {
final SpeedSearchSupply speedSearch = SpeedSearchSupply.getSupply(speedSearchEnabledComponent);
if (speedSearch != null) {
final Iterable<TextRange> fragments = speedSearch.matchingFragments(text);
if (fragments != null) {
final Color fg = attributes.getFgColor();
final Color bg = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground();
final int style = attributes.getStyle();
final SimpleTextAttributes plain = new SimpleTextAttributes(style, fg);
final SimpleTextAttributes highlighted = new SimpleTextAttributes(bg, fg, null, style | SimpleTextAttributes.STYLE_SEARCH_MATCH);
appendColoredFragments(simpleColoredComponent, text, fragments, plain, highlighted);
return;
}
}
simpleColoredComponent.append(text, attributes);
}
示例10: appendColoredFragmentForMatcher
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void appendColoredFragmentForMatcher(@NotNull final String text,
final SimpleColoredComponent component,
@NotNull final SimpleTextAttributes attributes,
final Matcher matcher,
final Color selectedBg,
final boolean selected) {
if (!(matcher instanceof MinusculeMatcher) || (Registry.is("ide.highlight.match.in.selected.only") && !selected)) {
component.append(text, attributes);
return;
}
final Iterable<TextRange> iterable = ((MinusculeMatcher)matcher).matchingFragments(text);
if (iterable != null) {
final Color fg = attributes.getFgColor();
final int style = attributes.getStyle();
final SimpleTextAttributes plain = new SimpleTextAttributes(style, fg);
final SimpleTextAttributes highlighted = new SimpleTextAttributes(selectedBg, fg, null, style | SimpleTextAttributes.STYLE_SEARCH_MATCH);
appendColoredFragments(component, text, iterable, plain, highlighted);
}
else {
component.append(text, attributes);
}
}
示例11: 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();
}
示例12: decorate
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public void decorate(Change change, SimpleColoredComponent component, boolean isShowFlatten) {
if (change instanceof FilePatchInProgress.PatchChange) {
final FilePatchInProgress.PatchChange patchChange = (FilePatchInProgress.PatchChange) change;
if (! isShowFlatten) {
// add change subpath
final TextFilePatch filePatch = patchChange.getPatchInProgress().getPatch();
final String patchPath = filePatch.getAfterName() == null ? filePatch.getBeforeName() : filePatch.getAfterName();
component.append(" ");
component.append("["+ patchPath + "]", SimpleTextAttributes.GRAY_ATTRIBUTES);
}
if (patchChange.getPatchInProgress().getCurrentStrip() > 0) {
component.append(" stripped " + patchChange.getPatchInProgress().getCurrentStrip(), SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
}
final String text;
if (FilePatchStatus.ADDED.equals(patchChange.getPatchInProgress().getStatus())) {
text = "(Added)";
} else if (FilePatchStatus.DELETED.equals(patchChange.getPatchInProgress().getStatus())) {
text = "(Deleted)";
} else {
text = "(Modified)";
}
component.append(" ");
component.append(text, SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
示例13: 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);
}
}
示例14: appendFragmentsForSpeedSearch
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void appendFragmentsForSpeedSearch(@Nonnull JComponent speedSearchEnabledComponent,
@Nonnull String text,
@Nonnull SimpleTextAttributes attributes,
boolean selected,
@Nonnull SimpleColoredComponent simpleColoredComponent) {
final SpeedSearchSupply speedSearch = SpeedSearchSupply.getSupply(speedSearchEnabledComponent);
if (speedSearch != null) {
final Iterable<TextRange> fragments = speedSearch.matchingFragments(text);
if (fragments != null) {
final Color fg = attributes.getFgColor();
final Color bg = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground();
final int style = attributes.getStyle();
final SimpleTextAttributes plain = new SimpleTextAttributes(style, fg);
final SimpleTextAttributes highlighted = new SimpleTextAttributes(bg, fg, null, style | SimpleTextAttributes.STYLE_SEARCH_MATCH);
appendColoredFragments(simpleColoredComponent, text, fragments, plain, highlighted);
return;
}
}
simpleColoredComponent.append(text, attributes);
}
示例15: appendColoredFragmentForMatcher
import com.intellij.ui.SimpleColoredComponent; //导入方法依赖的package包/类
public static void appendColoredFragmentForMatcher(@Nonnull String text,
SimpleColoredComponent component,
@Nonnull final SimpleTextAttributes attributes,
Matcher matcher,
Color selectedBg,
boolean selected) {
if (!(matcher instanceof MinusculeMatcher) || (Registry.is("ide.highlight.match.in.selected.only") && !selected)) {
component.append(text, attributes);
return;
}
final Iterable<TextRange> iterable = ((MinusculeMatcher)matcher).matchingFragments(text);
if (iterable != null) {
final Color fg = attributes.getFgColor();
final int style = attributes.getStyle();
final SimpleTextAttributes plain = new SimpleTextAttributes(style, fg);
final SimpleTextAttributes highlighted = new SimpleTextAttributes(selectedBg, fg, null, style | SimpleTextAttributes.STYLE_SEARCH_MATCH);
appendColoredFragments(component, text, iterable, plain, highlighted);
}
else {
component.append(text, attributes);
}
}