本文整理匯總了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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例5: getForegroundColor
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected static Color getForegroundColor(boolean isValid) {
return isValid ? UIUtil.getListForeground() : JBColor.RED;
}
示例6: getForeground
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected Color getForeground() {
return UIUtil.getListForeground();
}
示例7: getListForeground
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected Color getListForeground(boolean isSelected, boolean hasFocus) {
return UIUtil.getListForeground(isSelected);
}
示例8: getDarkVariant
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
Color getDarkVariant() {
return UIUtil.getListForeground();
}
示例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();
}
示例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));
}