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


Java JBColor.GRAY屬性代碼示例

本文整理匯總了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");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:HTMLTextPainter.java

示例2: getForeground

@Override
public Color getForeground() {
  if (getModel().isSelected()) {
    return JBColor.foreground();
  }
  else if (getModel().isRollover()) {
    return JBColor.GRAY;
  }
  else {
    return getColor();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ColorSelectionComponent.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:35,代碼來源:AndroidProjectStructureConfigurable.java

示例4: getPlainAttributes

@Override
protected SimpleTextAttributes getPlainAttributes() {
  if (myProjectsManager.isIgnored(myMavenProject)) {
    return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY);
  }
  return super.getPlainAttributes();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:MavenProjectsStructure.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:48,代碼來源:ProjectStructureElementRenderer.java


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