Package com.intellij.ui

Examples of com.intellij.ui.SimpleTextAttributes


      {
        @Override
        protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus)
        {
          String text;
          SimpleTextAttributes textAttributes;
          if (value.equals(ALL_CHOICE))
          {
            text = RevuBundle.message("browsing.filter.values.all.text");
            textAttributes = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
          }
View Full Code Here


        }
        catch (IndexNotReadyException ignored)
        {
        }

        final SimpleTextAttributes regularAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
        TextAttributes textAttributes = regularAttributes.toTextAttributes();
        if (node instanceof BasePsiNode && ((BasePsiNode) node).isDeprecated())
        {
          textAttributes =
            EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.DEPRECATED_ATTRIBUTES)
              .clone();
View Full Code Here

      if (column == 1) {
        final Icon icon = presentation.getIcon();
        textChunks.setIcon(icon == null ? EmptyIcon.ICON_16 : icon);
        if (text.length != 0) {
          SimpleTextAttributes attributes =
              isSelected ? new SimpleTextAttributes(bg, fg, fg, SimpleTextAttributes.STYLE_ITALIC)
                  : deriveAttributesWithColor(text[0].getSimpleAttributesIgnoreBackground(),
                      fileBgColor);
          textChunks.append(text[0].getText(), attributes);
        }
      } else if (column == 2) {
        for (int i = 1; i < text.length; i++) {
          TextChunk textChunk = text[i];
          final SimpleTextAttributes attrs = textChunk.getSimpleAttributesIgnoreBackground();
          SimpleTextAttributes attributes =
              isSelected ? new SimpleTextAttributes(bg, fg, fg, attrs.getStyle())
                  : deriveAttributesWithColor(attrs, fileBgColor);
          textChunks.append(textChunk.getText(), attributes);
        }
      } else {
        assert false : column;
View Full Code Here

    appendGroupText(parentGroup, panel, fileBgColor);
    if (node.canNavigateToSource()) {
      SimpleColoredComponent renderer = new SimpleColoredComponent();

      renderer.setIcon(group.getIcon(false));
      SimpleTextAttributes attributes =
          deriveAttributesWithColor(SimpleTextAttributes.REGULAR_ATTRIBUTES, fileBgColor);
      renderer.append(group.getText(myUsageView), attributes);
      renderer.append(" ", attributes);
      renderer.setIpad(new Insets(0, 0, 0, 0));
      renderer.setBorder(null);
View Full Code Here

  public int getWeight() {
    return 10;
  }

  protected SimpleTextAttributes getErrorAttributes() {
    return new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, getColor(), Color.red);
  }
View Full Code Here

  protected SimpleTextAttributes getErrorAttributes() {
    return new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, getColor(), Color.red);
  }

  protected SimpleTextAttributes getPlainAttributes() {
    return new SimpleTextAttributes(Font.PLAIN, getColor());
  }
View Full Code Here

   * @deprecated use {@link #getTemplatePresentation()} to set constant presentation right in node's constructor
   * or update presentation dynamically by defining {@link #update(com.intellij.ide.projectView.PresentationData)}
   */
  public final void setNodeText(String text, String tooltip, boolean hasError) {
    clearColoredText();
    SimpleTextAttributes attributes = hasError ? getErrorAttributes() : getPlainAttributes();
    getTemplatePresentation().addText(new ColoredFragment(text, tooltip, attributes));
  }
View Full Code Here

            if (treeNode instanceof DBObjectList) {
                DBObjectList objectsList = (DBObjectList) treeNode;
                boolean isEmpty = objectsList.getTreeChildCount() == 0;
                isLoading = objectsList.isLoading();
                SimpleTextAttributes textAttributes =
                        isLoading ? SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES :
                        isEmpty ? SimpleTextAttributes.REGULAR_ATTRIBUTES :
                        SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;

                append(displayName, textAttributes);

                // todo display load error
                /*
                            SimpleTextAttributes descriptionTA = objectsList.getErrorMessage() == null ?
                                    SimpleTextAttributes.GRAY_ATTRIBUTES : SimpleTextAttributes.ERROR_ATTRIBUTES;
                            append(" " + displayDetails, descriptionTA);

                            if (objectsList.getErrorMessage() != null) {
                                String msg = "Could not load " + displayName + ". Cause: " + objectsList.getErrorMessage();
                                setToolTipText(msg);
                            }  else {
                                setToolTipText(null);
                            }
                */
            } else {
                boolean showBold = false;
                boolean isError = false;
                if (treeNode instanceof DBObject) {
                    DBObject object = (DBObject) treeNode;
                    if (object.isOfType(DBObjectType.SCHEMA)) {
                        DBSchema schema = (DBSchema) object;
                        showBold = schema.isUserSchema();
                    }

                    isError = !object.isValid();
                }

                SimpleTextAttributes textAttributes =
                        isError ? SimpleTextAttributes.ERROR_ATTRIBUTES :
                        showBold ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES :
                        SimpleTextAttributes.REGULAR_ATTRIBUTES;

                if (displayName == null) displayName = "displayName null!!";
View Full Code Here

        DataModelCell cell = (DataModelCell) value;
        if (cell != null && !cell.isDisposed()) {
            boolean isLazyValue = cell.getUserValue() instanceof LazyLoadedValue;

            DataGridTextAttributes attributes = getAttributes();
            SimpleTextAttributes textAttributes = attributes.getPlainData(false, isCaretRow);


            if (isSelected) {
                textAttributes = attributes.getSelection();
            } else if (isLoading) {
                textAttributes = attributes.getLoadingData(isCaretRow);
            } else if (isLazyValue) {
                textAttributes = attributes.getReadonlyData(false, isCaretRow);
            }

            Color background = CommonUtil.nvl(textAttributes.getBgColor(), table.getBackground());
            Color foreground = CommonUtil.nvl(textAttributes.getFgColor(), table.getForeground());
            Border border = getLineBorder(background);

            setBorder(border);
            setBackground(background);
            setForeground(foreground);
View Full Code Here

             DataSearchResult searchResult = model.getSearchResult();

             Iterator<DataSearchResultMatch> matches = searchResult.getMatches(cell);
             if (matches != null) {
                 int lastEndOffset = 0;
                 SimpleTextAttributes searchResultAttributes = configTextAttributes.getSearchResult();
                 DataSearchResultMatch selectedMatch = searchResult.getSelectedMatch();
                 if (selectedMatch != null && selectedMatch.getCell() == cell) {
                    searchResultAttributes = configTextAttributes.getSelection();
                 }
View Full Code Here

TOP

Related Classes of com.intellij.ui.SimpleTextAttributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.