View Javadoc

1   /**
2    * Copyright (C) 2008 Atlassian
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.atlassian.theplugin.idea.action.crucible;
18  
19  import com.atlassian.theplugin.commons.crucible.CrucibleServerFacadeImpl;
20  import com.atlassian.theplugin.idea.crucible.CrucibleRevisionReviewCreator;
21  import com.intellij.openapi.actionSystem.AnActionEvent;
22  import com.intellij.openapi.actionSystem.DataKeys;
23  import com.intellij.openapi.application.ApplicationManager;
24  import com.intellij.openapi.application.ModalityState;
25  import com.intellij.openapi.project.Project;
26  import com.intellij.openapi.vcs.changes.ChangeList;
27  
28  public class PostCommitReviewAction extends Crucible16RepositoryAction {
29  	public void actionPerformed(AnActionEvent event) {
30  		final Project project = DataKeys.PROJECT.getData(event.getDataContext());
31  		final ChangeList[] changes = DataKeys.CHANGE_LISTS.getData(event.getDataContext());
32  
33  		new Thread(new Runnable() {
34  			public void run() {
35  				ApplicationManager.getApplication().invokeAndWait(
36  						new CrucibleRevisionReviewCreator(project, CrucibleServerFacadeImpl.getInstance(), changes),
37  						ModalityState.defaultModalityState());
38  			}
39  		}).start();
40  	}
41  }