Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] "Creating an Eclipse plug-in" cheat sheet

Add org.eclipse.ui and org.eclipse.core.runtime to the required bundles section of the dependencies tab in the MANIFEST.MF file.

They used to be added automatically when a plugin project was created but this is no longer the case.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=522710



On Tue, Aug 17, 2021 at 1:04 PM Weber Matthias <Matthias.Weber@xxxxxxxxxxx> wrote:
Hi all,

thank you for your hints - this has been very helpful. I have read the instructions more carefully and it really seems that I've accidentally skipped some steps.

However, I am still a bit stuck adding code for the view class. The instructions say "Add the following lines of code under the pre-generated createPartControl method" but there is no such pre-generated method but only "// TODO Auto-generated constructor stub" instead.

Even "public class SampleView extends ViewPart {" seems to be wrong as I get "the hierarchy of the type SampleView is inconsistent" - unfortunately I am a total Java newbie here.
Am I not allowed to extend the base class ViewPart? If I keep it, I get the following runtime error:
Plug-in "com.example.helloworld" was unable to instantiate class "com.example.helloworld.view.SampleView".

If I remove the "extends ViewPart" snippet, I get another error:
class com.example.helloworld.view.SampleView cannot be cast to class org.eclipse.ui.IViewPart (com.example.helloworld.view.SampleView is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @7d72aa8f; org.eclipse.ui.IViewPart is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @771fb289)

Any hint is welcome how I get a minimal example of code for a custom view working is very welcome. Please find my example code attached - I've also tried to Lars' demo project into account.

Best regards,
Matthias

-----Ursprüngliche Nachricht-----
Von: pde-dev <pde-dev-bounces@xxxxxxxxxxx> Im Auftrag von Lars Vogel
Gesendet: Dienstag, 17. August 2021 09:36
An: Eclipse PDE general developers list. <pde-dev@xxxxxxxxxxx>
Betreff: Re: [pde-dev] "Creating an Eclipse plug-in" cheat sheet

CAUTION: This email originated from outside your organization. Exercise caution when opening attachments or on clicking links from unknown senders.

Hi Matthias,

have a look at https://www.vogella.com/tutorials/EclipsePlugin/article.html
to learn how to extend the Eclipse IDE.

HTH, Lars

On Wed, Aug 11, 2021 at 3:55 PM Jonah Graham <jonah@xxxxxxxxxxxxxxxx> wrote:
>
> BTW - until the cheat sheet is fixed, I think you have missed a step.
>
> Your screenshot shows you have done the "add a view category", but you need to do "add a view" before you do "create a view class".
>
> HTH,
> Jonah
>
> ~~~
> Jonah Graham
> Kichwa Coders
> www.kichwacoders.com
>
>
> On Wed, 11 Aug 2021 at 04:12, Weber Matthias <Matthias.Weber@xxxxxxxxxxx> wrote:
>>
>> Hi,
>>
>>
>>
>> I’ve been an Eclipse user for several years now, but I am completely new to Eclipse development.
>>
>> Please let me know if I am wrong here and my questions should be directed to some other kind of support channel (forum, other mailing list, etc).
>>
>>
>>
>> I want to understand the development of Eclipse plug-ins and have therefore stumbled across the Eclipse PDE and this mailing list. I’ve started working through the Cheat Sheets and am already stuck with the “Create a plug-in extension”: I cannot perform the “Create a view class” step as I do not see any hyperlink labelled "class" in the Extension Element Details.
>>
>>
>>
>> From the  Cheat Sheet:
>>
>> >To create a view class, perform the following steps:
>>
>> >Click the "class" hyperlink under "Extension Element Details" to
>> >start the "New Java Class" wizard
>>
>>
>>
>> The Eclipse SDK I am using is: Version: 2021-06 (4.20), Build id:
>> I20210611-1600
>>
>>
>>
>> Best regards,
>>
>> Matthias
>>
>>
>>
>> _______________________________________________
>> pde-dev mailing list
>> pde-dev@xxxxxxxxxxx
>> To unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/pde-dev
>
> _______________________________________________
> pde-dev mailing list
> pde-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/pde-dev



--
Eclipse Platform project co-lead
CEO vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com _______________________________________________
pde-dev mailing list
pde-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/pde-dev
_______________________________________________
pde-dev mailing list
pde-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/pde-dev

Back to the top