Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to make JavaEditor example editor extend CompilationUnitEditor
How to make JavaEditor example editor extend CompilationUnitEditor [message #92993] Sun, 07 September 2003 21:55 Go to next message
Eclipse UserFriend
Hi all,

I like to know if there is any example or documentation about how to
change the JavaEditor example editor so that it extends
CompilationUnitEditor.I have looked into it before but it seems that I
can't extend it as it it an internal API.

Any pointer will be appreciated.

Syed
Re: How to make JavaEditor example editor extend CompilationUnitEditor [message #94224 is a reply to message #92993] Thu, 11 September 2003 03:35 Go to previous message
Eclipse UserFriend
Originally posted by: t_tcholakov.prosyst.bg

You can. I wanted to extend it and to add an additional tab to it and it
worked.
here is part of my code :

public void createPartControl(Composite parent) {

tabFolder = new TabFolder(parent,0);

TabItem item1= new TabItem(tabFolder,0);

item1.setText("Source");

Composite comps = new Composite(tabFolder,0);

item1.setControl(comps);

comps.setLayout(new FillLayout());

super.createPartControl(comps);//this creates the control for the source.

this is in a class which extends CompilationUnitEditor



and this is a part of my plugin.xml file - these plugins are needed to run
(or at least some of them. I think that some of them may be obsolete, but I
have no time to prove it)

<requires>

<import plugin="org.eclipse.jdt.ui"/>

<import plugin="org.eclipse.jdt.launching"/>

<import plugin="org.eclipse.swt"/>

<import plugin="org.eclipse.ui"/>

<import plugin="org.eclipse.jdt.core"/>

</requires>



if these plugins are not imported you would have a "ClassNotFound" exception
when in the runtime workbench.

And at last :

if you want to use the abilities of the original code editor set the
"contributorclass" element like this:

contributorClass="org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEdit
orActionContributor".

otherwise you won't have all the additional menus and actions that the java
editor supports.



I wish you success.



"Syed" <sma_r@hotmail.com> wrote in message news:bjgnim$8r4$1@eclipse.org...
> Hi all,
>
> I like to know if there is any example or documentation about how to
> change the JavaEditor example editor so that it extends
> CompilationUnitEditor.I have looked into it before but it seems that I
> can't extend it as it it an internal API.
>
> Any pointer will be appreciated.
>
> Syed
>
Previous Topic:[ANN] CodePro WebCast Thursday 1:00pm EDT
Next Topic:Package Explorer View Drop Action
Goto Forum:
  


Current Time: Wed Apr 30 07:34:46 EDT 2025

Powered by FUDForum. Page generated in 0.05849 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top