Package com.intellij.ui

Examples of com.intellij.ui.SimpleTextAttributes


        private final SimpleTextAttributes SELECTED;
        private final SimpleTextAttributes PLAIN;


        public GotoAngularCellRenderer() {
            SELECTED = new SimpleTextAttributes(UIUtil.getListSelectionBackground(),
                    UIUtil.getListSelectionForeground(),
                    JBColor.RED,
                    SimpleTextAttributes.STYLE_PLAIN);
            PLAIN = new SimpleTextAttributes(UIUtil.getListBackground(),
                    UIUtil.getListForeground(),
                    JBColor.RED,
                    SimpleTextAttributes.STYLE_PLAIN);

        }
View Full Code Here


            final Color bg = sel ? UIUtil.getListSelectionBackground() : UIUtil.getListBackground();
            final Color fg = sel ? UIUtil.getListSelectionForeground() : UIUtil.getListForeground();
            jPanel.setBackground(bg);
            jPanel.setForeground(fg);

            SimpleTextAttributes attr = sel ? SELECTED : PLAIN;
            if (value instanceof AngularItem) {
                AngularItem item = (AngularItem) value;
                final SimpleColoredComponent c = new SimpleColoredComponent();
                SpeedSearchUtil.appendColoredFragmentForMatcher("  " + item.getItemName(), c, attr, null, bg, sel);
                jPanel.add(c, BorderLayout.WEST);
View Full Code Here

    }
  }

  private static SimpleTextAttributes patchAttrs(Node node, SimpleTextAttributes original) {
    if (node.isExcluded()) {
      original = new SimpleTextAttributes(original.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT, original.getFgColor(), original.getWaveColor());
    }
    if (node instanceof GroupNode) {
      UsageGroup group = ((GroupNode)node).getGroup();
      FileStatus fileStatus = group != null ? group.getFileStatus() : null;
      if (fileStatus != null && fileStatus != FileStatus.NOT_CHANGED) {
        original = new SimpleTextAttributes(original.getStyle(), fileStatus.getColor(), original.getWaveColor());
      }

      DefaultMutableTreeNode parent = (DefaultMutableTreeNode)node.getParent();
      if (parent != null && parent.isRoot()) {
        original = new SimpleTextAttributes(original.getStyle() | SimpleTextAttributes.STYLE_BOLD, original.getFgColor(), original.getWaveColor());
      }
    }
    return original;
  }
View Full Code Here

    VirtualFilePointer folderFile = new LightFilePointer(folder.getUrl());
    if (!contentFile.isValid()) return forInvalidVirtualFilePointer(folderFile);
    String contentPath = contentFile.getFile().getPath();
    char separator = File.separatorChar;
    String relativePath;
    SimpleTextAttributes textAttributes;
    if (!folderFile.isValid()) {
      textAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
      String absolutePath = folderFile.getPresentableUrl();
      relativePath =
      absolutePath.startsWith(contentPath) ? absolutePath.substring(contentPath.length()) : absolutePath;
View Full Code Here

    }
    String name = jdk.getName();
    CompositeAppearance appearance = new CompositeAppearance();
    appearance.setIcon(jdk.getSdkType().getIcon());
    VirtualFile homeDirectory = jdk.getHomeDirectory();
    SimpleTextAttributes attributes = (homeDirectory != null && homeDirectory.isValid())
                                      ? createSimpleCellAttributes(selected)
                                      : SimpleTextAttributes.ERROR_ATTRIBUTES;
    CompositeAppearance.DequeEnd ending = appearance.getEnding();
    ending.addText(name, attributes);
    String versionString = jdk.getVersionString();
    if (versionString != null && !versionString.equals(name)) {
      SimpleTextAttributes textAttributes = isInComboBox ? SimpleTextAttributes.SYNTHETIC_ATTRIBUTES : SimpleTextAttributes.GRAY_ATTRIBUTES;
      ending.addComment(versionString, textAttributes);
    }
    return ending.getAppearance();
  }
View Full Code Here

    final Object valueToGetText = value instanceof AbstractTreeNode ? value.toString() : value;
    String text = tree.convertValueToText(valueToGetText,selected, expanded, leaf, row, hasFocus);

    if (text == null) text = "";

    SimpleTextAttributes simpleTextAttributes = getSimpleTextAttributes(value, color);

    append(text, simpleTextAttributes);

    if (value instanceof DefaultMutableTreeNode) {
      DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
View Full Code Here

      }
    }
  }

  protected static SimpleTextAttributes getSimpleTextAttributes(final Object value, final Color color) {
    SimpleTextAttributes simpleTextAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
    if (value instanceof DefaultMutableTreeNode) {
      final Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
      if (userObject instanceof AbstractTreeNode) {
        simpleTextAttributes = getSimpleTextAttributes(((AbstractTreeNode)userObject).getPresentation());
      }
    }
    if (color != null) {
      final TextAttributes textAttributes = simpleTextAttributes.toTextAttributes();
      textAttributes.setForegroundColor(color);
      simpleTextAttributes = SimpleTextAttributes.fromTextAttributes(textAttributes);
    }
    return simpleTextAttributes;
  }
View Full Code Here

    myList.setSelectedIndex(0);

    myList.setCellRenderer(new ColoredListCellRenderer(){
      protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
        append(myToStringAspect.getToStirng(value),
               new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, list.getForeground()));
      }
    });


    init();
View Full Code Here

    return true;
  }

  public SimpleTextAttributes getInvalidAttributes() {
    if (myCanBeAbsent) {
      return new SimpleTextAttributes(Font.PLAIN, FileStatus.DELETED.getColor());
    }
    else {
      return SimpleTextAttributes.ERROR_ATTRIBUTES;
    }
  }
View Full Code Here

    return hiders.get(allParents.get(0)).booleanValue();

  }

  protected SimpleTextAttributes getSimpleAttributes(final int style) {
    return new SimpleTextAttributes(style, SimpleTextAttributes.REGULAR_ATTRIBUTES.getFgColor());
  }
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.