Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 205817
Collapse All | Expand All

(-)src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java (-1 / +40 lines)
Lines 21-27 Link Here
21
import java.util.Observer;
21
import java.util.Observer;
22
22
23
import org.eclipse.jface.dialogs.IDialogConstants;
23
import org.eclipse.jface.dialogs.IDialogConstants;
24
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
25
import org.eclipse.jface.preference.IPreferenceStore;
24
import org.eclipse.jface.resource.JFaceResources;
26
import org.eclipse.jface.resource.JFaceResources;
27
import org.eclipse.jface.util.IPropertyChangeListener;
28
import org.eclipse.jface.util.PropertyChangeEvent;
25
import org.eclipse.jface.viewers.*;
29
import org.eclipse.jface.viewers.*;
26
import org.eclipse.jface.wizard.WizardPage;
30
import org.eclipse.jface.wizard.WizardPage;
27
import org.eclipse.osgi.util.NLS;
31
import org.eclipse.osgi.util.NLS;
Lines 793-801 Link Here
793
		fTable.modelChanged(true);
797
		fTable.modelChanged(true);
794
		fTable.selectAll();
798
		fTable.selectAll();
795
		filterBox.setFocus();
799
		filterBox.setFocus();
800
		setupListeners();
796
		setControl(mainComposite);
801
		setControl(mainComposite);
802
		validatePage();
797
	}
803
	}
798
	
804
805
	private void setupListeners() {
806
		fCommentArea.addPropertyChangeListener(new IPropertyChangeListener() {
807
			public void propertyChange(PropertyChangeEvent event) {
808
				if (event.getProperty() != null) {
809
					validatePage();
810
				}
811
			}
812
		});
813
	}
814
799
	protected ModeChangeTable getTable() {
815
	protected ModeChangeTable getTable() {
800
		return fTable;
816
		return fTable;
801
	}
817
	}
Lines 813-816 Link Here
813
	public String getComment(Shell shell) {
829
	public String getComment(Shell shell) {
814
		return fCommentArea.getCommentWithPrompt(shell);
830
		return fCommentArea.getCommentWithPrompt(shell);
815
	}
831
	}
832
833
	private void validatePage() {
834
		final String comment = fCommentArea.getComment(false);
835
		if (comment.equals("") && !isAllowEmptyCommitComments()) { //$NON-NLS-1$
836
			setPageComplete(false); // then the page is not complete
837
			return;
838
		} else {
839
			setPageComplete(true);
840
		}
841
	}
842
843
	private boolean isAllowEmptyCommitComments() {
844
		// check whether empty comments are allowed
845
		final IPreferenceStore store = CVSUIPlugin.getPlugin()
846
				.getPreferenceStore();
847
		final String allowEmptyComment = store
848
				.getString(ICVSUIConstants.PREF_ALLOW_EMPTY_COMMIT_COMMENTS);
849
		if (allowEmptyComment.equals(MessageDialogWithToggle.NEVER)) {
850
			return false;
851
		} else {
852
			return true;
853
		}
854
	}
816
}
855
}

Return to bug 205817