本文整理汇总了Java中com.intellij.ui.JBColor.GRAY属性的典型用法代码示例。如果您正苦于以下问题:Java JBColor.GRAY属性的具体用法?Java JBColor.GRAY怎么用?Java JBColor.GRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.ui.JBColor
的用法示例。
在下文中一共展示了JBColor.GRAY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeHeader
private void writeHeader(@NonNls Writer writer, String title) throws IOException {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
writer.write("<html>\r\n");
writer.write("<head>\r\n");
writer.write("<title>" + title + "</title>\r\n");
writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n");
writeStyles(writer);
writer.write("</head>\r\n");
Color color = scheme.getDefaultBackground();
if (color==null) color = JBColor.GRAY;
writer.write("<BODY BGCOLOR=\"#" + Integer.toString(color.getRGB() & 0xFFFFFF, 16) + "\">\r\n");
writer.write("<TABLE CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH=\"100%\" BGCOLOR=\"#C0C0C0\" >\r\n");
writer.write("<TR><TD><CENTER>\r\n");
writer.write("<FONT FACE=\"Arial, Helvetica\" COLOR=\"#000000\">\r\n");
writer.write(title + "</FONT>\r\n");
writer.write("</center></TD></TR></TABLE>\r\n");
writer.write("<pre>\r\n");
}
示例2: getForeground
@Override
public Color getForeground() {
if (getModel().isSelected()) {
return JBColor.foreground();
}
else if (getModel().isRollover()) {
return JBColor.GRAY;
}
else {
return getColor();
}
}
示例3: createComponent
@Override
@Nullable
public JComponent createComponent() {
JComponent component = new MainPanel();
mySplitter = new Splitter(false, .15f);
mySplitter.setHonorComponentsMinimumSize(true);
initSidePanel();
mySplitter.setFirstComponent(mySidePanel);
mySplitter.setSecondComponent(myDetails);
component.add(mySplitter, BorderLayout.CENTER);
myNotificationPanel = new JPanel();
Color background = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.GUTTER_BACKGROUND);
if (background == null) {
background = JBColor.GRAY;
}
myNotificationPanel.setBackground(background);
myNotificationPanel.setLayout(new BoxLayout(myNotificationPanel, BoxLayout.Y_AXIS));
component.add(myNotificationPanel, BorderLayout.NORTH);
myErrorsPanel = new ConfigurationErrorsPanel();
component.add(myErrorsPanel, BorderLayout.SOUTH);
myUiInitialized = true;
MessageBusConnection connection = myProject.getMessageBus().connect(myDisposable);
connection.subscribe(GradleSyncState.GRADLE_SYNC_TOPIC, this);
return component;
}
示例4: getPlainAttributes
@Override
protected SimpleTextAttributes getPlainAttributes() {
if (myProjectsManager.isIgnored(myMavenProject)) {
return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY);
}
return super.getPlainAttributes();
}
示例5: customizeCellRenderer
@Override
public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
if (value instanceof MasterDetailsComponent.MyNode) {
final MasterDetailsComponent.MyNode node = (MasterDetailsComponent.MyNode)value;
final NamedConfigurable namedConfigurable = node.getConfigurable();
if (namedConfigurable == null) {
return;
}
final String displayName = node.getDisplayName();
final Icon icon = namedConfigurable.getIcon(expanded);
setIcon(icon);
setToolTipText(null);
setFont(UIUtil.getTreeFont());
SimpleTextAttributes textAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
if (node.isDisplayInBold()) {
textAttributes = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
}
else if (namedConfigurable instanceof ProjectStructureElementConfigurable) {
final ProjectStructureElement projectStructureElement =
((ProjectStructureElementConfigurable)namedConfigurable).getProjectStructureElement();
if (projectStructureElement != null) {
final ProjectStructureDaemonAnalyzer daemonAnalyzer = myContext.getDaemonAnalyzer();
final ProjectStructureProblemsHolderImpl problemsHolder = daemonAnalyzer.getProblemsHolder(projectStructureElement);
if (problemsHolder != null && problemsHolder.containsProblems()) {
final boolean isUnused = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.UNUSED);
final boolean haveWarnings = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.WARNING);
final boolean haveErrors = problemsHolder.containsProblems(ProjectStructureProblemType.Severity.ERROR);
Color foreground = isUnused ? UIUtil.getInactiveTextColor() : null;
final int style = haveWarnings || haveErrors ? SimpleTextAttributes.STYLE_WAVED : -1;
final Color waveColor = haveErrors ? JBColor.RED : haveWarnings ? JBColor.GRAY : null;
textAttributes = textAttributes.derive(style, foreground, null, waveColor);
setToolTipText(problemsHolder.composeTooltipMessage());
}
append(displayName, textAttributes);
String description = projectStructureElement.getDescription();
if (description != null) {
append(" (" + description + ")", SimpleTextAttributes.GRAY_ATTRIBUTES, false);
}
return;
}
}
append(displayName, textAttributes);
}
}