DefaultInitializer.java :  » XML-UI » JAXX » jaxx » Java Open Source

Java Open Source » XML UI » JAXX 
JAXX » jaxx » DefaultInitializer.java
/*
 * Copyright 2006 Ethan Nicholas. All rights reserved.
 * Use is subject to license terms.
 */
package jaxx;

import java.awt.*;

import jaxx.compiler.*;
import jaxx.reflect.*;
import jaxx.spi.*;
import jaxx.tags.*;
import jaxx.types.*;

/** Initializes support for Swing components and types. */
public class DefaultInitializer implements Initializer {
  
  /** Called by the JAXX SPI system to initialize Swing support. */
    public void initialize() {
        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(Object.class), DefaultObjectHandler.class);
        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(Component.class), DefaultComponentHandler.class);
        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "script", new ScriptHandler());
        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "style", new StyleHandler());
        
        PrimitiveConverter primitiveConverter = new PrimitiveConverter();
        TypeManager.registerTypeConverter(boolean.class, primitiveConverter);
        TypeManager.registerTypeConverter(Boolean.class, primitiveConverter);
        TypeManager.registerTypeConverter(byte.class, primitiveConverter);
        TypeManager.registerTypeConverter(Byte.class, primitiveConverter);
        TypeManager.registerTypeConverter(short.class, primitiveConverter);
        TypeManager.registerTypeConverter(Short.class, primitiveConverter);
        TypeManager.registerTypeConverter(int.class, primitiveConverter);
        TypeManager.registerTypeConverter(Integer.class, primitiveConverter);
        TypeManager.registerTypeConverter(long.class, primitiveConverter);
        TypeManager.registerTypeConverter(Long.class, primitiveConverter);
        TypeManager.registerTypeConverter(float.class, primitiveConverter);
        TypeManager.registerTypeConverter(Float.class, primitiveConverter);
        TypeManager.registerTypeConverter(double.class, primitiveConverter);
        TypeManager.registerTypeConverter(Double.class, primitiveConverter);
        TypeManager.registerTypeConverter(char.class, primitiveConverter);
        TypeManager.registerTypeConverter(Character.class, primitiveConverter);
        TypeManager.registerTypeConverter(String.class, primitiveConverter);

        TypeManager.registerTypeConverter(Color.class, new ColorConverter());
        TypeManager.registerTypeConverter(GridBagConstraints.class, new GridBagConstraintsConverter());
        TypeManager.registerTypeConverter(Insets.class, new InsetsConverter());
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.