Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Saving values modified from property sheet
Saving values modified from property sheet [message #62221] Tue, 19 May 2009 08:31 Go to next message
Eclipse UserFriend
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 #62341 is a reply to message #62221] Wed, 20 May 2009 20:34 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
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 #63158 is a reply to message #62341] Mon, 25 May 2009 17:02 Go to previous message
Eclipse UserFriend
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 #597674 is a reply to message #62221] Wed, 20 May 2009 20:34 Go to previous message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:View menuContribution always disabled
Next Topic:Language Pack Eclipse 3.4.2
Goto Forum:
  


Current Time: Thu Apr 25 01:33:16 GMT 2024

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

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

Back to the top