Home » Eclipse Projects » Eclipse Platform » Problem in Opening Custom Editor from Custom View
Problem in Opening Custom Editor from Custom View [message #257809] |
Fri, 02 July 2004 05:18  |
Eclipse User |
|
|
|
Hi Dani,
Thanks a lot for your reply,
I have tried the way you said.
But the question is,
Eclipse says that editor can be made for any kind of inputs, so is it
possible to open editor without using file i mean without filebased editor
invocation?
I have temporarily implemented a wizard that restricts user to create file
other than i wanted to and it opens the editor using file and
IDE.openEditor(...) but if it can be open without using IFile/file then it
will be good for my requirement.
Help me if possible....
Thanks in Advance...:)
"Daniel Megert" <daniel.megert@gmx.net> wrote in message
news:cbrbjm$fq0$1@eclipse.org...
> Mahesh Devjibhai Dhola wrote:
>
> >Hi,
> >I have developed a view, that is fetching table and column lists from
> >database and shows in tree view as below
> >
> >Table1
> > Column1
> > Column2
> >Table 2
> > Column1
> > Column2
> >
> >Now I have created an Editor that fetches a table and its values and
shows
> >in editor with cell editors
> >Editor is file based with extension of .dte and when I open table1.dte it
> >shows data of table1 for editing
> >
> >The both view and editor works fine individually
> >
> >Now I just want to do, that when user double clicks on Table1 in View, it
> >should open editor for table1
> >I have implemented double-click listener and so on.
> >but I have main problem that how to open the editor from view using what?
> >I have tried with openEditor(..) but I am not figureout the solution.
> >
> >Please help me....
> >
> >
> I assume you can get the file (IFile) when clicking in the view. You can
> then use:
> IDE.openEditor(IWorkbenchPage, IFile)
>
> HTH
> Dani
>
> >
> >
> >
> >
|
|
|
Re: Problem in Opening Custom Editor from Custom View [message #258405 is a reply to message #257809] |
Mon, 05 July 2004 09:05   |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Mahesh Devjibhai Dhola wrote:
>Hi Dani,
>Thanks a lot for your reply,
>I have tried the way you said.
>But the question is,
>Eclipse says that editor can be made for any kind of inputs, so is it
>possible to open editor without using file i mean without filebased editor
>invocation?
>
>
Correct, e.g. the text and Java editors also display code from the CVS
repository or CVS history (IStorageEditorInput).
>I have temporarily implemented a wizard that restricts user to create file
>other than i wanted to and it opens the editor using file and
>IDE.openEditor(...) but if it can be open without using IFile/file then it
>will be good for my requirement.
>
>
One thing is how you open the editor when the user clicks on something:
if the user selects a .dte file which is not actually an IFile then this
will not work (example: you open a .dte file from the CVS Repositories
view). You define how much your editor can handle.
Don't forget that a user can decide to use your editor to open other
kinds of files e.g. .java or .txt (Window > Preferences > Workbench >
File Associations).
HTH
Dani
>Help me if possible....
>Thanks in Advance...:)
>
>"Daniel Megert" <daniel.megert@gmx.net> wrote in message
>news:cbrbjm$fq0$1@eclipse.org...
>
>
>>Mahesh Devjibhai Dhola wrote:
>>
>>
>>
>>>Hi,
>>>I have developed a view, that is fetching table and column lists from
>>>database and shows in tree view as below
>>>
>>>Table1
>>> Column1
>>> Column2
>>>Table 2
>>> Column1
>>> Column2
>>>
>>>Now I have created an Editor that fetches a table and its values and
>>>
>>>
>shows
>
>
>>>in editor with cell editors
>>>Editor is file based with extension of .dte and when I open table1.dte it
>>>shows data of table1 for editing
>>>
>>>The both view and editor works fine individually
>>>
>>>Now I just want to do, that when user double clicks on Table1 in View, it
>>>should open editor for table1
>>>I have implemented double-click listener and so on.
>>>but I have main problem that how to open the editor from view using what?
>>>I have tried with openEditor(..) but I am not figureout the solution.
>>>
>>>Please help me....
>>>
>>>
>>>
>>>
>>I assume you can get the file (IFile) when clicking in the view. You can
>>then use:
>> IDE.openEditor(IWorkbenchPage, IFile)
>>
>>HTH
>>Dani
>>
>>
>>
>>>
>>>
>>>
>>>
>
>
>
>
|
|
|
Re: Problem in Opening Custom Editor from Custom View [message #258585 is a reply to message #258405] |
Tue, 06 July 2004 03:50   |
Eclipse User |
|
|
|
Hi Dani,
Thanks for reply,
Now tell me please,
Is it possible to create an editor for input other than a file?
See, my scenario is,
I want to make a table viewer and table widget based editor that fetches the
data from the database and shows at a time single database table with the
values in cell editors and then I wanted to let the user change those values
and then user can save it back to database also.
I have done it using file input that for each table user will create a file
with the table name and .dte extension but I wanted to make it without using
file.
So when user will click on the table name in the view it will directly open
that editor without opening file
Is it possible?
How I can do that?
Please give me guidance or any references or links or any sample on net from
where I can get the idea....
Thanks in advance :)
Regards,
Mahesh Devjibhai Dhola
"Empower yourself..."
"Daniel Megert" <daniel.megert@gmx.net> wrote in message
news:ccbjks$nv8$1@eclipse.org...
> Mahesh Devjibhai Dhola wrote:
>
> >Hi Dani,
> >Thanks a lot for your reply,
> >I have tried the way you said.
> >But the question is,
> >Eclipse says that editor can be made for any kind of inputs, so is it
> >possible to open editor without using file i mean without filebased
editor
> >invocation?
> >
> >
> Correct, e.g. the text and Java editors also display code from the CVS
> repository or CVS history (IStorageEditorInput).
>
> >I have temporarily implemented a wizard that restricts user to create
file
> >other than i wanted to and it opens the editor using file and
> >IDE.openEditor(...) but if it can be open without using IFile/file then
it
> >will be good for my requirement.
> >
> >
> One thing is how you open the editor when the user clicks on something:
> if the user selects a .dte file which is not actually an IFile then this
> will not work (example: you open a .dte file from the CVS Repositories
> view). You define how much your editor can handle.
>
> Don't forget that a user can decide to use your editor to open other
> kinds of files e.g. .java or .txt (Window > Preferences > Workbench >
> File Associations).
>
> HTH
> Dani
>
> >Help me if possible....
> >Thanks in Advance...:)
> >
> >"Daniel Megert" <daniel.megert@gmx.net> wrote in message
> >news:cbrbjm$fq0$1@eclipse.org...
> >
> >
> >>Mahesh Devjibhai Dhola wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>I have developed a view, that is fetching table and column lists from
> >>>database and shows in tree view as below
> >>>
> >>>Table1
> >>> Column1
> >>> Column2
> >>>Table 2
> >>> Column1
> >>> Column2
> >>>
> >>>Now I have created an Editor that fetches a table and its values and
> >>>
> >>>
> >shows
> >
> >
> >>>in editor with cell editors
> >>>Editor is file based with extension of .dte and when I open table1.dte
it
> >>>shows data of table1 for editing
> >>>
> >>>The both view and editor works fine individually
> >>>
> >>>Now I just want to do, that when user double clicks on Table1 in View,
it
> >>>should open editor for table1
> >>>I have implemented double-click listener and so on.
> >>>but I have main problem that how to open the editor from view using
what?
> >>>I have tried with openEditor(..) but I am not figureout the solution.
> >>>
> >>>Please help me....
> >>>
> >>>
> >>>
> >>>
> >>I assume you can get the file (IFile) when clicking in the view. You can
> >>then use:
> >> IDE.openEditor(IWorkbenchPage, IFile)
> >>
> >>HTH
> >>Dani
> >>
> >>
> >>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
|
|
|
Re: Problem in Opening Custom Editor from Custom View [message #258627 is a reply to message #258585] |
Tue, 06 July 2004 04:35  |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Mahesh Devjibhai Dhola wrote:
>Hi Dani,
>
>Thanks for reply,
>
>Now tell me please,
>
>Is it possible to create an editor for input other than a file?
>
>
Yes of course, see subclasses of IEditorInput.
>See, my scenario is,
>
>I want to make a table viewer and table widget based editor that fetches the
>data from the database and shows at a time single database table with the
>values in cell editors and then I wanted to let the user change those values
>and then user can save it back to database also.
>
>I have done it using file input that for each table user will create a file
>with the table name and .dte extension but I wanted to make it without using
>file.
>
>So when user will click on the table name in the view it will directly open
>that editor without opening file
>
>
>Is it possible?
>
>
Yes.
>How I can do that?
>
>
You can define your own editor input (as subclass of IEditorInput or any
other public subtype that's closes to your needs) and write an editor
that can deal with your new editor input.
Dani
>Please give me guidance or any references or links or any sample on net from
>where I can get the idea....
>
>Thanks in advance :)
>
>Regards,
>
>Mahesh Devjibhai Dhola
>
>"Empower yourself..."
>
>"Daniel Megert" <daniel.megert@gmx.net> wrote in message
>news:ccbjks$nv8$1@eclipse.org...
>
>
>>Mahesh Devjibhai Dhola wrote:
>>
>>
>>
>>>Hi Dani,
>>>Thanks a lot for your reply,
>>>I have tried the way you said.
>>>But the question is,
>>>Eclipse says that editor can be made for any kind of inputs, so is it
>>>possible to open editor without using file i mean without filebased
>>>
>>>
>editor
>
>
>>>invocation?
>>>
>>>
>>>
>>>
>>Correct, e.g. the text and Java editors also display code from the CVS
>>repository or CVS history (IStorageEditorInput).
>>
>>
>>
>>>I have temporarily implemented a wizard that restricts user to create
>>>
>>>
>file
>
>
>>>other than i wanted to and it opens the editor using file and
>>>IDE.openEditor(...) but if it can be open without using IFile/file then
>>>
>>>
>it
>
>
>>>will be good for my requirement.
>>>
>>>
>>>
>>>
>>One thing is how you open the editor when the user clicks on something:
>>if the user selects a .dte file which is not actually an IFile then this
>>will not work (example: you open a .dte file from the CVS Repositories
>>view). You define how much your editor can handle.
>>
>>Don't forget that a user can decide to use your editor to open other
>>kinds of files e.g. .java or .txt (Window > Preferences > Workbench >
>>File Associations).
>>
>>HTH
>>Dani
>>
>>
>>
>>>Help me if possible....
>>>Thanks in Advance...:)
>>>
>>>"Daniel Megert" <daniel.megert@gmx.net> wrote in message
>>>news:cbrbjm$fq0$1@eclipse.org...
>>>
>>>
>>>
>>>
>>>>Mahesh Devjibhai Dhola wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hi,
>>>>>I have developed a view, that is fetching table and column lists from
>>>>>database and shows in tree view as below
>>>>>
>>>>>Table1
>>>>> Column1
>>>>> Column2
>>>>>Table 2
>>>>> Column1
>>>>> Column2
>>>>>
>>>>>Now I have created an Editor that fetches a table and its values and
>>>>>
>>>>>
>>>>>
>>>>>
>>>shows
>>>
>>>
>>>
>>>
>>>>>in editor with cell editors
>>>>>Editor is file based with extension of .dte and when I open table1.dte
>>>>>
>>>>>
>it
>
>
>>>>>shows data of table1 for editing
>>>>>
>>>>>The both view and editor works fine individually
>>>>>
>>>>>Now I just want to do, that when user double clicks on Table1 in View,
>>>>>
>>>>>
>it
>
>
>>>>>should open editor for table1
>>>>>I have implemented double-click listener and so on.
>>>>>but I have main problem that how to open the editor from view using
>>>>>
>>>>>
>what?
>
>
>>>>>I have tried with openEditor(..) but I am not figureout the solution.
>>>>>
>>>>>Please help me....
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>I assume you can get the file (IFile) when clicking in the view. You can
>>>>then use:
>>>> IDE.openEditor(IWorkbenchPage, IFile)
>>>>
>>>>HTH
>>>>Dani
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>>
>
>
>
>
|
|
|
Goto Forum:
Current Time: Thu Jul 17 01:37:23 EDT 2025
Powered by FUDForum. Page generated in 0.10215 seconds
|