本文整理匯總了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);
}
}