mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
making printing of labels look better and remove dependency on StringUtil
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3569 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,12 +17,10 @@
|
|||||||
package org.alfresco.web.templating.xforms.schemabuilder;
|
package org.alfresco.web.templating.xforms.schemabuilder;
|
||||||
|
|
||||||
import org.apache.xerces.xs.*;
|
import org.apache.xerces.xs.*;
|
||||||
import org.chiba.util.StringUtil;
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.Text;
|
import org.w3c.dom.Text;
|
||||||
|
|
||||||
import javax.xml.transform.Source;
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -80,7 +78,20 @@ public class BaseSchemaFormBuilder
|
|||||||
* @return __UNDOCUMENTED__
|
* @return __UNDOCUMENTED__
|
||||||
*/
|
*/
|
||||||
public String createCaption(String text) {
|
public String createCaption(String text) {
|
||||||
return StringUtil.capitalizeIdentifier(text);
|
// if the word is all upper case, then set to lower case and continue
|
||||||
|
if (text.equals(text.toUpperCase()))
|
||||||
|
text = text.toLowerCase();
|
||||||
|
String[] s = text.split("/[-_\\ ]/");
|
||||||
|
StringBuffer result = new StringBuffer();
|
||||||
|
for (int i = 0; i < s.length; i++)
|
||||||
|
{
|
||||||
|
if (i != 0)
|
||||||
|
result.append(' ');
|
||||||
|
result.append(Character.toUpperCase(s[i].charAt(0)) +
|
||||||
|
s[i].substring(1, s[i].length() - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user