Annotation of autoform/www/jsdoc/overview-summary-preferences_elements_UserListPreference.js.html, revision 1.1

1.1     ! kessler     1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
        !             2: <HTML>
        !             3: <HEAD>
        !             4: <TITLE>
        !             5: autoform.mozdev.org Overview
        !             6: </TITLE>
        !             7: <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
        !             8: <SCRIPT>
        !             9: function asd()
        !            10: {
        !            11: parent.document.title=" Overview";
        !            12: }
        !            13: </SCRIPT>
        !            14: </HEAD>
        !            15: <BODY BGCOLOR="white" onload="asd();">
        !            16: 
        !            17: <!-- ========== START OF NAVBAR ========== -->
        !            18: <A NAME="navbar_top"><!-- --></A>
        !            19: <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
        !            20: <TR>
        !            21: <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
        !            22: <A NAME="navbar_top_firstrow"><!-- --></A>
        !            23: <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
        !            24:   <TR ALIGN="center" VALIGN="top">
        !            25:   
        !            26:   
        !            27:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><b>Overview</b></FONT></A>&nbsp;</TD>
        !            28:   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">        &nbsp;<FONT CLASS="NavBarFont1Rev"><b>File</b></FONT>&nbsp;</TD>
        !            29:   
        !            30: 
        !            31:   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1">   <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
        !            32:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><b>Tree</b></FONT></A>&nbsp;</TD>
        !            33:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="index-all.html"--><FONT CLASS="NavBarFont1"><b>Index</b></FONT></A>&nbsp;</TD>
        !            34:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><b>Help</b></FONT></A>&nbsp;</TD>
        !            35:   </TR>
        !            36: </TABLE>
        !            37: </TD>
        !            38: <TD BGCOLOR="#EEEEFF" ALIGN="right" VALIGN="top">
        !            39: <EM>
        !            40: <b>autoform.mozdev.org</b></EM>
        !            41: </TD>
        !            42: </TR>
        !            43: 
        !            44: <TR>
        !            45: <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
        !            46: &nbsp;PREV&nbsp;
        !            47: &nbsp;NEXT</FONT></TD>
        !            48: <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
        !            49:   <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
        !            50: &nbsp;<A HREF="overview-summary.html" TARGET="_top"><B>NO FRAMES</B></A>
        !            51: &nbsp;&nbsp;
        !            52: <SCRIPT>
        !            53:   <!--
        !            54:   if(window==top) {
        !            55:     document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
        !            56:   }
        !            57:   //-->
        !            58: </SCRIPT>
        !            59: <NOSCRIPT>
        !            60: <A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
        !            61: </NOSCRIPT>
        !            62: </FONT></TD>
        !            63: </TR>
        !            64: </TABLE>
        !            65: <!-- =========== END OF NAVBAR =========== -->
        !            66: 
        !            67: <HR>
        !            68: <CENTER>
        !            69: 
        !            70:    <H2>preferences/elements/UserListPreference.js</H2>
        !            71: 
        !            72: </CENTER>
        !            73:         
        !            74:             
        !            75:         
        !            76:         
        !            77:         <h4>Summary</h4>
        !            78:         <p>
        !            79:         
        !            80:            No overview generated for 'preferences/elements/UserListPreference.js'<BR/><BR/>
        !            81:            
        !            82:         </p>
        !            83: 
        !            84: <HR>
        !            85: 
        !            86: 
        !            87: 
        !            88: 
        !            89: <!-- START SOURCECODE -->
        !            90: <pre class="sourceview">
        !            91: <span class="comment">/* ***** BEGIN LICENSE BLOCK *****
        !            92:  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
        !            93:  *
        !            94:  * The contents of this file are subject to the Mozilla Public License Version
        !            95:  * 1.1 (the "License"); you may not use this file except in compliance with
        !            96:  * the License. You may obtain a copy of the License at
        !            97:  * http://www.mozilla.org/MPL/
        !            98:  *
        !            99:  * Software distributed under the License is distributed on an "AS IS" basis,
        !           100:  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
        !           101:  * for the specific language governing rights and limitations under the
        !           102:  * License.
        !           103:  *
        !           104:  * The Original Code is from autoform.
        !           105:  *
        !           106:  * The Initial Developer of the Original Code is
        !           107:  * Michael Kessler, Bluewin AG &lt;michael.kessler<span class="attrib">@team</span>.bluewin.com&gt;.
        !           108:  * Portions created by the Initial Developer are Copyright (C) 2005
        !           109:  * the Initial Developer. All Rights Reserved.
        !           110:  *
        !           111:  * Contributor(s):
        !           112:  *
        !           113:  * Alternatively, the contents of this file may be used under the terms of
        !           114:  * either the GNU General Public License Version 2 or later (the "GPL"), or
        !           115:  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
        !           116:  * in which case the provisions of the GPL or the LGPL are applicable instead
        !           117:  * of those above. If you wish to allow use of your version of this file only
        !           118:  * under the terms of either the GPL or the LGPL, and not to allow others to
        !           119:  * use your version of this file under the terms of the MPL, indicate your
        !           120:  * decision by deleting the provisions above and replace them with the notice
        !           121:  * and other provisions required by the GPL or the LGPL. If you do not delete
        !           122:  * the provisions above, a recipient may use your version of this file under
        !           123:  * the terms of any one of the MPL, the GPL or the LGPL.
        !           124:  *
        !           125:  * ***** END LICENSE BLOCK ***** */</span>
        !           126: 
        !           127: <span class="comment">/**
        !           128:  * Manages virtual users (toolbar
        !           129:  * userchange and preferences
        !           130:  *
        !           131:  * <span class="attrib">@param</span> elementId the xul element id in the dialog
        !           132:  *
        !           133:  * <span class="attrib">@constructor</span>
        !           134:  */</span>
        !           135: <span class="reserved">function</span> UserListPreference(elementId) {
        !           136: <span class="comment">
        !           137:    // inherit</span>
        !           138:    <span class="reserved">this</span>.superclass = ListPreference;
        !           139:    <span class="reserved">this</span>.superclass();
        !           140:       
        !           141:    <span class="reserved">this</span>.elementId = elementId;
        !           142: 
        !           143:    <span class="comment">/**
        !           144:     * put preference values to
        !           145:     * its gui representation
        !           146:     * 
        !           147:     * overwrites ListPreference.loadElement()
        !           148:     */</span>
        !           149:    <span class="reserved">this</span>.loadElement = <span class="reserved">function</span>() {
        !           150: <span class="comment">      // remove onselelect from the listbox</span>
        !           151: <span class="comment">      // otherwise it will trigger a this.changeUser()</span>
        !           152:       var listBox = document.getElementById(<span class="reserved">this</span>.elementId);
        !           153:       var onSelectHandler = listBox.onselect;
        !           154:       listBox.onselect = null;
        !           155: <span class="comment">      // clear list</span>
        !           156:       <span class="reserved">while</span>(listBox.getRowCount() != 0) {
        !           157:          listBox.removeItemAt(0);
        !           158:       }
        !           159: <span class="comment">      // load values</span>
        !           160:       var prefs = <span class="reserved">this</span>.getListBranch();
        !           161:       var count = { value : 0 };
        !           162:       var childList = prefs.getChildList(<span class="literal">""</span>, count);      
        !           163:       <span class="reserved">for</span>(i=0; i&lt;count.value; i++) {
        !           164:          var item = listBox.appendItem(prefs.getCharPref(childList[i]), childList[i]);
        !           165:          <span class="reserved">if</span> (childList[i] == <span class="reserved">this</span>.getActiveUser()) {
        !           166:             listBox.selectItem(item);
        !           167:          }
        !           168:       }
        !           169: <span class="comment">      // restore this.changeUser()</span>
        !           170:       listBox.onselect = onSelectHandler;
        !           171:    };
        !           172:    
        !           173:    <span class="comment">/**
        !           174:     * user change  within the preferences dialog.
        !           175:     * the preference observer triggers the reload
        !           176:     * of all elements 
        !           177:     */</span>
        !           178:    <span class="reserved">this</span>.changeUser = <span class="reserved">function</span>(listBox) {
        !           179:       <span class="reserved">if</span> (listBox.selectedCount &gt; 0) {
        !           180:         <span class="reserved">this</span>.getPreferenceStore().setCharPref(<span class="literal">"autoform-activeuser"</span>, listBox.selectedItem.value);
        !           181:       }
        !           182:    }
        !           183: 
        !           184:    <span class="comment">/**
        !           185:     * returns the list branch
        !           186:     *
        !           187:     * Overwrites ListPreference.getListBranch()
        !           188:     */</span>
        !           189:    <span class="reserved">this</span>.getListBranch = <span class="reserved">function</span>() {
        !           190:       <span class="reserved">return</span> <span class="reserved">this</span>.getPreferenceStoreBranch(<span class="reserved">this</span>.elementId);
        !           191:    }
        !           192:    
        !           193:    <span class="comment">/**
        !           194:     * create the toolbar user menupopup
        !           195:     */</span>
        !           196:    <span class="reserved">this</span>.createUserMenu = <span class="reserved">function</span>(menu) {
        !           197:       <span class="reserved">while</span> (menu.childNodes.length &gt; 0) {
        !           198:          menu.removeChild(menu.lastChild);
        !           199:       }
        !           200: <span class="comment">      // create user menus</span>
        !           201:       var prefs = <span class="reserved">this</span>.getListBranch();
        !           202:       var count = { value : 0 };
        !           203:       var childList = prefs.getChildList(<span class="literal">""</span>, count);
        !           204:       <span class="reserved">for</span> (i=0; i&lt;count.value; i++) {
        !           205:          var menuitem = document.createElement(<span class="literal">"menuitem"</span>);
        !           206:          menuitem.setAttribute(<span class="literal">"label"</span>, prefs.getCharPref(childList[i]));
        !           207:          menuitem.setAttribute(<span class="literal">"id"</span>, childList[i]);
        !           208:          menuitem.setAttribute(<span class="literal">"value"</span>, childList[i]);
        !           209:          menuitem.setAttribute(<span class="literal">"type"</span>, <span class="literal">"radio"</span>);
        !           210:          menuitem.setAttribute(<span class="literal">"oncommand"</span>, <span class="literal">"toolbar.changeUser(this);"</span>);
        !           211:          <span class="reserved">if</span> (childList[i] == <span class="reserved">this</span>.getActiveUser()) {
        !           212:             menuitem.setAttribute(<span class="literal">"checked"</span>, <span class="literal">"true"</span>);
        !           213:          }
        !           214:          menu.appendChild(menuitem);
        !           215:       }
        !           216:    }
        !           217:    
        !           218:    <span class="comment">/**
        !           219:     * string representation
        !           220:     */</span>
        !           221:    <span class="reserved">this</span>.toString = <span class="reserved">function</span>() {
        !           222:       <span class="reserved">return</span> <span class="literal">"UserListPreference "</span> + <span class="reserved">this</span>.elementId + <span class="literal">" = "</span> + <span class="reserved">this</span>.getValueArray();
        !           223:    };
        !           224: } 
        !           225: <span class="comment">
        !           226: // inherit</span>
        !           227: UserListPreference.<span class="reserved">prototype</span> = new ListPreference();
        !           228: </pre>
        !           229: <!-- END SOURCECODE -->
        !           230: <HR>
        !           231: 
        !           232: 
        !           233: 
        !           234: 
        !           235: <!-- ========== START OF NAVBAR ========== -->
        !           236: <A NAME="navbar_top"><!-- --></A>
        !           237: <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
        !           238: <TR>
        !           239: <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
        !           240: <A NAME="navbar_top_firstrow"><!-- --></A>
        !           241: <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
        !           242:   <TR ALIGN="center" VALIGN="top">
        !           243:   
        !           244:   
        !           245:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><b>Overview</b></FONT></A>&nbsp;</TD>
        !           246:   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">        &nbsp;<FONT CLASS="NavBarFont1Rev"><b>File</b></FONT>&nbsp;</TD>
        !           247:   
        !           248: 
        !           249:   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
        !           250:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><b>Tree</b></FONT></A>&nbsp;</TD>
        !           251:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="index-all.html"--><FONT CLASS="NavBarFont1"><b>Index</b></FONT></A>&nbsp;</TD>
        !           252:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><b>Help</b></FONT></A>&nbsp;</TD>
        !           253:   </TR>
        !           254: </TABLE>
        !           255: </TD>
        !           256: <TD BGCOLOR="#EEEEFF" ALIGN="right" VALIGN="top"><EM>
        !           257: <b>autoform.mozdev.org</b></EM>
        !           258: </TD>
        !           259: </TR>
        !           260: 
        !           261: <TR>
        !           262: <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
        !           263: &nbsp;PREV&nbsp;
        !           264: &nbsp;NEXT</FONT></TD>
        !           265: <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
        !           266:   <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
        !           267: &nbsp;<A HREF="overview-summary.html" TARGET="_top"><B>NO FRAMES</B></A>
        !           268: &nbsp;&nbsp;
        !           269: <SCRIPT>
        !           270:   <!--
        !           271:   if(window==top) {
        !           272:     document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
        !           273:   }
        !           274:   //-->
        !           275: </SCRIPT>
        !           276: <NOSCRIPT>
        !           277: <A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
        !           278: </NOSCRIPT>
        !           279: </FONT></TD>
        !           280: </TR>
        !           281: </TABLE>
        !           282: <!-- =========== END OF NAVBAR =========== -->
        !           283: 
        !           284: <hr>
        !           285: <FONT SIZE="-1">
        !           286: 
        !           287: </FONT>
        !           288: <div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/">JSDoc</a> on Wed Mar 30 16:06:04 2005</div>
        !           289: </BODY>
        !           290: </HTML>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>