Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



3 answers

Permanent link
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

0 votes


Permanent link
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?

0 votes


Permanent link
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?

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,943

Question asked: Jan 12 '10, 2:49 p.m.

Question was seen: 5,370 times

Last updated: Jan 12 '10, 2:49 p.m.

Confirmation Cancel Confirm