Re: [skinlf-dev] Follow-up on laf-plugin proposal

Kirill Grouchnikov <[email protected]> Sun, 19 Feb 2006 04:09:59 -0800 (PST)
Newsgroups gmane.comp.java.skinlf.devel
Message-ID <[email protected]>
--0-1108850728-1140350999=:93704
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi, everybody

Following Frederic's suggestion, the newly posted version of laf-plugin contains common functionality for each one of the five functions:

    /**
     * Helper function to initialize all available plugins of <code>this</code>
     * plugin manager. Calls the {@link LafPlugin#initialize()} of all available
     * plugins.
     */
    public void initializeAll() {

    /**
     * Helper function to reset all available plugins of <code>this</code>
     * plugin manager. Calls the {@link LafPlugin#reset()} of all available
     * plugins.
     */
    public void resetAll() {

    /**
     * Helper function to process the UI delegates of all available plugins of
     * <code>this</code> plugin manager. Calls the
     * {@link LafPlugin#getUiDelegates()} of all available plugins and puts the
     * respective results in the specified table.
     * 
     * @param table
     *            The table that will be updated with the UI delegates of all
     *            available plugins.
     */
    public void processAllUiDelegateEntries(UIDefaults table) {

    /**
     * Helper function to process the font settings of all available plugins of
     * <code>this</code> plugin manager. Calls the
     * {@link LafPlugin#getFonts()} of all available plugins and puts the
     * respective results in the specified table.
     * 
     * @param table
     *            The table that will be updated with the font settings of all
     *            available plugins.
     */
    public void processAllFontEntries(UIDefaults table) {

    /**
     * Helper function to process the (possibly) theme-dependent default
     * settings of all available plugins of <code>this</code> plugin manager.
     * Calls the {@link LafPlugin#getDefaults(Object)} of all available plugins and
     * puts the respective results in the specified table.
     * 
     * @param table
     *            The table that will be updated with the (possibly)
     *            theme-dependent default settings of all available plugins.
     * @param themeInfo
     *            LAF-specific information on the current theme.
     */
    public void processAllDefaultsEntries(UIDefaults table, Object themeInfo) {

Let me know if you wish to have additional functionality.

Regards
Kirill

Fr�d�ric Lavigne <[email protected]> wrote: Hi Kirill,

I worked on it but did not commit the code yet. I copied the code  
from the LiquidLnf.

I have the following questions though regarding the integration:

* about initialize() and reset(), should I call both of them in  
LookAndFeel#initialize or only the first?

* what is the recommended approach? one static PluginManager (as done  
in LiquidLnf) or one PluginManager instance as member of the  
LookAndFeel subclass?

* why separate getFonts() and getDefaults() methods?

* plugin.getDefaults takes as parameter a themeInfo so the plugin  
developer can specify different "defaults" based on the current  
theme. Why getFonts and even getUIDelegates do not follow the same  
scheme?

* I had to copy a bunch of code from the LiquidLnf and did not have  
to make any changes to the copied code. Maybe the PluginManager could  
provide more helper methods like "initializeAvailablePlugins()",  
"resetAvailablePlugins()", "populateDefaultsFromPlugins(UIDefaults  
defaults)"... I mean all kinds of methods which would make the  
integration even easier. With this method I would just declare a  
PluginManager then call one of its method in my LookAndFeel  
initialize, initComponentDefaults, initClassDefaults, ... I checked  
the SquarenessLookAndFeel and it also duplicates this code.

regards,
-fred

On Feb 16, 2006, at 10:29 PM, Kirill Grouchnikov wrote:

> Frederic,
>
> We have spoken about two months ago on possible adoption of laf- 
> plugin [1] in this project. Has this ever come to the list of  
> things to-do or should i drop this subject entirely?
>
> Thanks
> Kirill
>
> [1] https://laf-plugin.dev.java.net
>
>
> What are the most popular cars? Find out at Yahoo! Autos


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
--0-1108850728-1140350999=:93704
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi, everybody<br><br>Following Frederic's suggestion, the newly posted version of laf-plugin contains common functionality for each one of the five functions:<br><br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp; &nbsp;* Helper function to initialize all available plugins of &lt;code&gt;this&lt;/code&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;* plugin manager. Calls the {@link LafPlugin#initialize()} of all available<br>&nbsp;&nbsp;&nbsp; &nbsp;* plugins.<br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; public void initializeAll() {<br><br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp; &nbsp;* Helper function to reset all available plugins of &lt;code&gt;this&lt;/code&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;* plugin manager. Calls the {@link LafPlugin#reset()} of all available<br>&nbsp;&nbsp;&nbsp; &nbsp;* plugins.<br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; public void resetAll() {<br><br>&nbsp;&
 nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp; &nbsp;* Helper function to process the UI delegates of all
 available plugins of<br>&nbsp;&nbsp;&nbsp; &nbsp;* &lt;code&gt;this&lt;/code&gt; plugin manager. Calls the<br>&nbsp;&nbsp;&nbsp; &nbsp;* {@link LafPlugin#getUiDelegates()} of all available plugins and puts the<br>&nbsp;&nbsp;&nbsp; &nbsp;* respective results in the specified table.<br>&nbsp;&nbsp;&nbsp; &nbsp;* <br>&nbsp;&nbsp;&nbsp; &nbsp;* @param table<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The table that will be updated with the UI delegates of all<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; available plugins.<br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; public void processAllUiDelegateEntries(UIDefaults table) {<br><br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp; &nbsp;* Helper function to process the font settings of all available plugins of<br>&nbsp;&nbsp;&nbsp; &nb
 sp;* &lt;code&gt;this&lt;/code&gt; plugin manager. Calls the<br>&nbsp;&nbsp;&nbsp; &nbsp;* {@link
 LafPlugin#getFonts()} of all available plugins and puts the<br>&nbsp;&nbsp;&nbsp; &nbsp;* respective results in the specified table.<br>&nbsp;&nbsp;&nbsp; &nbsp;* <br>&nbsp;&nbsp;&nbsp; &nbsp;* @param table<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The table that will be updated with the font settings of all<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; available plugins.<br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; public void processAllFontEntries(UIDefaults table) {<br><br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp; &nbsp;* Helper function to process the (possibly) theme-dependent default<br>&nbsp;&nbsp;&nbsp; &nbsp;* settings of all available plugins of &lt;code&gt;this&lt;/code&gt; plugin manager.<br>&nbsp;&nbsp;&nbsp; &nbsp;* Calls the {@link LafPlugin#getDefaults(Objec
 t)} of all available plugins and<br>&nbsp;&nbsp;&nbsp; &nbsp;* puts the respective results in the
 specified table.<br>&nbsp;&nbsp;&nbsp; &nbsp;* <br>&nbsp;&nbsp;&nbsp; &nbsp;* @param table<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The table that will be updated with the (possibly)<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theme-dependent default settings of all available plugins.<br>&nbsp;&nbsp;&nbsp; &nbsp;* @param themeInfo<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LAF-specific information on the current theme.<br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; public void processAllDefaultsEntries(UIDefaults table, Object themeInfo) {<br><br>Let me know if you wish to have additional functionality.<br><br>Regards<br>Kirill<br><br><b><i>Fr�d�ric Lavigne &lt;[email protected]&gt;</i></b> wrote:<blockquote class="replb
 q" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi
 Kirill,<br><br>I worked on it but did not commit the code yet. I copied the code  <br>from the LiquidLnf.<br><br>I have the following questions though regarding the integration:<br><br>* about initialize() and reset(), should I call both of them in  <br>LookAndFeel#initialize or only the first?<br><br>* what is the recommended approach? one static PluginManager (as done  <br>in LiquidLnf) or one PluginManager instance as member of the  <br>LookAndFeel subclass?<br><br>* why separate getFonts() and getDefaults() methods?<br><br>* plugin.getDefaults takes as parameter a themeInfo so the plugin  <br>developer can specify different "defaults" based on the current  <br>theme. Why getFonts and even getUIDelegates do not follow the same  <br>scheme?<br><br>* I had to copy a bunch of code from the LiquidLnf and did not have  <br>to make any changes to the copied code. Maybe the PluginManager co
 uld  <br>provide more helper methods like "initializeAvailablePlugins()", 
 <br>"resetAvailablePlugins()", "populateDefaultsFromPlugins(UIDefaults  <br>defaults)"... I mean all kinds of methods which would make the  <br>integration even easier. With this method I would just declare a  <br>PluginManager then call one of its method in my LookAndFeel  <br>initialize, initComponentDefaults, initClassDefaults, ... I checked  <br>the SquarenessLookAndFeel and it also duplicates this code.<br><br>regards,<br>-fred<br><br>On Feb 16, 2006, at 10:29 PM, Kirill Grouchnikov wrote:<br><br>&gt; Frederic,<br>&gt;<br>&gt; We have spoken about two months ago on possible adoption of laf- <br>&gt; plugin [1] in this project. Has this ever come to the list of  <br>&gt; things to-do or should i drop this subject entirely?<br>&gt;<br>&gt; Thanks<br>&gt; Kirill<br>&gt;<br>&gt; [1] https://laf-plugin.dev.java.net<br>&gt;<br>&gt;<br>&gt; What are the most popular cars? Find out at Yaho
 o! Autos<br><br><br>---------------------------------------------------------------------<br>To
 unsubscribe, e-mail: [email protected]<br>For additional commands, e-mail: [email protected]<br><br></blockquote><br><p>
		<hr size=1>Relax. Yahoo! Mail 
<a href="http://us.rd.yahoo.com/mail_us/taglines/virusall/*http://communications.yahoo.com/features.php?page=221">virus scanning</a> helps detect nasty viruses!
--0-1108850728-1140350999=:93704--