|
From: Mikael P. <er...@us...> - 2012-02-22 08:47:30
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards
In directory vz-cvs-4.sog:/tmp/cvs-serv18241/src/net/sourceforge/eclipseccase/ui/wizards
Modified Files:
CheckinWizardPage.java CheckinWizard.java
Log Message:
Fix bug 3490766
Index: CheckinWizardPage.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards/CheckinWizardPage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CheckinWizardPage.java 16 Feb 2012 09:47:53 -0000 1.2
--- CheckinWizardPage.java 22 Feb 2012 08:47:27 -0000 1.3
***************
*** 1,4 ****
--- 1,7 ----
package net.sourceforge.eclipseccase.ui.wizards;
+ import org.eclipse.swt.events.ModifyEvent;
+ import org.eclipse.swt.events.ModifyListener;
+
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
***************
*** 111,115 ****
private Text commentText;
! String[] comments = new String[0];
private Combo previousCommentsCombo;
--- 114,120 ----
private Text commentText;
! private String[] comments = new String[0];
!
! private String comment = "";
private Combo previousCommentsCombo;
***************
*** 134,138 ****
resourceList.add(resource);
}
! // Load previous comments.
if (null != ClearCasePlugin.getDefault()) {
comments = ClearCasePlugin.getDefault().getPreviousComments();
--- 139,143 ----
resourceList.add(resource);
}
! // Load previous comments for combo.
if (null != ClearCasePlugin.getDefault()) {
comments = ClearCasePlugin.getDefault().getPreviousComments();
***************
*** 211,216 ****
String extCoComment = getLastExtCoComment(resources);
! if (!(extCoComment != null && extCoComment.length() == 0)) {
! commentText.setText(extCoComment);
}
commentText.selectAll();
--- 216,222 ----
String extCoComment = getLastExtCoComment(resources);
! if(!extCoComment.equalsIgnoreCase("")){
! this.setComment(extCoComment);
!
}
commentText.selectAll();
***************
*** 225,228 ****
--- 231,242 ----
}
});
+
+ commentText.setText(comment);
+ commentText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ comment = commentText.getText();
+ }
+ });
// Combo for comments
***************
*** 347,351 ****
public String getText(Object element) {
IResource resource = (IResource) element;
! return resource.getFullPath().makeRelative().toString();
}
}
--- 361,365 ----
public String getText(Object element) {
IResource resource = (IResource) element;
! return resource.getFullPath().toString();
}
}
***************
*** 391,397 ****
}
! public String getCommentText() {
! return commentText.getText();
! }
/**
--- 405,409 ----
}
!
/**
***************
*** 454,457 ****
--- 466,497 ----
}
+
+ /**
+ * Returns the comment.
+ *
+ * @return String
+ */
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+
+ /**
+ * Returns the comment.
+ *
+ * @return String
+ */
+ public String getComment() {
+ if (comment != null && comment.length() > 0) {
+ finished();
+ }
+ return comment;
+ }
+
+ private void finished() {
+ // if there is a comment, remember it
+ if (comment.length() > 0) {
+ ClearCasePlugin.getDefault().addComment(comment);
+ }
+ }
}
Index: CheckinWizard.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/wizards/CheckinWizard.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CheckinWizard.java 16 Feb 2012 09:48:40 -0000 1.2
--- CheckinWizard.java 22 Feb 2012 08:47:27 -0000 1.3
***************
*** 76,80 ****
*/
public boolean performFinish() {
! final String comment = page.getCommentText();
final IResource[] resources = page.getResourceList();
final boolean recursive = page.isRecursive();
--- 76,80 ----
*/
public boolean performFinish() {
! final String comment = page.getComment();
final IResource[] resources = page.getResourceList();
final boolean recursive = page.isRecursive();
|