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

How to fetch enumaraion values for plug form dropdown.

Hi,

i want to display custom enumaration values into my plugin form.

How can i fetch all the enumaration values from my project area.




Thanks,

Glory

0 votes



3 answers

Permanent link
Hi,

this might be helpful. In general you can search the PDE and Eclipse in general for things. E.g. if you find return values in the API, select the type and press F3 (search for references) or open the for declarations and search for references there.

There are also numerous posts that you can search for examples: https://jazz.net/search_results.jsp?q=#page=0&type=type%3DDocument-ForumThread&q=enumeration%20ILiteral


private static Identifier<extends> getLiteralStartsWithString(
String name, IWorkItemCommon workItemCommon, IAttributeHandle ia)
throws TeamRepositoryException {
Identifier<extends> literalID = null;
IEnumeration<extends> enumeration = workItemCommon
.resolveEnumeration(ia, null);

List<extends> literals = enumeration
.getEnumerationLiterals();
for (Iterator<extends> iterator = literals.iterator(); iterator
.hasNext();) {
ILiteral iLiteral = (ILiteral) iterator.next();
if (iLiteral.getName().startsWith(name)) {
literalID = iLiteral.getIdentifier2();
break;
}
}
return literalID;
}

0 votes


Permanent link
Hi ,

Thank you for your response.

I have found the solution for this.

Check my code below.


public static String[] getEnumarationList(String attributeName) throws TeamRepositoryException {

String[] list = null;

IProgressMonitor monitor = new NullProgressMonitor();
IAttribute attribute= workItemClient.findAttribute(projectArea,attributeName, monitor );
IEnumeration<ILiteral> enumeration;
int i =0;
try {
enumeration = (IEnumeration<ILiteral>)workItemClient.resolveEnumeration(attribute, null);
List<ILiteral> enumerationLiterals = enumeration.getEnumerationLiterals();
list = new String;
for (ILiteral literal : enumerationLiterals) {
list = literal.getName();
i++;
}

} catch (TeamRepositoryException e) {
}
return list;
}



Thanks ,
Glory

0 votes


Permanent link
Hi,

I have designed plugin form for create workitem.

i have few query.

1. How to get values for Planned for combo box.
2. How to get values for Filed Against for combo box.
3. How to get values for Release for combo box.



Thanks,

Glory

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,937

Question asked: Mar 29 '12, 12:42 a.m.

Question was seen: 6,044 times

Last updated: Mar 29 '12, 12:42 a.m.

Confirmation Cancel Confirm