Get the appropriate keyboard shortcut character (that hasn't been used in this group).
@param strMenu Menu string (try to use first character).
@param rgChars Currently used characters.
@param bResetCache First item on menu, reset rgChars.
776617
public static char getFirstChar(String strMenu, char[] rgChars, boolean bResetCache)
    {
        if (bResetCache) if (rgChars != null)
        {
            for (int i = 0; i < rgChars.length; i++)
                rgChars[i] = 0;
        }
        if (strMenu != null)
        {
            for (int iCharPosition = 0; iCharPosition < strMenu.length(); iCharPosition++)
            {
                char chShortcut = strMenu.charAt(iCharPosition);
                char chShortcutCompare = Character.toUpperCase(chShortcut);
                if (rgChars != null)    // Make sure this shortcut has not been used
                    for (int i = 0; i < rgChars.length; i++)
                    {
                        if (rgChars[i] == 0)
                        {
                            rgChars[i] = chShortcutCompare;
                            return chShortcut;  // End of cache (success)
                        }
                        if (rgChars[i] == chShortcutCompare)
                            break;  // Continue search (This char already used)
                    }
            }
        }
        return NO_CHAR; // No first char found
    }
853654
public final static String getHeader(String headerKey, String charset) {
		return ServletUtil.getHeader(getServletRequest(), headerKey, charset);
	}
685114
public void characters(char[] ch, int start, int length) {

        if (ignore)
            return;

        String content = new String(ch, start, length);
        // System.err.println("'" + content + "'");

        if (content.trim().length() == 0 && content.indexOf(' ') < 0) {
            return;
        }

        StringBuffer buf = new StringBuffer();
        int len = content.length();
        char character;
        boolean newline = false;
        for (int i = 0; i < len; i++) {
            switch (character = content.charAt(i)) {
            case ' ':
                if (!newline) {
                    buf.append(character);
                }
                break;
            case '\n':
                if (i > 0) {
                    newline = true;
                    buf.append(' ');
                }
                break;
            case '\r':
                break;
            case '\t':
                break;
            default:
                newline = false;
                buf.append(character);
            }
        }
        if (currentChunk == null) {
        	if (bf == null) {
        		currentChunk = new Chunk(buf.toString());
        	}
        	else {
        		currentChunk = new Chunk(buf.toString(), new Font(this.bf));
        	}
        } else {
            currentChunk.append(buf.toString());
        }
    }
614463
public int handleCharacter(int nextChar) {		
		this.characterCount++;	// stats

		if (this.getTokeniserState() == TOKENISER_SKIP_GROUP) { 
			return errOK;
		}


		RtfDestination dest = this.getCurrentDestination();
		if(dest != null) {
			dest.handleCharacter(nextChar);
		}

		return errOK;
	}
161605
private KeyStroke getDefaultAccelerator(ZapMenuItem menuItem) {
		if (isIdentifierWithDuplicatedAccelerator(menuItem.getIdentifier())) {
			return null;
		}
		return menuItem.getDefaultAccelerator();
	}
217073
public static int getKeyCode(final char character)
		throws IllegalAccessException, NoSuchFieldException
	{
		final String c = String.valueOf(character).toUpperCase();
		final String variableName = "VK_" + c;
		final Class<KeyEvent> clazz = KeyEvent.class;
		final Field field = clazz.getField(variableName);
		final int keyCode = field.getInt(null);
		return keyCode;
	}
1159578
@Pure
	public static char getMnemonicChar(String text) {
		if (text != null) {
			final int pos = text.indexOf('&');
			if ((pos != -1) && (pos < text.length() - 1)) {
				return text.charAt(pos + 1);
			}
		}
		return '\0';
	}
134395
def handle_key ch
      if !@current_menu.empty?
        cmenu = @current_menu.last
      else 
        cmenu = self
      end
      if !@@menus.empty?
       cmenu = @@menus.last
      else 
       cmenu = self
      end
      case ch
      when KEY_DOWN
        cmenu.select_next_item
        #return cmenu.fire # XXX 2010-10-16 21:39 trying out
        if cmenu.is_a? Canis::Menu 
          #alert "is a menu" # this gets triggered even when we are on items
        end
      when KEY_UP
        cmenu.select_prev_item
      when KEY_ENTER, 10, 13, 32 # added 32 2008-11-27 23:50 
        return cmenu.fire
      when KEY_LEFT
        if cmenu.parent.is_a? Canis::Menu 
       #$log.debug "LEFT IN MENU : #{cmenu.parent.class} len: #{cmenu.parent.current_menu.length}"
       #$log.debug "left IN MENU : #{cmenu.parent.class} len: #{cmenu.current_menu.length}"
        end
        ret = cmenu.select_left_item # 2011-09-24 V1.3.1 attempt to goto left item if columns
        if ret == :UNHANDLED
          if cmenu.parent.is_a? Canis::MenuBar #and !cmenu.parent.current_menu.empty?
            #$log.debug " ABOU TO DESTROY DUE TO LEFT"
            cmenu.current_menu.pop
            @@menus.pop ## NEW
            cmenu.destroy
            return :UNHANDLED
          end
          # LEFT on a menu list allows me to close and return to higher level
          if cmenu.parent.is_a? Canis::Menu #and !cmenu.parent.current_menu.empty?
            #$log.debug " ABOU TO DESTROY DUE TO LEFT"
            cmenu.current_menu.pop
            @@menus.pop ## NEW
            cmenu.destroy
            #return :UNHANDLED
          end
        end
      when KEY_RIGHT
       $log.debug "RIGHTIN MENU : #{text}  "
       if cmenu.active_index
        if cmenu.items[cmenu.active_index].is_a?  Canis::Menu 
          #alert "could fire here cmenu: #{cmenu.text}, par: #{cmenu.parent.text} "
          cmenu.fire
          return
       #$log.debug "right IN MENU : #{cmenu.parent.class} len: #{cmenu.parent.current_menu.length}"
       #$log.debug "right IN MENU : #{cmenu.parent.class} len: #{cmenu.current_menu.length}"
        end
       end
       # This introduces a bug if no open items
       ret = cmenu.select_right_item # 2011-09-24 V1.3.1 attempt to goto right item if columns
       #alert "attempting to select right #{ret} "
        if ret == :UNHANDLED
          #if cmenu.parent.is_a? Canis::Menu and !cmenu.parent.current_menu.empty?
          if cmenu.parent.is_a? Canis::MenuBar #and !cmenu.current_menu.empty?
            $log.debug " ABOU TO DESTROY DUE TO RIGHT"
            cmenu.current_menu.pop
            @@menus.pop
            cmenu.destroy
            return :UNHANDLED
          end
        end
      else
        ret = check_mnemonics cmenu, ch
        return ret
      end
    end
544187
def get_key():
    
    character_name = chr
    codes = _get_keycodes()
    if len(codes) == 1:
        code = codes[0]
        if code >= 32:
            return character_name(code)
        return control_key_name(code)
    return get_extended_key_name(codes)
1126295
protected static String convertNonNCNameChar(char c) {
        String str = "" + c;
        byte[] bytes = str.getBytes();
        StringBuilder sb = new StringBuilder(4);

        for (int i = 0; i < bytes.length; i++) {
            sb.append(String.format("%x",
                                    bytes[i]));
        }
        return sb.toString().toUpperCase();
    }
166192
public StrBuilder getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) {
		if (srcBegin < 0) {
			srcBegin = 0;
		}
		if (srcEnd < 0) {
			srcEnd = 0;
		} else if (srcEnd > this.position) {
			srcEnd = this.position;
		}
		if (srcBegin > srcEnd) {
			throw new StringIndexOutOfBoundsException("srcBegin > srcEnd");
		}
		System.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin);
		return this;
	}
