com.intellij.ui.SimpleTextAttributes Java Examples

The following examples show how to use com.intellij.ui.SimpleTextAttributes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UnknownFileTypeDiffRequest.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public JComponent getComponent(@Nonnull final DiffContext context) {
  final SimpleColoredComponent label = new SimpleColoredComponent();
  label.setTextAlign(SwingConstants.CENTER);
  label.append("Can't show diff for unknown file type. ",
               new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getInactiveTextColor()));
  if (myFileName != null) {
    label.append("Associate", SimpleTextAttributes.LINK_ATTRIBUTES, new Runnable() {
      @Override
      public void run() {
        FileType type = FileTypeChooser.associateFileType(myFileName);
        if (type != null) onSuccess(context);
      }
    });
    LinkMouseListenerBase.installSingleTagOn(label);
  }
  return JBUI.Panels.simplePanel(label).withBorder(JBUI.Borders.empty(5));
}
 
Example #2
Source File: FilterHighlightRenderer.java    From railways with MIT License 6 votes vote down vote up
@Override
protected void customizeCellRenderer(JTable table, @Nullable Object value,
                                     boolean selected, boolean hasFocus, int row, int column) {
    // Value can be null in older JDKs (below 1.7, I suppose).
    // Info: http://stackoverflow.com/questions/3054775/jtable-strange-behavior-from-getaccessiblechild-method-resulting-in-null-point
    if (value == null)
        return;

    setBorder(null);
    setBackground(UIUtil.getTableBackground(selected, table.hasFocus()));
    setForeground(UIUtil.getTableForeground(selected, table.hasFocus()));

    String text = value.toString();

    if (selected) {
        append(text, SimpleTextAttributes.REGULAR_ATTRIBUTES);
    } else {
        appendHighlighted(text, filter.findMatchedString(text));
    }
}
 
