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

How to construct an Aspect Editor with an SWT Tree?

Hi all,


for RTC 6.0.6 I'd like to build an aspect editor with a tree, broadly similar to Required Attributes For Type and State.  I'm aiming to add more granularity to the precondition All Children Resolved and have it configurable for type and state, like this:

<precondition description="Verifies that a work item that matches the selected type and state can only be saved if all its children are resolved" 
id="com.nbs.workitem.all_children_resolved_type_state" name="All Children Resolved For Type and State">
<condition workItemTypeId="com.nbs.workitem.type.ida" >
<workflow workflowTargetStateId="com.ibm.team.workitem.taskWorkflow.state.s3" />
</condition>
<condition workItemTypeId="com.nbs.workitem.type.someOrOther">
<workflow workflowTargetStateId="com.ibm.team.workitem.taskWorkflow.state.sOther1" />
<workflow workflowTargetStateId="com.ibm.team.workitem.taskWorkflow.state.sOther2" />
</condition>
</precondition>

I can't see how this can be done via the combobox approach in the extension workshop, not least because comboboxes are not multi-select, and I think Tree/TreeViewer is the way to go.  I see a checkbox where the Attributes are in Required Attributes For Type and State; I think this will be achievable using this approach.

Now this is really stretching my Java knowledge, perhaps past breaking point, so I'd like to know if anyone has done something like this and if they can share some wisdom.  I think I understand the Model well enough, but handling a Tree in the AspectEditor class will be a challenge for which any help will be very welcome.

Thanks -
Cliff

0 votes



One answer

Permanent link

 Cliff, there are good tutorials on the Eclipse.org pages. You need to implement label and tree node provider.

The SDK ships the code so you can actually try look into that code. I am not totally sure it is shipped, but worth trying to look for it.

0 votes

Comments

Thanks Ralph, 


I have looked at the examples from Eclipse.org but I think I'm making things harder for myself because I only want the checkbox on the leaf node, and none of the examples are close to that.  I've also searched the SDK but have to rely on a decompiler as the source doesn't seem to be available (unless I've missed something), and that seems to be abstracted to be a generalised as possible.  I find it hard to follow.

I'll look into your comment about label and tree node, but I'm sure I won't find this easy!  It's going to be an interesting challenge.

Thanks -
Cliff

If you setup your environment following the Extensions Workshop you have the code and do not need a decompiler. 

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
× 6,121

Question asked: Feb 08 '19, 11:02 a.m.

Question was seen: 2,054 times

Last updated: Feb 12 '19, 9:07 a.m.

Confirmation Cancel Confirm