332320
@Deprecated
	public static String removeChars(String S, char ch) {
		int pos;
		while((pos=S.indexOf(ch))!=-1) S=S.substring(0,pos)+S.substring(pos+1);
		return S;
	}
234345
public Optional<Character> getOptionalCharacter(String key) {
		return optionalGet(key).map((c) -> {
			if (c.length() != 1) {
				throw new ValidationException("The value of '" + key + "' must only contain one character.");
			}
			return c.charAt(0);
		}
682174
public void preSetupGrid(String strMenu)
    {
        Record record = this.getMainRecord();
        if (record != null)
            record.setOpenMode(record.getOpenMode() | DBConstants.OPEN_CACHE_RECORDS);    // Cache recently used records.
        if (record != null) if (record.getKeyArea().getKeyName().equals(DBConstants.PRIMARY_KEY))
            record.setKeyArea(record.getDefaultScreenKeyArea());
    }
1343524
private char getRelationFromRels(char builtForRel, char glossRel) {
        if (builtForRel == IMappingElement.EQUIVALENCE) {
            return glossRel;
        }
        if (builtForRel == IMappingElement.LESS_GENERAL) {
            if ((glossRel == IMappingElement.LESS_GENERAL) || (glossRel == IMappingElement.EQUIVALENCE)) {
                return IMappingElement.LESS_GENERAL;
            }
        }
        if (builtForRel == IMappingElement.MORE_GENERAL) {
            if ((glossRel == IMappingElement.MORE_GENERAL) || (glossRel == IMappingElement.EQUIVALENCE)) {
                return IMappingElement.MORE_GENERAL;
            }
        }
        return IMappingElement.IDK;
    }
801050
public StringBuffer getMessageKey(StringBuffer sb)
    {
        if ((this.getKeyInformation() & NOT_UNIQUE) == 0)
        {
            if (sb == null)
                sb = new StringBuffer();
            boolean bCompoundDataAdded = false;
            if ((this.getKeyInformation() & COMPOUND_PARAM) != 0)
            {
                String strSaveKey = this.getKey();
                String strBaseParam = strSaveKey;
                if (Character.isDigit(strSaveKey.charAt(strSaveKey.length() - 1)))
                    strBaseParam = strSaveKey.substring(0, strSaveKey.length() - 1);
                int iMaxParam = this.getKeyInformation() & COMPOUND_MASK;
                if (iMaxParam == 0)
                    iMaxParam = COMPOUND_MASK;
                for (int i = 1; i <= iMaxParam; i++)
                {
                    this.setKey(strBaseParam + Integer.toString(i));
                    String data = this.getString();
                    if (data != null)
                    {
                        if (sb.length() > 0)
                            sb.append('/');
                        sb.append(data);
                        if (data.length() > 0)
                            bCompoundDataAdded = true;
                    }
                    else
                        if (iMaxParam == COMPOUND_MASK)
                            break;  // If there are a unlimited number of params, stop on first null.
                }
                this.setKey(strSaveKey);
            }
            if (!bCompoundDataAdded)
            {
                if (sb.length() > 0)
                    sb.append('/');
                String data = this.getString();
                if (data != null)
                    sb.append(data);
            }
        }
        return sb;
    }
1347518
private static int selectStyle(char ch) {
        switch (ch) {
        case 'S':
            return SHORT;
        case 'M':
            return MEDIUM;
        case 'L':
            return LONG;
        case 'F':
            return FULL;
        case '-':
            return NONE;
        default:
            throw new IllegalArgumentException("Invalid style character: " + ch);
        }
    }