Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] overriding DsfSourceDisplayAdapter

Thanks Pawel !

That got rid of almost all copy and paste J

The only think I ended copying was the meat of : DsfSourceDisplayAdapter. LookupJob. performLookup().

I was wandering should I have delegated the default cases to CDebugModelPresentation getEditorId  and getEditorInput instead?

 

Dobrin

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Pawel Piech
Sent: Monday, July 26, 2010 6:40 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] overriding DsfSourceDisplayAdapter

 

DsfSourceDisplayAdapter will delegate to ISourcePresentation if there is one configured (see DsfSourceDisplayAdapter.java:198).  You can register an instance of ISourcePresentation as an adapter to the DSF session, along with all other session adapters.

Unfortunately linking APIs through the adapter mechanism is not very self documenting.  I added a little blurb to the javadoc about ISourcePresentation.

Cheers,
Pawel



On 07/26/2010 03:19 PM, Alexiev, Dobrin wrote:

We are using custom source lookup director too and it is being hooked up through our Source Lookup service.

I don’t understand how to get in my debugger the functionality provided by DsfSourceDisplayAdapter without completely copying it.

 

Which method of CDebugModelPresentation is to be used for the source lookup?

The only methods that are being used from this class with our DSF debugger is related to breakpoint icons.

I think the rest is hooked though the DSF adapters. We tried to stick to DSF as close as possible.

Maybe I’m missing some integration points?

 

Thanks

Dobrin

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Pawel Piech
Sent: Monday, July 26, 2010 5:35 PM
To: cdt-dev@xxxxxxxxxxx
Subject: Re: [cdt-dev] overriding DsfSourceDisplayAdapter

 

Wind river overrides the source not found editor by using a custom source lookup director, so that may be an option for you.  The other place where the source not found editor is referenced is in CDebugModelPresentation, would you be able to override this class instead?

Cheers,
Pawel

On 07/26/2010 01:12 PM, Alexiev, Dobrin wrote:

Hello,

 

I’d like to override the behavior of the buttons in the “pseudo editor” CSourceNotFoundEditor in our DSF debugger.

I contributed a new editor type that derives from CSourceNotFoundEditor and overrode few methods in it.

So far so good.

 

The problem I hit is DsfSourceDisplayAdapter is referencing the contribution of CSourceNotFoundEditor via the constant ICDebugUIConstants.CSOURCENOTFOUND_EDITOR_ID.

My first thought was to override parts of DsfSourceDisplayAdapter that are referencing the constant but that proved impossible.

I ended up copying the whole class DsfSourceDisplayAdapter plus three more classes in the same package – total of 1500+ lines of code.

 

Does it make sense to introduce a protected method getSourceNotFoundEditorId() inside DsfSourceDisplayAdapter so other debuggers can easily override the source not found editor?

I noticed that other DSF adapters as much better suited for overriding.

 

May be there is a better way to deliver this functionality?

 

I noticed that the Executable View also is referencing the constant ICDebugUIConstants.CSOURCENOTFOUND_EDITOR_ID.

Since I am not altering the workflow if the not found file is a translation unit, referencing the constant there is not an issue (yet).

 

Regards

Dobrin

 

 
 
_______________________________________________
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