Annotation of autoform/www/jsdoc/overview-summary-preferences_PreferencesService.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/PreferencesService.js</H2>
        !            71: 
        !            72: </CENTER>
        !            73:         
        !            74:             
        !            75:         
        !            76:         
        !            77:         <h4>Summary</h4>
        !            78:         <p>
        !            79:         
        !            80:            No overview generated for 'preferences/PreferencesService.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:  * Handles diffrent context sensible
        !           129:  * preferences. Provides generic 
        !           130:  * methods and is parent class of all
        !           131:  * other preference elements.
        !           132:  *
        !           133:  * <span class="attrib">@constructor</span>
        !           134:  */</span>
        !           135: <span class="reserved">function</span> PreferencesService() {
        !           136: <span class="comment">
        !           137:    // initialize preferences</span>
        !           138:    <span class="reserved">this</span>.preferenceService = Components.classes[<span class="literal">"@mozilla.org/preferences-service;1"</span>].getService(Components.interfaces.nsIPrefService);
        !           139:    <span class="reserved">this</span>.autoformPreferences = <span class="reserved">this</span>.preferenceService.getBranch(<span class="literal">"extensions.autoform."</span>);
        !           140: <span class="comment">
        !           141:    // load string bundle</span>
        !           142:    <span class="reserved">this</span>.stringBundle = new StringBundle();
        !           143:    
        !           144:    <span class="comment">/**
        !           145:     * returns the active (selected) user
        !           146:     */</span>
        !           147:    <span class="reserved">this</span>.getActiveUser = <span class="reserved">function</span>() {
        !           148:       try {
        !           149:          <span class="reserved">return</span> <span class="reserved">this</span>.autoformPreferences.getCharPref(<span class="literal">"autoform-activeuser"</span>);
        !           150:       } catch(e) {
        !           151: <span class="comment">         // default user</span>
        !           152:          <span class="reserved">this</span>.autoformPreferences.setCharPref(<span class="literal">"autoform-activeuser"</span>, <span class="literal">"autoform-userList0"</span>);
        !           153:          <span class="reserved">this</span>.autoformPreferences.setCharPref(<span class="literal">"autoform-userList.autoform-userList0"</span>, <span class="literal">"Default"</span>);
        !           154:          <span class="reserved">return</span> <span class="literal">"autoform-userList0"</span>
        !           155:       }
        !           156:    };
        !           157:    
        !           158:    <span class="comment">/**
        !           159:     * returns the active users branch
        !           160:     */</span>
        !           161:    <span class="reserved">this</span>.getUserPreferenceStore = <span class="reserved">function</span>() {
        !           162:       <span class="reserved">return</span> <span class="reserved">this</span>.preferenceService.getBranch(<span class="literal">"extensions.autoform."</span> + <span class="reserved">this</span>.getActiveUser() + <span class="literal">"."</span>); 
        !           163:    };   
        !           164: 
        !           165:    <span class="comment">/**
        !           166:     * returns a subbranch of the active users branch
        !           167:     */</span>
        !           168:    <span class="reserved">this</span>.getUserPreferenceStoreBranch = <span class="reserved">function</span>(name) {
        !           169:       <span class="reserved">return</span> <span class="reserved">this</span>.preferenceService.getBranch(<span class="literal">"extensions.autoform."</span> + <span class="reserved">this</span>.getActiveUser() + <span class="literal">"."</span> + name + <span class="literal">"."</span>); 
        !           170:    }; 
        !           171: 
        !           172:    <span class="comment">/**
        !           173:     * returns the main branch
        !           174:     */</span>
        !           175:    <span class="reserved">this</span>.getPreferenceStore = <span class="reserved">function</span>() {
        !           176:       <span class="reserved">return</span> <span class="reserved">this</span>.autoformPreferences;
        !           177:    };   
        !           178: 
        !           179:    <span class="comment">/**
        !           180:     * returns a subbranch of the main branch
        !           181:     */</span>
        !           182:    <span class="reserved">this</span>.getPreferenceStoreBranch = <span class="reserved">function</span>(name) {
        !           183:       <span class="reserved">return</span> <span class="reserved">this</span>.preferenceService.getBranch(<span class="literal">"extensions.autoform."</span> + name + <span class="literal">"."</span>); 
        !           184:    }; 
        !           185:       
        !           186:    <span class="comment">/**
        !           187:     * string representation
        !           188:     */</span>
        !           189:    <span class="reserved">this</span>.toString = <span class="reserved">function</span>() {
        !           190:       <span class="reserved">return</span> <span class="literal">"PreferencesService"</span>;
        !           191:    };
        !           192: } 
        !           193: 
        !           194: </pre>
        !           195: <!-- END SOURCECODE -->
        !           196: <HR>
        !           197: 
        !           198: 
        !           199: 
        !           200: 
        !           201: <!-- ========== START OF NAVBAR ========== -->
        !           202: <A NAME="navbar_top"><!-- --></A>
        !           203: <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
        !           204: <TR>
        !           205: <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
        !           206: <A NAME="navbar_top_firstrow"><!-- --></A>
        !           207: <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
        !           208:   <TR ALIGN="center" VALIGN="top">
        !           209:   
        !           210:   
        !           211:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><b>Overview</b></FONT></A>&nbsp;</TD>
        !           212:   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">        &nbsp;<FONT CLASS="NavBarFont1Rev"><b>File</b></FONT>&nbsp;</TD>
        !           213:   
        !           214: 
        !           215:   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
        !           216:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><b>Tree</b></FONT></A>&nbsp;</TD>
        !           217:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="index-all.html"--><FONT CLASS="NavBarFont1"><b>Index</b></FONT></A>&nbsp;</TD>
        !           218:   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><b>Help</b></FONT></A>&nbsp;</TD>
        !           219:   </TR>
        !           220: </TABLE>
        !           221: </TD>
        !           222: <TD BGCOLOR="#EEEEFF" ALIGN="right" VALIGN="top"><EM>
        !           223: <b>autoform.mozdev.org</b></EM>
        !           224: </TD>
        !           225: </TR>
        !           226: 
        !           227: <TR>
        !           228: <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
        !           229: &nbsp;PREV&nbsp;
        !           230: &nbsp;NEXT</FONT></TD>
        !           231: <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
        !           232:   <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
        !           233: &nbsp;<A HREF="overview-summary.html" TARGET="_top"><B>NO FRAMES</B></A>
        !           234: &nbsp;&nbsp;
        !           235: <SCRIPT>
        !           236:   <!--
        !           237:   if(window==top) {
        !           238:     document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
        !           239:   }
        !           240:   //-->
        !           241: </SCRIPT>
        !           242: <NOSCRIPT>
        !           243: <A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
        !           244: </NOSCRIPT>
        !           245: </FONT></TD>
        !           246: </TR>
        !           247: </TABLE>
        !           248: <!-- =========== END OF NAVBAR =========== -->
        !           249: 
        !           250: <hr>
        !           251: <FONT SIZE="-1">
        !           252: 
        !           253: </FONT>
        !           254: <div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/">JSDoc</a> on Wed Mar 30 16:06:04 2005</div>
        !           255: </BODY>
        !           256: </HTML>

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