james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r1522409 - /james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java
Date Thu, 12 Sep 2013 04:53:03 GMT
Author: dongxu
Date: Thu Sep 12 04:53:03 2013
New Revision: 1522409

URL: http://svn.apache.org/r1522409
Log:
fixed issue#80, make root path empty string ''

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java?rev=1522409&r1=1522408&r2=1522409&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java
Thu Sep 12 04:53:03 2013
@@ -190,13 +190,14 @@ public class LabelPropertiesView extends
 
 	@UiField TextBox name;
 	private String path;
-	
+
 	@UiField ListBox parent;
 	@UiField Button save;
 
 >>>>>>> fixed issue#77, the reason is that the arguement passed to server
was not the selected value in the list box
 	@UiField VerticalPanel propContainer;
 	@UiField CaptionPanel information;
+	private static final String ROOT_PATH = "imap_root";
 
 	private int state;
 
@@ -226,7 +227,12 @@ public class LabelPropertiesView extends
 			final ImapFolder f = req.create(ImapFolder.class);
 			f.setFullName(folder.getFullName());
 			action.setFolder(f);
-			action.setNewName(parent.getValue(parent.getSelectedIndex()) + "/" + name.getText());
+
+			if (ROOT_PATH.equals(parent.getValue(parent.getSelectedIndex()))) {
+				action.setNewName(name.getText());
+			} else {
+				action.setNewName(parent.getValue(parent.getSelectedIndex()) + "/" + name.getText());
+			}
 			req.rename(action).fire(new Receiver<GenericResult>() {
 				@Override
 				public void onSuccess(GenericResult response) {
@@ -362,7 +368,7 @@ public class LabelPropertiesView extends
 	}
 	private void makeParentList(LabelNode labelNode, boolean isParent, List<LabelNode>
wholeList) {
 		parent.clear();
-		parent.addItem("---", "root");
+		parent.addItem("---", ROOT_PATH);
 		for (LabelNode folderNode : wholeList) {
 			if (isItself(labelNode, isParent, folderNode) || isItsDecendant(labelNode, isParent, folderNode))
{
 				continue;
@@ -388,7 +394,7 @@ public class LabelPropertiesView extends
 	}
 
 	private boolean isKinship(LabelNode labelNode, LabelNode folderNode) {
-		if(folderNode == null){
+		if (folderNode == null) {
 			return false;
 		}
 		if (labelNode.compareTo(folderNode.getParent()) == 0)



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message