001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.unifiedGui.interfaces;
032:
033: import de.ug2t.kernel.*;
034:
035: /**
036: * @author Dirk
037: *
038: * date: 16.11.2003 project: WiSer-Framework
039: *
040: * <p>
041: * IUnKeyAccess is the common interface to manage keyboard-access to all widgets
042: * </p>
043: */
044: public interface IUnKeyAccess {
045: public class UnInsertHTMLString {
046: public static KeStringTemplate pcmf_insert(
047: IUnKeyAccess xTreeEl, KeStringTemplate xOrg) {
048: if (((IUnKeyAccess) xTreeEl).pcmf_getAccKey() != ' ') {
049: StringBuffer l_buf = new StringBuffer("accesskey='");
050: l_buf.append((char) ((IUnKeyAccess) xTreeEl)
051: .pcmf_getAccKey());
052: l_buf.append("'");
053: xOrg = KeTools.pcmf_stringSubst(xOrg, "$KEYACC", l_buf
054: .toString());
055: } else
056: xOrg = KeTools.pcmf_stringSubst(xOrg, "$KEYACC", "");
057:
058: return (xOrg);
059: }
060:
061: public static String pcmf_modValue(IUnKeyAccess xTreeEl,
062: String xValue) {
063: if (((IUnKeyAccess) xTreeEl).pcmf_getAccKey() != ' ') {
064: StringBuffer l_org = new StringBuffer(Character
065: .toString((char) xTreeEl.pcmf_getAccKey()));
066: StringBuffer l_new = new StringBuffer("<u>");
067: l_new.append(l_org);
068: l_new.append("</u>");
069:
070: return (KeTools.pcmf_stringSingleSubstIC(xValue, l_org
071: .toString(), l_new.toString()));
072: }
073:
074: return (xValue);
075: }
076: }
077:
078: /**
079: * <p>
080: * Sets the access-key of a widget
081: * </p>
082: * <p>
083: *
084: * </p>
085: * <p>
086: *
087: * @param xKey
088: * keycode of the access-key
089: * </p>
090: */
091: public void pcmf_setKeyAccess(int xKey);
092:
093: /**
094: * <p>
095: * Gets the acces-key of a widget
096: * </p>
097: * <p>
098: *
099: * @return access-key
100: * </p>
101: * <p>
102: * </p>
103: */
104: public int pcmf_getAccKey();
105: }
|