SVN auth
[fedora-idea.git] / plugins / svn4idea / src / org / jetbrains / idea / svn / dialogs / CheckoutDialog.java
blobbffb759ed33dd46bd21a94982858aa57c398798e
1 /*
2 * Copyright 2000-2009 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 org.jetbrains.idea.svn.dialogs;
18 import com.intellij.openapi.project.Project;
19 import com.intellij.openapi.vcs.CheckoutProvider;
20 import org.jetbrains.idea.svn.SvnBundle;
22 import javax.swing.event.TreeSelectionEvent;
23 import javax.swing.event.TreeSelectionListener;
25 public class CheckoutDialog extends RepositoryBrowserDialog {
26 private final CheckoutProvider.Listener myListener;
28 public CheckoutDialog(Project project, final CheckoutProvider.Listener listener) {
29 super(project, false);
30 myListener = listener;
33 public void init() {
34 super.init();
35 setTitle(SvnBundle.message("checkout.dialog.title"));
36 setOKButtonText(SvnBundle.message("checkout.dialog.button"));
37 getRepositoryBrowser().addChangeListener(new TreeSelectionListener() {
38 public void valueChanged(TreeSelectionEvent e) {
39 if (getOKAction() != null) {
40 getOKAction().setEnabled(getRepositoryBrowser().getSelectedURL() != null);
43 });
44 getOKAction().setEnabled(getRepositoryBrowser().getSelectedURL() != null);
47 protected String getHelpId() {
48 return "vcs.subversion.browseSVN";
51 protected void doOKAction() {
52 final RepositoryTreeNode selectedNode = getSelectedNode();
53 close(OK_EXIT_CODE);
54 doCheckout(myListener, selectedNode);