Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
幽默龙
luyten
提交
23bd1740
L
luyten
项目概览
幽默龙
/
luyten
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
luyten
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
23bd1740
编写于
2月 05, 2019
作者:
D
deathmarine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Well know file extensions to additional include addition syntax
highlighting.
上级
26fe3a28
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
5 deletion
+10
-5
src/us/deathmarine/luyten/OpenFile.java
src/us/deathmarine/luyten/OpenFile.java
+10
-5
未找到文件。
src/us/deathmarine/luyten/OpenFile.java
浏览文件 @
23bd1740
...
...
@@ -49,7 +49,7 @@ import com.strobel.decompiler.languages.Languages;
public
class
OpenFile
implements
SyntaxConstants
{
public
static
final
HashSet
<
String
>
WELL_KNOWN_TEXT_FILE_EXTENSIONS
=
new
HashSet
<>(
Arrays
.
asList
(
".java"
,
".xml"
,
".rss"
,
".project"
,
".classpath"
,
".h"
,
".sql"
,
".js"
,
".php"
,
".php5"
,
Arrays
.
asList
(
".java"
,
".xml"
,
".rss"
,
".project"
,
".classpath"
,
".h"
,
".
c"
,
".cpp"
,
".yaml"
,
".yml"
,
".ini"
,
".
sql"
,
".js"
,
".php"
,
".php5"
,
".phtml"
,
".html"
,
".htm"
,
".xhtm"
,
".xhtml"
,
".lua"
,
".bat"
,
".pl"
,
".sh"
,
".css"
,
".json"
,
".txt"
,
".rb"
,
".make"
,
".mak"
,
".py"
,
".properties"
,
".prop"
));
...
...
@@ -99,13 +99,16 @@ public class OpenFile implements SyntaxConstants {
textArea
.
setEditable
(
false
);
textArea
.
setAntiAliasingEnabled
(
true
);
textArea
.
setCodeFoldingEnabled
(
true
);
if
(
name
.
toLowerCase
().
endsWith
(
".class"
)
||
name
.
toLowerCase
().
endsWith
(
".java"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_JAVA
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".xml"
)
||
name
.
toLowerCase
().
endsWith
(
".rss"
)
||
name
.
toLowerCase
().
endsWith
(
".project"
)
||
name
.
toLowerCase
().
endsWith
(
".classpath"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_XML
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".h"
))
else
if
(
name
.
toLowerCase
().
endsWith
(
".h"
)
||
name
.
toLowerCase
().
endsWith
(
".c"
)
)
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_C
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".cpp"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_CPLUSPLUS
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".sql"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_SQL
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".js"
))
...
...
@@ -130,8 +133,10 @@ public class OpenFile implements SyntaxConstants {
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_CSS
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".json"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_JSON
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".txt"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_NONE
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".ini"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_INI
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".yaml"
)
||
name
.
toLowerCase
().
endsWith
(
".yml"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_YAML
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".rb"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_RUBY
);
else
if
(
name
.
toLowerCase
().
endsWith
(
".make"
)
||
name
.
toLowerCase
().
endsWith
(
".mak"
))
...
...
@@ -139,7 +144,7 @@ public class OpenFile implements SyntaxConstants {
else
if
(
name
.
toLowerCase
().
endsWith
(
".py"
))
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_PYTHON
);
else
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_
PROPERTIES_FIL
E
);
textArea
.
setSyntaxEditingStyle
(
SYNTAX_STYLE_
NON
E
);
scrollPane
=
new
RTextScrollPane
(
textArea
,
true
);
scrollPane
.
setIconRowHeaderEnabled
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录