View Javadoc

1   package com.atlassian.theplugin.idea.action.reviews;
2   
3   import com.intellij.openapi.actionSystem.AnActionEvent;
4   import com.intellij.openapi.actionSystem.DataKeys;
5   import com.intellij.openapi.project.Project;
6   import com.intellij.openapi.application.ApplicationManager;
7   import com.intellij.openapi.application.ModalityState;
8   import com.atlassian.theplugin.commons.crucible.api.model.CrucibleAction;
9   import com.atlassian.theplugin.idea.crucible.CrucibleSetReviewersWorker;
10  import com.atlassian.theplugin.idea.Constants;
11  
12  /**
13   * User: jgorycki
14   * Date: Dec 3, 2008
15   * Time: 2:34:51 PM
16   */
17  public class SetReviewersAction extends AbstractReviewAction {
18  	@Override
19  	protected CrucibleAction getRequestedAction() {
20  		return CrucibleAction.MODIFY_FILES;
21  	}
22  
23  	@Override
24  	public void actionPerformed(final AnActionEvent event) {
25  		final Project project = DataKeys.PROJECT.getData(event.getDataContext());
26  
27  		new Thread(new Runnable() {
28  			public void run() {
29  				ApplicationManager.getApplication().invokeAndWait(
30  						new CrucibleSetReviewersWorker(project, event.getData(Constants.REVIEW_KEY)),
31  						ModalityState.defaultModalityState());
32  			}
33  		}).start();
34  
35  	}
36  }