3 Replies Last post: Sep 9, 2002 12:04 AM by Jacques Morel  
Guest
Currently Being Moderated

Sep 7, 2002 11:22 AM

Marking Project as Current programmatically

I would like to invoke the Mark Project as Current in my custom Update

action.

How should I do it?

 

Thanks

 

Jacques

 

 

 

Jacques Morel Expert 1,550 posts since
Aug 20, 2002
Currently Being Moderated
Sep 9, 2002 12:04 AM in response to: Mike Aizatsky
Re: Marking Project as Current programmatically

I am creating a custom action Update Project that will modify externally several files. I want to mark them as current in one shot

Alexey Efimov IDEA Plugin Contest Winner 1,410 posts since
Aug 21, 2002
Currently Being Moderated
Sep 7, 2002 4:55 PM in response to: Jacques Morel
Re: Marking Project as Current programmatically

I guess project level properties not exist now. But you can create it by yourself. Create a ApplicationComponent named like, 'MY_PROJECT_MANAGER' or etc.

In any place if you need to get or set current project use:

MyProjectManager mpm = (MyProjectManager)Application.getComponent(MyProjectManager.class);

 

mpm.setActive(project);

 

// or

Project current = mpm.getActive();

 

This just an example, i think idea is simple to understand

Good luck.

 

PS. This practic i used in CurrentProjectComponent, but i misstake in source of "current project" and now this solution is depricated (http://www.intellij.org/twiki/bin/view/Main/CurrentProjectComponent). I use wrong algorithm for marking "active" project - i used ProjectManagerListener for this.

But for you target this solution is working correctly.

More Like This

  • Retrieving data ...