Monday, May 5, 2008

getPluralString() method

public static final List plural_NOT_REQD;
// for words whose singular equals plural, add in lowercase
static {
plural_NOT_REQD = new ArrayList();
plural_NOT_REQD.add("status");
}

****************
****************
/**

* Returns the plural form of the words passed to it
*
* @param singular
* form of the word
* @return the plural form
*/
public static String getPluralString(String singular) {

String plural = singular;
int length = singular.length();
if (length <>
return plural;
if (plural_NOT_REQD.contains(singular.toLowerCase()))
plural = singular;
else if (singular.charAt(length - 1) == 's' || singular.endsWith("sh")
|| singular.endsWith("ch")
|| singular.charAt(length - 1) == 'x'
|| singular.charAt(length - 1) == 'z')
plural = plural + "es";
else if (singular.charAt(length - 1) == 'y') {
if (singular.charAt(length - 2) == 'a'
|| singular.charAt(length - 2) == 'e'
|| singular.charAt(length - 2) == 'i'
|| singular.charAt(length - 2) == 'o'
|| singular.charAt(length - 2) == 'u')
plural = plural + "s";
else
plural = plural.substring(0, length - 1) + "ies";
} else if (singular.charAt(length - 1) == 'f')
plural = plural.substring(0, length - 1) + "ves";
else if (singular.endsWith("fe"))
plural = plural.substring(0, length - 2) + "ves";
else
plural = plural + "s";
return plural;
}

Thursday, December 20, 2007

linkx for cool tootips

http://www.guistuff.com/tools/tooltip/tooltipgen2.cgi?navlinks=&titletextcolor=FFFFFF&titlefont=times&titletextsize=8&contenttextcolor=000000&contentfont=arial&contenttextsize=8&titleareacolor=808080&contentareacolor=C0C0C0&tooltipwidth=150

i used this one in for my project
http://www.walterzorn.com/tooltip/tooltip_e.htm#download

Thursday, November 22, 2007

problem with cursor:hand in firefox

well its common problem as i found on the net seaches, that we can't use the cursor:hand style in the firefox.
well i've a lil get around for this issue.
though its not official but lil trick and a lil help from the addons of firefox.
jus d'load the IETab addon of firefox. then the rest is simple
Try it..


Well the simpler solution yet i found it now....... hehe

use cursor:pointer for firefox

for cross browser compatibility use "cursor:pointer, cursor:hand" in the specified order