Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] Customize memory monitor label


Hi Jan,

The post referenced here is quite old.  The solution proposed works for the old implementation of the Memory View.  This old implementation is based off the flexible hierarchy framework introduced in Eclipse 3.2 time frame.  In this implementation, you can customize the memory block label using IAsynchronousLabelAdapter.  The Memory View has since been rewritten to adopt a newer flexible hierarchy implementation, introduced in Eclipse 3.3.  In this newer implementation you can override the label by using an adapter to IElementLabelProvider.  IElementLabelProvider is the replacement class for IAsynchronousLabelAdapter.

Hope this helps...

Samantha



From: Jan Scherer <jan.scherer@xxxxxxxxxxxxxx>
To: platform-debug-dev@xxxxxxxxxxx
Date: 29/07/2009 02:46 PM
Subject: [platform-debug-dev] Customize memory monitor label
Sent by: platform-debug-dev-bounces@xxxxxxxxxxx





Hi,

I have a question about a problem which has been posted some time
ago.(see below or
http://dev.eclipse.org/mhonarc/lists/platform-debug-dev/msg01042.html)

Unfortunately I was not able to manage with the proposed solution. I had
the impression that #getAdapter() would eventually be asked for an
IAsynchronousLabelAdapter, but this is not the case somehow. The
#getAdapter() Method does get asked for an IElementLabelProvider and
when I return a customized DebugElementLabelProvider I am actually able
to change the label of the memory monitor (displayed on the left side)
to whatever I want.

Although I somehow managed with my problem, I would like to understand
why the proposed solution did not work. I would very much appreciate it
if someone could provide more details.

Best regards,
Jan.


The posted problem:

> It appears that the text for the memory monitors is the _expression_
> used to create the monitor (in my case a memory address). Is it
> possible to override so that I can provide more descriptive text to my
> user? For example, the memory location (which I add programmatically)
> has an address (0x12345678) and a name (such as "Video memory"). I
> would like "Video memory" to be displayed.


>> 2.  To customize the labels from the tree view pane, you need to
>> provide your own label adapter to your memory block.  From your
>> memory block, override the #getAdapter() method and return an
>> IAsynchronousLabelAdapter when needed.  The label adapter will be
>> called whenever the memory block's label is needed from the Memory
>> View. For an example implementation of the label adapter, look at
>> MemoryBlockLabelAdapter.  (Please note that there are other ways of
>> providing adapters to your debug elements.  You may want to look at
>> the tutorial form EclipseCon to figure out which way is best for
>> you.)
_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-debug-dev



Back to the top