Package de.mhus.lib.form.builders

Examples of de.mhus.lib.form.builders.FormModelBuilder$ClassHandler


      FillLayout layout = new FillLayout();
      mainWindow.setLayout(layout);

    MForm target = new Target();
    MFormModel model = new FormModelBuilder( MSingleton.instance().getActivator(), target, FormModelBuilder.DEFAULT_SCHEMA );
    MFormSwtControl control = new MFormSwtControl( model );

    control.createControl(mainWindow);
   
      mainWindow.setText("SWT");
View Full Code Here


    if (target instanceof IConfigurable) {
      return ((IConfigurable) target).getConfigurationForm();
    }
    if (target.getClass().isAnnotationPresent(FormElement.class)) {
      try {
        return new FormModelBuilder(activator, target, schema);
      } catch (Exception e) {
        throw new FormException(target, null, e);
      }
    }
    throw new FormException(target, null, "can't create form");
View Full Code Here

  public UiModel(MForm target, String schema) throws Exception {
    this(MSingleton.instance().getActivator(), target, schema);
  }
 
  public UiModel(MActivator activator, MForm target, String schema) throws Exception {
    this(new FormModelBuilder(activator, target, schema).getForm());
  }
View Full Code Here

public class FormTest extends TestCase {

 
  public void testStaticForm() throws Exception {
    StaticForm target = new StaticForm();
    MFormModel model = new FormModelBuilder( MSingleton.instance().getActivator(), target, FormModelBuilder.DEFAULT_SCHEMA );

    target.setInput("string");
    model.loadFromTarget();
    assertEquals("string", ((FString)model.getElement("input")).getValue());
   
    ((FString)model.getElement("input")).setValue("newstring");
    assertNotSame("set", "newstring", target.getInput());
   
    model.saveToTarget(false);
    assertEquals("newstring", ((FString)model.getElement("input")).getValue());

    try {
      ((FString)model.getElement("input2")).setValue("");
      // should hrow an error
      assertTrue(true);
    } catch (ValidateException e) {
     
    }
   
    try {
      ((FString)model.getElement("input2")).setValue("123456");
      // should hrow an error
      assertTrue(true);
    } catch (ValidateException e) {
     
    }
View Full Code Here

  }
 
  public void testNls() throws Exception {
   
    StaticForm target = new StaticForm();
    MFormModel model = new FormModelBuilder( MSingleton.instance().getActivator(), target, FormModelBuilder.DEFAULT_SCHEMA );

    FObject input = model.getElement("input");
    String inputTitle = input.findTitle();
   
    //assertEquals("TestNlsInput", inputTitle);
   
  }
View Full Code Here

        Panel panel = new Panel("Details");
        panel.setWidth("100%");
       
        try {
          MForm target = createTarget();
          model = new FormModelBuilder(new MActivator(this.getClass().getClassLoader()), target,null);
          model.setEnabled(false);
          control = new MFormVaadinControl(model);
          control.createControl(panel);
        } catch (Exception e) {
          e.printStackTrace();
View Full Code Here

TOP

Related Classes of de.mhus.lib.form.builders.FormModelBuilder$ClassHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.