獨(dú)自等待
那曾經(jīng)從自己身邊溜走的人……
BlogJava
首頁
新隨筆
新文章
聯(lián)系
聚合
管理
posts - 0,comments - 3,trackbacks - 0
<
2025年7月
>
日
一
二
三
四
五
六
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
Java
文章分類
(12)
Birt(2)
Eclipse(3)
EMF(1)
GEF
GMF
Java(3)
SWT(3)
文章檔案
(11)
2009年3月 (1)
2009年1月 (1)
2008年12月 (1)
2008年11月 (3)
2008年9月 (1)
2008年6月 (3)
2008年5月 (1)
搜索
最新評論
1.?re: SWT顯示圖片[未登錄]
擦擦擦
--1
2.?re: 自定義 CellEditor[未登錄]
評論內(nèi)容較長,點(diǎn)擊標(biāo)題查看
--楊
3.?re: 自定義 CellEditor
怎么調(diào)用呢?能給個例子么?
--ljj
從插件/Rcp中獲取文件路徑的方法
從插件中獲得絕對路徑:
AaaaPlugin.getDefault().getStateLocation().makeAbsolute().toFile().getAbsolutePath());
通過文件得到Project:
IProject project
=
((IFile)o).getProject();
通過文件得到全路徑:
String path
=
((IFile)o).getLocation().makeAbsolute().toFile().getAbsolutePath();
得到整個Workspace的根:
IWorkspaceRoot root
=
ResourcesPlugin.getWorkspace().getRoot();
從根來查找資源:
IResource resource
=
root.findMember(
new
Path(containerName));
從Bundle來查找資源:
Bundle bundle
=
Platform.getBundle(pluginId);
URL fullPathString
=
BundleUtility.find(bundle, filePath);
從編輯器來獲得編輯文件
IEditorPart editor
=
((DefaultEditDomain)(parent.getViewer().getEditDomain())).getEditorPart();
IEditorInput input
=
editor.getEditorInput();
if
(input
instanceof
IFileEditorInput)
{
IFile file
=
((IFileEditorInput)input).getFile();
}
得到runtimeworkspace:
Platform.getInstanceLocation().getURL().getPath();
得到Appliaction workspace:
Platform.asLocalURL(PRODUCT_BUNDLE.getEntry(
""
)).getPath()).getAbsolutePath();
posted on 2008-11-20 19:39
自由
閱讀(607)
評論(0)
編輯
收藏
所屬分類:
Eclipse
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發(fā)表評論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
Eclipse RCP中超長任務(wù)單線程,異步線程處理
從插件/Rcp中獲取文件路徑的方法
為SourceViewer添加Undo、Redo功能
Copyright ©2025 自由 Powered By
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
郸城县
|
浑源县
|
兴城市
|
淅川县
|
赤水市
|
叶城县
|
大埔县
|
金川县
|
漾濞
|
郎溪县
|
闽清县
|
江都市
|
渑池县
|
奉贤区
|
怀柔区
|
SHOW
|
家居
|
霍城县
|
巫山县
|
恩施市
|
来安县
|
南和县
|
宜宾市
|
常州市
|
广宗县
|
石门县
|
海伦市
|
小金县
|
迁安市
|
金坛市
|
从化市
|
玛曲县
|
长垣县
|
浪卡子县
|
沁水县
|
柘荣县
|
义乌市
|
吉首市
|
潼南县
|
汉寿县
|
莱西市
|