vcs: cleanup - remove unnecessary fields

This commit is contained in:
Aleksey Pivovarov
2016-11-18 11:49:43 +03:00
committed by Aleksey Pivovarov
parent 5aa2a1b6de
commit 2f19315e81
@@ -68,6 +68,7 @@ import java.util.List;
public class CommitChangeListDialog extends DialogWrapper implements CheckinProjectPanel, TypeSafeDataProvider { public class CommitChangeListDialog extends DialogWrapper implements CheckinProjectPanel, TypeSafeDataProvider {
private static final String HELP_ID = "reference.dialogs.vcs.commit"; private static final String HELP_ID = "reference.dialogs.vcs.commit";
private static final String TITLE = VcsBundle.message("commit.dialog.title");
private static final int LAYOUT_VERSION = 2; private static final int LAYOUT_VERSION = 2;
private static final String SPLITTER_PROPORTION_OPTION = "CommitChangeListDialog.SPLITTER_PROPORTION_" + LAYOUT_VERSION; private static final String SPLITTER_PROPORTION_OPTION = "CommitChangeListDialog.SPLITTER_PROPORTION_" + LAYOUT_VERSION;
@@ -92,10 +93,9 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
@NotNull private final List<RefreshableOnComponent> myAdditionalComponents = ContainerUtil.newArrayList(); @NotNull private final List<RefreshableOnComponent> myAdditionalComponents = ContainerUtil.newArrayList();
@NotNull private final List<CheckinHandler> myHandlers = ContainerUtil.newArrayList(); @NotNull private final List<CheckinHandler> myHandlers = ContainerUtil.newArrayList();
@NotNull private final String myActionName;
@NotNull private final Project myProject; @NotNull private final Project myProject;
@NotNull private final VcsConfiguration myVcsConfiguration; @NotNull private final VcsConfiguration myVcsConfiguration;
private final List<CommitExecutor> myExecutors; @Nullable private final List<CommitExecutor> myExecutors;
@NotNull private final Alarm myOKButtonUpdateAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD); @NotNull private final Alarm myOKButtonUpdateAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
private String myLastKnownComment = ""; private String myLastKnownComment = "";
private final boolean myAllOfDefaultChangeListChangesIncluded; private final boolean myAllOfDefaultChangeListChangesIncluded;
@@ -119,7 +119,6 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
@Nullable private final String myHelpId; @Nullable private final String myHelpId;
@NotNull private final SplitterWithSecondHideable myDetailsSplitter; @NotNull private final SplitterWithSecondHideable myDetailsSplitter;
private final String myOkActionText;
@Nullable private final CommitAction myCommitAction; @Nullable private final CommitAction myCommitAction;
@Nullable private final CommitResultHandler myResultHandler; @Nullable private final CommitResultHandler myResultHandler;
@@ -328,16 +327,13 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
myBrowser.setDiffBottomComponent(new DiffCommitMessageEditor(this)); myBrowser.setDiffBottomComponent(new DiffCommitMessageEditor(this));
myActionName = VcsBundle.message("commit.dialog.title");
final String actionName = getCommitActionName(); final String actionName = getCommitActionName();
final String borderTitleName = actionName.replace("_", "").replace("&", ""); final String borderTitleName = actionName.replace("_", "").replace("&", "");
JPanel optionsPanel = createOptionsPanel(project, borderTitleName); JPanel optionsPanel = createOptionsPanel(project, borderTitleName);
myOkActionText = actionName;
if (myShowVcsCommit) { if (myShowVcsCommit) {
setTitle(myActionName); setTitle(TITLE);
} }
else { else {
setTitle(trimEllipsis(myExecutors.get(0).getActionText())); setTitle(trimEllipsis(myExecutors.get(0).getActionText()));
@@ -346,7 +342,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
restoreState(); restoreState();
if (myShowVcsCommit) { if (myShowVcsCommit) {
myCommitAction = new CommitAction(); myCommitAction = new CommitAction(actionName);
} }
else { else {
myCommitAction = null; myCommitAction = null;
@@ -616,8 +612,8 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
private Action[] myOptions = new Action[0]; private Action[] myOptions = new Action[0];
private CommitAction() { private CommitAction(String okActionText) {
super(myOkActionText); super(okActionText);
putValue(DEFAULT_ACTION, Boolean.TRUE); putValue(DEFAULT_ACTION, Boolean.TRUE);
} }
@@ -681,7 +677,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
@NotNull @NotNull
@Override @Override
protected Action getOKAction() { protected Action getOKAction() {
return new CommitAction(); return myCommitAction != null ? myCommitAction : myExecutorActions.get(0);
} }
@Override @Override
@@ -1008,7 +1004,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
myProject, myProject,
myBrowser.getSelectedChangeList(), myBrowser.getSelectedChangeList(),
getIncludedChanges(), getIncludedChanges(),
myActionName, TITLE,
getCommitMessage(), getCommitMessage(),
myHandlers, myHandlers,
myAllOfDefaultChangeListChangesIncluded, false, myAdditionalData, customResultHandler); myAllOfDefaultChangeListChangesIncluded, false, myAdditionalData, customResultHandler);