Saving values modified from property sheet [message #62221] |
Tue, 19 May 2009 08:31 |
Eclipse User |
|
|
|
Originally posted by: rodrigo.garcia.kotasoft.com
Hi,
I want to know how to setDirty my editor when a property of my model is
changed from the propertySheetPage.
I have this in my editor:
protected PropertySheetPage getPropertySheetPage()
{
if (null == propertySheetPage)
{
propertySheetPage = new PropertySheetPage();
propertySheetPage.setPropertySourceProvider(new
EObjectPropertySourceProvider());
}
return propertySheetPage;
}
public Object getAdapter(Class adapter) {
if (adapter == IPropertySheetPage.class)
return getPropertySheetPage();
// the super implementation handles the rest
return super.getAdapter(adapter);
}
The propertySheet shows the differents properties of my model and let me
edit, but I need to save the new values.
Any idea?
Thanks in advance.
|
|
|
|
Re: Saving values modified from property sheet [message #63158 is a reply to message #62341] |
Mon, 25 May 2009 17:02 |
Eclipse User |
|
|
|
Originally posted by: rodrigo.garcia.kotasoft.com
Ok, I'll do that,
but it would be possible add the editor like a listener to the
propertysource?
Ben Vitale escribió:
> If your model provides notification when it changes, listen for those
> notifications in your editor and call firePropertyChange(PROP_DIRTY).
>
> Also make sure you implement isDirty().
>
> Hope that helps,
> Ben
>
> Rodrigo García wrote:
>> Hi,
>>
>> I want to know how to setDirty my editor when a property of my model
>> is changed from the propertySheetPage.
>>
>> I have this in my editor:
>>
>> protected PropertySheetPage getPropertySheetPage()
>> {
>> if (null == propertySheetPage)
>> {
>> propertySheetPage = new PropertySheetPage();
>> propertySheetPage.setPropertySourceProvider(new
>> EObjectPropertySourceProvider());
>> }
>> return propertySheetPage;
>> }
>>
>> public Object getAdapter(Class adapter) {
>> if (adapter == IPropertySheetPage.class)
>> return getPropertySheetPage();
>> // the super implementation handles the rest
>> return super.getAdapter(adapter);
>> }
>>
>> The propertySheet shows the differents properties of my model and let
>> me edit, but I need to save the new values.
>>
>> Any idea?
>>
>> Thanks in advance.
|
|
|
|
Re: Saving values modified from property sheet [message #597837 is a reply to message #62341] |
Mon, 25 May 2009 17:02 |
Eclipse User |
|
|
|
Originally posted by: rodrigo.garcia.kotasoft.com
Ok, I'll do that,
but it would be possible add the editor like a listener to the
propertysource?
Ben Vitale escribió:
> If your model provides notification when it changes, listen for those
> notifications in your editor and call firePropertyChange(PROP_DIRTY).
>
> Also make sure you implement isDirty().
>
> Hope that helps,
> Ben
>
> Rodrigo García wrote:
>> Hi,
>>
>> I want to know how to setDirty my editor when a property of my model
>> is changed from the propertySheetPage.
>>
>> I have this in my editor:
>>
>> protected PropertySheetPage getPropertySheetPage()
>> {
>> if (null == propertySheetPage)
>> {
>> propertySheetPage = new PropertySheetPage();
>> propertySheetPage.setPropertySourceProvider(new
>> EObjectPropertySourceProvider());
>> }
>> return propertySheetPage;
>> }
>>
>> public Object getAdapter(Class adapter) {
>> if (adapter == IPropertySheetPage.class)
>> return getPropertySheetPage();
>> // the super implementation handles the rest
>> return super.getAdapter(adapter);
>> }
>>
>> The propertySheet shows the differents properties of my model and let
>> me edit, but I need to save the new values.
>>
>> Any idea?
>>
>> Thanks in advance.
|
|
|
Powered by
FUDForum. Page generated in 0.04566 seconds