Problem to integrate a 3rd-part plugin [message #437134] |
Thu, 22 September 2005 09:33 |
Eclipse User |
|
|
|
Originally posted by: reg.sheng.clanfang.com
Hello,
I have integrated a 3rd-part plugin into my Eclipse-RCP-APP, it's like a
type of XML editor. But the plugin only accepts files which are attached
into the workspace with a proyect. The code of the editor is like the
following:
public void init(IEditorSite site, IEditorInput input) throws
PartInitException {
FileEditorInput fileInput = (FileEditorInput)input; // XXX
...
...
}
If I try to open a external file(away form the workspace, type of
"java.io.File"), it will throw an exception while doing the casting.
There are 2 ideas, which I have now in my mind. They are:
1. Attach the external file into the workspace while trying to open it.
2. Convert a external "java.io.File" into
"org.eclipse.ui.part.FileEditorInput".
I prefer the 2nd way, I think it's cleaner but I don't know if it's
viable, because I've seen that the FileEditorInput contains a a interfaz
IFile which contains at the same time, informations of the workspace.
Maybe the 1st way will be easier.
Would you give me any recomendation of which to choose and how to carry it
out? Or any more suggestion will be welcome also.
Thanks in advance.
ShEng
|
|
|
Re: Problem to integrate a 3rd-part plugin [message #437140 is a reply to message #437134] |
Thu, 22 September 2005 14:50 |
Haris Peco Messages: 1072 Registered: July 2009 |
Senior Member |
|
|
Sheng Fang wrote:
> Hello,
>
> I have integrated a 3rd-part plugin into my Eclipse-RCP-APP, it's like a
> type of XML editor. But the plugin only accepts files which are attached
> into the workspace with a proyect. The code of the editor is like the
> following:
>
> public void init(IEditorSite site, IEditorInput input) throws
> PartInitException {
> FileEditorInput fileInput = (FileEditorInput)input; // XXX
> ...
> ...
> }
>
> If I try to open a external file(away form the workspace, type of
> "java.io.File"), it will throw an exception while doing the casting.
>
> There are 2 ideas, which I have now in my mind. They are:
>
> 1. Attach the external file into the workspace while trying to open it.
> 2. Convert a external "java.io.File" into
> "org.eclipse.ui.part.FileEditorInput".
>
> I prefer the 2nd way, I think it's cleaner but I don't know if it's
> viable, because I've seen that the FileEditorInput contains a a interfaz
> IFile which contains at the same time, informations of the workspace.
> Maybe the 1st way will be easier.
>
> Would you give me any recomendation of which to choose and how to carry it
> out? Or any more suggestion will be welcome also.
>
> Thanks in advance.
>
> ShEng
You can change File to IFile - search eclipse tips & tricks on
www.eclipsezone.com
|
|
|
Re: Problem to integrate a 3rd-part plugin [message #437217 is a reply to message #437140] |
Fri, 23 September 2005 10:14 |
Eclipse User |
|
|
|
Originally posted by: reg.sheng.clanfang.com
Thank you snpe, this may guide me a little.
snpe wrote:
> Sheng Fang wrote:
>> Hello,
>>
>> I have integrated a 3rd-part plugin into my Eclipse-RCP-APP, it's like a
>> type of XML editor. But the plugin only accepts files which are attached
>> into the workspace with a proyect. The code of the editor is like the
>> following:
>>
>> public void init(IEditorSite site, IEditorInput input) throws
>> PartInitException {
>> FileEditorInput fileInput = (FileEditorInput)input; // XXX
>> ...
>> ...
>> }
>>
>> If I try to open a external file(away form the workspace, type of
>> "java.io.File"), it will throw an exception while doing the casting.
>>
>> There are 2 ideas, which I have now in my mind. They are:
>>
>> 1. Attach the external file into the workspace while trying to open it.
>> 2. Convert a external "java.io.File" into
>> "org.eclipse.ui.part.FileEditorInput".
>>
>> I prefer the 2nd way, I think it's cleaner but I don't know if it's
>> viable, because I've seen that the FileEditorInput contains a a interfaz
>> IFile which contains at the same time, informations of the workspace.
>> Maybe the 1st way will be easier.
>>
>> Would you give me any recomendation of which to choose and how to carry it
>> out? Or any more suggestion will be welcome also.
>>
>> Thanks in advance.
>>
>> ShEng
> You can change File to IFile - search eclipse tips & tricks on
> www.eclipsezone.com
|
|
|
|
Re: Problem to integrate a 3rd-part plugin [message #437256 is a reply to message #437232] |
Mon, 26 September 2005 08:06 |
Eclipse User |
|
|
|
Originally posted by: reg.sheng.clanfang.com
Jason Milliron wrote:
> I have a question. How did you integrate this 3rd party plugin with your
RCP app. Do you have documentation or web links that helped you do this? I
need to get an XML plugin working, which one did you use?
> Thanks,
> Jason
Integrate a 3td part plugin(for Eclipse) into a RCP app is trivial. You
only need to import the necesary official Eclipse plugins in your project,
then... nothing, it's all.
|
|
|
Re: Problem to integrate a 3rd-part plugin [message #437257 is a reply to message #437140] |
Mon, 26 September 2005 08:10 |
Eclipse User |
|
|
|
Originally posted by: reg.sheng.clanfang.com
snpe wrote:
> Sheng Fang wrote:
>> Hello,
>>
>> I have integrated a 3rd-part plugin into my Eclipse-RCP-APP, it's like a
>> type of XML editor. But the plugin only accepts files which are attached
>> into the workspace with a proyect. The code of the editor is like the
>> following:
>>
>> public void init(IEditorSite site, IEditorInput input) throws
>> PartInitException {
>> FileEditorInput fileInput = (FileEditorInput)input; // XXX
>> ...
>> ...
>> }
>>
>> If I try to open a external file(away form the workspace, type of
>> "java.io.File"), it will throw an exception while doing the casting.
>>
>> There are 2 ideas, which I have now in my mind. They are:
>>
>> 1. Attach the external file into the workspace while trying to open it.
>> 2. Convert a external "java.io.File" into
>> "org.eclipse.ui.part.FileEditorInput".
>>
>> I prefer the 2nd way, I think it's cleaner but I don't know if it's
>> viable, because I've seen that the FileEditorInput contains a a interfaz
>> IFile which contains at the same time, informations of the workspace.
>> Maybe the 1st way will be easier.
>>
>> Would you give me any recomendation of which to choose and how to carry it
>> out? Or any more suggestion will be welcome also.
>>
>> Thanks in advance.
>>
>> ShEng
> You can change File to IFile - search eclipse tips & tricks on
> www.eclipsezone.com
I'a afraid that the ideas on www.eclipsezone.com do not work to change
File to IFile.
Anyone has more suggestion about this?
Thanx
ShEng
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03355 seconds