2012-10-29 69 views
1

我們使用框架,對於某些類,有xml配置文件。我想寫一個插件,在字段聲明附近添加圖標(在eclipse中圖標稱爲標記)。當點擊這個圖標時,用戶導航到字段的xml配置。這與使用xml config的spring或hibernate插件類似。我如何添加標記?有沒有一些開源插件可以做類似的事情?帶標記的Intellij IDEA插件

回答

1

抓住IntelliJ IDEA Community Edition source code from GitHub如果還沒有它。

請參閱com.intellij.navigation.GotoRelatedProvider,樣本實現可在com.theoryinpractice.testng.TestNGRelatedFilesProvider中找到。

+0

非常感謝,這是我所需要的。但是如何以及何時調用GotoRelatedProvider?我創建了插件,在plugin.xml中添加了gotoRelatedProvider與我的實現MyGotoRelatedProvider,並且在運行插件時從不調用此類。 –

+0

請參閱'com.intellij.ide.actions.GotoRelatedFileAction'。 – CrazyCoder