@Target(value=METHOD) @Retention(value=RUNTIME) public @interface DesignCreate
Example for using a bean that requires parameters in its constructor:
public class MyBean extends JCompoment { @DesignCreate private static MyBean designCreate() { return new MyBean( "someArgValue" ); } public MyBean( String someArg ) { // ... } }Note: For the above example, you have to use the "Custom Creation Code" property to ensure that JFormDesigner generates compilable code.
Example for using this annotation to initialize the bean with test data for the Design view:
public class MyBean extends JCompoment { @DesignCreate private static MyBean designCreate() { MyBean myBean = new MyBean(); myBean.setData( new SomeDummyDataForDesigning() ); return myBean; } public MyBean() { // ... } }
Copyright (C) 2004-2019 FormDev Software GmbH. All rights reserved.