本文整理匯總了Java中com.intellij.util.ui.UIUtil.getTreeTextForeground方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.getTreeTextForeground方法的具體用法?Java UIUtil.getTreeTextForeground怎麽用?Java UIUtil.getTreeTextForeground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.getTreeTextForeground方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: update
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected void update(PresentationData presentation) {
Object newElement = updateElement();
if (getElement() != newElement) {
presentation.setChanged(true);
}
if (newElement == null) return;
Color oldColor = myColor;
String oldName = myName;
Icon oldIcon = getIcon();
List<ColoredFragment> oldFragments = new ArrayList<ColoredFragment>(presentation.getColoredText());
myColor = UIUtil.getTreeTextForeground();
updateFileStatus();
doUpdate();
myName = getName();
presentation.setPresentableText(myName);
presentation.setChanged(!Comparing.equal(new Object[]{getIcon(), myName, oldFragments, myColor},
new Object[]{oldIcon, oldName, oldFragments, oldColor}));
presentation.setForcedTextForeground(myColor);
presentation.setIcon(getIcon());
}
示例2: customizeCellRenderer
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void customizeCellRenderer(@NotNull JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)value;
final Object userObject = treeNode.getUserObject();
if (userObject == null) return;
final Color background = selected ? UIUtil.getTreeSelectionBackground(hasFocus) : UIUtil.getTreeTextBackground();
final Color foreground = selected && hasFocus ? UIUtil.getTreeSelectionForeground() : UIUtil.getTreeTextForeground();
final String text;
final int style;
if (userObject instanceof Configuration) {
text = ((Configuration)userObject).getName();
style = SimpleTextAttributes.STYLE_PLAIN;
}
else {
text = userObject.toString();
style = SimpleTextAttributes.STYLE_BOLD;
}
SearchUtil.appendFragments(mySpeedSearch.getEnteredPrefix(), text, style, foreground, background, this);
}
示例3: getForeground
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected Color getForeground() {
return UIUtil.getTreeTextForeground();
}