How to read project name in AttributePart
4 answers
If your code is in server side, you can use:
IRepositoryItemService.fetchItem() to get the project area.
If your code is in eclipse client side, you can use
IItemManager.fetchCompleteItems() to get the project area. You can use
ITeamRepository.itemManager() to get the item manager instance.
Hi,
Thanks for the answer but I still cannot fill the gaps. I am rephrasing my question:
I am in client side and extending presentation pf a workitem attribute
(com.ibm.team.workitem.ide.ui.internal.editor.presentations.AttributePart )
What I need is to read the name of project area.
I am able to get IProjectAreaHandle.
I am asking an example of reading project area name from IProjectAreaHandle.
Below is my method that gets IProjectAreaHandle:
private String getProjectAreaName() {
String projectAreaName = "";
IAttribute ia = getAttribute();
IProjectAreaHandle ph = ia.getProjectArea();
//set projectAreaName
return projectAreaName;
}
Hi Andre thanks for your effort but my question was how to resolve IProjectAreaHandle to a IProjectArea.
Here is the answer we found by digging the API:
fWorkingCopy is WorkItemEditorInput's working copy.
Here is the answer we found by digging the API:
fWorkingCopy is WorkItemEditorInput's working copy.
private String getComponentName() {
ITeamRepository tRepo = fWorkingCopy.getTeamRepository();
IAttribute ia = getAttribute();
IProjectAreaHandle ph = ia.getProjectArea();
IItemManager im = tRepo.itemManager();
IProjectArea pa = (IProjectArea)im.fetchCompleteItem(ph, 0, null);
return pa.getName();
}