It's all about the answers!

Ask a question

Getting work item layout in external Swing application


Pawel Dolecinski (26163) | asked Jan 12 '10, 2:49 p.m.
Hello,

I'm writting a Swing application which extends RTC and i need to run work item query, open some work items from results, modify and save them. It will be exactly like in Eclipse client. And i've got a problem with work item layout.
How can i get information about what tabs, sections and presentations in sections should be shown? This information i can set in process configuration, so my JPanel shouldn't be constant. I found some information about how contributing attribute presentations, but only in Eclipse and Web UI. How can I get this informations using only Plain Java API?

Regards,
Pawel Dolecinski.

3 answers



permanent link
Patrick Streule (4.9k21) | answered Jan 14 '10, 5:38 a.m.
JAZZ DEVELOPER
I'm writting a Swing application which extends RTC and i need to run
work item query, open some work items from results, modify and save
them. It will be exactly like in Eclipse client. And i've got a
problem with work item layout.
How can i get information about what tabs, sections and presentations
in sections should be shown? This information i can set in process
configuration, so my JPanel shouldn't be constant. I found some
information about how contributing attribute presentations, but only
in Eclipse and Web UI. How can I get this informations using only
Plain Java API?

We don't have public API for this. The internal API is:
com.ibm.team.workitem.common.internal.WorkItemCommon.getEditorPresentation(IWorkItem,
IProgressMonitor)

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Pawel Dolecinski (26163) | answered Feb 05 '10, 6:48 p.m.
Thank you for response.
I was trying use this API, but it wasn't work.

I'm doing this this way:

EditorPresentation editor = workItemCommon.getEditorPresentation(wi,null);
Map<String,List<AbstractPresentationDescriptor>> presen = editor.getPresentationsMap();
List<AbstractPresentationDescriptor> list = presen.get("com.ibm.team.workitem.tab.overview");

for (AbstractPresentationDescriptor it : list) {
System.out.println("+ "+it.getElementId());
System.out.println("++"+((SectionDescriptor)it).getTitle());
Map<String> map = ((SectionDescriptor)it).getProperties();
System.out.println(map.isEmpty());
}


and i've got title of section, but list of properties in section is empty. what i'm doing wrong? or maybe i should get it from somewhere else?

permanent link
Pawel Dolecinski (26163) | answered Feb 05 '10, 8:31 p.m.
OK, i think i got it. just need to check if my approach is fine.


List<AbstractPresentationDescriptor> list = editor
.getPresentationsMap().get(editor.getEditorLayout());
for (AbstractPresentationDescriptor it : list) {
System.out.println(it.getElementId());
List<AbstractPresentationDescriptor> list2 = editor
.getPresentationsMap().get(it.getElementId());

for (AbstractPresentationDescriptor it2 : list2) {

System.out.println("\t * "
+ ((SectionDescriptor) it2).getTitle() + " -- "
+ it2.getElementId());

List<AbstractPresentationDescriptor> list3 = editor
.getPresentationsMap().get(it2.getElementId());
if (list3 == null)
continue;
for (AbstractPresentationDescriptor it3 : list3) {
if (((PresentationDescriptor) it3).getAttributeId() != null) {
System.out.println("\t\t -- Attr: "
+ ((PresentationDescriptor) it3)
.getAttributeId());
} else {
System.out.println("\t\t ** "
+ ((PresentationDescriptor) it3)
.getElementId());
}
}
System.out.println();
}
}


It's ok?

Your answer


Register or to post your answer.