本文整理汇总了Java中com.intellij.ui.speedSearch.SpeedSearchUtil.appendFragmentsForSpeedSearch方法的典型用法代码示例。如果您正苦于以下问题:Java SpeedSearchUtil.appendFragmentsForSpeedSearch方法的具体用法?Java SpeedSearchUtil.appendFragmentsForSpeedSearch怎么用?Java SpeedSearchUtil.appendFragmentsForSpeedSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.speedSearch.SpeedSearchUtil
的用法示例。
在下文中一共展示了SpeedSearchUtil.appendFragmentsForSpeedSearch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderTreeNode
import com.intellij.ui.speedSearch.SpeedSearchUtil; //导入方法依赖的package包/类
@Override
public void renderTreeNode(SimpleColoredComponent component, JTree tree) {
SpeedSearchUtil.appendFragmentsForSpeedSearch(tree, getText(), SimpleTextAttributes.REGULAR_ATTRIBUTES, false, component);
component.setIcon(myParameter.getIcon(0));
}
示例2: renderTreeNode
import com.intellij.ui.speedSearch.SpeedSearchUtil; //导入方法依赖的package包/类
@Override
public void renderTreeNode(SimpleColoredComponent component, JTree tree) {
SpeedSearchUtil.appendFragmentsForSpeedSearch(tree, getText(), getTextAttributes(tree), false, component);
component.setIcon(myIcon);
}
示例3: customizeCellRenderer
import com.intellij.ui.speedSearch.SpeedSearchUtil; //导入方法依赖的package包/类
@Override
protected void customizeCellRenderer(final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) {
// Fix GTK background
if (UIUtil.isUnderGTKLookAndFeel()){
final Color background = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground();
UIUtil.changeBackGround(this, background);
}
Color color = UIUtil.getListForeground();
SimpleTextAttributes attributes = null;
String locationString = null;
setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); // for separator, see below
if (value instanceof NodeDescriptor) {
final NodeDescriptor descriptor = (NodeDescriptor)value;
setIcon(descriptor.getIcon());
final Color elementColor = descriptor.getColor();
if (elementColor != null) {
color = elementColor;
}
if (descriptor instanceof AbstractTreeNode) {
final AbstractTreeNode treeNode = (AbstractTreeNode)descriptor;
final TextAttributesKey attributesKey = treeNode.getAttributesKey();
if (attributesKey != null) {
final TextAttributes textAttributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attributesKey);
if (textAttributes != null) attributes = SimpleTextAttributes.fromTextAttributes(textAttributes);
}
locationString = treeNode.getLocationString();
final PresentationData presentation = treeNode.getPresentation();
if (presentation.hasSeparatorAbove() && !selected) {
setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, GroupedElementsRenderer.POPUP_SEPARATOR_FOREGROUND),
BorderFactory.createEmptyBorder(0, 0, 1, 0)));
}
}
}
if(attributes == null) attributes = new SimpleTextAttributes(Font.PLAIN, color);
final String text = value.toString();
if (myCommanderPanel.isEnableSearchHighlighting()) {
JList list1 = myCommanderPanel.getList();
if (list1 != null) {
SpeedSearchUtil.appendFragmentsForSpeedSearch(list1, text, attributes, selected, this);
}
}
else {
append(text != null ? text : "", attributes);
}
if (locationString != null && locationString.length() > 0) {
append(" (" + locationString + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
示例4: renderTreeNode
import com.intellij.ui.speedSearch.SpeedSearchUtil; //导入方法依赖的package包/类
@Override
public void renderTreeNode(SimpleColoredComponent component, JTree tree) {
SpeedSearchUtil.appendFragmentsForSpeedSearch(tree, getText(), SimpleTextAttributes.REGULAR_ATTRIBUTES, false, component);
component.setIcon(IconDescriptorUpdaters.getIcon(myParameter, 0));
}