This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 141001 - Try and isolate the DataLoader API usage in GSF
Summary: Try and isolate the DataLoader API usage in GSF
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: CSL (API & infrastructure) (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-21 14:56 UTC by emi
Modified: 2009-02-19 20:45 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
A new API class: DataLoadersBridge and refactored code to make use of it (33.91 KB, patch)
2008-07-21 14:58 UTC, emi
Details | Diff
New patch against the latest head (as of 22nd July) (48.52 KB, text/plain)
2008-07-23 13:10 UTC, emi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description emi 2008-07-21 14:56:40 UTC
GSF is using DataLoaders API in multiple places for quite simple scenarios. Mostly these seem to involve relationships
between JTextComponent <--> Document <--> FileObject and only in rare ocasions actual DataObject (for listeners as far
as I see and a few cookies).

I'd like to suggest that we isolate the DataLoaders access into a few methods in bridge class.

This will have the advantage that will reduce duplicate code across the GSF modules (copy-paste) and will also allow the
future decoupling of GSF from DataLoaders if needed.

My actual need is trying to make GSF usable in a standalone (outside the Platform) situation so DataLoaders usually gets
in the way. Having all this code in a separate place allows alternative implementations and stubbing out, reducing the
need to actually patch a lot of GSF classes.

Attaching the current patch for the GSF classes. Please note the new org.netbeans.modules.gsf.api.DataLoadersBridge
which hold the common methods.

Please note that not all DataLoaders usage has been moved. The are a few other that need changing (like
SourceFileObject, Source and LookupBasedSourceTaskFactory).
Comment 1 emi 2008-07-21 14:58:00 UTC
Created attachment 65133 [details]
A new API class: DataLoadersBridge and refactored code to make use of it
Comment 2 Vitezslav Stejskal 2008-07-23 10:31:57 UTC
Thanks for the patch Emilian.
Comment 3 emi 2008-07-23 13:10:01 UTC
Created attachment 65363 [details]
New patch against the latest head (as of 22nd July)
Comment 4 Torbjorn Norbye 2008-07-23 22:35:35 UTC
Thank you for the patch. I just applied it (changeset 52a83f34d7d9).
Comment 5 Martin Krauskopf 2009-02-02 14:31:17 UTC
'ruby/gsf -> editor/csl' mass-move to be able to deleted gsf/ruby. Having to
change the version and platform of all closed moved issues to the same due to
Issuezilla deficiencies - choosing version == 6.5 and TM = 7.0.