本文整理匯總了Java中com.intellij.openapi.editor.markup.TextAttributes.getEffectType方法的典型用法代碼示例。如果您正苦於以下問題:Java TextAttributes.getEffectType方法的具體用法?Java TextAttributes.getEffectType怎麽用?Java TextAttributes.getEffectType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.editor.markup.TextAttributes
的用法示例。
在下文中一共展示了TextAttributes.getEffectType方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fromTextAttributes
import com.intellij.openapi.editor.markup.TextAttributes; //導入方法依賴的package包/類
@NotNull
public static SimpleTextAttributes fromTextAttributes(TextAttributes attributes) {
if (attributes == null) return REGULAR_ATTRIBUTES;
Color foregroundColor = attributes.getForegroundColor();
if (foregroundColor == null) foregroundColor = REGULAR_ATTRIBUTES.getFgColor();
int style = attributes.getFontType();
if (attributes.getEffectColor() != null) {
EffectType effectType = attributes.getEffectType();
if (effectType == EffectType.STRIKEOUT) {
style |= STYLE_STRIKEOUT;
}
else if (effectType == EffectType.WAVE_UNDERSCORE) {
style |= STYLE_WAVED;
}
else if (effectType == EffectType.LINE_UNDERSCORE ||
effectType == EffectType.BOLD_LINE_UNDERSCORE ||
effectType == EffectType.BOLD_DOTTED_LINE) {
style |= STYLE_UNDERLINE;
}
else if (effectType == EffectType.SEARCH_MATCH) {
style |= STYLE_SEARCH_MATCH;
}
else {
// not supported
}
}
return new SimpleTextAttributes(attributes.getBackgroundColor(), foregroundColor, attributes.getEffectColor(), style);
}
示例2: LineExtensionInfo
import com.intellij.openapi.editor.markup.TextAttributes; //導入方法依賴的package包/類
public LineExtensionInfo(@NotNull String text, @NotNull TextAttributes attr) {
myText = text;
myColor = attr.getForegroundColor();
myEffectType = attr.getEffectType();
myEffectColor = attr.getEffectColor();
myFontType = attr.getFontType();
}
示例3: equals
import com.intellij.openapi.editor.markup.TextAttributes; //導入方法依賴的package包/類
@Override
public boolean equals(final TextAttributes attributes1, final TextAttributes attributes2) {
Color effectColor = attributes1.getEffectColor();
EffectType effectType = attributes1.getEffectType();
return effectColor != null
&& effectColor.equals(attributes2.getEffectColor())
&& (EffectType.BOXED == effectType || EffectType.ROUNDED_BOX == effectType) &&
effectType == attributes2.getEffectType();
}
示例4: NamedTextAttr
import com.intellij.openapi.editor.markup.TextAttributes; //導入方法依賴的package包/類
public NamedTextAttr(@NotNull String name, @NotNull TextAttributes ta) {
super(ta.getForegroundColor(), ta.getBackgroundColor(), ta.getEffectColor(),
ta.getEffectType(), ta.getFontType());
setErrorStripeColor(ta.getErrorStripeColor());
this.name = name;
}
示例5: getOutputKey
import com.intellij.openapi.editor.markup.TextAttributes; //導入方法依賴的package包/類
@NotNull
public Key getOutputKey(@NonNls String attribute) {
final String completeAttribute = attribute;
if (attribute.startsWith("\u001B[")) {
attribute = attribute.substring(2);
}
else if (attribute.startsWith("[")) {
attribute = attribute.substring(1);
}
if (attribute.endsWith("m")) {
attribute = attribute.substring(0, attribute.length() - 1);
}
if (attribute.equals("0")) {
return ProcessOutputTypes.STDOUT;
}
TextAttributes attrs = new TextAttributes();
final String[] strings = attribute.split(";");
for (String string : strings) {
int value;
try {
value = Integer.parseInt(string);
}
catch (NumberFormatException e) {
continue;
}
if (value == 1) {
attrs.setFontType(Font.BOLD);
}
else if (value == 4) {
attrs.setEffectType(EffectType.LINE_UNDERSCORE);
}
else if (value == 22) {
attrs.setFontType(Font.PLAIN);
}
else if (value == 24) { //not underlined
attrs.setEffectType(null);
}
else if (value >= 30 && value <= 37) {
attrs.setForegroundColor(getAnsiColor(value - 30));
}
else if (value == 38) {
//TODO: 256 colors foreground
}
else if (value == 39) {
attrs.setForegroundColor(getColorByKey(ConsoleViewContentType.NORMAL_OUTPUT_KEY));
}
else if (value >= 40 && value <= 47) {
attrs.setBackgroundColor(getAnsiColor(value - 40));
}
else if (value == 48) {
//TODO: 256 colors background
}
else if (value == 49) {
attrs.setBackgroundColor(getColorByKey(ConsoleViewContentType.NORMAL_OUTPUT_KEY));
}
else if (value >= 90 && value <= 97) {
attrs.setForegroundColor(
getAnsiColor(value - 82));
}
else if (value >= 100 && value <= 107) {
attrs.setBackgroundColor(
getAnsiColor(value - 92));
}
}
if (attrs.getEffectType() == EffectType.LINE_UNDERSCORE) {
attrs.setEffectColor(attrs.getForegroundColor());
}
Key newKey = new Key(completeAttribute);
ConsoleViewContentType contentType = new ConsoleViewContentType(completeAttribute, attrs);
ConsoleViewContentType.registerNewConsoleViewType(newKey, contentType);
return newKey;
}
示例6: isBorder
import com.intellij.openapi.editor.markup.TextAttributes; //導入方法依賴的package包/類
private static boolean isBorder(TextAttributes textAttributes) {
return textAttributes != null &&
textAttributes.getEffectColor() != null &&
(EffectType.BOXED == textAttributes.getEffectType() || EffectType.ROUNDED_BOX == textAttributes.getEffectType());
}