Changeset 12 for trunk/src/org/expeditee/gui/FrameIO.java
- Timestamp:
- 05/01/08 17:55:18 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameIO.java
r10 r12 774 774 } 775 775 776 p rivate static String NameValidation(String toValidate) throws Exception{776 public static String ConvertToValidFramesetName(String toValidate) { 777 777 String result = ""; 778 778 … … 781 781 char cur = toValidate.charAt(i); 782 782 783 // check for illegal characters784 if (ILLEGAL_CHARS.contains("" + cur)) {785 throw new Exception(786 "Frameset name contains illegal character '" + cur787 + "' at position " + (i + 1));788 }789 790 783 // capitalize all characters after spaces 791 if (cur == ' ') { 792 capital = true; 793 } else { 784 if (Character.isLetterOrDigit(cur)) { 794 785 if (capital) { 795 786 capital = false; … … 799 790 800 791 if (result.length() >= MAX_NAME_LENGTH) { 801 throw new Exception("Frameset name is too long (Max " 802 + MAX_NAME_LENGTH + " characters)"); 792 result = result.substring(0,MAX_NAME_LENGTH); 803 793 } 804 } 805 } 806 794 } else { 795 capital = true; 796 } 797 } 798 807 799 return result; 808 800 } … … 900 892 901 893 // ensure the framename is valid 902 frameset = NameValidation(frameset);894 frameset = ConvertToValidFramesetName(frameset); 903 895 904 896 if (frameset == null) … … 970 962 if (!FrameIO.DoesFramesetExist(framesetName)) 971 963 return false; 972 964 973 965 for (String path : UserSettings.FrameDirs) { 974 966 String source = path + framesetName.toLowerCase() + File.separator;
Note:
See TracChangeset
for help on using the changeset viewer.