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


Java UIUtil.getListForeground方法代碼示例

本文整理匯總了Java中com.intellij.util.ui.UIUtil.getListForeground方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.getListForeground方法的具體用法?Java UIUtil.getListForeground怎麽用?Java UIUtil.getListForeground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.util.ui.UIUtil的用法示例。


在下文中一共展示了UIUtil.getListForeground方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: customizeCellRenderer

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean focus) {
  if (!(value instanceof Configuration)) {
    return;
  }
  final Configuration configuration = (Configuration)value;
  final Color background = (selected && !focus) ?
                           UIUtil.getListUnfocusedSelectionBackground() : UIUtil.getListBackground(selected);
  final Color foreground = UIUtil.getListForeground(selected);
  setPaintFocusBorder(false);
  SearchUtil.appendFragments(mySpeedSearch.getEnteredPrefix(), configuration.getName(), SimpleTextAttributes.STYLE_PLAIN,
                             foreground, background, this);
  final long created = configuration.getCreated();
  if (created > 0) {
    final String createdString = DateFormatUtil.formatPrettyDateTime(created);
    append(" (" + createdString + ')',
           selected ? new SimpleTextAttributes(Font.PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:ExistingTemplatesComponent.java

示例2: getListCellRendererComponent

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
  if (isSelected || cellHasFocus) {
    setBackground(UIUtil.getListSelectionBackground());
    final Color selectedForegroundColor = UIUtil.getListSelectionForeground();
    myUrlLabel.setForeground(selectedForegroundColor);
    myDateLabel.setForeground(selectedForegroundColor);
    setForeground(selectedForegroundColor);
  }
  else {
    setBackground(UIUtil.getListBackground());
    final Color foregroundColor = UIUtil.getListForeground();
    myUrlLabel.setForeground(foregroundColor);
    myDateLabel.setForeground(UIUtil.getInactiveTextColor());
    setForeground(foregroundColor);
  }
  if (value instanceof String) {
    myUrlLabel.setText((String) value);
    myDateLabel.setText("");
  } else {
    SvnBranchItem item = (SvnBranchItem) value;
    myUrlLabel.setText(SVNPathUtil.tail(item.getUrl()));
    final long creationMillis = item.getCreationDateMillis();
    myDateLabel.setText((creationMillis > 0) ? DateFormatUtil.formatDate(creationMillis) : "");
  }
  return this;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:SelectBranchPopup.java

示例3: getAttributesFor

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@NotNull
private static SimpleTextAttributes getAttributesFor(@NotNull FileStatus status) {
  Color color = status.getColor();
  if (color == null) color = UIUtil.getListForeground();

  if (!myFileStatusToAttributeMap.containsKey(status)) {
    myFileStatusToAttributeMap.put(status, new SimpleTextAttributes(Font.PLAIN, color));
  }
  return myFileStatusToAttributeMap.get(status);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:FileOrDirectoryTreeNode.java

示例4: InspectionListCellRenderer

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public InspectionListCellRenderer() {
  mySelected = new SimpleTextAttributes(UIUtil.getListSelectionBackground(),
                                        UIUtil.getListSelectionForeground(),
                                        JBColor.RED,
                                        SimpleTextAttributes.STYLE_PLAIN);
  myPlain = new SimpleTextAttributes(UIUtil.getListBackground(),
                                     UIUtil.getListForeground(),
                                     JBColor.RED,
                                     SimpleTextAttributes.STYLE_PLAIN);
  myHighlighted = new SimpleTextAttributes(UIUtil.getListBackground(),
                                           UIUtil.getListForeground(),
                                           null,
                                           SimpleTextAttributes.STYLE_SEARCH_MATCH);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:InspectionListCellRenderer.java

示例5: getForegroundColor

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected static Color getForegroundColor(boolean isValid) {
  return isValid ? UIUtil.getListForeground() : JBColor.RED;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:LibraryTableTreeContentElement.java

示例6: getForeground

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

示例7: getListForeground

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected Color getListForeground(boolean isSelected, boolean hasFocus) {
  return UIUtil.getListForeground(isSelected);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:RecentProjectPanel.java

示例8: getDarkVariant

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

示例9: defaultActionForeground

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected static Color defaultActionForeground(boolean isSelected, @Nullable Presentation presentation) {
  if (isSelected) return UIUtil.getListSelectionForeground();
  if (presentation != null && (!presentation.isEnabled() || !presentation.isVisible())) return UIUtil.getInactiveTextColor();
  return UIUtil.getListForeground();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:GotoActionModel.java

示例10: getAttributes

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private static SimpleTextAttributes getAttributes(final boolean selected, final boolean taskClosed) {
  return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
                                  taskClosed ? UIUtil.getLabelDisabledForeground() : UIUtil.getListForeground(selected));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:TaskCellRenderer.java


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