我正在尝试更改Eclipse中的文本颜色(版本3.7).
从我读到的内容看来,似乎我应该能够通过转到窗口>首选项>常规>外观>颜色和字体来更改java编辑器文本,选择java> java编辑器文本并单击"编辑".
然而,当我这样做并选择不同的颜色时,只要我点击"确定",它就会恢复为黑色.我可以改变字体,大小和其他属性,而不是颜色.我已经尝试将"设置为默认值:文本字体"更改为"覆盖默认值:文本字体",右键单击我想要更改的文本并从那里选择首选项,更改基本>文本字体(相同问题).
有任何想法吗?
我需要规范化一个字符串,如"quée",我似乎无法将扩展的ASCII字符(如é,á,í等)转换为罗马/英语版本.我已经尝试了几种不同的方法但到目前为止没有任何工作.这个一般主题有相当多的材料,但我似乎无法找到这个问题的工作答案.
这是我的代码:
#transliteration solution (works great with standard chars but doesn't find the
#special ones) - I've tried looking for both \x{130} and é with the same result.
$mystring =~ tr/\\x{130}/e/;
#converting into array, then iterating through and replacing the specific char
#( same result as the above solution )
my @breakdown = split( "",$mystring );
foreach ( @breakdown ) {
if ( $_ eq "\x{130}" ) {
$_ = "e";
print "\nArray Output: @breakdown\n";
}
$lowercase = join( "",@breakdown …Run Code Online (Sandbox Code Playgroud) 当我在我的时区枚举中声明最终的TimeZone tz变量时,我收到错误.我在http://snipplr.com/view/23131/timezone-enum/找到了这个枚举的例子,但Eclipse给了我一个"令牌tz的语法错误",我无法弄清楚为什么.我已经用几种方式重新配置了代码,但这似乎是最好的,Eclipse不喜欢它.
import java.util.TimeZone;
public enum TimeZoneEnum {
DEFAULT(TimeZone.getDefault()),
ETC_GMT_PLUS_12(TimeZone.getTimeZone("Etc/GMT+12")),
ETC_GMT_PLUS_11(TimeZone.getTimeZone("Etc/GMT+11")),
ETC_GMT_PLUS_10(TimeZone.getTimeZone("Etc/GMT+10")),
ETC_GMT_PLUS_9(TimeZone.getTimeZone("Etc/GMT+9")),
ETC_GMT_PLUS_8(TimeZone.getTimeZone("Etc/GMT+8")),
ETC_GMT_PLUS_7(TimeZone.getTimeZone("Etc/GMT+7")),
ETC_GMT_PLUS_6(TimeZone.getTimeZone("Etc/GMT+6")),
ETC_GMT_PLUS_5(TimeZone.getTimeZone("Etc/GMT+5")),
ETC_GMT_PLUS_4(TimeZone.getTimeZone("Etc/GMT+4")),
ETC_GMT_PLUS_3(TimeZone.getTimeZone("Etc/GMT+3")),
ETC_GMT_PLUS_2(TimeZone.getTimeZone("Etc/GMT+2")),
ETC_GMT_PLUS_1(TimeZone.getTimeZone("Etc/GMT+1")),
ETC_GMT_PLUS_0(TimeZone.getTimeZone("Etc/GMT+0")),
ETC_GMT_MINUS_1(TimeZone.getTimeZone("Etc/GMT-1")),
ETC_GMT_MINUS_2(TimeZone.getTimeZone("Etc/GMT-2")),
ETC_GMT_MINUS_3(TimeZone.getTimeZone("Etc/GMT-3")),
ETC_GMT_MINUS_4(TimeZone.getTimeZone("Etc/GMT-4")),
ETC_GMT_MINUS_5(TimeZone.getTimeZone("Etc/GMT-5")),
ETC_GMT_MINUS_6(TimeZone.getTimeZone("Etc/GMT-6")),
ETC_GMT_MINUS_7(TimeZone.getTimeZone("Etc/GMT-7")),
ETC_GMT_MINUS_8(TimeZone.getTimeZone("Etc/GMT-8")),
ETC_GMT_MINUS_9(TimeZone.getTimeZone("Etc/GMT-9")),
ETC_GMT_MINUS_10(TimeZone.getTimeZone("Etc/GMT-10")),
ETC_GMT_MINUS_11(TimeZone.getTimeZone("Etc/GMT-11")),
ETC_GMT_MINUS_12(TimeZone.getTimeZone("Etc/GMT-12")),
ETC_GMT_MINUS_13(TimeZone.getTimeZone("Etc/GMT-13")),
ETC_GMT_MINUS_14(TimeZone.getTimeZone("Etc/GMT-14")),
private final TimeZone tz;
private TimeZoneEnum(final TimeZone tz) {
this.tz = tz;
}
public final TimeZone getTimeZone() {
return tz;
}
}
Run Code Online (Sandbox Code Playgroud)