[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sapphire-dev] JavaType create action failing for type with single interface
|
Nice! I updated to build 537 and this is no longer an issue.
On Thu, Sep 29, 2011 at 9:25 PM, Konstantin Komissarchik
<konstantin.komissarchik@xxxxxxxxxx> wrote:
Hi Greg,
Good to see you back in Sapphire land! This problem looks similar to a bug that was fixed very recently. I believe that if you upgrade to the latest build, it will go away.
- Konstantin
Hello again Sapphire developers,
After a several month hiatus I've back to working on sapphire editors again! We are about to roll out a new sapphire based editor and just doing some final QA and noticed a strange issue with @JavaType create class action.
First here is my build env: 0.3.x stream, buildId: 0.3.1.201109221708
Here is my element that represents a listener element:
public interface IListener extends IModelElement, IDescribeable, IDisplayable {
ModelElementType TYPE = new ModelElementType( IListener.class );
// *** Implementation ***
@Type( base = JavaTypeName.class )
@Reference( target = JavaType.class )
@JavaTypeConstraint( kind = JavaTypeKind.CLASS, type = "javax.servlet.ServletContextListener" )
@Label( standard = "Implementation", full = "Listener implementation class" )
@XmlBinding( path = "listener-class" )
@Documentation( content = "The listener implementation class." )
ValueProperty PROP_IMPLEMENTATION = new ValueProperty( TYPE, "Implementation" );
ReferenceValue<JavaTypeName, JavaType> getImplementation();
void setImplementation( String value );
void setImplementation( JavaTypeName value );
So this type of model when a property editor is added for the Implementation property is where I'm having the problem. In the editor when I type in a implementation class name and if it doesn't exist, then I click on the "+" button for create, the file that is created is invalid. Here is the output in my particular case:
import javax.servlet.ServletContextEvent;
// TODO Auto-generated constructor stub
}Listener implements ServletContextListener
public void contextDestroyed(ServletContextEvent arg0) {
// TODO Auto-generated method stub
public void contextInitialized(ServletContextEvent arg0) {
// TODO Auto-generated method stub
As you can see the code is malformed and will not compile. What is strange is that if I go back to the @JavaTypeConstraint(..) annotation and specify another type ="" attribute and use a Class instead of an Interface the "+" create action works as expected. Also if instead use two interface classes instead of one that also works properly. But when I use just one interface class I get this error.
--
Liferay, Inc.
_______________________________________________
sapphire-dev mailing list
sapphire-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/sapphire-dev
--
Greg Amerson
Liferay, Inc.