Getting work item layout in external Swing application
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.
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
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
Thank you for response.
I was trying use this API, but it wasn't work.
I'm doing this this way:
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?
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?
OK, i think i got it. just need to check if my approach is fine.
It's ok?
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?