EditorPart, IEditorInput and domain/model objects [message #453416] |
Fri, 28 July 2006 15:40  |
Eclipse User |
|
|
|
I am bulding an editor (class extends EditorPart) which has an associated
IEditorInput that provides model data (a domain object) to my editor. this
model data is shown as the text values within my editor Text objects. When
my editor becomes dirty and the doSave() method is called I want to save
my newly modified model/domain object but there is no clear way to tie the
text values of the Text objects to the domain object through the
IEditorInput object. What is the best way to get text data(value) from a
Text widget and set it that data into a domain object before saving? I
would hope I don't have to write a mapping of the Text inputs (widgets) to
my domain object.
Thoughts?
|
|
|
|
|
|
Re: EditorPart, IEditorInput and domain/model objects [message #453507 is a reply to message #453418] |
Tue, 01 August 2006 08:47   |
Eclipse User |
|
|
|
Originally posted by: lamont_gilbert.rigidsoftware.com
Alexander Karnstedt wrote:
> Maybe the JFace Data Binding Framework is an option?
>
> http://wiki.eclipse.org/index.php/JFace_Data_Binding
>
> I think IEditorInput should not contain any model data. The API
> documentation for IEditorInput states:
>
> "Please note that it is important that the editor input be light weight.
> Within the workbench, the navigation history tends to hold on to editor
> inputs as a means of reconstructing the editor at a later time. The
> navigation history can hold on to quite a few inputs (i.e., the default
> is fifty). The actual data model should probably not be held in the
> input."
>
>
> Regards,
> Alex
>
> Derrick Kittler schrieb:
>> I am bulding an editor (class extends EditorPart) which has an
>> associated IEditorInput that provides model data (a domain object) to my
>> editor. this model data is shown as the text values within my editor
>> Text objects. When my editor becomes dirty and the doSave() method is
>> called I want to save my newly modified model/domain object but there is
>> no clear way to tie the text values of the Text objects to the domain
>> object through the IEditorInput object. What is the best way to get text
>> data(value) from a Text widget and set it that data into a domain object
>> before saving? I would hope I don't have to write a mapping of the Text
>> inputs (widgets) to my domain object.
>>
>> Thoughts?
>>
In my case the IEditorInput holds a weakReference to my model. Its true
that the architecture will hold on to the IEditorInputs. I think the
recently opened file list is one place.
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.47524 seconds