Hi Christian, This isn't quite the way that Isis works.
Instead, we have what are called FacetFactorys, and a collection of these are registered to constitute the programming model - see ProgrammingModelFacetsJava5. The icon is determined by the IconFacet, that is attached to the ObjectSpecification (cf java.lang.Class) in the metamodel. So what the viewers do is they (should) search for IconFacet and if present call it. Since this is a common operation, there is actually a helper method getIconName() on ObjectAdapter (cf java.lang.Object). And indeed, the html, dnd and scimpi viewers are calling ObjectAdapter.getIconName(), while the wicket viewer does not. Was just looking at my list of things I need to address... I'm afraid this one is quite far down the list. You're very welcome, of course, to cobble together a patch if you wish :-) I have found that this stuff is somewhat fiddly, so don't feel compelled to. Cheers Dan ~~~~~~ On 14 February 2013 12:32, Christian Steinebach < [email protected]> wrote: > Hi again, > > Just did a search for iconName in isis/component/viewer (pulled the latest > from github) > There are no files containing the string iconName in the wicket module > but several files in the html, dnd and scimpi module do > Probably iconName() is not implemented in the wicket viewer. > > Christian > > > ________________________________________ > From: Christian Steinebach [[email protected]] > Sent: Thursday, February 14, 2013 12:58 PM > To: [email protected] > Subject: RE: iconName() > > Hi Dan > > https://issues.apache.org/jira/browse/ISIS-334 > > Christian > > ________________________________________ > From: Dan Haywood [[email protected]] > Sent: Thursday, February 14, 2013 12:17 PM > To: [email protected] > Subject: Re: iconName() > > Hi Christian, > Could you raise a ticket on that? there's a reasonable chance that this > doesn't work correctly yet...it's not a feature that Jeroen and I have used > in our app. > > Still, I think that the Wicket viewer should support it, as described. > > Thx > Dan > > > On 14 February 2013 11:11, Christian Steinebach < > [email protected]> wrote: > > > Hi > > > > I understood that the method iconName() should return a String > > which is the name of an image file in dom/src/main/resources/images. > > I inserted the method into ToDoItem.java but still the default > > ToDoItem.gif icon is > > shown in the wicket viewer. > > > > I inserted > > public String iconName(){ > > return "SomeIcon"; > > } > > > > into ToDoItem.java > > > > but iconName() is never called > > > > Christian > > >
