當前位置: 首頁>>代碼示例>>Java>>正文


Java UIUtil.getTreeTextForeground方法代碼示例

本文整理匯總了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());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:SimpleNode.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:ExistingTemplatesComponent.java

示例3: getForeground

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected Color getForeground() {
  return UIUtil.getTreeTextForeground();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:GroupedElementsRenderer.java


注:本文中的com.intellij.util.ui.UIUtil.getTreeTextForeground方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。