diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.form b/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.form index bf767f9084c2..cebe2419eb47 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.form +++ b/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.form @@ -1,6 +1,6 @@
- + @@ -49,37 +49,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.java b/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.java index aa01fb3fa50f..d78af2d5aab0 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.java +++ b/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.java @@ -15,10 +15,8 @@ */ package git4idea.update; -import com.intellij.openapi.application.ApplicationNamesInfo; import git4idea.config.GitVcsSettings; import git4idea.config.UpdateMethod; -import git4idea.i18n.GitBundle; import javax.swing.*; @@ -30,8 +28,6 @@ public class GitUpdateOptionsPanel { private JRadioButton myBranchDefaultRadioButton; private JRadioButton myForceRebaseRadioButton; private JRadioButton myForceMergeRadioButton; - private JRadioButton myStashRadioButton; - private JRadioButton myShelveRadioButton; public JComponent getPanel() { return myPanel; @@ -39,14 +35,7 @@ public class GitUpdateOptionsPanel { public boolean isModified(GitVcsSettings settings) { UpdateMethod type = getUpdateType(); - return type != settings.getUpdateMethod() || updateSaveFilesPolicy() != settings.updateChangesPolicy(); - } - - /** - * @return get policy value from selected radio buttons - */ - private GitVcsSettings.UpdateChangesPolicy updateSaveFilesPolicy() { - return UpdatePolicyUtils.getUpdatePolicy(myStashRadioButton, myShelveRadioButton); + return type != settings.getUpdateMethod(); } /** @@ -72,7 +61,6 @@ public class GitUpdateOptionsPanel { */ public void applyTo(GitVcsSettings settings) { settings.setUpdateMethod(getUpdateType()); - settings.setUpdateChangesPolicy(updateSaveFilesPolicy()); } /** @@ -92,12 +80,5 @@ public class GitUpdateOptionsPanel { default: assert false : "Unknown value of update type: " + settings.getUpdateMethod(); } - UpdatePolicyUtils.updatePolicyItem(settings.updateChangesPolicy(), myStashRadioButton, myShelveRadioButton); - } - - private void createUIComponents() { - myShelveRadioButton = new JRadioButton(GitBundle.message("update.options.save.shelve")); - myShelveRadioButton.setToolTipText(GitBundle.message("update.options.save.shelve.tooltip", - ApplicationNamesInfo.getInstance().getFullProductName())); } } diff --git a/plugins/git4idea/src/git4idea/update/UpdatePolicyUtils.java b/plugins/git4idea/src/git4idea/update/UpdatePolicyUtils.java deleted file mode 100644 index b01d01896200..000000000000 --- a/plugins/git4idea/src/git4idea/update/UpdatePolicyUtils.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2000-2010 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package git4idea.update; - -import git4idea.config.GitVcsSettings; -import org.jetbrains.annotations.NotNull; - -import javax.swing.*; - -/** - * The utilities for update policy - */ -public class UpdatePolicyUtils { - /** - * The private constructor - */ - private UpdatePolicyUtils() { - } - - /** - * Set policy value to radio buttons - * - * @param updateChangesPolicy the policy value to set - * @param stashRadioButton the stash radio button - * @param shelveRadioButton the shelve radio button - */ - public static void updatePolicyItem(GitVcsSettings.UpdateChangesPolicy updateChangesPolicy, - JRadioButton stashRadioButton, - JRadioButton shelveRadioButton) { - switch (updateChangesPolicy == null ? GitVcsSettings.UpdateChangesPolicy.STASH : updateChangesPolicy) { - case STASH: - stashRadioButton.setSelected(true); - return; - case SHELVE: - shelveRadioButton.setSelected(true); - return; - default: - assert false : "Unknown policy value: " + updateChangesPolicy; - } - } - - /** - * Get policy value from radio buttons - * - * @param stashRadioButton the stash radio button - * @param shelveRadioButton the shelve radio button - * @return the policy value - */ - public static GitVcsSettings.UpdateChangesPolicy getUpdatePolicy(@NotNull JRadioButton stashRadioButton, - @NotNull JRadioButton shelveRadioButton) { - - if (stashRadioButton.isSelected()) { - return GitVcsSettings.UpdateChangesPolicy.STASH; - } else if (shelveRadioButton.isSelected()) { - return GitVcsSettings.UpdateChangesPolicy.SHELVE; - } else { - // the stash is a default policy, in case if the policy could not be determined - return GitVcsSettings.UpdateChangesPolicy.STASH; - } - } -}