本文整理匯總了Java中com.intellij.util.ui.UIUtil.getTableForeground方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.getTableForeground方法的具體用法?Java UIUtil.getTableForeground怎麽用?Java UIUtil.getTableForeground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.getTableForeground方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTreeCellRendererComponent
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@NotNull
@Override
public Component getTreeCellRendererComponent(@NotNull JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
if (value instanceof MyTreeNode) {
MyTreeNode node = (MyTreeNode)value;
myLabel.setText(getRenamedTitle(node.getKey().field.getName(), node.getText()));
myLabel.setFont(myLabel.getFont().deriveFont(node.getKey().groupName == null ? Font.BOLD : Font.PLAIN));
myLabel.setEnabled(node.isEnabled());
}
else {
myLabel.setText(getRenamedTitle(value.toString(), value.toString()));
myLabel.setFont(myLabel.getFont().deriveFont(Font.BOLD));
myLabel.setEnabled(true);
}
Color foreground = selected ? UIUtil.getTableSelectionForeground() : UIUtil.getTableForeground();
myLabel.setForeground(foreground);
return myLabel;
}
示例2: customizeCellRenderer
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected void customizeCellRenderer(JTable table, Object value, boolean selected) {
myPanel.removeAll();
myPanel.setBackground(null);
myRenderer.clear();
myRenderer.setBackground(null);
// 7-8, a hack
if (value instanceof SvnChangeList) {
final SvnChangeList changeList = (SvnChangeList)value;
myRenderer.renderChangeList(table, changeList);
final Color bg = selected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground();
final Color fg = selected ? UIUtil.getTableSelectionForeground() : UIUtil.getTableForeground();
myRenderer.setBackground(bg);
myRenderer.setForeground(fg);
myCheckBox.setBackground(bg);
myCheckBox.setForeground(fg);
myPanel.setBackground(bg);
myPanel.setForeground(fg);
myCheckBox.setSelected(myWiseSelection.isSelected(changeList.getNumber()));
myPanel.add(myCheckBox, BorderLayout.WEST);
myPanel.add(myRenderer, BorderLayout.CENTER);
}
}
示例3: updateColors
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void updateColors(boolean isSelected) {
Color bg = isSelected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground();
Color fg = isSelected ? UIUtil.getTableSelectionForeground() : UIUtil.getTableForeground();
setColors(bg, fg, myPanel, myActionLabel, myDateLabel, mySpacePanel);
}
示例4: updateColors
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void updateColors(boolean isSelected) {
Color bg = isSelected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground();
Color fg = isSelected ? UIUtil.getTableSelectionForeground() : UIUtil.getTableForeground();
setColors(bg, fg, myPanel, myNameLabel);
}