From 3cb06cb9b14af4501d1deb518c4fb982a93e7782 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Tue, 3 Apr 2012 12:04:56 +0200 Subject: [PATCH] really fix IDEA-83542 --- .../cvsSupport2/ui/experts/CvsWizard.java | 17 ++++------------- .../ui/experts/SelectCVSConfigurationStep.java | 7 +------ .../ui/experts/SelectCvsElementStep.java | 7 +------ .../ui/experts/SelectLocationStep.java | 6 +----- .../cvsSupport2/ui/experts/WizardStep.java | 2 +- .../ui/experts/checkout/ChooseCheckoutMode.java | 6 ++---- .../experts/importToCvs/ImportSettingsStep.java | 5 ++--- 7 files changed, 12 insertions(+), 38 deletions(-) diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java index d1c6e8f45441..ec92397d2f29 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/CvsWizard.java @@ -78,19 +78,10 @@ public class CvsWizard extends AbstractWizard { final int numberOfSteps = getNumberOfSteps(); if (numberOfSteps == 0) return; final WizardStep currentStep = getCurrentStepObject(); - if (!currentStep.setActive()){ - doPreviousAction(); - return; - } - if (!currentStep.nextIsEnabled()) { - getNextButton().setEnabled(false); - getFinishButton().setEnabled(false); - } - else { - final boolean enableFinish = (getCurrentStep() + 1) == numberOfSteps; - getFinishButton().setEnabled(enableFinish); - getNextButton().setEnabled(!enableFinish); - } + currentStep.activate(); + final boolean enableNext = currentStep.nextIsEnabled(); + getNextButton().setEnabled(enableNext && (!isLastStep() || SystemInfo.isMac)); + getFinishButton().setEnabled(enableNext && isLastStep()); } public void disableNextAndFinish() { diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCVSConfigurationStep.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCVSConfigurationStep.java index 6a365bee83b9..fca05cfd6eff 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCVSConfigurationStep.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCVSConfigurationStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,11 +53,6 @@ public class SelectCVSConfigurationStep extends WizardStep{ return mySelectCvsConfigurationPanel.getSelectedConfiguration() != null; } - @Override - public boolean setActive() { - return true; - } - @Override protected JComponent createComponent() { return mySelectCvsConfigurationPanel; diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java index 995106a79b83..263a486e362d 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectCvsElementStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -109,11 +109,6 @@ public class SelectCvsElementStep extends WizardStep { return logged; } - @Override - public boolean setActive() { - return true; - } - @Override protected void dispose() { if (myCvsTree != null) { diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectLocationStep.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectLocationStep.java index 6ae1eb86259d..fda6e349ed28 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectLocationStep.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/SelectLocationStep.java @@ -59,7 +59,7 @@ public abstract class SelectLocationStep extends WizardStep { private final JPanel myNorthPanel = new JPanel(new BorderLayout()); private final JComponent myPathTextFieldWrapper; - private TextFieldAction myTextFieldAction; + private final TextFieldAction myTextFieldAction; private ActionToolbar myFileSystemToolBar; private VirtualFile mySelectedFile; private boolean myShowPath = CvsApplicationLevelConfiguration.getInstance().SHOW_PATH; @@ -160,10 +160,6 @@ public abstract class SelectLocationStep extends WizardStep { return selectedFiles.length == 1 && selectedFiles[0].isDirectory(); } - public boolean setActive() { - return true; - } - private DefaultActionGroup createFileSystemActionGroup() { final DefaultActionGroup group = FileSystemTreeFactory.SERVICE.getInstance().createDefaultFileSystemActions(myFileSystemTree); final AnAction[] actions = getActions(); diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java index c7943339638d..21fcfd4368e1 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/WizardStep.java @@ -41,7 +41,7 @@ public abstract class WizardStep extends StepAdapter{ } public abstract boolean nextIsEnabled(); - public abstract boolean setActive(); + public void activate() {} protected abstract JComponent createComponent(); protected void dispose() {} diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java index 72337586aadf..1ecdc2d0708f 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,7 +133,7 @@ public class ChooseCheckoutMode extends WizardStep { } @Override - public boolean setActive() { + public void activate() { final File selectedLocation = myWizard.getSelectedLocation(); final Collection cvsPaths = getSelectedFiles(); @@ -158,8 +158,6 @@ public class ChooseCheckoutMode extends WizardStep { else if (selectedLocation == null) { getWizard().disableNextAndFinish(); } - - return true; } private StringBuilder composeLocationsMessage() { diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportSettingsStep.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportSettingsStep.java index 802d71d3b861..a35737a9de6e 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportSettingsStep.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/ImportSettingsStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -134,7 +134,7 @@ public class ImportSettingsStep extends WizardStep { } @Override - public boolean setActive() { + public void activate() { if (!myIsInitialized) { myIsInitialized = true; myReleaseTag.setText(myImportConfiguration.RELEASE_TAG); @@ -154,7 +154,6 @@ public class ImportSettingsStep extends WizardStep { myModuleName.setText(myDirectoryToImport.getName()); myModuleName.selectAll(); } - return true; } private void selectAll() {