2 * Copyright 2000-2008 JetBrains s.r.o.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package git4idea
.rebase
;
18 import com
.intellij
.openapi
.project
.Project
;
19 import com
.intellij
.openapi
.ui
.DialogWrapper
;
20 import com
.intellij
.openapi
.vfs
.VirtualFile
;
21 import git4idea
.ui
.GitUIUtil
;
22 import org
.jetbrains
.annotations
.Nullable
;
25 import java
.util
.List
;
28 * The rebase action dialog
30 public class GitRebaseActionDialog
extends DialogWrapper
{
34 private JComboBox myGitRootComboBox
;
38 private JPanel myPanel
;
43 * @param project the project to select
44 * @param title the dialog title
45 * @param roots the git repository roots for the project
46 * @param defaultRoot the guessed default root
48 public GitRebaseActionDialog(Project project
, String title
, List
<VirtualFile
> roots
, VirtualFile defaultRoot
) {
50 GitUIUtil
.setupRootChooser(project
, roots
, defaultRoot
, myGitRootComboBox
, null);
52 setOKButtonText(title
);
58 * Show dialog and select root
60 * @return selected root or null if the dialog has been cancelled
63 public VirtualFile
selectRoot() {
65 return isOK() ?
(VirtualFile
)myGitRootComboBox
.getSelectedItem() : null;
72 protected JComponent
createCenterPanel() {