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


Java SimpleTextAttributes.ERROR_ATTRIBUTES屬性代碼示例

本文整理匯總了Java中com.intellij.ui.SimpleTextAttributes.ERROR_ATTRIBUTES屬性的典型用法代碼示例。如果您正苦於以下問題:Java SimpleTextAttributes.ERROR_ATTRIBUTES屬性的具體用法?Java SimpleTextAttributes.ERROR_ATTRIBUTES怎麽用?Java SimpleTextAttributes.ERROR_ATTRIBUTES使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.intellij.ui.SimpleTextAttributes的用法示例。


在下文中一共展示了SimpleTextAttributes.ERROR_ATTRIBUTES屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: formatRelativePath

@NotNull
private static CellAppearanceEx formatRelativePath(@NotNull final ContentFolder folder, @NotNull final Icon icon) {
  LightFilePointer folderFile = new LightFilePointer(folder.getUrl());
  VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(folder.getContentEntry().getUrl());
  if (file == null) return FileAppearanceService.getInstance().forInvalidUrl(folderFile.getPresentableUrl());

  String contentPath = file.getPath();
  String relativePath;
  SimpleTextAttributes textAttributes;
  VirtualFile folderFileFile = folderFile.getFile();
  if (folderFileFile == null) {
    String absolutePath = folderFile.getPresentableUrl();
    relativePath = absolutePath.startsWith(contentPath) ? absolutePath.substring(contentPath.length()) : absolutePath;
    textAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
  }
  else {
    relativePath = VfsUtilCore.getRelativePath(folderFileFile, file, File.separatorChar);
    textAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
  }

  relativePath = StringUtil.isEmpty(relativePath) ? "." + File.separatorChar : relativePath;
  return new SimpleTextCellAppearance(relativePath, icon, textAttributes);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:OrderEntryAppearanceServiceImpl.java

示例2: getTextAttributes

private static SimpleTextAttributes getTextAttributes(final boolean valid, final boolean selected) {
  if (!valid) {
    return SimpleTextAttributes.ERROR_ATTRIBUTES;
  }
  else if (selected && !(SystemInfo.isWinVistaOrNewer && UIManager.getLookAndFeel().getName().contains("Windows"))) {
    return SimpleTextAttributes.SELECTED_SIMPLE_CELL_ATTRIBUTES;
  }
  else {
    return SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:OrderEntryAppearanceServiceImpl.java

示例3: render

public void render(@NotNull PresentationData presentationData, SimpleTextAttributes mainAttributes, SimpleTextAttributes commentAttributes) {
  presentationData.setIcon(AllIcons.Nodes.ExtractedFolder);
  final String parentPath = PathUtil.getParentPath(myJarPath);
  if (myFile == null || !myFile.isDirectory()) {
    mainAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
    final VirtualFile parentFile = LocalFileSystem.getInstance().findFileByPath(parentPath);
    if (parentFile == null) {
      commentAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
    }
  }
  presentationData.addText("Extracted '" + PathUtil.getFileName(myJarPath) + myPathInJar + "'", mainAttributes);
  presentationData.addText(" (" + parentPath + ")", commentAttributes);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ExtractedDirectoryPresentation.java

示例4: render

public void render(@NotNull PresentationData presentationData, SimpleTextAttributes mainAttributes, SimpleTextAttributes commentAttributes) {
  presentationData.setIcon(AllIcons.Nodes.CopyOfFolder);
  if (myFile == null || !myFile.isDirectory()) {
    mainAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
    final VirtualFile parentFile = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(mySourcePath));
    if (parentFile == null) {
      commentAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
    }
  }
  presentationData.addText(CompilerBundle.message("node.text.0.directory.content", mySourceFileName), mainAttributes);
  presentationData.addText(" (" + mySourcePath + ")", commentAttributes);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:DirectoryCopyPresentation.java

示例5: getInvalidAttributes

public SimpleTextAttributes getInvalidAttributes() {
  if (myCanBeAbsent) {
    return new SimpleTextAttributes(Font.PLAIN, FileStatus.DELETED.getColor());
  }
  else {
    return SimpleTextAttributes.ERROR_ATTRIBUTES;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:FileGroup.java

示例6: textStyle

private static SimpleTextAttributes textStyle(RadComponent component, String value, boolean system, StringBuilder colorValue) {
  if (value.startsWith("@") && !value.startsWith("@id/") && !value.startsWith("@+id/") && !value.startsWith("@android:id/")) {
    try {
      int start = system ? ANDROID_PREFIX.length() : 1;
      int index = value.indexOf('/', start + 1);
      String type = value.substring(start, index);
      String name = value.substring(index + 1);

      Module module = RadModelBuilder.getModule(component);
      if (module != null) {
        AndroidFacet facet = AndroidFacet.getInstance(module);
        if (facet != null) {
          ResourceManager manager = facet.getResourceManager(system ? AndroidUtils.SYSTEM_RESOURCE_PACKAGE : null);
          if (manager != null) {
            List<ResourceElement> resources = manager.findValueResources(type, name, false);

            if ("color".equalsIgnoreCase(type) && !resources.isEmpty()) {
              colorValue.append(resources.get(0).getRawText());
            }

            if (resources.isEmpty() && manager.findResourceFiles(type, name, false).isEmpty()) {
              return SimpleTextAttributes.ERROR_ATTRIBUTES;
            }
          }
        }
      }
    }
    catch (Throwable e) {
    }
  }
  return SimpleTextAttributes.REGULAR_ATTRIBUTES;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:32,代碼來源:ResourceRenderer.java

示例7: customizeCellRenderer

@Override
protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
  if (!(value instanceof String)) {
    return;
  }

  String s = (String)value;
  if (shouldClip(s)) {
    s = clip(s);
  }

  SimpleTextAttributes attributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
  String problem = ((StringResourceTableModel) table.getModel()).getCellProblem(row, column);
  if (problem != null) {
    if (ConstantColumn.KEY.ordinal() == column) {
      attributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
    }
    else {
      attributes = CELL_ERROR_ATTRIBUTES;
    }
  }

  Font currentFont = table.getFont();
  Font f = FontUtil.getFontAbleToDisplay(s, currentFont);
  if (currentFont != f) {
    setFont(f);
  }

  setToolTipText(problem);
  append(s, attributes);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:StringsCellRenderer.java

示例8: invalid

public static SimpleTextCellAppearance invalid(@NotNull final String text, @Nullable final Icon icon) {
  return new SimpleTextCellAppearance(text, icon, SimpleTextAttributes.ERROR_ATTRIBUTES);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:SimpleTextCellAppearance.java

示例9: DirectoryTreeNode

public DirectoryTreeNode(String path, Project project, String parentPath) {
  super(path, SimpleTextAttributes.ERROR_ATTRIBUTES, project, parentPath);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:DirectoryTreeNode.java

示例10: UpdateRootNode

public UpdateRootNode(UpdatedFiles updatedFiles, Project project, String rootName, ActionInfo actionInfo) {
  super(rootName, false, SimpleTextAttributes.ERROR_ATTRIBUTES, project, Collections.<String, String>emptyMap(), null);
  myProject = project;

  addGroupsToNode(updatedFiles.getTopLevelGroups(), this, actionInfo);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:UpdateRootNode.java


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