Custom IDE links in Strings - possible?

I'm not entirely sure how to correctly phrase this question so I'll go the descriptive route:

Suppose we have a basic JPA DAO:

public class MyDao {
     private EntityManager entityManager;

     public void findSomething() {
          Query q = entityManager.createNamedQuery("com.domain.sql.myQuery");
     }
}


Now - IDEA allows me to navigate straight to the JPA query definition by control-clicking the query name right in the method call - pure awesome :)

Is there any way to define custom links like these? For example by writing some configuration rules? custom doclets etc etc?

Suppose I have a factory class that pulls query definitions from spring context - I'd like to tell IDEA that the string that is passed to this method is a spring bean and ctrl+clicking it should take me to its definition

myQueryFactory.getNamedQuery("spring.bean.query");


Is it doable? Or would I have to write a plugin for that? If so - where to start?

Thanks

Please sign in to leave a comment.