Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] CElements adapting to IResource

Hi Chris,
that's actually what I meant to do. ITranslationUnits shall remain to
be adaptable to IFile, but not ICElements like IFunction, IVariable,
etc. 
Markus.


> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Chris Recoskie
> Sent: Mittwoch, 23. August 2006 14:27
> To: CDT General developers list.
> Subject: Re: [cdt-dev] CElements adapting to IResource
> 
> The thing to be careful about is object contributions.  The 
> extension point
> for them has an "isAdaptable" flag or something like that (I 
> forget the
> exact details), that allows your action to show up for any 
> object adaptable
> to IResource.  If you change this, then such actions won't show up for
> translation units etc.  It is pretty common for a lot of 
> tools to provide
> their actions this way.  E.g., a Team provider would generally need to
> operate on any kind of file in the workspace, so I would 
> expect them to use
> this method to provide source control actions.
> 
> I wonder if it wouldn't make more sense to have the the 
> adaptation only
> work for the implementors of ICElement that make sense to adapt to
> IResource.  There is nothing saying that every ICElement has 
> to allow the
> adaptation.
> 
> ===========================
> 
> Chris Recoskie
> Team Lead, IBM CDT Team
> IBM Toronto
> http://www.eclipse.org/cdt
> 
> 
> 
>                                                               
>              
>              "Schorn, Markus"                                 
>              
>              <Markus.Schorn@wi                                
>              
>              ndriver.com>                                     
>           To 
>              Sent by:                  "CDT General 
> developers list."      
>              cdt-dev-bounces@e         <cdt-dev@xxxxxxxxxxx>  
>              
>              clipse.org                                       
>           cc 
>                                                               
>              
>                                                               
>      Subject 
>              23/08/2006 05:37          [cdt-dev] CElements 
> adapting to     
>              AM                        IResource              
>              
>                                                               
>              
>                                                               
>              
>              Please respond to                                
>              
>                "CDT General                                   
>              
>              developers list."                                
>              
>              <cdt-dev@eclipse.                                
>              
>                    org>                                       
>              
>                                                               
>              
>                                                               
>              
> 
> 
> 
> 
> Hi,
> currently most of the CElements can be adapted to IResources. 
> This makes
> perfectly sense for translation units, folders or projects. 
> However, it
> is problematic for others as the context menu of classes, functions,
> vars,
> etc. gets populated with actions that apply for files, only.
> For example select a function in the CView and choose 'Delete' from
> the context menu. This deletes the entire file.
> 
> I plan to change that. Doing so it is possible that I break code that
> obtains the enclosing resource from an ICElement by means of the
> adaptable
> mechanism rather than using a direct call to ICElement.getResource().
> I believe we have enough time until 4.0 to find all related 
> problems and
> 
> fix them.
> 
> Is that ok for you?
> Markus.
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top