Discussion:
[gui-dev] ResultPanel constructor
M. Vernier
2004-09-23 17:14:40 UTC
Permalink
Ok, I am puzzled with the code. I need the media type used in a search in
order to instantiate different types of columns (audio, video…) for the
results.

The media type is accessible from “info”.

The columns are instantiated in the constructor of ResultPanelModel and
ResultPanelModel itself is instantiated in the contructor of the super-class
of ResultPanel: AbstractTableMediator.

I wanted to put SearchInformation as a parameter of the constructor of
AbstractTableMediator but AbstractTableMediator is supposed to be generic
and other panels inherit from it, not just ResultPanel.

How can I access info from ResultPanel::setupConstants?



/**

* Constructs a new ResultPanel for search results.

*

* @param guid the guid of the query. Used to match results.

* @param info the info of the search

*/

ResultPanel(GUID guid, SearchInformation info) {

super("SEARCH_TABLE");

SEARCH_INFO = info;

this.guid = guid;

setupRealTable();

}
M. Vernier
2004-09-24 16:19:24 UTC
Permalink
I found a workaround for the problem mentioned in my last post without
modifying too much of AbstractTableMediator. I plan to save the settings for
each column by overriding the corresponding methods of
DefaultColumnPreferenceHandler in SearchColumnPreferenceHandler. I would
still retrieve the id for each column but they would be prefixed by the type
of search.

Example: col.GetId() returns “RESULT_PANEL_QUALITY”, I will prefix it with
“AUDIO_” for an audio search. The preference would be saved as
“AUDIO_RESULT_PANEL_QUALITY”.

Default values for visibility, order and width will be provided by xml files
that would follow a common schema.
Sam Berlin
2004-09-24 16:45:30 UTC
Permalink
That sounds like a good workaround!

Thanks,
Sam
Post by M. Vernier
I found a workaround for the problem mentioned in my last post without
modifying too much of AbstractTableMediator. I plan to save the
settings for each column by overriding the corresponding methods of
DefaultColumnPreferenceHandler in SearchColumnPreferenceHandler. I
would still retrieve the id for each column but they would be prefixed
by the type of search.
Example: col.GetId() returns “RESULT_PANEL_QUALITY”, I will prefix it
with “AUDIO_” for an audio search. The preference would be saved as
“AUDIO_RESULT_PANEL_QUALITY”.
Default values for visibility, order and width will be provided by xml
files that would follow a common schema.
_______________________________________________
gui-dev mailing list
http://www.limewire.org/mailman/listinfo/gui-dev
Philippe Verdy
2004-09-24 18:35:46 UTC
Permalink
I have added a complete check of MessageBundles to detect dead/removed or
invalid/incorrectly spelled resource keys.
This is now in CountPercent.java. (run "java CountPercent check").

Also the new version now really works with .UTF-8 files rather than
generated .properties files, because it's simpler to run this tool after
modifying the actual UTF-8 source files rather than having to run
native2ascii each time after changes.

I used it to clean up all message bundles, correcting some resource keys
that were incorrectly spelled.
The status page for limewire.org should now be regenerated with "java
CountPercent html > translate.shtml" as before, as it better reflects the
current translation status.

I will next include some other checks, and possibly a template-based
regeneration that will avoid lots of manual editing.

Loading...