editor connected to a DB [message #79571] |
Fri, 20 June 2003 17:33  |
Eclipse User |
|
|
|
Originally posted by: arturof.netomat.net
Hello,
I want to create an Editor that instead of being registered to edit a
particular file or extension, is registered to edit rows from a particular
table in a relational database.
Does it make sense to do this?
Particularly, what I want to do, is to provide a Multi-Page-Editor type of
interface that is displayed in the EditorArea and is tightly integrated with
the Workbench that allows the user to edit entries in a database.
"To open an editor, the user will typically invoke "Open" on an IFile. When
this action is performed the workbench registry is consulted to determine an
appropriate editor for the file type and then a new instance of the editor
type is created."
Is there such a thing as an RDBMS implementation of IFile? (I would not
expect it, instead, I would expect there to be some sort of RDBMS
implementation of IStorage... but I haven't found one... in any case, it
might not be sufficient, since the Workbench expects an IFile.)
If somebody knows of a plugin that does this already, I would appreciate it
very much if you could point me to it, otherwise, any ideas are appreciated.
Thanks in advance,
--
Arturo Falck
|
|
|
|
Re: editor connected to a DB [message #79680 is a reply to message #79586] |
Fri, 20 June 2003 22:35  |
Eclipse User |
|
|
|
Originally posted by: pdrolet.mac.com
Hi,
You need to create a new kind of editor. I am developping this kind of
app at this time. New to Java since dec. 2002 (VFP developper) and to
eclipse since feb. 2003... and working only part time on it - this is
my second job... But I think I am doing fine!
So I read the API and many docs, looked at examples and then created a
class EditorInput that implements IEditorInput and a class FmedxEditor
that extends EditorPart
I created a viewpart with a Tree that is hard coded with the names of
the tables that I want the user be able do modify or view. When he
double-clic an item, it calls EditorInput and this one calls the
appropriate Editor (in my case here FmedxEditor - but I will create
more).
The logic of creating, saving, printing, undoing is located in the
FmedxEditor when specific to the table, and in the EditorInput when
generic. You have to code the getText/setText, load, validation, save
yourself.
The code at this time is not cleaned at all and not generic. It cannot
really be shared and I guess it would be more a waste of time for
somebody that did not write it... And I must admit I do not have the
time to explain it more!
So this is possible.
Patrice Drolet
|
|
|
Powered by
FUDForum. Page generated in 0.03083 seconds