Skip to main content



      Home
Home » Eclipse Projects » GEF » showing properties for a list of items
showing properties for a list of items [message #168476] Wed, 16 February 2005 07:20 Go to next message
Eclipse UserFriend
Originally posted by: alan.battersby.ntu.ac.uk

I am new to gef and still on a steep learning curve and also this question
is probably not gef specific please forgive my ignorance.

I have a Declaration class that contains a list of variable declarations.I
have also created a Variable class containing name,type and initialvalue
that implements the IPropertySource interface. Displaying one variable
defined alone, is not a problem.

When the DeclarationPart is selected I want the list off all variables
declared to appear in the properties window. One variable per line showing
name,type and initial value all to be editable. I assume that I must
create a DeclarationPropertySource class that iterates through the list but
am not sure how to start. I looked at the examples for flow, shapes and
logic but was unable to see anything similar to what I require.

Firstly is this possible? If so how do I go about it ? Is there something
in the examples above that I missed?

Thanks

Alan
Re: showing properties for a list of items [message #168532 is a reply to message #168476] Wed, 16 February 2005 11:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Alan Battersby wrote:
> I am new to gef and still on a steep learning curve and also this question
> is probably not gef specific please forgive my ignorance.
>
> I have a Declaration class that contains a list of variable declarations.I
> have also created a Variable class containing name,type and initialvalue
> that implements the IPropertySource interface. Displaying one variable
> defined alone, is not a problem.
>
> When the DeclarationPart is selected I want the list off all variables
> declared to appear in the properties window. One variable per line showing
> name,type and initial value all to be editable. I assume that I must
> create a DeclarationPropertySource class that iterates through the list but
> am not sure how to start. I looked at the examples for flow, shapes and
> logic but was unable to see anything similar to what I require.
>
> Firstly is this possible? If so how do I go about it ? Is there something
> in the examples above that I missed?
>
> Thanks
>
> Alan

yes its possible. you just return an array of property descriptors. I
learned how to do it from the examples, so its in there. If I can, ill
post some example code.

CL
Re: showing properties for a list of items [message #168548 is a reply to message #168532] Wed, 16 February 2005 12:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alan.battersby.ntlworld.com

CL [dnoyeb] Gilbert wrote:
> Alan Battersby wrote:
>
>> I am new to gef and still on a steep learning curve and also this
>> question
>> is probably not gef specific please forgive my ignorance.
>> I have a Declaration class that contains a list of variable
>> declarations.I
>> have also created a Variable class containing name,type and initialvalue
>> that implements the IPropertySource interface. Displaying one variable
>> defined alone, is not a problem.
>> When the DeclarationPart is selected I want the list off all variables
>> declared to appear in the properties window. One variable per line
>> showing
>> name,type and initial value all to be editable. I assume that I must
>> create a DeclarationPropertySource class that iterates through the
>> list but
>> am not sure how to start. I looked at the examples for flow, shapes and
>> logic but was unable to see anything similar to what I require.
>>
>> Firstly is this possible? If so how do I go about it ? Is there something
>> in the examples above that I missed?
>>
>> Thanks
>>
>> Alan
>
>
> yes its possible. you just return an array of property descriptors. I
> learned how to do it from the examples, so its in there. If I can, ill
> post some example code.
>
> CL
I would appreciate an example. I have looked at examples again but
cannot see any item that when selected show a list of items and
properties viz

Item 1
Prop 1 value 1
Prop 2 value
...
Item 2
Prop 1 value
Prop 2 value
...
Item 3
etc

So any code example would be greatly appreciated.

Alan
Re: showing properties for a list of items [message #168571 is a reply to message #168548] Wed, 16 February 2005 15:30 Go to previous message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Alan Battersby wrote:
> CL [dnoyeb] Gilbert wrote:
>
>> Alan Battersby wrote:
>>
>>> I am new to gef and still on a steep learning curve and also this
>>> question
>>> is probably not gef specific please forgive my ignorance.
>>> I have a Declaration class that contains a list of variable
>>> declarations.I
>>> have also created a Variable class containing name,type and initialvalue
>>> that implements the IPropertySource interface. Displaying one variable
>>> defined alone, is not a problem.
>>> When the DeclarationPart is selected I want the list off all variables
>>> declared to appear in the properties window. One variable per line
>>> showing
>>> name,type and initial value all to be editable. I assume that I must
>>> create a DeclarationPropertySource class that iterates through the
>>> list but
>>> am not sure how to start. I looked at the examples for flow, shapes and
>>> logic but was unable to see anything similar to what I require.
>>>
>>> Firstly is this possible? If so how do I go about it ? Is there
>>> something
>>> in the examples above that I missed?
>>>
>>> Thanks
>>>
>>> Alan
>>
>>
>>
>> yes its possible. you just return an array of property descriptors.
>> I learned how to do it from the examples, so its in there. If I can,
>> ill post some example code.
>>
>> CL
>
> I would appreciate an example. I have looked at examples again but
> cannot see any item that when selected show a list of items and
> properties viz
>
> Item 1
> Prop 1 value 1
> Prop 2 value
> ...
> Item 2
> Prop 1 value
> Prop 2 value
> ...
> Item 3
> etc
>
> So any code example would be greatly appreciated.
>
> Alan


One property source can return another property source as its value
instead of returning an int for instance. that property source can have
an array of descriptors, and a corresponding value for each one.

public Object getPropertyValue(Object id){
if(MyProperty.equals(id){
return new InteratingPropertySource(mystuff);
}
else return super.get....
}


class IteratingPropertySource{

public IPropertyDescriptor [] getPropertyDescritpros(){
for(int x=0;x < props.length;x++){
SubPropDescrip pd = new SubPropDescrip("Prop"+x,"value");
SubPropDescrip sps[x] = pd;
}
return sps;
}


public Object getPropertyValue(Object id){
for(int x=0;x<props.length;x++){
if(id.equals("Prop"+x)){
return new ValueSource(props[x]);
}
}
return null;
}

}

ValueSource is a simple source with a prop and a value.




if that does not help any send me an email and ill send u some files as
my email is on linux but my code is on windows mainly...



CL
Previous Topic:SWT widgets in Figures
Next Topic:Cancel a time consuming paint operation
Goto Forum:
  


Current Time: Thu Jun 19 12:58:55 EDT 2025

Powered by FUDForum. Page generated in 0.09063 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top