本文整理匯總了Java中com.intellij.ui.SimpleTextAttributes.STYLE_PLAIN屬性的典型用法代碼示例。如果您正苦於以下問題:Java SimpleTextAttributes.STYLE_PLAIN屬性的具體用法?Java SimpleTextAttributes.STYLE_PLAIN怎麽用?Java SimpleTextAttributes.STYLE_PLAIN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.ui.SimpleTextAttributes
的用法示例。
在下文中一共展示了SimpleTextAttributes.STYLE_PLAIN屬性的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: customizeRendererText
@Override
protected void customizeRendererText(ColoredTreeCellRenderer renderer) {
final StringBuilder buffer = new StringBuilder(128);
final PsiClass containingClass = myMethod.getContainingClass();
if (containingClass != null) {
buffer.append(ClassPresentationUtil.getNameForClass(containingClass, false));
buffer.append('.');
}
final String methodText = PsiFormatUtil.formatMethod(
myMethod,
PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_PARAMETERS,
PsiFormatUtil.SHOW_TYPE
);
buffer.append(methodText);
final SimpleTextAttributes attributes = isEnabled() ?
new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getTreeForeground()) :
SimpleTextAttributes.EXCLUDED_ATTRIBUTES;
renderer.append(buffer.toString(), attributes);
if (containingClass != null) {
final String packageName = getPackageName(containingClass);
renderer.append(" (" + packageName + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, JBColor.GRAY));
}
}
示例2: setUI
public void setUI(final TreeUI ui) {
super.setUI(ui);
// [vova] we cannot create this hash in constructor and just clear it here. The
// problem is that setUI is invoked by constructor of superclass.
myHighlightAttributes = new HashMap<HighlightSeverity, Map<SimpleTextAttributes, SimpleTextAttributes>>();
final EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();
final TextAttributes attributes = globalScheme.getAttributes(JavaHighlightingColors.STRING);
myBindingAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, UIUtil.getTreeForeground());
myClassAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getTreeForeground());
myPackageAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, Color.GRAY);
myTitleAttributes =new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, attributes.getForegroundColor());
myUnknownAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, Color.RED);
}
示例3: forJdk
@NotNull
@Override
public CellAppearanceEx forJdk(@Nullable final Sdk jdk, final boolean isInComboBox, final boolean selected, final boolean showVersion) {
if (jdk == null) {
return FileAppearanceService.getInstance().forInvalidUrl(NO_JDK);
}
String name = jdk.getName();
CompositeAppearance appearance = new CompositeAppearance();
SdkType sdkType = (SdkType)jdk.getSdkType();
appearance.setIcon(sdkType.getIcon());
SimpleTextAttributes attributes = getTextAttributes(sdkType.sdkHasValidPath(jdk), selected);
CompositeAppearance.DequeEnd ending = appearance.getEnding();
ending.addText(name, attributes);
if (showVersion) {
String versionString = jdk.getVersionString();
if (versionString != null && !versionString.equals(name)) {
SimpleTextAttributes textAttributes = isInComboBox && !selected ? SimpleTextAttributes.SYNTHETIC_ATTRIBUTES :
SystemInfo.isMac && selected ? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
Color.WHITE): SimpleTextAttributes.GRAY_ATTRIBUTES;
ending.addComment(versionString, textAttributes);
}
}
return ending.getAppearance();
}
示例4: getDefaultAttributes
@NotNull
private SimpleTextAttributes getDefaultAttributes() {
SimpleTextAttributes attributes = myDefaultAttributes;
if (attributes == null) {
myDefaultAttributes = attributes = new SimpleTextAttributes(myDefaultStyle != -1 ? myDefaultStyle : SimpleTextAttributes.STYLE_PLAIN,
myDefaultForeground, myDefaultWaveColor);
}
return attributes;
}
示例5: appendFileName
@Override
public void appendFileName(final ChangesBrowserNodeRenderer renderer, final VirtualFile vFile, final String fileName, final Color color, final boolean highlightProblems) {
int style = SimpleTextAttributes.STYLE_PLAIN;
Color underlineColor = null;
if (highlightProblems && vFile != null && !vFile.isDirectory() && myProblemSolver.isProblemFile(vFile)) {
underlineColor = JBColor.RED;
style = SimpleTextAttributes.STYLE_WAVED;
}
renderer.append(fileName, new SimpleTextAttributes(style, color, underlineColor));
}
示例6: InspectionListCellRenderer
public InspectionListCellRenderer() {
mySelected = new SimpleTextAttributes(UIUtil.getListSelectionBackground(),
UIUtil.getListSelectionForeground(),
JBColor.RED,
SimpleTextAttributes.STYLE_PLAIN);
myPlain = new SimpleTextAttributes(UIUtil.getListBackground(),
UIUtil.getListForeground(),
JBColor.RED,
SimpleTextAttributes.STYLE_PLAIN);
myHighlighted = new SimpleTextAttributes(UIUtil.getListBackground(),
UIUtil.getListForeground(),
null,
SimpleTextAttributes.STYLE_SEARCH_MATCH);
}
示例7: getPlainAttributes
@Override
protected SimpleTextAttributes getPlainAttributes() {
if (myProjectsManager.isIgnored(myMavenProject)) {
return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY);
}
return super.getPlainAttributes();
}
示例8: FormPropertyTableCellRenderer
FormPropertyTableCellRenderer(@NotNull final Project project) {
myPalette = Palette.getInstance(project);
myAttrs1 = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
myAttrs2 = SimpleTextAttributes.REGULAR_ATTRIBUTES;
myAttrs3 = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, Color.GRAY);
setFocusBorderAroundIcon(true);
}
示例9: getTextAttributes
@Override
protected SimpleTextAttributes getTextAttributes(final JTree tree) {
return new SimpleTextAttributes(
getPsiDocCommentOwner().isDeprecated() ? SimpleTextAttributes.STYLE_STRIKEOUT : SimpleTextAttributes.STYLE_PLAIN,
tree.getForeground());
}
示例10: getTextAttributes
protected SimpleTextAttributes getTextAttributes(JTree tree) {
return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, tree.getForeground());
}
示例11: getTextAttributes
protected SimpleTextAttributes getTextAttributes(final Object object, final boolean selected) {
if (!NavBarModel.isValid(object)) return SimpleTextAttributes.REGULAR_ATTRIBUTES;
if (object instanceof PsiElement) {
if (!ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
return ((PsiElement)object).isValid();
}
}).booleanValue()) return SimpleTextAttributes.GRAYED_ATTRIBUTES;
PsiFile psiFile = ((PsiElement)object).getContainingFile();
if (psiFile != null) {
final VirtualFile virtualFile = psiFile.getVirtualFile();
return new SimpleTextAttributes(null, selected ? null : FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor(),
JBColor.red, WolfTheProblemSolver.getInstance(myProject).isProblemFile(virtualFile)
? SimpleTextAttributes.STYLE_WAVED
: SimpleTextAttributes.STYLE_PLAIN);
}
else {
if (object instanceof PsiDirectory) {
VirtualFile vDir = ((PsiDirectory)object).getVirtualFile();
if (vDir.getParent() == null || ProjectRootsUtil.isModuleContentRoot(vDir, myProject)) {
return SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
}
}
if (wolfHasProblemFilesBeneath((PsiElement)object)) {
return WOLFED;
}
}
}
else if (object instanceof Module) {
if (WolfTheProblemSolver.getInstance(myProject).hasProblemFilesBeneath((Module)object)) {
return WOLFED;
}
}
else if (object instanceof Project) {
final Project project = (Project)object;
final Module[] modules = ApplicationManager.getApplication().runReadAction(
new Computable<Module[]>() {
@Override
public Module[] compute() {
return ModuleManager.getInstance(project).getModules();
}
}
);
for (Module module : modules) {
if (WolfTheProblemSolver.getInstance(project).hasProblemFilesBeneath(module)) {
return WOLFED;
}
}
}
return SimpleTextAttributes.REGULAR_ATTRIBUTES;
}
示例12: getAttributes
private static SimpleTextAttributes getAttributes(final boolean selected, final boolean taskClosed) {
return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
taskClosed ? UIUtil.getLabelDisabledForeground() : UIUtil.getListForeground(selected));
}
示例13: BeanPropertyTableCellRenderer
BeanPropertyTableCellRenderer() {
myAttrs1 = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
myAttrs2 = SimpleTextAttributes.REGULAR_ATTRIBUTES;
myAttrs3 = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, Color.GRAY);
}