Example #3
Source File: CppStackFrame.java    From CppTools with Apache License 2.0 6 votes vote down vote up
@Override
  public void customizePresentation(ColoredTextContainer component) {

  XSourcePosition position = getSourcePosition();
  component.append(myScope, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  component.append(" in ", SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (position != null) {
    component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.append(":" + position.getLine(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
  else {
    component.append("<file name is not available>", SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
  component.setIcon(AllIcons.Debugger.StackFrame);
}
 
Example #4
Source File: UsageInfo2UsageAdapter.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
private TextChunk[] initChunks() {
  PsiFile psiFile = getPsiFile();
  Document document = psiFile == null ? null : PsiDocumentManager.getInstance(getProject()).getDocument(psiFile);
  TextChunk[] chunks;
  if (document == null) {
    // element over light virtual file
    PsiElement element = getElement();
    if (element == null) {
      chunks = new TextChunk[]{new TextChunk(SimpleTextAttributes.ERROR_ATTRIBUTES.toTextAttributes(), UsageViewBundle.message("node.invalid"))};
    }
    else {
      chunks = new TextChunk[]{new TextChunk(new TextAttributes(), element.getText())};
    }
  }
  else {
    chunks = ChunkExtractor.extractChunks(psiFile, this);
  }

  myTextChunks = new SoftReference<>(chunks);
  return chunks;
}
 
Example #5
Source File: GtRepoChooser.java    From GitToolBox with Apache License 2.0 6 votes vote down vote up
GtRepoChooser(@NotNull Project project, @Nullable Component parentComponent) {
  super(project, parentComponent, false, IdeModalityType.PROJECT);
  this.project = project;
  repoList = new JBList<>();
  repoList.setCellRenderer(new ColoredListCellRenderer<GitRepository>() {
    @Override
    protected void customizeCellRenderer(@NotNull JList<? extends GitRepository> list, GitRepository value, int index,
                                         boolean selected, boolean hasFocus) {
      append(GtUtil.name(value));
      StringBand url = new StringBand(" (");
      url.append(value.getRoot().getPresentableUrl());
      url.append(")");
      append(url.toString(), SimpleTextAttributes.GRAYED_ATTRIBUTES);
    }
  });
  JBScrollPane scrollPane = new JBScrollPane(repoList);
  centerPanel = JBUI.Panels.simplePanel().addToCenter(scrollPane);
  centerPanel.setPreferredSize(JBUI.size(400, 300));
  setTitle(ResBundle.message("configurable.prj.autoFetch.exclusions.add.title"));
  init();
}
 
Example #6
Source File: LibrarySourceItem.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public void render(@Nonnull PresentationData presentationData, SimpleTextAttributes mainAttributes,
                   SimpleTextAttributes commentAttributes) {
  final String name = myLibrary.getName();
  if (name != null) {
    presentationData.setIcon(AllIcons.Nodes.PpLib);
    presentationData.addText(name, mainAttributes);
    presentationData.addText(LibraryElementPresentation.getLibraryTableComment(myLibrary), commentAttributes);
  }
  else {
    if (((LibraryEx)myLibrary).isDisposed()) {
      //todo[nik] disposed library should not be shown in the tree
      presentationData.addText("Invalid Library", SimpleTextAttributes.ERROR_ATTRIBUTES);
      return;
    }
    final VirtualFile[] files = myLibrary.getFiles(BinariesOrderRootType.getInstance());
    if (files.length > 0) {
      final VirtualFile file = files[0];
      presentationData.setIcon(VirtualFilePresentation.getIcon(file));
      presentationData.addText(file.getName(), mainAttributes);
    }
    else {
      presentationData.addText("Empty Library", SimpleTextAttributes.ERROR_ATTRIBUTES);
    }
  }
}
 
Example #7
Source File: PhpTypeColumn.java    From intellij-latte with MIT License 6 votes vote down vote up
@Override
public @Nullable TableCellRenderer getRenderer(T settings) {
	return new ColoredTableCellRenderer() {
		@Override
		protected void customizeCellRenderer(JTable table, Object value,
											 boolean isSelected, boolean hasFocus, int row, int column) {
			if (value == null) {
				return;
			}

			LattePhpType type = LattePhpType.create((String) value);
			if (type.hasUndefinedClass(project)) {
				append((String) value, new SimpleTextAttributes(Font.PLAIN, JBColor.RED));
			} else {
				append((String) value, new SimpleTextAttributes(Font.PLAIN, null));
			}
		}
	};
}
 
Example #8
Source File: PsiElementListCellRenderer.java    From consulo with Apache License 2.0 6 votes vote down vote up
private void appendLocationText(boolean selected, Color bgColor, boolean isProblemFile, String containerText) {
  SimpleTextAttributes locationAttrs = SimpleTextAttributes.GRAYED_ATTRIBUTES;
  if (isProblemFile) {
    SimpleTextAttributes wavedAttributes = SimpleTextAttributes.merge(new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, UIUtil.getInactiveTextColor(), JBColor.RED), locationAttrs);
    java.util.regex.Matcher matcher = CONTAINER_PATTERN.matcher(containerText);
    if (matcher.matches()) {
      String prefix = matcher.group(1);
      SpeedSearchUtil.appendColoredFragmentForMatcher(" " + ObjectUtils.notNull(prefix, ""), this, locationAttrs, myMatchers.locationMatcher, bgColor, selected);

      String strippedContainerText = matcher.group(2);
      SpeedSearchUtil.appendColoredFragmentForMatcher(ObjectUtils.notNull(strippedContainerText, ""), this, wavedAttributes, myMatchers.locationMatcher, bgColor, selected);

      String suffix = matcher.group(3);
      if (suffix != null) {
        SpeedSearchUtil.appendColoredFragmentForMatcher(suffix, this, locationAttrs, myMatchers.locationMatcher, bgColor, selected);
      }
      return;
    }
    locationAttrs = wavedAttributes;
  }
  SpeedSearchUtil.appendColoredFragmentForMatcher(" " + containerText, this, locationAttrs, myMatchers.locationMatcher, bgColor, selected);
}
 
Example #9
Source File: NewProjectTreeStructure.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public NodeDescriptor createDescriptor(@Nonnull Object element, @Nullable NodeDescriptor parentDescriptor) {
  return new PresentableNodeDescriptor(null, parentDescriptor) {

    @Override
    protected void update(PresentationData presentation) {
      if (element instanceof NewModuleContextNode) {
        boolean isGroup = element instanceof NewModuleContextGroup;
        presentation.addText(((NewModuleContextNode)element).getName().getValue(), isGroup ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);
        presentation.setIcon(((NewModuleContextNode)element).getImage());
      }
    }

    @Override
    public Object getElement() {
      return element;
    }
  };
}
 
Example #10
Source File: XValueContainerNode.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
public XDebuggerTreeNode addTemporaryEditorNode(@Nullable Image icon, @Nullable String text) {
  if (isLeaf()) {
    setLeaf(false);
  }
  myTree.expandPath(getPath());
  MessageTreeNode node = new MessageTreeNode(myTree, this, true);
  node.setIcon(icon);
  if (!StringUtil.isEmpty(text)) {
    node.getText().append(text, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
  myTemporaryEditorNode = node;
  myCachedAllChildren = null;
  fireNodesInserted(Collections.singleton(node));
  return node;
}
 
Example #11
Source File: UsageListCellRenderer.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
protected void customizeCellRenderer(final JList list,
                                     final Object value,
                                     final int index,
                                     final boolean selected,
                                     final boolean hasFocus) {
  Usage usage = (Usage)value;
  UsagePresentation presentation = usage.getPresentation();
  setIcon(presentation.getIcon());
  VirtualFile virtualFile = getVirtualFile(usage);
  if (virtualFile != null) {
    append(virtualFile.getName() + ": ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
    setIcon(virtualFile.getFileType().getIcon());
    PsiFile psiFile = PsiManager.getInstance(myProject).findFile(virtualFile);
    if (psiFile != null) {
      setIcon(IconDescriptorUpdaters.getIcon(psiFile, 0));
    }
  }

  TextChunk[] text = presentation.getText();
  for (TextChunk textChunk : text) {
    SimpleTextAttributes simples = textChunk.getSimpleAttributesIgnoreBackground();
    append(textChunk.getText(), simples);
  }
}
 
Example #12
Source File: BlockTreeNode.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
protected void update(PresentationData presentation) {
  String name = myBlock.getClass().getSimpleName();
  if (myBlock instanceof DataLanguageBlockWrapper) {
    name += " (" + ((DataLanguageBlockWrapper)myBlock).getOriginal().getClass().getSimpleName() + ")";
  }
  presentation.addText(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (myBlock.getIndent() != null) {
    presentation.addText(" " + String.valueOf(myBlock.getIndent()).replaceAll("[<>]", " "), SimpleTextAttributes.GRAY_ATTRIBUTES);
  }
  else {
    presentation.addText(" Indent: null", SimpleTextAttributes.GRAY_ATTRIBUTES);
  }
  if (myBlock.getAlignment() != null) {
    presentation
      .addText(" " + String.valueOf(myBlock.getAlignment()), new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, Color.darkGray));
  }
  if (myBlock.getWrap() != null) {
    presentation
      .addText(" " + String.valueOf(myBlock.getWrap()), new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, JBColor.BLUE));
  }
}
 
Example #13
Source File: DartVmServiceStackFrame.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void customizePresentation(@NotNull final ColoredTextContainer component) {
  final String unoptimizedPrefix = "[Unoptimized] ";

  String name = StringUtil.trimEnd(myVmFrame.getCode().getName(), "="); // trim setter postfix
  name = StringUtil.trimStart(name, unoptimizedPrefix);

  final boolean causal = myVmFrame.getKind() == FrameKind.AsyncCausal;
  component.append(name, causal ? SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (mySourcePosition != null) {
    final String text = " (" + mySourcePosition.getFile().getName() + ":" + (mySourcePosition.getLine() + 1) + ")";
    component.append(text, SimpleTextAttributes.GRAY_ATTRIBUTES);
  }

  component.setIcon(AllIcons.Debugger.Frame);
}
 
Example #14
Source File: XValueGroupNodeImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
public XValueGroupNodeImpl(XDebuggerTree tree, XDebuggerTreeNode parent, @Nonnull XValueGroup group) {
  super(tree, parent, group);
  setLeaf(false);
  setIcon(group.getIcon());
  myText.append(group.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
  String comment = group.getComment();
  if (comment != null) {
    XValuePresentationUtil.appendSeparator(myText, group.getSeparator());
    myText.append(comment, SimpleTextAttributes.GRAY_ATTRIBUTES);
  }

  if (group.isAutoExpand()) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        if (!isObsolete()) {
          myTree.expandPath(getPath());
        }
      }
    });
  }
  myTree.nodeLoaded(this, group.getName());
}
 
Example #15
Source File: QuarkusExtensionsStep.java    From intellij-quarkus with Eclipse Public License 2.0 6 votes vote down vote up
private ExtensionsTable() {
    setShowGrid(false);
    setShowVerticalLines(false);
    this.setCellSelectionEnabled(false);
    this.setRowSelectionAllowed(true);
    this.setSelectionMode(0);
    this.setTableHeader(null);
    setModel(new Model(new ArrayList<>()));
    TableColumn selectedColumn = columnModel.getColumn(0);
    TableUtil.setupCheckboxColumn(this, 0);
    selectedColumn.setCellRenderer(new BooleanTableCellRenderer());
    TableColumn extensionColumn = columnModel.getColumn(1);
    extensionColumn.setCellRenderer(new ColoredTableCellRenderer() {

        @Override
        protected void customizeCellRenderer(JTable table, @Nullable Object value, boolean b, boolean b1, int i, int i1) {
            QuarkusExtension extension = (QuarkusExtension) value;
            append(extension.getName(), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, null));
            append(" ");
            append(extension.asLabel(false), new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, null));
        }
    });
}
 
Example #16
Source File: MyDeviceChooser.java    From ADBWIFI with Apache License 2.0 6 votes vote down vote up
@Override
protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
  if (!(value instanceof LaunchCompatibility)) {
    return;
  }

  LaunchCompatibility compatibility = (LaunchCompatibility)value;
  ThreeState compatible = compatibility.isCompatible();
  if (compatible == ThreeState.YES) {
    append("Yes");
  } else {
    if (compatible == ThreeState.NO) {
      append("No", SimpleTextAttributes.ERROR_ATTRIBUTES);
    } else {
      append("Maybe");
    }
    String reason = compatibility.getReason();
    if (reason != null) {
      append(", ");
      append(reason);
    }
  }
}
 
Example #17
Source File: TabInfo.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
private SimpleTextAttributes getDefaultAttributes() {
  SimpleTextAttributes attributes = myDefaultAttributes;
  if (attributes == null) {
    myDefaultAttributes = attributes = new SimpleTextAttributes(myDefaultStyle != -1 ? myDefaultStyle : SimpleTextAttributes.STYLE_PLAIN,
                                                                myDefaultForeground, myDefaultWaveColor);

  }
  return attributes;
}
 
Example #18
Source File: ChangesBrowserSpecificFilesNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void render(@Nonnull ChangesBrowserNodeRenderer renderer, boolean selected, boolean expanded, boolean hasFocus) {
  super.render(renderer, selected, expanded, hasFocus);
  if (isManyFiles()) {
    renderer.append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
    renderer.append("browse", SimpleTextAttributes.LINK_ATTRIBUTES, myDialogShower);
  }
}
 
Example #19
Source File: StatusText.java    From consulo with Apache License 2.0 5 votes vote down vote up
public StatusText appendText(String text, SimpleTextAttributes attrs, ActionListener listener) {
  if (myIsDefaultText) {
    clear();
    myIsDefaultText = false;
  }

  myText += text;
  myComponent.append(text, attrs);
  myClickListeners.add(listener);
  if (listener != null) {
    myHasActiveClickListeners = true;
  }
  repaintOwner();
  return this;
}
 
Example #20
Source File: LineParser.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Nullable
private SimpleTextAttributes readStyle() {
  if (!peek(1).equals("[")) {
    return null;
  }

  final String remainder = str.substring(index);
  final int escapeEndIndex = remainder.indexOf("m");
  if (escapeEndIndex == -1) {
    return null;
  }

  final String paramString = remainder.substring(1, escapeEndIndex);

  // Eat params + leading [ and trailing m
  eat(paramString.length() + 2);

  Color color = null;
  int fontStyle = SimpleTextAttributes.STYLE_PLAIN;

  for (String param : paramString.split(";")) {
    final Object style = toStyle(param);
    if (style instanceof Color) {
      color = (Color)style;
    }
    else if (style instanceof Integer) {
      fontStyle |= (int)style;
    }
  }

  return new SimpleTextAttributes(fontStyle, color);
}
 
Example #21
Source File: NodeRenderer.java    From consulo with Apache License 2.0 5 votes vote down vote up
private SimpleTextAttributes addColorToSimpleTextAttributes(SimpleTextAttributes simpleTextAttributes, Color color) {
  if (color != null) {
    final TextAttributes textAttributes = simpleTextAttributes.toTextAttributes();
    textAttributes.setForegroundColor(color);
    simpleTextAttributes = SimpleTextAttributes.fromTextAttributes(textAttributes);
  }
  return simpleTextAttributes;
}
 
Example #22
Source File: VirtualFileListCellRenderer.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
  final FilePath path = TreeModelBuilder.getPathForObject(value);
  renderIcon(path);
  final FileStatus fileStatus = myIgnoreFileStatus ? FileStatus.NOT_CHANGED : getStatus(value, path);
  append(getName(path), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, fileStatus.getColor(), null));
  putParentPath(value, path, path);
}
 
Example #23
Source File: CommittedChangeListRenderer.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void customize(JComponent tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
  if (node.getUserObject() instanceof CommittedChangeList) {
    CommittedChangeList changeList = (CommittedChangeList) node.getUserObject();

    renderChangeList(tree, changeList);
  }
  else if (node.getUserObject() != null) {
    append(node.getUserObject().toString(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
  }
}
 
Example #24
Source File: VirtualFileListCellRenderer.java    From consulo with Apache License 2.0 5 votes vote down vote up
protected void putParentPath(Object value, FilePath path, FilePath self) {
  final File parentFile = path.getIOFile().getParentFile();
  if (parentFile != null) {
    final String parentPath = parentFile.getPath();
    append(" (", SimpleTextAttributes.GRAYED_ATTRIBUTES);
    putParentPathImpl(value, parentPath, self);
    append(")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
  }
}
 
Example #25
Source File: ColumnResultsTest.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void testPresentation_TestInProgress() {
  mySimpleTest.setStarted();

  doRender(mySimpleTest);
  assertFragmentsSize(1);
  assertEquals(SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES, myFragmentsContainer.getAttribsAt(0));
  assertEquals("Running...", myFragmentsContainer.getTextAt(0));
}
 
Example #26
Source File: FileCopyPresentation.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void render(@Nonnull PresentationData presentationData, SimpleTextAttributes mainAttributes, SimpleTextAttributes commentAttributes) {
  if (myFile != null && !myFile.isDirectory()) {
    presentationData.setIcon(VirtualFilePresentation.getIcon(myFile));
    presentationData.addText(myOutputFileName, mainAttributes);
    presentationData.addText(" (" + mySourcePath + ")", commentAttributes);
  }
  else {
    presentationData.setIcon(AllIcons.FileTypes.Text);
    presentationData.addText(myOutputFileName, SimpleTextAttributes.ERROR_ATTRIBUTES);
    final VirtualFile parentFile = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(mySourcePath));
    presentationData.addText("(" + mySourcePath + ")",
                    parentFile != null ? commentAttributes : SimpleTextAttributes.ERROR_ATTRIBUTES);
  }
}
 
Example #27
Source File: Utils.java    From idea-gitignore with MIT License 5 votes vote down vote up
/**
 * Adds ColoredFragment to the node's presentation.
 *
 * @param data       node's presentation data
 * @param text       text to add
 * @param attributes custom {@link SimpleTextAttributes}
 */
public static void addColoredText(@NotNull PresentationData data, @NotNull String text,
                                  @NotNull SimpleTextAttributes attributes) {
    if (data.getColoredText().isEmpty()) {
        data.addText(data.getPresentableText(), REGULAR_ATTRIBUTES);
    }
    data.addText(" " + text, attributes);
}
 
Example #28
Source File: LineInfo.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public LineInfo(@NotNull String line,
                @NotNull List<StyledText> styledText,
                FlutterLogEntry.Kind kind,
                @NotNull String category,
                @NotNull List<Filter> filters,
                @Nullable SimpleTextAttributes inheritedStyle) {
  this.line = line;
  this.styledText = styledText;
  this.kind = kind;
  this.category = category;
  this.filters = filters;
  this.inheritedStyle = inheritedStyle;
}
 
Example #29
Source File: HotfixGroupElement.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void customizeCellRenderer(SimpleColoredComponent renderer,
                                  JTree tree,
                                  Object value,
                                  boolean selected,
                                  boolean expanded,
                                  boolean leaf,
                                  int row,
                                  boolean hasFocus) {
  renderer.append(" ");
  if (myInProgress) {
    renderer.append("fixing...", SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
  } else {
    renderer.append("Fix: " + myFixDescription, SimpleTextAttributes.LINK_BOLD_ATTRIBUTES, myRunner);
  }
}
 
Example #30
Source File: TemplateDataLanguageConfigurable.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected boolean handleDefaultValue(VirtualFile file, ColoredTableCellRenderer renderer) {
  final Language language = TemplateDataLanguagePatterns.getInstance().getTemplateDataLanguageByFileName(file);
  if (language != null) {
    renderer.append(visualize(language), SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
    return true;
  }
  return false;
}