ViewPart vs. EditorPart [message #436749] |
Fri, 16 September 2005 16:03  |
Eclipse User |
|
|
|
Hello,
I am building a client/server app and have widgets like textfields,
check boxes, comboboxes etc. I am indecisive whether to use an
EditorPart or a ViewPart. I am using an oodb on the backend and a
project called EssentialData that directly binds my widgets to my
persistable objects.
What I am trying to accomplish is to ask the user if anychanges were
made whether they want to save them or not.
ie Class Client{
String name;
getName();
setName();
}
Class Part{
private Text nameText;
createpart{
create the gui ...
POJOAdapter pojoClient = new POJOAdapter().add(new
POJOFieldAdapter(nameText,"name");
pojoClient.setInput(new Client());
}
}
Any changes to the text field are automatically stored in my client
object. I can ask the POJOAdapter if it isDirty();
Can the EditorPart and IEditorInput be adapted to utilize the above
scenario or should I stick with Viewpart and implement all the stuff
that seems to be available in EditorPart.
Any opinions or (Sample Code) would be greatly appreciated.
Thanks all.
|
|
|
Re: ViewPart vs. EditorPart [message #436751 is a reply to message #436749] |
Fri, 16 September 2005 19:11  |
Eclipse User |
|
|
|
Choose EditorPart
ViewPart haven't save/close feature
James Leotta wrote:
> Hello,
>
> I am building a client/server app and have widgets like textfields,
> check boxes, comboboxes etc. I am indecisive whether to use an
> EditorPart or a ViewPart. I am using an oodb on the backend and a
> project called EssentialData that directly binds my widgets to my
> persistable objects.
>
> What I am trying to accomplish is to ask the user if anychanges were
> made whether they want to save them or not.
>
> ie Class Client{
> String name;
> getName();
> setName();
> }
>
> Class Part{
>
> private Text nameText;
>
> createpart{
> create the gui ...
>
> POJOAdapter pojoClient = new POJOAdapter().add(new
> POJOFieldAdapter(nameText,"name");
> pojoClient.setInput(new Client());
>
> }
> }
>
> Any changes to the text field are automatically stored in my client
> object. I can ask the POJOAdapter if it isDirty();
>
> Can the EditorPart and IEditorInput be adapted to utilize the above
> scenario or should I stick with Viewpart and implement all the stuff
> that seems to be available in EditorPart.
>
> Any opinions or (Sample Code) would be greatly appreciated.
>
>
> Thanks all.
|
|
|
Powered by
FUDForum. Page generated in 0.03217 seconds