This is what I am doing,
TaskAttribute attribute =
taskData.getRoot().createAttribute(TaskAttribute.SUMMARY);
TaskAttributeMetaData metaData = attribute.getMetaData().defaults();
metaData.setReadOnly(isReadOnly); //isReadOnly = true
metaData.setKind(kind); // kind = null
metaData.setLabel(label); // label = Summery
metaData.setType(type); // type = shortText
metaData.putValue("type", "textField");
return attribute;
This is quite similar code.
Please, let me know any changes required.
Thanks,
Pankaj Turkar
On Wed, Apr 1, 2009 at 5:24 PM, Steffen Pingel
<[email protected]>wrote:
> In order to mark an attribute as read-only, you have to set the meta-data
> accordingly, e.g.:
>
> TaskAttribute attr =
> taskData.getRoot().getAttribute(TaskAttribute.SUMMARY);
> attr.getMetaData().setReadOnly(true)
>
> What type did you set on the read-only attributes?
>
> Steffen
>
>
>
> On Wed, Apr 1, 2009 at 4:43 AM, pankaj chaitram turkar <
> [email protected]> wrote:
>
>> Hi Peter,
>>
>> 1. I tried and created few ReadOnly TaskAttributes, but its not happing.
>> 2. I have implemented custom part in task editor (at PATH_ATTRIBUTES path)
>> and added those read only Task Attributes to it. Its also not working
>> properly.
>>
>> Could u plz help me out to have ReadOnly in Task Editor UI.
>>
>> Thanks,
>> Pankaj
>>
>>
>> On Wed, Apr 1, 2009 at 4:25 PM, Peter Stibrany <[email protected]> wrote:
>>
>>> Hello Pankaj,
>>>
>>> I think you have these possibilities:
>>>
>>> 1) create custom read-only task attributes (see my previous email) --
>>> basically, you create TaskAttributes in TaskData and set proper
>>> metadata to them (kind/readonly).
>>>
>>> 2) add custom part in task editor (at PATH_ATTRIBUTES path) -- but
>>> then your custom fields will be visually separated from task
>>> attributes
>>>
>>> 3) replace TaskEditorAttributePart with your custom part. You can base
>>> your code on existing TaskEditorAttributePart [*], and add custom
>>> widgets at appropriate places.
>>>
>>> [*]
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttributePart.java?root=Tools_Project&view=markup
>>>
>>> -Peter Stibrany
>>>
>>> On Wed, Apr 1, 2009 at 12:32 PM, pankaj chaitram turkar
>>> <[email protected]> wrote:
>>> > Hi,
>>> >
>>> > I want to add ReadOnly filds in Attribute Part in Task Editor UI, but
>>> i'm
>>> > unable to do so.
>>> > Can I add ReadOnly filds in Attribute Part in Task Editor UI. How do I
>>> do
>>> > this?
>>> >
>>> > Thanks,
>>> > Pankaj
>>> >
>>> > On Wed, Apr 1, 2009 at 2:32 PM, Peter Stibrany <[email protected]>
>>> wrote:
>>> >>
>>> >> Hello,
>>> >>
>>> >> you need to override createPartDescriptors method of
>>> >> AbstractTaskEditorPage, and add descriptor for your custom editor
>>> >> part. Your implementation should look similar to this:
>>> >>
>>> >> @Override
>>> >> protected Set<TaskEditorPartDescriptor> createPartDescriptors() {
>>> >> Set<TaskEditorPartDescriptor> partDescriptors =
>>> >> super.createPartDescriptors();
>>> >>
>>> >> TaskEditorPartDescriptor desc = new
>>> >> TaskEditorPartDescriptor(YOUR_PART_ID) {
>>> >> @Override
>>> >> public AbstractTaskEditorPart createPart() {
>>> >> return new YourTaskEditorPart();
>>> >> }
>>> >> };
>>> >> desc.setPath(PATH_COMMENTS);
>>> >>
>>> >> partDescriptors.add(desc);
>>> >>
>>> >> return partDescriptors;
>>> >> }
>>> >>
>>> >> Path specifies where in task editor your part will be places. Existing
>>> >> paths (references from createParts() method of AbstractTaskEditorPage)
>>> >> are PATH_HEADER, PATH_ATTRIBUTES, PATH_ATTACHMENTS, PATH_COMMENTS,
>>> >> PATH_PLANNING, PATH_ACTIONS, PATH_PEOPLE.
>>> >>
>>> >> To set your attributes as read only, simply set attribute metadata to
>>> >> read only. See "Showing custom attributes via TaskEditorAttributePart"
>>> >> section of
>>> >>
>>> http://wiki.eclipse.org/index.php/Mylyn/Integrator_Reference#Task_editor
>>> >>
>>> >> Hope this helps,
>>> >>
>>> >> -Peter Stibrany
>>> >> www.foglyn.com
>>> >>
>>> >> On Wed, Apr 1, 2009 at 10:29 AM, pankaj chaitram turkar
>>> >> <[email protected]> wrote:
>>> >> >
>>> >> > Hi,
>>> >> >
>>> >> > Apart form the existing standerd parts, I want to add few custom
>>> parts
>>> >> > on
>>> >> > the Task Editor page. How could I achieve this.
>>> >> > Also I want the fields(Attributes) in the Attribute part as read
>>> only.
>>> >> > Plz
>>> >> > help me out in achieving this.
>>> >> >
>>> >> > Thanks,
>>> >> > Pankaj Turkar
>>> >> > _______________________________________________
>>> >> > mylyn-integrators mailing list
>>> >> > [email protected]
>>> >> > https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>>> >> >
>>> >> >
>>> >> _______________________________________________
>>> >> mylyn-integrators mailing list
>>> >> [email protected]
>>> >> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>>> >
>>> >
>>> >
>>> > --
>>> > Panku
>>> >
>>> > _______________________________________________
>>> > mylyn-integrators mailing list
>>> > [email protected]
>>> > https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>>> >
>>> >
>>> _______________________________________________
>>> mylyn-integrators mailing list
>>> [email protected]
>>> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>>>
>>
>>
>>
>> --
>> Panku
>>
>> _______________________________________________
>> mylyn-integrators mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>>
>>
>
>
> --
> Steffen Pingel
> Committer, http://eclipse.org/mylyn
> Senior Developer, http://tasktop.com
>
> _______________________________________________
> mylyn-integrators mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>
>
--
Panku
_______________________________________________
mylyn-integrators mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/mylyn-integrators