It's all about the answers!

Ask a question

Custom Editor Presentations sample missing method, help?! Solved


sam detweiler (12.4k6175200) | asked May 02 '13, 5:39 p.m.
edited May 03 '13, 1:32 p.m.
In the wiki page for custom presentation development, the sample Star application uses a method call in addListeners() that is not found with the 3.0.1.1 sdk classes..

<code>
private void addListeners() {
   PresentationHandlerManager mgr= (PresentationHandlerManager) getSite().getAdapter(PresentationHandlerManager.class);
   if (mgr != null) {
      mgr.addPresentationUpdater(fPresentationUpdater, getDescriptor());
   }
}</code>
anyone know what this should be replaced with?
it appears in some of the other code to be
getPresentation();

4 answers



permanent link
sam detweiler (12.4k6175200) | answered May 02 '13, 6:41 p.m.
but I get an exception
java.lang.NoSuchMethodError: com.ca.extensions.DeliverableFromWorkitem.getPresentation()Lcom/ibm/team/workitem/common/internal/presentations/PresentationDescriptor;
on that call.

I find it interesting that this class is com/ibm/team/workitem/common/internal/
is not the same one where this method is defined.
com/ibm/team/workitem/ide/ui/internal/presentations

I restarted the test eclipse clean, but still see this same error

permanent link
sam detweiler (12.4k6175200) | answered May 02 '13, 11:18 p.m.
the Star Sample fails the same after changing the getDescriptor() to getPresentation()

permanent link
sam detweiler (12.4k6175200) | answered May 03 '13, 12:50 p.m.
anybody?  trying to run the samples on 3.0.1.1, it doesn't compile
and changing to what appears to be the same code in the official object type parts
yields a 'no such function' exception.. yes, duh,  its looking in the wrong class tree

com/ibm/team/workitem/common/internal/  - not here
instead of
com/ibm/team/workitem/ide/ui/internal/presentations -- its here

permanent link
sam detweiler (12.4k6175200) | answered May 03 '13, 1:35 p.m.
Resolution:

when I built the projects, both mine and the sample, I have V4 SDK selected as the plugin target platform.

and altho I changed it, it did not actually change. (even tho the code compiled ok).

when I changed it from 3.0.1.1 to 3.0.1, then suddenly everything reset.
now the sample works and my code does not crash..

Your answer


Register or to post your answer.