Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Views Article: getImageDescriptor throws NullPointerException
Views Article: getImageDescriptor throws NullPointerException [message #65986] Fri, 06 June 2003 21:04 Go to next message
Eclipse UserFriend
Originally posted by: rohiteipe.hotmail.com

Hi

I was following the Article on Views
( http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l), and I ran
into a spot of trouble. Before I commented out this line:

addItemAction.setImageDescriptor(getImageDescriptor("add.gif "));

The call to getImageDescriptor(), was giving me a NullPointerException.
When I did comment it out, the view worked, I got a toolbar, and a menu,
and I could add and delete items, but I couldn't see the images add.gif
and delete.gif for the menu bar buttons.

As far as the code in the article goes, createPartControl() calls a method
createActions(), which makes a call to getImageDescriptor() in the line
pasted above.

See below for the log entry, I think only the first few lines are relevant.

Any advice would be appreciated, Thanks in advance.

Rohit




!ENTRY org.eclipse.ui.workbench 4 2 Jun 06, 2003 15:53:24.526
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.ui.articles.views.WordView.getImageDescriptor(Wo rdView.java:218)
at org.eclipse.ui.articles.views.WordView.createActions(WordVie w.java:130)
at
org.eclipse.ui.articles.views.WordView.createPartControl(Wor dView.java:80)
at org.eclipse.ui.internal.PartPane$4.run(PartPane.java:138)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:867)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.ui.internal.PartPane.createChildControl(PartPane .java:134)
at org.eclipse.ui.internal.ViewPane.createChildControl(ViewPane .java:202)
at org.eclipse.ui.internal.PartPane.createControl(PartPane.java :183)
at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java :181)
at
org.eclipse.ui.internal.PartTabFolder.createPartTab(PartTabF older.java:251)
at
org.eclipse.ui.internal.PartTabFolder.replaceChild(PartTabFo lder.java:683)
at org.eclipse.ui.internal.PartTabFolder.replace(PartTabFolder. java:623)
at
org.eclipse.ui.internal.PerspectivePresentation.addPart(Pers pectivePresentation.java:189)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1470)
at
org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:652)
at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:631)
at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.j ava:2742)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:65)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2739)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2729)
at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:173)
at org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:159)
at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :47)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:841 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:456)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Event(ActionContributionItem.java:403)
at
org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContributionItem.java:397)
at
org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEvent(ActionContributionItem.java:72)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1775)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1483)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1271)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254)
at
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.java:845)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
at org.eclipse.core.launcher.Main.run(Main.java:703)
at org.eclipse.core.launcher.Main.main(Main.java:539)
Re: Views Article: getImageDescriptor throws NullPointerException [message #68314 is a reply to message #65986] Mon, 09 June 2003 19:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: debbie_wilson.ca.ibm.com

I ran this example on I20030605 without difficulty. The add.gif image is
found under the icons directory of this plugin. Did you extract the entire
viewArticleSrc.zip to your plugins directory?

My steps to run this example were:
- from the Eclipse download page, extract I20030605 (or M1) to d:/I20030506
(I'm on Windows XP)
- from the article, extract viewArticleSrc.zip to
d:/I20030506/eclipse/plugins
- fire up Eclipse
- Window->Show View->Other->Article->Word View
- I could add and/or remove words in this view without trouble

There were no errors in my log file.

Does this help at all?

Deb


"Rohit Eipe" <rohiteipe@hotmail.com> wrote in message
news:bbqvkn$sog$1@rogue.oti.com...
> Hi
>
> I was following the Article on Views
> ( http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l), and I ran
> into a spot of trouble. Before I commented out this line:
>
> addItemAction.setImageDescriptor(getImageDescriptor("add.gif "));
>
> The call to getImageDescriptor(), was giving me a NullPointerException.
> When I did comment it out, the view worked, I got a toolbar, and a menu,
> and I could add and delete items, but I couldn't see the images add.gif
> and delete.gif for the menu bar buttons.
>
> As far as the code in the article goes, createPartControl() calls a method
> createActions(), which makes a call to getImageDescriptor() in the line
> pasted above.
>
> See below for the log entry, I think only the first few lines are
relevant.
>
> Any advice would be appreciated, Thanks in advance.
>
> Rohit
>
>
>
>
> !ENTRY org.eclipse.ui.workbench 4 2 Jun 06, 2003 15:53:24.526
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.ui.workbench".
> !STACK 0
> java.lang.NullPointerException
> at
>
org.eclipse.ui.articles.views.WordView.getImageDescriptor(Wo rdView.java:218)
> at org.eclipse.ui.articles.views.WordView.createActions(WordVie w.java:130)
> at
> org.eclipse.ui.articles.views.WordView.createPartControl(Wor dView.java:80)
> at org.eclipse.ui.internal.PartPane$4.run(PartPane.java:138)
> at
>
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:867)
> at org.eclipse.core.runtime.Platform.run(Platform.java:413)
> at org.eclipse.ui.internal.PartPane.createChildControl(PartPane .java:134)
> at org.eclipse.ui.internal.ViewPane.createChildControl(ViewPane .java:202)
> at org.eclipse.ui.internal.PartPane.createControl(PartPane.java :183)
> at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java :181)
> at
>
org.eclipse.ui.internal.PartTabFolder.createPartTab(PartTabF older.java:251)
> at
> org.eclipse.ui.internal.PartTabFolder.replaceChild(PartTabFo lder.java:683)
> at org.eclipse.ui.internal.PartTabFolder.replace(PartTabFolder. java:623)
> at
>
org.eclipse.ui.internal.PerspectivePresentation.addPart(Pers pectivePresentat
ion.java:189)
> at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1470)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:652)
> at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:631)
> at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.j ava:2742)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:65)
> at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2739)
> at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2729)
> at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:173)
> at org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:159)
> at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :47)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:841 )
> at
>
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Action
ContributionItem.java:456)
> at
>
org.eclipse.jface.action.ActionContributionItem.handleWidget Event(ActionCont
ributionItem.java:403)
> at
>
org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContributionI
tem.java:397)
> at
>
org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEvent(A
ctionContributionItem.java:72)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1775)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1483)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1271)
> at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254)
> at
>
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.jav
a:845)
> at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39
)
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl
..java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
> at org.eclipse.core.launcher.Main.run(Main.java:703)
> at org.eclipse.core.launcher.Main.main(Main.java:539)
>
Re: Views Article: getImageDescriptor throws NullPointerException [message #68324 is a reply to message #68314] Mon, 09 June 2003 19:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rohiteipe.hotmail.com

Debbie Wilson wrote:

> I ran this example on I20030605 without difficulty. The add.gif image is
> found under the icons directory of this plugin. Did you extract the entire
> viewArticleSrc.zip to your plugins directory?

> My steps to run this example were:
> - from the Eclipse download page, extract I20030605 (or M1) to d:/I20030506
> (I'm on Windows XP)
> - from the article, extract viewArticleSrc.zip to
> d:/I20030506/eclipse/plugins
> - fire up Eclipse
> - Window->Show View->Other->Article->Word View
> - I could add and/or remove words in this view without trouble

> There were no errors in my log file.

> Does this help at all?

> Deb


> "Rohit Eipe" <rohiteipe@hotmail.com> wrote in message
> news:bbqvkn$sog$1@rogue.oti.com...
> > Hi
> >
> > I was following the Article on Views
> > ( http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l), and I ran
> > into a spot of trouble. Before I commented out this line:
> >
> > addItemAction.setImageDescriptor(getImageDescriptor("add.gif "));
> >
> > The call to getImageDescriptor(), was giving me a NullPointerException.
> > When I did comment it out, the view worked, I got a toolbar, and a menu,
> > and I could add and delete items, but I couldn't see the images add.gif
> > and delete.gif for the menu bar buttons.
> >
> > As far as the code in the article goes, createPartControl() calls a method
> > createActions(), which makes a call to getImageDescriptor() in the line
> > pasted above.
> >
> > See below for the log entry, I think only the first few lines are
> relevant.
> >
> > Any advice would be appreciated, Thanks in advance.
> >
> > Rohit
> >
> >
> >
> >
> > !ENTRY org.eclipse.ui.workbench 4 2 Jun 06, 2003 15:53:24.526
> > !MESSAGE Problems occurred when invoking code from plug-in:
> > "org.eclipse.ui.workbench".
> > !STACK 0
> > java.lang.NullPointerException
> > at
> >
> org.eclipse.ui.articles.views.WordView.getImageDescriptor(Wo rdView.java:218)
> > at org.eclipse.ui.articles.views.WordView.createActions(WordVie w.java:130)
> > at
> > org.eclipse.ui.articles.views.WordView.createPartControl(Wor dView.java:80)
> > at org.eclipse.ui.internal.PartPane$4.run(PartPane.java:138)
> > at
> >
> org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
> :867)
> > at org.eclipse.core.runtime.Platform.run(Platform.java:413)
> > at org.eclipse.ui.internal.PartPane.createChildControl(PartPane .java:134)
> > at org.eclipse.ui.internal.ViewPane.createChildControl(ViewPane .java:202)
> > at org.eclipse.ui.internal.PartPane.createControl(PartPane.java :183)
> > at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java :181)
> > at
> >
> org.eclipse.ui.internal.PartTabFolder.createPartTab(PartTabF older.java:251)
> > at
> > org.eclipse.ui.internal.PartTabFolder.replaceChild(PartTabFo lder.java:683)
> > at org.eclipse.ui.internal.PartTabFolder.replace(PartTabFolder. java:623)
> > at
> >
> org.eclipse.ui.internal.PerspectivePresentation.addPart(Pers pectivePresentat
> ion.java:189)
> > at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1470)
> > at
> > org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:652)
> > at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:631)
> > at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.j ava:2742)
> > at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:65)
> > at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2739)
> > at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2729)
> > at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:173)
> > at org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:159)
> > at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :47)
> > at org.eclipse.jface.action.Action.runWithEvent(Action.java:841 )
> > at
> >
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Action
> ContributionItem.java:456)
> > at
> >
> org.eclipse.jface.action.ActionContributionItem.handleWidget Event(ActionCont
> ributionItem.java:403)
> > at
> >
> org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContributionI
> tem.java:397)
> > at
> >
> org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEvent(A
> ctionContributionItem.java:72)
> > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
> > at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
> > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1775)
> > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1483)
> > at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1271)
> > at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254)
> > at
> >
> org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.jav
> a:845)
> > at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39
> )
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl
> ..java:25)
> > at java.lang.reflect.Method.invoke(Method.java:324)
> > at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
> > at org.eclipse.core.launcher.Main.run(Main.java:703)
> > at org.eclipse.core.launcher.Main.main(Main.java:539)
> >
Re: Views Article: getImageDescriptor throws NullPointerException [message #68368 is a reply to message #68314] Mon, 09 June 2003 20:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rohiteipe.hotmail.com

Hi

Well, I am running 2.1, maybe that's the problem, though I'd be surprised
if it was. Can you update/install Eclipse over a previous installation
without losing all your work?

The add.gif was in the org.articles.ui.views folder of my workspace
folder. I moved it to the /plugins/org.articles.ui.views/icons/*.gif, and
that still didn't work. Ditto for delete.gif. I tried moving to
/plugins/icons/*.gif and that didn't work. I tried moving to
/plugins/*.gif and that didn't work. I tried
plugins/org.articles.ui.views/*.gif and that didn't work :-(

I didn't extract all of the code, though I did have to copy some files
from there. For the most part, I was just following along with the
article, so that I would understand things for myself.

The error message that comes up, if it helps, is
'Unable to create part view' : in a window, and then ..
'An error has occurred when creating this view' : in the view itself.

.. and the buttons don't show up. As I said, if I comment out the lines
mentioned in my original post, I get all the functionality, I was just
wondering about getting the +++ and X images to show up too. In their
places, I get little red squares.

I appreciate your help, thanks :-)

Debbie Wilson wrote:

> I ran this example on I20030605 without difficulty. The add.gif image is
> found under the icons directory of this plugin. Did you extract the entire
> viewArticleSrc.zip to your plugins directory?

> My steps to run this example were:
> - from the Eclipse download page, extract I20030605 (or M1) to d:/I20030506
> (I'm on Windows XP)
> - from the article, extract viewArticleSrc.zip to
> d:/I20030506/eclipse/plugins
> - fire up Eclipse
> - Window->Show View->Other->Article->Word View
> - I could add and/or remove words in this view without trouble

> There were no errors in my log file.

> Does this help at all?

> Deb


> "Rohit Eipe" <rohiteipe@hotmail.com> wrote in message
> news:bbqvkn$sog$1@rogue.oti.com...
> > Hi
> >
> > I was following the Article on Views
> > ( http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l), and I ran
> > into a spot of trouble. Before I commented out this line:
> >
> > addItemAction.setImageDescriptor(getImageDescriptor("add.gif "));
> >
> > The call to getImageDescriptor(), was giving me a NullPointerException.
> > When I did comment it out, the view worked, I got a toolbar, and a menu,
> > and I could add and delete items, but I couldn't see the images add.gif
> > and delete.gif for the menu bar buttons.
> >
> > As far as the code in the article goes, createPartControl() calls a method
> > createActions(), which makes a call to getImageDescriptor() in the line
> > pasted above.
> >
> > See below for the log entry, I think only the first few lines are
> relevant.
> >
> > Any advice would be appreciated, Thanks in advance.
> >
> > Rohit
> >
> >
> >
> >
> > !ENTRY org.eclipse.ui.workbench 4 2 Jun 06, 2003 15:53:24.526
> > !MESSAGE Problems occurred when invoking code from plug-in:
> > "org.eclipse.ui.workbench".
> > !STACK 0
> > java.lang.NullPointerException
> > at
> >
> org.eclipse.ui.articles.views.WordView.getImageDescriptor(Wo rdView.java:218)
> > at org.eclipse.ui.articles.views.WordView.createActions(WordVie w.java:130)
> > at
> > org.eclipse.ui.articles.views.WordView.createPartControl(Wor dView.java:80)
> > at org.eclipse.ui.internal.PartPane$4.run(PartPane.java:138)
> > at
> >
> org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
> :867)
> > at org.eclipse.core.runtime.Platform.run(Platform.java:413)
> > at org.eclipse.ui.internal.PartPane.createChildControl(PartPane .java:134)
> > at org.eclipse.ui.internal.ViewPane.createChildControl(ViewPane .java:202)
> > at org.eclipse.ui.internal.PartPane.createControl(PartPane.java :183)
> > at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java :181)
> > at
> >
> org.eclipse.ui.internal.PartTabFolder.createPartTab(PartTabF older.java:251)
> > at
> > org.eclipse.ui.internal.PartTabFolder.replaceChild(PartTabFo lder.java:683)
> > at org.eclipse.ui.internal.PartTabFolder.replace(PartTabFolder. java:623)
> > at
> >
> org.eclipse.ui.internal.PerspectivePresentation.addPart(Pers pectivePresentat
> ion.java:189)
> > at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1470)
> > at
> > org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:652)
> > at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:631)
> > at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.j ava:2742)
> > at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:65)
> > at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2739)
> > at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2729)
> > at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:173)
> > at org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:159)
> > at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :47)
> > at org.eclipse.jface.action.Action.runWithEvent(Action.java:841 )
> > at
> >
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Action
> ContributionItem.java:456)
> > at
> >
> org.eclipse.jface.action.ActionContributionItem.handleWidget Event(ActionCont
> ributionItem.java:403)
> > at
> >
> org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContributionI
> tem.java:397)
> > at
> >
> org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEvent(A
> ctionContributionItem.java:72)
> > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
> > at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
> > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1775)
> > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1483)
> > at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1271)
> > at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254)
> > at
> >
> org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.jav
> a:845)
> > at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39
> )
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl
> ..java:25)
> > at java.lang.reflect.Method.invoke(Method.java:324)
> > at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
> > at org.eclipse.core.launcher.Main.run(Main.java:703)
> > at org.eclipse.core.launcher.Main.main(Main.java:539)
> >
Re: Views Article: getImageDescriptor throws NullPointerException [message #71074 is a reply to message #68368] Wed, 11 June 2003 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: debbie_wilson.ca.ibm.com

I tried this with 2.1 and it works fine.

Is it possible for you to remove this particular project
(org.eclipse.ui.articles.views) and re-install it from the zip file? That
way we are starting from a common point.

The code to look for the icons happens in WorkView.getImageDescriptor(...).
It will look in a directory 'icons' under the directory for this plugin -
<workspace>/eclipse/plugins/org.eclipse.ui.articles.views/icons

Deb


"Rohit Eipe" <rohiteipe@hotmail.com> wrote in message
news:bc2p8h$uka$1@rogue.oti.com...
> Hi
>
> Well, I am running 2.1, maybe that's the problem, though I'd be surprised
> if it was. Can you update/install Eclipse over a previous installation
> without losing all your work?
>
> The add.gif was in the org.articles.ui.views folder of my workspace
> folder. I moved it to the /plugins/org.articles.ui.views/icons/*.gif, and
> that still didn't work. Ditto for delete.gif. I tried moving to
> /plugins/icons/*.gif and that didn't work. I tried moving to
> /plugins/*.gif and that didn't work. I tried
> plugins/org.articles.ui.views/*.gif and that didn't work :-(
>
> I didn't extract all of the code, though I did have to copy some files
> from there. For the most part, I was just following along with the
> article, so that I would understand things for myself.
>
> The error message that comes up, if it helps, is
> 'Unable to create part view' : in a window, and then ..
> 'An error has occurred when creating this view' : in the view itself.
>
> . and the buttons don't show up. As I said, if I comment out the lines
> mentioned in my original post, I get all the functionality, I was just
> wondering about getting the +++ and X images to show up too. In their
> places, I get little red squares.
>
> I appreciate your help, thanks :-)
>
> Debbie Wilson wrote:
>
> > I ran this example on I20030605 without difficulty. The add.gif image
is
> > found under the icons directory of this plugin. Did you extract the
entire
> > viewArticleSrc.zip to your plugins directory?
>
> > My steps to run this example were:
> > - from the Eclipse download page, extract I20030605 (or M1) to
d:/I20030506
> > (I'm on Windows XP)
> > - from the article, extract viewArticleSrc.zip to
> > d:/I20030506/eclipse/plugins
> > - fire up Eclipse
> > - Window->Show View->Other->Article->Word View
> > - I could add and/or remove words in this view without trouble
>
> > There were no errors in my log file.
>
> > Does this help at all?
>
> > Deb
>
>
> > "Rohit Eipe" <rohiteipe@hotmail.com> wrote in message
> > news:bbqvkn$sog$1@rogue.oti.com...
> > > Hi
> > >
> > > I was following the Article on Views
> > > ( http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l), and I
ran
> > > into a spot of trouble. Before I commented out this line:
> > >
> > > addItemAction.setImageDescriptor(getImageDescriptor("add.gif "));
> > >
> > > The call to getImageDescriptor(), was giving me a
NullPointerException.
> > > When I did comment it out, the view worked, I got a toolbar, and a
menu,
> > > and I could add and delete items, but I couldn't see the images
add.gif
> > > and delete.gif for the menu bar buttons.
> > >
> > > As far as the code in the article goes, createPartControl() calls a
method
> > > createActions(), which makes a call to getImageDescriptor() in the
line
> > > pasted above.
> > >
> > > See below for the log entry, I think only the first few lines are
> > relevant.
> > >
> > > Any advice would be appreciated, Thanks in advance.
> > >
> > > Rohit
> > >
> > >
> > >
> > >
> > > !ENTRY org.eclipse.ui.workbench 4 2 Jun 06, 2003 15:53:24.526
> > > !MESSAGE Problems occurred when invoking code from plug-in:
> > > "org.eclipse.ui.workbench".
> > > !STACK 0
> > > java.lang.NullPointerException
> > > at
> > >
> >
org.eclipse.ui.articles.views.WordView.getImageDescriptor(Wo rdView.java:218)
> > > at
org.eclipse.ui.articles.views.WordView.createActions(WordVie w.java:130)
> > > at
> > >
org.eclipse.ui.articles.views.WordView.createPartControl(Wor dView.java:80)
> > > at org.eclipse.ui.internal.PartPane$4.run(PartPane.java:138)
> > > at
> > >
> >
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
> > :867)
> > > at org.eclipse.core.runtime.Platform.run(Platform.java:413)
> > > at
org.eclipse.ui.internal.PartPane.createChildControl(PartPane .java:134)
> > > at
org.eclipse.ui.internal.ViewPane.createChildControl(ViewPane .java:202)
> > > at org.eclipse.ui.internal.PartPane.createControl(PartPane.java :183)
> > > at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java :181)
> > > at
> > >
> >
org.eclipse.ui.internal.PartTabFolder.createPartTab(PartTabF older.java:251)
> > > at
> > >
org.eclipse.ui.internal.PartTabFolder.replaceChild(PartTabFo lder.java:683)
> > > at
org.eclipse.ui.internal.PartTabFolder.replace(PartTabFolder. java:623)
> > > at
> > >
> >
org.eclipse.ui.internal.PerspectivePresentation.addPart(Pers pectivePresentat
> > ion.java:189)
> > > at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1470)
> > > at
> > >
org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:652)
> > > at
org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:631)
> > > at
org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.j ava:2742)
> > > at
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:65)
> > > at
org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2739)
> > > at
org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2729)
> > > at
org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:173)
> > > at
org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:159)
> > > at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :47)
> > > at org.eclipse.jface.action.Action.runWithEvent(Action.java:841 )
> > > at
> > >
> >
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Action
> > ContributionItem.java:456)
> > > at
> > >
> >
org.eclipse.jface.action.ActionContributionItem.handleWidget Event(ActionCont
> > ributionItem.java:403)
> > > at
> > >
> >
org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContributionI
> > tem.java:397)
> > > at
> > >
> >
org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEvent(A
> > ctionContributionItem.java:72)
> > > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
> > > at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
> > > at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1775)
> > > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1483)
> > > at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1271)
> > > at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254)
> > > at
> > >
> >
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.jav
> > a:845)
> > > at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> >
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39
> > )
> > > at
> > >
> >
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl
> > ..java:25)
> > > at java.lang.reflect.Method.invoke(Method.java:324)
> > > at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
> > > at org.eclipse.core.launcher.Main.run(Main.java:703)
> > > at org.eclipse.core.launcher.Main.main(Main.java:539)
> > >
>
>
>
>
>
Previous Topic:HElp!!! big pb with plugin.xml
Next Topic:Build Eclipse project without starting IDE
Goto Forum:
  


Current Time: Sat Aug 10 07:30:19 GMT 2024

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

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

Back to the top