IDEADEV-41062 (Map help button of "Import into Subversion" dialog box)
[fedora-idea.git] / plugins / svn4idea / src / org / jetbrains / idea / svn / dialogs / ImportDialog.java
blob54f53ed07fca5e4d5d385687531335db53a89bd0
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.help.HelpManager;
20 import org.jetbrains.idea.svn.SvnBundle;
22 import javax.swing.event.TreeSelectionEvent;
23 import javax.swing.event.TreeSelectionListener;
25 public class ImportDialog extends RepositoryBrowserDialog {
26 public ImportDialog(Project project) {
27 super(project);
30 public void init() {
31 super.init();
32 setTitle(SvnBundle.message("import.dialog.title"));
33 setOKButtonText(SvnBundle.message("import.dialog.button"));
34 getRepositoryBrowser().addChangeListener(new TreeSelectionListener() {
35 public void valueChanged(TreeSelectionEvent e) {
36 if (getOKAction() != null) {
37 updateOKAction();
40 });
41 updateOKAction();
44 @Override
45 protected String getHelpId() {
46 return "vcs.subversion.import";
49 private void updateOKAction() {
50 getOKAction().setEnabled(getRepositoryBrowser().getSelectedURL() != null);
53 protected void doOKAction() {
54 if(doImport()) {
55 super.doOKAction();
59 @Override
60 protected void doHelpAction() {
61 HelpManager.getInstance().invokeHelp("vcs.subversion.import");
64 @Override
65 protected boolean showImportAction() {
66 return false;