Home » Eclipse Projects » Eclipse Platform » MutliPageEditorPart
MutliPageEditorPart [message #115991] |
Mon, 25 August 2003 10:00  |
Eclipse User |
|
|
|
Originally posted by: jayanth_18.hotmail.com
I have created a multipage editor of four pages and an extra page as
'general'. When i click on any of the tabs, a new page becomes active.
This new page contains nothing. I want a file to be opened whenever i cick
on any tab. So how am i to pass the filepath to the method to open the
corresponding file. The code for creating a page is as given below. I use
the same method for creating all the other pages.
void createPage2()
{
Composite composite = new Composite(getContainer(), SWT.NONE);
FillLayout layout = new FillLayout();
composite.setLayout(layout);
int index = addPage(composite);
setPageText(index, "Preview");
}
Thanks in advance.....
With Regards,
Jayanth
Project Trainee,
IBM Software Lab, Bangalore,
India.
Ph:080-5094190
|
|
| |
Re: MutliPageEditorPart [message #116496 is a reply to message #116174] |
Tue, 26 August 2003 02:35   |
Eclipse User |
|
|
|
Originally posted by: jayanth_18.hotmail.com
Thanks Chris for replying.....
Actually I want to display files as pages in the multipage editor. So how
am I to give the filepath to the method 'addPage'? The syntax for addPage
is
addPage(IEditorPart editor, IEditorInput input)
Here I can give 'editor' as a TexTEditor. But I dont know how to give the
'input' as the filepath to be opened. Could someone help me out?
Thanks and Regards,
Jayanth.
Chris Laffra wrote:
> I don't really understand what your problem is.
> Have you tried the PDE Wizard to create a sample MultiPageEditor and
> see what code it generates? Perhaps there is enough information for you
> there to answer your questions?
> Chris
> "Jayanth" <jayanth_18@hotmail.com> wrote in message
> news:bid4pe$ojs$1@eclipse.org...
> > I have created a multipage editor of four pages and an extra page as
> > 'general'. When i click on any of the tabs, a new page becomes active.
> > This new page contains nothing. I want a file to be opened whenever i cick
> > on any tab. So how am i to pass the filepath to the method to open the
> > corresponding file. The code for creating a page is as given below. I use
> > the same method for creating all the other pages.
> >
> > void createPage2()
> > {
> > Composite composite = new Composite(getContainer(), SWT.NONE);
> > FillLayout layout = new FillLayout();
> > composite.setLayout(layout);
> > int index = addPage(composite);
> > setPageText(index, "Preview");
> > }
> >
> > Thanks in advance.....
> > With Regards,
> > Jayanth
> > Project Trainee,
> > IBM Software Lab, Bangalore,
> > India.
> > Ph:080-5094190
> >
> >
> >
> >
|
|
|
Re: MutliPageEditorPart [message #116669 is a reply to message #116496] |
Tue, 26 August 2003 13:52   |
Eclipse User |
|
|
|
You mean passing in an instance of org.eclipse.ui.part.FileEditorInput?
Chris
"Jayanth" <jayanth_18@hotmail.com> wrote in message
news:biev2k$chp$1@eclipse.org...
> Thanks Chris for replying.....
>
> Actually I want to display files as pages in the multipage editor. So how
> am I to give the filepath to the method 'addPage'? The syntax for addPage
> is
> addPage(IEditorPart editor, IEditorInput input)
>
> Here I can give 'editor' as a TexTEditor. But I dont know how to give the
> 'input' as the filepath to be opened. Could someone help me out?
>
> Thanks and Regards,
> Jayanth.
>
>
>
>
>
>
> Chris Laffra wrote:
>
> > I don't really understand what your problem is.
>
> > Have you tried the PDE Wizard to create a sample MultiPageEditor and
> > see what code it generates? Perhaps there is enough information for you
> > there to answer your questions?
>
> > Chris
>
> > "Jayanth" <jayanth_18@hotmail.com> wrote in message
> > news:bid4pe$ojs$1@eclipse.org...
> > > I have created a multipage editor of four pages and an extra page as
> > > 'general'. When i click on any of the tabs, a new page becomes active.
> > > This new page contains nothing. I want a file to be opened whenever i
cick
> > > on any tab. So how am i to pass the filepath to the method to open the
> > > corresponding file. The code for creating a page is as given below. I
use
> > > the same method for creating all the other pages.
> > >
> > > void createPage2()
> > > {
> > > Composite composite = new Composite(getContainer(), SWT.NONE);
> > > FillLayout layout = new FillLayout();
> > > composite.setLayout(layout);
> > > int index = addPage(composite);
> > > setPageText(index, "Preview");
> > > }
> > >
> > > Thanks in advance.....
> > > With Regards,
> > > Jayanth
> > > Project Trainee,
> > > IBM Software Lab, Bangalore,
> > > India.
> > > Ph:080-5094190
> > >
> > >
> > >
> > >
>
>
|
|
|
Re: MutliPageEditorPart [message #117145 is a reply to message #116669] |
Wed, 27 August 2003 04:47   |
Eclipse User |
|
|
|
Originally posted by: jayanth_18.hotmail.com
Yeah exactly passing an instance of org.eclipse.ui.part.FileEditorInput
Can you help me out?
With Regards,
Jayanth.
Chris Laffra wrote:
> You mean passing in an instance of org.eclipse.ui.part.FileEditorInput?
> Chris
> "Jayanth" <jayanth_18@hotmail.com> wrote in message
> news:biev2k$chp$1@eclipse.org...
> > Thanks Chris for replying.....
> >
> > Actually I want to display files as pages in the multipage editor. So how
> > am I to give the filepath to the method 'addPage'? The syntax for addPage
> > is
> > addPage(IEditorPart editor, IEditorInput input)
> >
> > Here I can give 'editor' as a TexTEditor. But I dont know how to give the
> > 'input' as the filepath to be opened. Could someone help me out?
> >
> > Thanks and Regards,
> > Jayanth.
> >
> >
> >
> >
> >
> >
> > Chris Laffra wrote:
> >
> > > I don't really understand what your problem is.
> >
> > > Have you tried the PDE Wizard to create a sample MultiPageEditor and
> > > see what code it generates? Perhaps there is enough information for you
> > > there to answer your questions?
> >
> > > Chris
> >
> > > "Jayanth" <jayanth_18@hotmail.com> wrote in message
> > > news:bid4pe$ojs$1@eclipse.org...
> > > > I have created a multipage editor of four pages and an extra page as
> > > > 'general'. When i click on any of the tabs, a new page becomes active.
> > > > This new page contains nothing. I want a file to be opened whenever i
> cick
> > > > on any tab. So how am i to pass the filepath to the method to open the
> > > > corresponding file. The code for creating a page is as given below. I
> use
> > > > the same method for creating all the other pages.
> > > >
> > > > void createPage2()
> > > > {
> > > > Composite composite = new Composite(getContainer(), SWT.NONE);
> > > > FillLayout layout = new FillLayout();
> > > > composite.setLayout(layout);
> > > > int index = addPage(composite);
> > > > setPageText(index, "Preview");
> > > > }
> > > >
> > > > Thanks in advance.....
> > > > With Regards,
> > > > Jayanth
> > > > Project Trainee,
> > > > IBM Software Lab, Bangalore,
> > > > India.
> > > > Ph:080-5094190
> > > >
> > > >
> > > >
> > > >
> >
> >
|
|
|
Re: MutliPageEditorPart [message #117674 is a reply to message #117145] |
Wed, 27 August 2003 18:03   |
Eclipse User |
|
|
|
How about
new FileEditorInput(Ifile file)
?
"Jayanth" <jayanth_18@hotmail.com> wrote in message
news:bihr64$g3$1@eclipse.org...
> Yeah exactly passing an instance of org.eclipse.ui.part.FileEditorInput
> Can you help me out?
>
> With Regards,
> Jayanth.
>
>
> Chris Laffra wrote:
>
> > You mean passing in an instance of org.eclipse.ui.part.FileEditorInput?
>
> > Chris
>
> > "Jayanth" <jayanth_18@hotmail.com> wrote in message
> > news:biev2k$chp$1@eclipse.org...
> > > Thanks Chris for replying.....
> > >
> > > Actually I want to display files as pages in the multipage editor. So
how
> > > am I to give the filepath to the method 'addPage'? The syntax for
addPage
> > > is
> > > addPage(IEditorPart editor, IEditorInput input)
> > >
> > > Here I can give 'editor' as a TexTEditor. But I dont know how to give
the
> > > 'input' as the filepath to be opened. Could someone help me out?
> > >
> > > Thanks and Regards,
> > > Jayanth.
> > >
> > >
> > >
> > >
> > >
> > >
> > > Chris Laffra wrote:
> > >
> > > > I don't really understand what your problem is.
> > >
> > > > Have you tried the PDE Wizard to create a sample MultiPageEditor and
> > > > see what code it generates? Perhaps there is enough information for
you
> > > > there to answer your questions?
> > >
> > > > Chris
> > >
> > > > "Jayanth" <jayanth_18@hotmail.com> wrote in message
> > > > news:bid4pe$ojs$1@eclipse.org...
> > > > > I have created a multipage editor of four pages and an extra page
as
> > > > > 'general'. When i click on any of the tabs, a new page becomes
active.
> > > > > This new page contains nothing. I want a file to be opened
whenever i
> > cick
> > > > > on any tab. So how am i to pass the filepath to the method to open
the
> > > > > corresponding file. The code for creating a page is as given
below. I
> > use
> > > > > the same method for creating all the other pages.
> > > > >
> > > > > void createPage2()
> > > > > {
> > > > > Composite composite = new Composite(getContainer(), SWT.NONE);
> > > > > FillLayout layout = new FillLayout();
> > > > > composite.setLayout(layout);
> > > > > int index = addPage(composite);
> > > > > setPageText(index, "Preview");
> > > > > }
> > > > >
> > > > > Thanks in advance.....
> > > > > With Regards,
> > > > > Jayanth
> > > > > Project Trainee,
> > > > > IBM Software Lab, Bangalore,
> > > > > India.
> > > > > Ph:080-5094190
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
>
>
|
|
|
Re: MutliPageEditorPart [message #117789 is a reply to message #117674] |
Thu, 28 August 2003 01:34  |
Eclipse User |
|
|
|
Originally posted by: jayanth_18.hotmail.com
Thanks chris for your kind help..... its finally working for me
Here is the code for the same...
editor = new TextEditor();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IPath p = new Path(FILE_PATH + "runmqtst.cfg"); //FILE_PATH stores the
path of the file to opened.
IFile newLogo = root.getFile(p);
FileEditorInput fileEditor = new FileEditorInput( newLogo );
int index = addPage(editor, fileEditor);
Thanks and Regards,
Jayanth.
Chris Laffra wrote:
> How about
> new FileEditorInput(Ifile file)
> ?
> "Jayanth" <jayanth_18@hotmail.com> wrote in message
> news:bihr64$g3$1@eclipse.org...
> > Yeah exactly passing an instance of org.eclipse.ui.part.FileEditorInput
> > Can you help me out?
> >
> > With Regards,
> > Jayanth.
> >
> >
> > Chris Laffra wrote:
> >
> > > You mean passing in an instance of org.eclipse.ui.part.FileEditorInput?
> >
> > > Chris
> >
> > > "Jayanth" <jayanth_18@hotmail.com> wrote in message
> > > news:biev2k$chp$1@eclipse.org...
> > > > Thanks Chris for replying.....
> > > >
> > > > Actually I want to display files as pages in the multipage editor. So
> how
> > > > am I to give the filepath to the method 'addPage'? The syntax for
> addPage
> > > > is
> > > > addPage(IEditorPart editor, IEditorInput input)
> > > >
> > > > Here I can give 'editor' as a TexTEditor. But I dont know how to give
> the
> > > > 'input' as the filepath to be opened. Could someone help me out?
> > > >
> > > > Thanks and Regards,
> > > > Jayanth.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Chris Laffra wrote:
> > > >
> > > > > I don't really understand what your problem is.
> > > >
> > > > > Have you tried the PDE Wizard to create a sample MultiPageEditor and
> > > > > see what code it generates? Perhaps there is enough information for
> you
> > > > > there to answer your questions?
> > > >
> > > > > Chris
> > > >
> > > > > "Jayanth" <jayanth_18@hotmail.com> wrote in message
> > > > > news:bid4pe$ojs$1@eclipse.org...
> > > > > > I have created a multipage editor of four pages and an extra page
> as
> > > > > > 'general'. When i click on any of the tabs, a new page becomes
> active.
> > > > > > This new page contains nothing. I want a file to be opened
> whenever i
> > > cick
> > > > > > on any tab. So how am i to pass the filepath to the method to open
> the
> > > > > > corresponding file. The code for creating a page is as given
> below. I
> > > use
> > > > > > the same method for creating all the other pages.
> > > > > >
> > > > > > void createPage2()
> > > > > > {
> > > > > > Composite composite = new Composite(getContainer(), SWT.NONE);
> > > > > > FillLayout layout = new FillLayout();
> > > > > > composite.setLayout(layout);
> > > > > > int index = addPage(composite);
> > > > > > setPageText(index, "Preview");
> > > > > > }
> > > > > >
> > > > > > Thanks in advance.....
> > > > > > With Regards,
> > > > > > Jayanth
> > > > > > Project Trainee,
> > > > > > IBM Software Lab, Bangalore,
> > > > > > India.
> > > > > > Ph:080-5094190
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >
|
|
|
Goto Forum:
Current Time: Tue Jul 22 13:48:08 EDT 2025
Powered by FUDForum. Page generated in 0.05639 seconds
|