獨(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)
搜索
最新評(píng)論
1.?re: SWT顯示圖片[未登錄]
擦擦擦
--1
2.?re: 自定義 CellEditor[未登錄]
評(píng)論內(nèi)容較長(zhǎng),點(diǎn)擊標(biāo)題查看
--楊
3.?re: 自定義 CellEditor
怎么調(diào)用呢?能給個(gè)例子么?
--ljj
從插件/Rcp中獲取文件路徑的方法
從插件中獲得絕對(duì)路徑:
AaaaPlugin.getDefault().getStateLocation().makeAbsolute().toFile().getAbsolutePath());
通過文件得到Project:
IProject project
=
((IFile)o).getProject();
通過文件得到全路徑:
String path
=
((IFile)o).getLocation().makeAbsolute().toFile().getAbsolutePath();
得到整個(gè)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
自由
閱讀(605)
評(píng)論(0)
編輯
收藏
所屬分類:
Eclipse
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
Eclipse RCP中超長(zhǎng)任務(wù)單線程,異步線程處理
從插件/Rcp中獲取文件路徑的方法
為SourceViewer添加Undo、Redo功能
Copyright ©2025 自由 Powered By
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
平乐县
|
岳阳县
|
淄博市
|
武隆县
|
汝州市
|
岑巩县
|
济源市
|
大姚县
|
山西省
|
兴业县
|
剑川县
|
唐山市
|
隆子县
|
蕉岭县
|
揭西县
|
庆元县
|
苏尼特右旗
|
辽阳市
|
金昌市
|
泸西县
|
南召县
|
靖宇县
|
丹凤县
|
开封县
|
海门市
|
甘泉县
|
新余市
|
华阴市
|
利津县
|
宜良县
|
桐庐县
|
凯里市
|
昌邑市
|
黄平县
|
冀州市
|
苏尼特右旗
|
定安县
|
扶绥县
|
宜都市
|
长垣县
|
贺州市
|