锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
AaaaPlugin.getDefault().getStateLocation().makeAbsolute().toFile().getAbsolutePath());
String path = ((IFile)o).getLocation().makeAbsolute().toFile().getAbsolutePath();
聽
榪愯鐜(runtime-workspace)錛?/p>
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
浠庢牴鏉ユ煡鎵捐祫婧愶細(xì)
IResource resource = root.findMember(new Path(containerName));
IWorkspaceRoot
聽-IProject
聽聽 -IFolder
聽聽聽聽 -IFile
IResource
寰楀埌緇濆璺緞鏂規(guī)硶錛?br />getLocation().toOSString()
寰楀埌鐩稿璺緞鏂規(guī)硶錛?br />getFullPath().toOSString()
閫氳繃鐩稿璺緞鎵懼埌鏂囦歡:
姣斿璇達(dá)細(xì)XXXProject涓嬮潰鏈?"/webApp/StarflowFormEdit.jsp"
String path=pjt.getFile("/webApp/StarflowFormEdit.jsp").getLocation().toOSString();
//Project
浠嶣undle鏉ユ煡鎵捐祫婧愶細(xì)
Bundle bundle = Platform.getBundle(pluginId);
URL fullPathString = BundleUtility.find(bundle, filePath);
澶囨敞錛?br />涓涓狾SGI妯″潡鏈閲嶈鐨勫氨鏄疊undle鍜孲ervice錛屾垜浠彲浠ヨ涓築undle鏄竴縐嶆彃浠剁鐞嗗櫒錛?br />涓昏鏄氳繃BundleActivator綆$悊妯″潡鐨勭敓鍛藉懆鏈燂紝鑰孲ervice鍒欐槸榪欎釜妯″潡鍙毚闇插澶栫殑鏈嶅姟瀵硅薄銆?br />榪欓噷浣撶幇浜哋SGI鍜屼紶緇熺殑Plug-in Framework涓嶅悓鐨勪竴涓湴鏂癸紝綆$悊鍜岄潤鎬佺粨鏋勫垎寮錛?br />姣忎釜Bundle鎷ユ湁鑷繁鐨凜lassLoader浠ュ強(qiáng)context錛岄氳繃context鍙繘琛屾湇鍔$殑娉ㄥ唽銆佸嵏杞界瓑錛?br />榪欎簺鎿嶄綔閮戒細(xì)閫氳繃浜嬩歡鏈哄埗騫挎挱緇欑浉搴旂殑鍏朵粬鐨凚undle錛涗竴鑸潵璇撮兘涓洪氳繃鍦˙undle涓紪鍐欏垵濮嬮渶瑕佹敞鍐岀殑鏈嶅姟鐨勬柟娉曟潵
瀹屾垚Bundle鍙緵澶栭儴浣跨敤鐨勬湇鍔$殑鏆撮湶鍔熻兘銆?/p>
寰楀埌Appliaction workspace錛?br />Platform.asLocalURL(PRODUCT_BUNDLE.getEntry("")).getPath()).getAbsolutePath();
榪愯鐜(runtime-workspace)錛?br />Platform.getInstanceLocation().getURL().getPath();
浠庣紪杈戝櫒鏉ヨ幏寰楃紪杈戞枃浠訛細(xì)
IEditorPart editor = ((DefaultEditDomain)(parent.getViewer().getEditDomain())).getEditorPart();
IEditorInput input = editor.getEditorInput();
if(input instanceof IFileEditorInput){
IFile file = ((IFileEditorInput)input).getFile();