[ 
http://jira.xwiki.org/jira/browse/XECLIPSE-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_19146
 ] 

Fabio Mancinelli commented on XECLIPSE-30:
------------------------------------------

Added standard Eclipse Workbench adapters for all model elements:

XWikiConnectionAdapter
XWikiSpaceAdapter
XWikiPageAdapter

Now labels and images are provided directly by these adapter. The previously 
used methods getText() and getImage() have been removed from model elements and 
from the old TreeAdapter interface (...that is going to be removed in next 
refactorings)

The old label provider is now unnecessary and it has been removed.

Done in Revision: 5365
* Added adapters for model elements.
* Removed getText() and getImage() methods from all model elements, now labels 
and images are provided directly by adapters.
* Removed XWikiNavigatorLabelProvider and used the standard 
WorkbenchLabelProvider for the XWikiNavigator tree viewer.
* Removed getText() and getImage() from TreeAdapter (that is going to be 
removed with next refactorings)

> Design improvements and refactoring
> -----------------------------------
>
>                 Key: XECLIPSE-30
>                 URL: http://jira.xwiki.org/jira/browse/XECLIPSE-30
>             Project: XWiki Eclipse Integration
>          Issue Type: Task
>          Components: Build, Test and Packaging
>    Affects Versions: 1.0 M2, 1.0
>            Reporter: Fabio Mancinelli
>         Assigned To: Fabio Mancinelli
>
> Refactor XEclipse in order to leverage Eclipse platform's features that 
> (...that to some extent, have been re-implemented in XEclipse)
> 1) Deferred tree content managers.
> Basically a deferred tree content manager allows you to "fetch" tree children 
> in a deferred way.
> One example is the "SVN Repository" or "CVS Repository" views in your Eclipse 
> IDE. When you expand a node it displays a "Pending..." element
> and, when the fetching job is over, the actual elements (i.e., files and 
> directories available on the repository) are displayed.
> The same mechanism could be used in XEclipse to fetch Spaces and Pages.
> Using the deferred tree content fetching mechanism eliminates the need of 
> having additional logic in XWikiSpace for understanding when pages are ready 
> (i.e., all the code that manages isPagesReady in XWikiSpace.java). You will 
> simply have a method getPages that could take possibly forever and that 
> directly fetches the pages from the XMLRPC source (or from the offline cache).
> I think that this will also have impact on the Decorators that are used to 
> wrap XWiki* elements in order to provide a visual feedback on what's going on 
> (i.e., all the GuiUtils.runOperationWithProgress will be unnecessary since 
> the deferred tree content manager will take care of everything)
> 2) Adapters
> There is a TreeAdapter interface that is used for providing labels, children 
> and so on.
> All classes that can be "displayed" in a tree implements this interface 
> (i.e., XWikiConnection, XWikiPage, XWikiSpace).
> I this "pollutes" the model because, for example, getPages and 
> getTreeChildren basically return the same thing and, therefore, are 
> duplicated methods. Moreover in this way we put "GUI"-oriented stuff in the 
> model and this is not good.
> The Eclipse platform has a mechanism for providing adapters that are able to 
> give information about model elements to GUI components[2].
> When you need structural information about an object, you can then query the 
> platform for an adapter that matches a given interface and is suitable for a 
> given object. In our case I can register an adapter for XWikiSpace that 
> implements the getChildren method and that will simply call the getPages 
> method of the XWikiSpace model object.
> In this way we can clearly separate the "GUI" code from the "model" code and 
> leave Eclipse handle the rest.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.xwiki.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to