r2225 - in trunk: . jaxx-compiler jaxx-compiler/src/license jaxx-compiler/src/main/java/jaxx/compiler jaxx-compiler/src/main/java/jaxx/compiler/beans jaxx-compiler/src/main/java/jaxx/compiler/binding jaxx-compiler/src/main/java/jaxx/compiler/binding/writers jaxx-compiler/src/main/java/jaxx/compiler/css jaxx-compiler/src/main/java/jaxx/compiler/css/parser jaxx-compiler/src/main/java/jaxx/compiler/decorators jaxx-compiler/src/main/java/jaxx/compiler/finalizers jaxx-compiler/src/main/java/jaxx/c
Author: tchemit Date: 2011-02-19 21:15:00 +0100 (Sat, 19 Feb 2011) New Revision: 2225 Url: http://nuiton.org/repositories/revision/jaxx/2225 Log: add svn-eol-style property Anomalie #1129: call constructors other than default ones Add JavaConstructor in generator api Added: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaConstructor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateConstructorsTask.java Modified: trunk/LICENSE.txt trunk/README.txt trunk/changelog.txt trunk/jaxx-compiler/LICENSE.txt trunk/jaxx-compiler/README.txt trunk/jaxx-compiler/changelog.txt trunk/jaxx-compiler/pom.xml trunk/jaxx-compiler/src/license/THIRD-PARTY.properties trunk/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/IDHelper.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFile.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXFactory.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBinding.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBindingHelper.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataListener.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/JavaParserUtil.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/PseudoClassDataBinding.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/AbstractJAXXBindingWriter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/DefaultJAXXBindingWriter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/JAXXBindingWriter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/SimpleJAXXObjectBindingWriter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jj trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jjt trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/JAXXCompilerFinalizer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElementFactory.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorHelper.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorResolver.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJavaClass.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJavaFile.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJaxxFile.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/ImportHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/CompileFirstPassTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/CompileSecondPassTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/FinalizeTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/InitTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/JAXXEngineTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/ProfileTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/StyleSheetTask.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.CompiledObjectDecorator trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.JAXXCompilerFinalizer trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.spi.Initializer trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.types.TypeConverter trunk/jaxx-compiler/src/site/rst/index.rst trunk/jaxx-compiler/src/site/site_fr.xml trunk/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/binding/JavaParserUtilTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/java/JavaFieldTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/java/JavaMethodTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyAbstractClass.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyClass.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyEnum.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyInterface.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyInterface2.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyInterface3.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJavaFileTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/TypeManagerTest.java trunk/jaxx-compiler/src/test/resources/log4j.properties trunk/jaxx-demo/LICENSE.txt trunk/jaxx-demo/README.txt trunk/jaxx-demo/changelog.txt trunk/jaxx-demo/pom.xml trunk/jaxx-demo/src/license/THIRD-PARTY.properties trunk/jaxx-demo/src/main/filters/jaxx-demo.properties trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSourcesHandler.java trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTab.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.css trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.css trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemoModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/HidorButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/entities/AbstractDemoBean.java trunk/jaxx-demo/src/main/java/jaxx/demo/entities/DemoDecoratorProvider.java trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Identity.java trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BindingExtremeDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DefaultDemoUIModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DemoUIModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoDataProvider.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoHandler.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/AbstractContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorsContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MovieContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MoviesContentUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/ActorsTreeNodeLoador.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/MoviesTreeNodeLoador.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeCellRenderer.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeHelper.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeNode.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/ActorsTreeTableNodeLoador.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/MoviesTreeTableNodeLoador.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableHelper.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableNode.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.css trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.css trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNode.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNodeLoador.java trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoTreeHelper.java trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-error-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-info-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-warning-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-error-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-info-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-warning-validation.xml trunk/jaxx-demo/src/main/resources/log4j.properties trunk/jaxx-demo/src/site/rst/index.rst trunk/jaxx-demo/src/site/site_fr.xml trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java trunk/jaxx-runtime/LICENSE.txt trunk/jaxx-runtime/README.txt trunk/jaxx-runtime/changelog.txt trunk/jaxx-runtime/pom.xml trunk/jaxx-runtime/src/license/THIRD-PARTY.properties trunk/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXBinding.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXUtil.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/binding/DefaultJAXXBinding.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/binding/SimpleJAXXObjectBinding.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorProvider.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MapPropertyHandler.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionExecutor.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionWorker.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ApplicationRunner.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavBridge.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavDataProvider.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavHelper.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavNode.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavNodeChildLoador.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/package.html trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/AbstractNavTreeCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeBridge.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeHelper.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeNode.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeNodeChildLoador.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/package.html trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableBridge.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableHelper.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableModel.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableNode.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableNodeChildLoador.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/package.html trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorListCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorProviderListCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorProviderTableCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorTableCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorTableCelleRenderer.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/BusyChangeListener.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtModel.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtStep.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtStepModel.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtUI.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtUtil.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardState.java trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/package.html trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/package.html trunk/jaxx-runtime/src/main/resources/i18n/jaxx-runtime_en_GB.properties trunk/jaxx-runtime/src/main/resources/i18n/jaxx-runtime_fr_FR.properties trunk/jaxx-runtime/src/main/resources/validators.xml trunk/jaxx-runtime/src/site/rst/index.rst trunk/jaxx-runtime/src/site/site_fr.xml trunk/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/context/DataContextEntryIteratorTest.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/DecoratorProviderTest.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathContextTester.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MapPropertyHandlerTest.java trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java trunk/jaxx-runtime/src/test/resources/log4j.properties trunk/jaxx-swing-action/LICENSE.txt trunk/jaxx-swing-action/README.txt trunk/jaxx-swing-action/changelog.txt trunk/jaxx-swing-action/pom.xml trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java trunk/jaxx-swing-action/src/main/resources/META-INF/services/javax.annotation.processing.Processor trunk/jaxx-swing-action/src/main/resources/i18n/jaxx-swing-action-en_GB.properties trunk/jaxx-swing-action/src/main/resources/i18n/jaxx-swing-action-fr_FR.properties trunk/jaxx-swing-action/src/site/rst/Todo.rst trunk/jaxx-swing-action/src/site/rst/index.rst trunk/jaxx-swing-action/src/site/site_fr.xml trunk/jaxx-tutorial-config/LICENSE.txt trunk/jaxx-tutorial-config/README.txt trunk/jaxx-tutorial-config/changelog.txt trunk/jaxx-tutorial-config/pom.xml trunk/jaxx-tutorial-config/src/license/THIRD-PARTY.properties trunk/jaxx-tutorial-config/src/main/java/jaxx/demo/config/DemoConfig.java trunk/jaxx-tutorial-config/src/main/java/jaxx/demo/config/RunDemo.java trunk/jaxx-tutorial-config/src/main/resources/i18n/jaxx-tutorial-config_en_GB.properties trunk/jaxx-tutorial-config/src/main/resources/i18n/jaxx-tutorial-config_fr_FR.properties trunk/jaxx-tutorial-config/src/main/resources/log4j.properties trunk/jaxx-tutorial-config/src/site/rst/index.rst trunk/jaxx-tutorial-config/src/site/site_fr.xml trunk/jaxx-tutorial-css/LICENSE.txt trunk/jaxx-tutorial-css/README.txt trunk/jaxx-tutorial-css/changelog.txt trunk/jaxx-tutorial-css/pom.xml trunk/jaxx-tutorial-css/src/license/THIRD-PARTY.properties trunk/jaxx-tutorial-css/src/main/java/org/nuiton/jaxx/tutorials/css/Css.css trunk/jaxx-tutorial-css/src/main/java/org/nuiton/jaxx/tutorials/css/Css.jaxx trunk/jaxx-tutorial-css/src/site/rst/index.rst trunk/jaxx-tutorial-css/src/site/site_fr.xml trunk/jaxx-tutorial-databinding/LICENSE.txt trunk/jaxx-tutorial-databinding/README.txt trunk/jaxx-tutorial-databinding/changelog.txt trunk/jaxx-tutorial-databinding/pom.xml trunk/jaxx-tutorial-databinding/src/license/THIRD-PARTY.properties trunk/jaxx-tutorial-databinding/src/main/java/org/nuiton/jaxx/tutorials/databinding/data-binding.css trunk/jaxx-tutorial-databinding/src/main/java/org/nuiton/jaxx/tutorials/databinding/databinding.jaxx trunk/jaxx-tutorial-databinding/src/site/rst/index.rst trunk/jaxx-tutorial-databinding/src/site/site_fr.xml trunk/jaxx-tutorial-helloworld/LICENSE.txt trunk/jaxx-tutorial-helloworld/README.txt trunk/jaxx-tutorial-helloworld/changelog.txt trunk/jaxx-tutorial-helloworld/pom.xml trunk/jaxx-tutorial-helloworld/src/license/THIRD-PARTY.properties trunk/jaxx-tutorial-helloworld/src/main/java/org/nuiton/jaxx/tutorials/helloworld/helloworld.jaxx trunk/jaxx-tutorial-helloworld/src/site/rst/index.rst trunk/jaxx-tutorial-helloworld/src/site/site_fr.xml trunk/jaxx-tutorial-helloworld2/LICENSE.txt trunk/jaxx-tutorial-helloworld2/README.txt trunk/jaxx-tutorial-helloworld2/changelog.txt trunk/jaxx-tutorial-helloworld2/pom.xml trunk/jaxx-tutorial-helloworld2/src/license/THIRD-PARTY.properties trunk/jaxx-tutorial-helloworld2/src/main/java/org/nuiton/jaxx/tutorials/helloworld/helloworld.jaxx trunk/jaxx-tutorial-helloworld2/src/site/rst/index.rst trunk/jaxx-tutorial-helloworld2/src/site/site_fr.xml trunk/jaxx-tutorial-validation/src/main/filters/jaxx-demo.properties trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/DemoConfig.java trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/RunDemo.java trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/model/AbstractDemoBean.java trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/model/Movie.java trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/model/People.java trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/DemoUI.css trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/DemoUI.jaxx trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/DemoUIHandler.java trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/ValidationTableDemo.jaxx trunk/jaxx-tutorial-validation/src/site/rst/index.rst trunk/jaxx-tutorial/LICENSE.txt trunk/jaxx-tutorial/README.txt trunk/jaxx-tutorial/changelog.txt trunk/jaxx-tutorial/pom.xml trunk/jaxx-tutorial/src/site/rst/index.rst trunk/jaxx-tutorial/src/site/site_fr.xml trunk/jaxx-validator/src/main/java/jaxx/runtime/JAXXValidator.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java trunk/jaxx-validator/src/site/apt/index.rst trunk/jaxx-validator/src/test/resources/log4j.properties trunk/jaxx-validator/src/test/resources/validators.xml trunk/jaxx-widgets/LICENSE.txt trunk/jaxx-widgets/README.txt trunk/jaxx-widgets/changelog.txt trunk/jaxx-widgets/pom.xml trunk/jaxx-widgets/src/license/THIRD-PARTY.properties trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/AboutPanel.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ClockWidget.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ErrorDialogUI.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/FontSizor.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorUI.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/MemoryStatusWidget.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanel.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditor.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditor.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorPopup.css trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditor.css trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditor.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBoxHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeaderHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanUIUtil.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/package.html trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCallBackUI.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCallBackUIHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCategoryUI.css trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCategoryUI.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUI.css trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUI.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIHelper.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBackEntry.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBackFinalizer.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBackMap.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBacksManager.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModelBuilder.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/MainCallBackFinalizer.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/package.html trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/package.html trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/package.html trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/package.html trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_en_GB.properties trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_fr_FR.properties trunk/jaxx-widgets/src/site/rst/index.rst trunk/jaxx-widgets/src/site/site_fr.xml trunk/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/config/model/ConfigUIModelBuilderTest.java trunk/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/config/model/MyConfig.java trunk/jaxx-widgets/src/test/resources/log4j.properties trunk/maven-jaxx-plugin/LICENSE.txt trunk/maven-jaxx-plugin/README.txt trunk/maven-jaxx-plugin/changelog.txt trunk/maven-jaxx-plugin/pom.xml trunk/maven-jaxx-plugin/src/license/THIRD-PARTY.properties trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractGenerateHelpMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpFilesMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpSearchMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java trunk/maven-jaxx-plugin/src/main/resources/defaultContent.html.vm trunk/maven-jaxx-plugin/src/main/resources/defaultHelpSet.hs.vm trunk/maven-jaxx-plugin/src/main/resources/defaultI18n.java.vm trunk/maven-jaxx-plugin/src/main/resources/defaultIndex.xml.vm trunk/maven-jaxx-plugin/src/main/resources/defaultMap.jhm.vm trunk/maven-jaxx-plugin/src/main/resources/defaultToc.xml.vm trunk/maven-jaxx-plugin/src/main/resources/log4j.properties trunk/maven-jaxx-plugin/src/site/rst/Todo.rst trunk/maven-jaxx-plugin/src/site/rst/index.rst trunk/maven-jaxx-plugin/src/site/site_fr.xml trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug184Test.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/Bean.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/BeanImpl.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBindingTest.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerTest/classReferences/JavaTaist.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/Identity.java trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/Model.java trunk/maven-jaxx-plugin/src/test/resources/log4j.properties trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1722Test/Bug_1722.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1750Test/Bug_1750.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1750Test/ComboBox.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Bug_1751.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Test1.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Test2.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Test3.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/Bug_184.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/MyPanel.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/CSSTests.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ClassReferences.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ClientProperty.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ErrorJaxxContextImplementorClass.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Errors.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ErrorsCss.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Force.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Icon.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ImportTag.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Initializers.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/InnerClasses.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/NoLog.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/OverridingDataBindings.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Script.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/SpecialSubclassing.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/WithLog.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/Child.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/Child2.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/GrandChild.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/GrandChildButton.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/SimpleCSS.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/classReferences/TypeReference.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/clientProperty/TestOne.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/ConflictingPackages.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/InvalidRootTag.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/ScriptNotFound.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/StyleNotFound.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/dependencies/test.css trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/dependencies/test.script trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/force/JButton.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/icon/Test1.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/nolog/NoLog.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/nolog/NoLogSon.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/withlog/WithLog.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/withlog/WithLogTwo.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/overridingDataBindings/OverriddenCurrentTime.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/script/JScriptInitializer.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/ValidatorErrors.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/ValidatorOk.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/AutoFieldComponentNotFound.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedBean.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedBean2.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedErrorListModel.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedErrorTableModel.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedFieldInSameValidator.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldBeanPropertyNotFound.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldComponentDuplicated.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldComponentNotFound.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldComponentNotFound2.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldNoName.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldNoName2.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/Model.java trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/NoBean.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundBean.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorList.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorListModel.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorTable.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorTableModel.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundParentValidator.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/Validation.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/ValidationBeanClass.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/dataBindingTest/First.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/dataBindingTest/simpleBinding.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/decoratorTest/BoxedDecorator.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/decoratorTest/Decorator.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error/swingcombo.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error/swinglist.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error/swingtree.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/jaxxcombo.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/jaxxlist.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/jaxxtree.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/swingcombo.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/swinglist.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/swingtree.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/I18nText.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/I18nTitle.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/I18nToolTipText.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/text/JButton.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/title/JDialog.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/title/JTabbedPane.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/title/JTabbedPane2.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JButton.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JTabbedPane.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JTabbedPane2.jaxx trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JTabbedPane3.jaxx trunk/pom.xml trunk/src/site/rst/BeanValidator.rst trunk/src/site/rst/Core.rst trunk/src/site/rst/I18n.rst trunk/src/site/rst/JAXXContext.rst trunk/src/site/rst/JAXXFile.rst trunk/src/site/rst/NavigationModel.rst trunk/src/site/rst/Todo.rst trunk/src/site/rst/contractProgramming.rst trunk/src/site/rst/dataBinding.rst trunk/src/site/rst/demo.rst trunk/src/site/rst/index.rst trunk/src/site/rst/javaBeans.rst trunk/src/site/rst/migration.rst trunk/src/site/rst/old-compiler-doc/BeanValidator.rst trunk/src/site/rst/old-compiler-doc/I18n.rst trunk/src/site/rst/old-compiler-doc/Interface.rst trunk/src/site/rst/old-compiler-doc/JAXXContext.rst trunk/src/site/rst/old-compiler-doc/JavaBean.rst trunk/src/site/rst/old-compiler-doc/NavigationTreeModel.rst trunk/src/site/rst/presentation.rst trunk/src/site/rst/scripting.rst trunk/src/site/rst/spec-validator2.rst trunk/src/site/rst/tutos/config.rst trunk/src/site/rst/tutos/css.rst trunk/src/site/rst/tutos/data-binding.rst trunk/src/site/rst/tutos/helloworld.rst trunk/src/site/rst/tutos/helloworld2.rst trunk/src/site/rst/useStylesheets.rst trunk/src/site/rst/useSwingObjects.rst trunk/src/site/site_fr.xml Property changes on: trunk/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,315 +1,315 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler; - -import jaxx.compiler.finalizers.JAXXCompilerFinalizer; -import jaxx.compiler.spi.Initializer; -import jaxx.runtime.JAXXContext; -import jaxx.runtime.JAXXObject; -import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.commons.lang.builder.ToStringStyle; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.swing.UIManager; -import java.io.File; -import java.util.Map; -import java.util.ServiceLoader; -import java.util.TreeMap; - -/** Options of the {@link JAXXCompiler} and {@link JAXXEngine}. */ -public class DefaultCompilerConfiguration implements CompilerConfiguration { - - /** Logger. */ - private static final Log log = - LogFactory.getLog(DefaultCompilerConfiguration.class); - - /** where to generate */ - private File targetDirectory; - - /** flag to optimize generated code */ - private boolean optimize; - - /** verbose flag */ - private boolean verbose; - - /** to do a profile pass after generation */ - private boolean profile; - - /** a flag to enable or disable i18n generation */ - private boolean i18nable; - - /** a flag to add or not logger on generated jaxx files */ - private boolean addLogger; - - /** a flag to not reset compiler after a compile */ - private boolean resetAfterCompile; - - /** - * the name of implementation of {@link JAXXContext} - * to be used on {@link JAXXObject}. - */ - protected Class<? extends JAXXContext> jaxxContextClass; - - /** list of fqn of class to import for all generated jaxx files */ - protected String[] extraImports; - - /** default error ui */ - private Class<?> defaultErrorUI; - - /** class loader to use in compiler */ - private ClassLoader classLoader = getClass().getClassLoader(); - - /** the compiler class to use */ - private Class<? extends JAXXCompiler> compilerClass; - - /** - * the default compiled object decorator to use if none specifed via - * decorator attribute - */ - private Class<? extends CompiledObjectDecorator> defaultDecoratorClass; - - /** a flag to use {@link UIManager} to retreave icons. */ - private boolean useUIManagerForIcon; - - /** a flag to generate javax help for any */ - private boolean generateHelp; - - /** - * Fully qualified name of help broker, can not use a class here - * since this class should be in sources (so not yet compiled) - */ - private String helpBrokerFQN; - - /** Encoding to use to write files */ - private String encoding; - - private boolean autoImportCss; - - private boolean autoRecurseInCss; - - /** decorators available in engine */ - protected Map<String, CompiledObjectDecorator> decorators; - - /** finalizers available in engine */ - protected Map<String, JAXXCompilerFinalizer> finalizers; - - /** initializes availables */ - protected Map<String, Initializer> initializers; - - /** - * To trace class descriptor loading. - * - * @since 2.4 - */ - private boolean showClassDescriptorLoading; - - @Override - public File getTargetDirectory() { - return targetDirectory; - } - - @Override - public boolean getOptimize() { - return optimize; - } - - @Override - public boolean isVerbose() { - return verbose; - } - - @Override - public boolean isShowClassDescriptorLoading() { - return showClassDescriptorLoading; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - - @Override - public boolean isI18nable() { - return i18nable; - } - - @Override - public boolean isUseUIManagerForIcon() { - return useUIManagerForIcon; - } - - @Override - public boolean isAddLogger() { - return addLogger; - } - - @Override - public Class<? extends JAXXContext> getJaxxContextClass() { - return jaxxContextClass; - } - - @Override - public String[] getExtraImports() { - return extraImports; - } - - @Override - public boolean isResetAfterCompile() { - return resetAfterCompile; - } - - @Override - public boolean isOptimize() { - return optimize; - } - - @Override - public Class<?> getDefaultErrorUI() { - return defaultErrorUI; - } - - @Override - public ClassLoader getClassLoader() { - return classLoader; - } - - @Override - public Class<? extends JAXXCompiler> getCompilerClass() { - return compilerClass; - } - - @Override - public Class<? extends CompiledObjectDecorator> getDefaultDecoratorClass() { - return defaultDecoratorClass; - } - - @Override - public boolean isProfile() { - return profile; - } - - @Override - public boolean isGenerateHelp() { - return generateHelp; - } - - @Override - public String getHelpBrokerFQN() { - return helpBrokerFQN; - } - - @Override - public String getEncoding() { - return encoding; - } - - @Override - public Map<String, CompiledObjectDecorator> getDecorators() { - if (decorators == null) { - decorators = new TreeMap<String, CompiledObjectDecorator>(); - ClassLoader classloader = - Thread.currentThread().getContextClassLoader(); - if (log.isInfoEnabled()) { - log.info("with cl " + classloader); - } - - // load decorators - ServiceLoader<CompiledObjectDecorator> services = - ServiceLoader.load(CompiledObjectDecorator.class, - classloader); - for (CompiledObjectDecorator decorator : services) { - if (log.isInfoEnabled()) { - log.info("detected " + decorator); - } - decorators.put(decorator.getName(), decorator); - } - } - return decorators; - } - - @Override - public Map<String, JAXXCompilerFinalizer> getFinalizers() { - if (finalizers == null) { - finalizers = new TreeMap<String, JAXXCompilerFinalizer>(); - - ClassLoader classloader = - Thread.currentThread().getContextClassLoader(); - if (log.isInfoEnabled()) { - log.info("with cl " + classloader); - } - - ServiceLoader<JAXXCompilerFinalizer> services = - ServiceLoader.load(JAXXCompilerFinalizer.class, - classloader); - for (JAXXCompilerFinalizer finalizer : services) { - if (log.isInfoEnabled()) { - log.info("detected " + finalizer); - } - finalizers.put(finalizer.getClass().getName(), finalizer); - } - } - return finalizers; - } - - @Override - public Map<String, Initializer> getInitializers() { - if (initializers == null) { - initializers = new TreeMap<String, Initializer>(); - ClassLoader classloader = - Thread.currentThread().getContextClassLoader(); - if (log.isInfoEnabled()) { - log.info("with cl " + classloader); - } - - ServiceLoader<Initializer> loader = - ServiceLoader.load(Initializer.class, classloader); - - for (Initializer initializer : loader) { - if (log.isInfoEnabled()) { - log.info("detected " + initializer); - } - initializers.put(initializer.getClass().getName(), initializer); - } - } - return initializers; - } - - @Override - public boolean isAutoImportCss() { - return autoImportCss; - } - - @Override - public boolean isAutoRecurseInCss() { - return autoRecurseInCss; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString( - this, ToStringStyle.MULTI_LINE_STYLE); - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler; + +import jaxx.compiler.finalizers.JAXXCompilerFinalizer; +import jaxx.compiler.spi.Initializer; +import jaxx.runtime.JAXXContext; +import jaxx.runtime.JAXXObject; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.swing.UIManager; +import java.io.File; +import java.util.Map; +import java.util.ServiceLoader; +import java.util.TreeMap; + +/** Options of the {@link JAXXCompiler} and {@link JAXXEngine}. */ +public class DefaultCompilerConfiguration implements CompilerConfiguration { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(DefaultCompilerConfiguration.class); + + /** where to generate */ + private File targetDirectory; + + /** flag to optimize generated code */ + private boolean optimize; + + /** verbose flag */ + private boolean verbose; + + /** to do a profile pass after generation */ + private boolean profile; + + /** a flag to enable or disable i18n generation */ + private boolean i18nable; + + /** a flag to add or not logger on generated jaxx files */ + private boolean addLogger; + + /** a flag to not reset compiler after a compile */ + private boolean resetAfterCompile; + + /** + * the name of implementation of {@link JAXXContext} + * to be used on {@link JAXXObject}. + */ + protected Class<? extends JAXXContext> jaxxContextClass; + + /** list of fqn of class to import for all generated jaxx files */ + protected String[] extraImports; + + /** default error ui */ + private Class<?> defaultErrorUI; + + /** class loader to use in compiler */ + private ClassLoader classLoader = getClass().getClassLoader(); + + /** the compiler class to use */ + private Class<? extends JAXXCompiler> compilerClass; + + /** + * the default compiled object decorator to use if none specifed via + * decorator attribute + */ + private Class<? extends CompiledObjectDecorator> defaultDecoratorClass; + + /** a flag to use {@link UIManager} to retreave icons. */ + private boolean useUIManagerForIcon; + + /** a flag to generate javax help for any */ + private boolean generateHelp; + + /** + * Fully qualified name of help broker, can not use a class here + * since this class should be in sources (so not yet compiled) + */ + private String helpBrokerFQN; + + /** Encoding to use to write files */ + private String encoding; + + private boolean autoImportCss; + + private boolean autoRecurseInCss; + + /** decorators available in engine */ + protected Map<String, CompiledObjectDecorator> decorators; + + /** finalizers available in engine */ + protected Map<String, JAXXCompilerFinalizer> finalizers; + + /** initializes availables */ + protected Map<String, Initializer> initializers; + + /** + * To trace class descriptor loading. + * + * @since 2.4 + */ + private boolean showClassDescriptorLoading; + + @Override + public File getTargetDirectory() { + return targetDirectory; + } + + @Override + public boolean getOptimize() { + return optimize; + } + + @Override + public boolean isVerbose() { + return verbose; + } + + @Override + public boolean isShowClassDescriptorLoading() { + return showClassDescriptorLoading; + } + + public void setVerbose(boolean verbose) { + this.verbose = verbose; + } + + @Override + public boolean isI18nable() { + return i18nable; + } + + @Override + public boolean isUseUIManagerForIcon() { + return useUIManagerForIcon; + } + + @Override + public boolean isAddLogger() { + return addLogger; + } + + @Override + public Class<? extends JAXXContext> getJaxxContextClass() { + return jaxxContextClass; + } + + @Override + public String[] getExtraImports() { + return extraImports; + } + + @Override + public boolean isResetAfterCompile() { + return resetAfterCompile; + } + + @Override + public boolean isOptimize() { + return optimize; + } + + @Override + public Class<?> getDefaultErrorUI() { + return defaultErrorUI; + } + + @Override + public ClassLoader getClassLoader() { + return classLoader; + } + + @Override + public Class<? extends JAXXCompiler> getCompilerClass() { + return compilerClass; + } + + @Override + public Class<? extends CompiledObjectDecorator> getDefaultDecoratorClass() { + return defaultDecoratorClass; + } + + @Override + public boolean isProfile() { + return profile; + } + + @Override + public boolean isGenerateHelp() { + return generateHelp; + } + + @Override + public String getHelpBrokerFQN() { + return helpBrokerFQN; + } + + @Override + public String getEncoding() { + return encoding; + } + + @Override + public Map<String, CompiledObjectDecorator> getDecorators() { + if (decorators == null) { + decorators = new TreeMap<String, CompiledObjectDecorator>(); + ClassLoader classloader = + Thread.currentThread().getContextClassLoader(); + if (log.isInfoEnabled()) { + log.info("with cl " + classloader); + } + + // load decorators + ServiceLoader<CompiledObjectDecorator> services = + ServiceLoader.load(CompiledObjectDecorator.class, + classloader); + for (CompiledObjectDecorator decorator : services) { + if (log.isInfoEnabled()) { + log.info("detected " + decorator); + } + decorators.put(decorator.getName(), decorator); + } + } + return decorators; + } + + @Override + public Map<String, JAXXCompilerFinalizer> getFinalizers() { + if (finalizers == null) { + finalizers = new TreeMap<String, JAXXCompilerFinalizer>(); + + ClassLoader classloader = + Thread.currentThread().getContextClassLoader(); + if (log.isInfoEnabled()) { + log.info("with cl " + classloader); + } + + ServiceLoader<JAXXCompilerFinalizer> services = + ServiceLoader.load(JAXXCompilerFinalizer.class, + classloader); + for (JAXXCompilerFinalizer finalizer : services) { + if (log.isInfoEnabled()) { + log.info("detected " + finalizer); + } + finalizers.put(finalizer.getClass().getName(), finalizer); + } + } + return finalizers; + } + + @Override + public Map<String, Initializer> getInitializers() { + if (initializers == null) { + initializers = new TreeMap<String, Initializer>(); + ClassLoader classloader = + Thread.currentThread().getContextClassLoader(); + if (log.isInfoEnabled()) { + log.info("with cl " + classloader); + } + + ServiceLoader<Initializer> loader = + ServiceLoader.load(Initializer.class, classloader); + + for (Initializer initializer : loader) { + if (log.isInfoEnabled()) { + log.info("detected " + initializer); + } + initializers.put(initializer.getClass().getName(), initializer); + } + } + return initializers; + } + + @Override + public boolean isAutoImportCss() { + return autoImportCss; + } + + @Override + public boolean isAutoRecurseInCss() { + return autoRecurseInCss; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString( + this, ToStringStyle.MULTI_LINE_STYLE); + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/IDHelper.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1578,6 +1578,10 @@ return javaFile; } + public void preFinalizeCompiler() throws Exception { + + } + public void finalizeCompiler() throws Exception { int dotPos = getOutputClassName().lastIndexOf("."); Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFile.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -29,6 +29,7 @@ import jaxx.compiler.tasks.CompileFirstPassTask; import jaxx.compiler.tasks.CompileSecondPassTask; import jaxx.compiler.tasks.FinalizeTask; +import jaxx.compiler.tasks.GenerateConstructorsTask; import jaxx.compiler.tasks.GenerateTask; import jaxx.compiler.tasks.InitTask; import jaxx.compiler.tasks.JAXXEngineTask; @@ -121,6 +122,7 @@ tasks.add(new CompileSecondPassTask()); tasks.add(new StyleSheetTask()); tasks.add(new FinalizeTask()); + tasks.add(new GenerateConstructorsTask()); tasks.add(new GenerateTask()); if (getConfiguration().isProfile()) { Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXFactory.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,92 +1,92 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler; - -import jaxx.compiler.reflect.FieldDescriptor; -import jaxx.compiler.reflect.MethodDescriptor; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** Symbol table constructed during the first pass of compilation. */ -public class SymbolTable { - - private String superclass; - // maps ID strings to class names -- we can't map directly to CompiledObjects, because we - // can't create those until after the first pass - - private Map<String, String> ids = new HashMap<String, String>(); - - private List<FieldDescriptor> scriptFields = new ArrayList<FieldDescriptor>(); - - private List<MethodDescriptor> scriptMethods = new ArrayList<MethodDescriptor>(); - - private String[] interfaces; - - /** @return the fully-qualified name of the superclass of the class described by this symbol table. */ - public String getSuperclassName() { - return superclass; - } - - public String[] getInterfaces() { - return interfaces; - } - - public void setSuperclassName(String superclass) { - this.superclass = superclass; - } - - /** - * @return a map of IDs to class names. Each entry in the map corresponds to a class tag with an - * <code>id</code> attribute. The <code>id</code> is the key, and the fully-qualified class name - * of the tag is the value. - */ - public Map<String, String> getClassTagIds() { - return ids; - } - - /** @return a list of <code>FieldDescriptors</code> for fields defined in <script> tags. */ - public List<FieldDescriptor> getScriptFields() { - return scriptFields; - } - - /** @return a list of <code>MethodDescriptors</code> for methods defined in <script> tags. */ - public List<MethodDescriptor> getScriptMethods() { - return scriptMethods; - } - - public void setInterfaces(String[] interfaces) { - this.interfaces = interfaces; - } - - public void clear() { - ids.clear(); - scriptFields.clear(); - scriptMethods.clear(); - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler; + +import jaxx.compiler.reflect.FieldDescriptor; +import jaxx.compiler.reflect.MethodDescriptor; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Symbol table constructed during the first pass of compilation. */ +public class SymbolTable { + + private String superclass; + // maps ID strings to class names -- we can't map directly to CompiledObjects, because we + // can't create those until after the first pass + + private Map<String, String> ids = new HashMap<String, String>(); + + private List<FieldDescriptor> scriptFields = new ArrayList<FieldDescriptor>(); + + private List<MethodDescriptor> scriptMethods = new ArrayList<MethodDescriptor>(); + + private String[] interfaces; + + /** @return the fully-qualified name of the superclass of the class described by this symbol table. */ + public String getSuperclassName() { + return superclass; + } + + public String[] getInterfaces() { + return interfaces; + } + + public void setSuperclassName(String superclass) { + this.superclass = superclass; + } + + /** + * @return a map of IDs to class names. Each entry in the map corresponds to a class tag with an + * <code>id</code> attribute. The <code>id</code> is the key, and the fully-qualified class name + * of the tag is the value. + */ + public Map<String, String> getClassTagIds() { + return ids; + } + + /** @return a list of <code>FieldDescriptors</code> for fields defined in <script> tags. */ + public List<FieldDescriptor> getScriptFields() { + return scriptFields; + } + + /** @return a list of <code>MethodDescriptors</code> for methods defined in <script> tags. */ + public List<MethodDescriptor> getScriptMethods() { + return scriptMethods; + } + + public void setInterfaces(String[] interfaces) { + this.interfaces = interfaces; + } + + public void clear() { + ids.clear(); + scriptFields.clear(); + scriptMethods.clear(); + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,40 +1,40 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.beans; - -import jaxx.compiler.reflect.ClassDescriptor; - -/** - * Mirrors the class <code>java.beans.BeanDescriptor</code>. JAXX uses its own introspector rather than the built-in - * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, - * not just <code>java.lang.Class</code>. - */ -public class JAXXBeanDescriptor extends JAXXFeatureDescriptor { - - public JAXXBeanDescriptor(ClassDescriptor beanClass) { - super(beanClass, beanClass.getName()); - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.beans; + +import jaxx.compiler.reflect.ClassDescriptor; + +/** + * Mirrors the class <code>java.beans.BeanDescriptor</code>. JAXX uses its own introspector rather than the built-in + * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, + * not just <code>java.lang.Class</code>. + */ +public class JAXXBeanDescriptor extends JAXXFeatureDescriptor { + + public JAXXBeanDescriptor(ClassDescriptor beanClass) { + super(beanClass, beanClass.getName()); + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,60 +1,60 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.beans; - -import jaxx.compiler.reflect.ClassDescriptor; - -/** - * Mirrors the class <code>java.beans.BeanInfo</code>. JAXX uses its own introspector rather than the built-in - * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, - * not just <code>java.lang.Class</code>. - */ -public class JAXXBeanInfo { - - private JAXXBeanDescriptor beanDescriptor; - private JAXXPropertyDescriptor[] propertyDescriptors; - private JAXXEventSetDescriptor[] eventSetDescriptors; - - public JAXXBeanInfo(JAXXBeanDescriptor beanDescriptor, - JAXXPropertyDescriptor[] propertyDescriptors, - JAXXEventSetDescriptor[] eventSetDescriptors) { - this.beanDescriptor = beanDescriptor; - this.propertyDescriptors = propertyDescriptors; - this.eventSetDescriptors = eventSetDescriptors; - } - - public JAXXBeanDescriptor getJAXXBeanDescriptor() { - return beanDescriptor; - } - - public JAXXPropertyDescriptor[] getJAXXPropertyDescriptors() { - return propertyDescriptors; - } - - public JAXXEventSetDescriptor[] getJAXXEventSetDescriptors() { - return eventSetDescriptors; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.beans; + +import jaxx.compiler.reflect.ClassDescriptor; + +/** + * Mirrors the class <code>java.beans.BeanInfo</code>. JAXX uses its own introspector rather than the built-in + * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, + * not just <code>java.lang.Class</code>. + */ +public class JAXXBeanInfo { + + private JAXXBeanDescriptor beanDescriptor; + private JAXXPropertyDescriptor[] propertyDescriptors; + private JAXXEventSetDescriptor[] eventSetDescriptors; + + public JAXXBeanInfo(JAXXBeanDescriptor beanDescriptor, + JAXXPropertyDescriptor[] propertyDescriptors, + JAXXEventSetDescriptor[] eventSetDescriptors) { + this.beanDescriptor = beanDescriptor; + this.propertyDescriptors = propertyDescriptors; + this.eventSetDescriptors = eventSetDescriptors; + } + + public JAXXBeanDescriptor getJAXXBeanDescriptor() { + return beanDescriptor; + } + + public JAXXPropertyDescriptor[] getJAXXPropertyDescriptors() { + return propertyDescriptors; + } + + public JAXXEventSetDescriptor[] getJAXXEventSetDescriptors() { + return eventSetDescriptors; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,61 +1,61 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.beans; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.MethodDescriptor; - -/** - * Mirrors the class <code>java.beans.EventSetDescriptor</code>. JAXX uses its own introspector rather than the built-in - * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, - * not just <code>java.lang.Class</code>. - */ -public class JAXXEventSetDescriptor extends JAXXFeatureDescriptor { - - private MethodDescriptor addListenerMethod; - private MethodDescriptor removeListenerMethod; - private MethodDescriptor[] listenerMethods; - - public JAXXEventSetDescriptor(ClassDescriptor classDescriptor, String name, MethodDescriptor addListenerMethod, - MethodDescriptor removeListenerMethod, MethodDescriptor[] listenerMethods) { - super(classDescriptor, name); - this.addListenerMethod = addListenerMethod; - this.removeListenerMethod = removeListenerMethod; - this.listenerMethods = listenerMethods; - } - - public MethodDescriptor getAddListenerMethod() { - return addListenerMethod; - } - - public MethodDescriptor getRemoveListenerMethod() { - return removeListenerMethod; - } - - public MethodDescriptor[] getListenerMethods() { - return listenerMethods; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.beans; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.MethodDescriptor; + +/** + * Mirrors the class <code>java.beans.EventSetDescriptor</code>. JAXX uses its own introspector rather than the built-in + * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, + * not just <code>java.lang.Class</code>. + */ +public class JAXXEventSetDescriptor extends JAXXFeatureDescriptor { + + private MethodDescriptor addListenerMethod; + private MethodDescriptor removeListenerMethod; + private MethodDescriptor[] listenerMethods; + + public JAXXEventSetDescriptor(ClassDescriptor classDescriptor, String name, MethodDescriptor addListenerMethod, + MethodDescriptor removeListenerMethod, MethodDescriptor[] listenerMethods) { + super(classDescriptor, name); + this.addListenerMethod = addListenerMethod; + this.removeListenerMethod = removeListenerMethod; + this.listenerMethods = listenerMethods; + } + + public MethodDescriptor getAddListenerMethod() { + return addListenerMethod; + } + + public MethodDescriptor getRemoveListenerMethod() { + return removeListenerMethod; + } + + public MethodDescriptor[] getListenerMethods() { + return listenerMethods; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,77 +1,77 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.beans; - -import jaxx.compiler.reflect.ClassDescriptor; - -import java.util.HashMap; -import java.util.Map; - -/** - * Mirrors the class <code>java.beans.FeatureDescriptor</code>. JAXX uses its own introspector rather than the built-in - * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, - * not just <code>java.lang.Class</code>. - */ -public class JAXXFeatureDescriptor { - - private String name; - private Map<String, Object> values; - private ClassDescriptor classDescriptor; - - JAXXFeatureDescriptor(ClassDescriptor classDescriptor, String name) { - if (name == null || classDescriptor == null) { - throw new NullPointerException(); - } - this.name = name; - this.classDescriptor = classDescriptor; - } - - public String getName() { - return name; - } - - public ClassDescriptor getClassDescriptor() { - return classDescriptor; - } - - public Object getValue(String key) { - return values != null ? values.get(key) : null; - } - - public void setValue(String key, Object value) { - if (values == null) { - values = new HashMap<String, Object>(); - } - values.put(key, value); - } - - public static String capitalize(String name) { - if (name.length() == 0) { - return name; - } - return Character.toUpperCase(name.charAt(0)) + name.substring(1); - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.beans; + +import jaxx.compiler.reflect.ClassDescriptor; + +import java.util.HashMap; +import java.util.Map; + +/** + * Mirrors the class <code>java.beans.FeatureDescriptor</code>. JAXX uses its own introspector rather than the built-in + * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, + * not just <code>java.lang.Class</code>. + */ +public class JAXXFeatureDescriptor { + + private String name; + private Map<String, Object> values; + private ClassDescriptor classDescriptor; + + JAXXFeatureDescriptor(ClassDescriptor classDescriptor, String name) { + if (name == null || classDescriptor == null) { + throw new NullPointerException(); + } + this.name = name; + this.classDescriptor = classDescriptor; + } + + public String getName() { + return name; + } + + public ClassDescriptor getClassDescriptor() { + return classDescriptor; + } + + public Object getValue(String key) { + return values != null ? values.get(key) : null; + } + + public void setValue(String key, Object value) { + if (values == null) { + values = new HashMap<String, Object>(); + } + values.put(key, value); + } + + public static String capitalize(String name) { + if (name.length() == 0) { + return name; + } + return Character.toUpperCase(name.charAt(0)) + name.substring(1); + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,192 +1,192 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.beans; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorHelper; -import jaxx.compiler.reflect.MethodDescriptor; - -import java.beans.BeanDescriptor; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyChangeListener; -import java.beans.PropertyDescriptor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Enumeration; -import java.util.EventListener; -import java.util.HashMap; -import java.util.Map; - -/** - * Performs introspection on a <code>ClassDescriptor</code>. Ideally, I could just have copied Sun's Introspector - * and changed a few things, but the licensing terms are incompatible. This implementation is incomplete -- it only - * bothers to report info that JAXX actually checks. It also relaxes some of Introspector's rules a bit, but I - * don't believe it results in any meaningful incompatibilities. - * <p/> - * JAXX uses its own introspector rather than the built-in - * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, - * not just <code>java.lang.Class</code>. - */ -public class JAXXIntrospector { - - private ClassDescriptor classDescriptor; - private Map<String, JAXXPropertyDescriptor> propertyDescriptors = new HashMap<String, JAXXPropertyDescriptor>(); - private Map<String, JAXXEventSetDescriptor> eventSetDescriptors = new HashMap<String, JAXXEventSetDescriptor>(); - - private JAXXIntrospector(ClassDescriptor classDescriptor) { - this.classDescriptor = classDescriptor; - } - - /** - * Returns the <code>JAXXBeanInfo</code> for a given class. - * - * @param classDescriptor the class to introspect - * @return the <code>JAXXBeanInfo</code> for the bean class - * @throws IntrospectionException if an error occurs - */ - public static JAXXBeanInfo getJAXXBeanInfo(ClassDescriptor classDescriptor) throws IntrospectionException { - JAXXIntrospector introspector = new JAXXIntrospector(classDescriptor); - return introspector.createBeanInfo(); - } - - private JAXXBeanInfo createBeanInfo() { - ClassDescriptor explicitInfoClass = classDescriptor; - BeanInfo explicitBeanInfo = null; - while (explicitInfoClass != null) { - explicitBeanInfo = getExplicitBeanInfo(explicitInfoClass); - if (explicitBeanInfo != null) { - break; - } - explicitInfoClass = explicitInfoClass.getSuperclass(); - } - - if (explicitBeanInfo != null) { - PropertyDescriptor[] explicitProperties = explicitBeanInfo.getPropertyDescriptors(); - for (PropertyDescriptor explicitProperty : explicitProperties) { - Class type = explicitProperty.getPropertyType(); - Method readMethod = explicitProperty.getReadMethod(); - Method writeMethod = explicitProperty.getWriteMethod(); - try { - ClassDescriptor typeDescriptor = ClassDescriptorHelper.getClassDescriptor(type.getName(), type.getClassLoader()); - JAXXPropertyDescriptor propertyDescriptor = new JAXXPropertyDescriptor(classDescriptor, explicitProperty.getName(), - readMethod != null ? classDescriptor.getMethodDescriptor(readMethod.getName()) : null, - writeMethod != null ? classDescriptor.getMethodDescriptor(writeMethod.getName(), typeDescriptor) : null); - propertyDescriptor.setBound(explicitProperty.isBound()); - Enumeration<String> attributeNames = explicitProperty.attributeNames(); - while (attributeNames.hasMoreElements()) { - String name = attributeNames.nextElement(); - propertyDescriptor.setValue(name, explicitProperty.getValue(name)); - } - propertyDescriptors.put(propertyDescriptor.getName(), propertyDescriptor); - } catch (ClassNotFoundException e) { - throw new RuntimeException("Internal error: Could not find ClassDescriptor corresponding to Java " + type, e); - } catch (NoSuchMethodException e) { - throw new RuntimeException("Internal error: Could not find expected MethodDescriptor in " + classDescriptor, e); - } - } - } - - // if the class broadcasts PropertyChangeEvent, assume all properties are bound (java.beans.Introspector - // does the same) - boolean propertyChangeSource; - try { - classDescriptor.getMethodDescriptor("addPropertyChangeListener", ClassDescriptorHelper.getClassDescriptor(PropertyChangeListener.class)); - propertyChangeSource = true; - } catch (NoSuchMethodException e) { - propertyChangeSource = false; - } - - MethodDescriptor[] methods = classDescriptor.getMethodDescriptors(); - for (MethodDescriptor method : methods) { - String name = method.getName(); - if (name.startsWith("get") && name.length() > 3 && Character.isUpperCase(name.charAt(3)) && method.getParameterTypes().length == 0) { - String propertyName = Introspector.decapitalize(name.substring(3)); - if (!propertyDescriptors.containsKey(propertyName)) { - propertyDescriptors.put(propertyName, new JAXXPropertyDescriptor(classDescriptor, propertyName, method, null, propertyChangeSource)); - } - } else if (name.startsWith("is") && name.length() > 2 && Character.isUpperCase(name.charAt(2)) && method.getParameterTypes().length == 0) { - String propertyName = Introspector.decapitalize(name.substring(2)); - if (!propertyDescriptors.containsKey(propertyName)) { - propertyDescriptors.put(propertyName, new JAXXPropertyDescriptor(classDescriptor, propertyName, method, null, propertyChangeSource)); - } - } else if (name.startsWith("set") && name.length() > 3 && Character.isUpperCase(name.charAt(3)) && method.getParameterTypes().length == 1) { - String propertyName = Introspector.decapitalize(name.substring(3)); - if (!propertyDescriptors.containsKey(propertyName)) { - propertyDescriptors.put(propertyName, new JAXXPropertyDescriptor(classDescriptor, propertyName, null, method, propertyChangeSource)); - } - } else if (name.startsWith("add") && name.length() > 3 && Character.isUpperCase(name.charAt(3))) { - ClassDescriptor[] parameters = method.getParameterTypes(); - if (parameters.length != 1 || !ClassDescriptorHelper.getClassDescriptor(EventListener.class).isAssignableFrom(parameters[0])) { - continue; // not an event listener method - } - try { - String eventSetName = method.getName().substring(3); - MethodDescriptor remove = classDescriptor.getMethodDescriptor("remove" + eventSetName, parameters); - eventSetDescriptors.put(eventSetName, new JAXXEventSetDescriptor(classDescriptor, eventSetName, method, remove, parameters[0].getMethodDescriptors())); - } catch (NoSuchMethodException e) { - // no matching remove method, not a valid event - } - } - } - - JAXXBeanDescriptor beanDescriptor = new JAXXBeanDescriptor(classDescriptor); - if (explicitBeanInfo != null) { - BeanDescriptor explicitBeanDescriptor = explicitBeanInfo.getBeanDescriptor(); - if (explicitBeanDescriptor != null) { - Enumeration/*<String>*/ attributeNames = explicitBeanDescriptor.attributeNames(); - while (attributeNames.hasMoreElements()) { - String name = (String) attributeNames.nextElement(); - beanDescriptor.setValue(name, explicitBeanDescriptor.getValue(name)); - } - } - } - - return new JAXXBeanInfo(beanDescriptor, - propertyDescriptors.values().toArray(new JAXXPropertyDescriptor[propertyDescriptors.size()]), - eventSetDescriptors.values().toArray(new JAXXEventSetDescriptor[eventSetDescriptors.size()])); - } - - private static BeanInfo getExplicitBeanInfo(ClassDescriptor classDescriptor) { - try { - Class beanClass = Class.forName(classDescriptor.getName(), true, classDescriptor.getClassLoader()); // see if there is a class by that name in this package - Method findExplicitBeanInfo = Introspector.class.getDeclaredMethod("findExplicitBeanInfo", new Class[]{Class.class}); - findExplicitBeanInfo.setAccessible(true); - return (BeanInfo) findExplicitBeanInfo.invoke(null, beanClass); - } catch (ClassNotFoundException e) { - return null; // happens for uncompiled classes - } catch (NoClassDefFoundError e) { - return null; // wrong case, etc. - } catch (NoSuchMethodException e) { - throw new RuntimeException("Error: could not find method 'findExplicitBeanInfo' in java.beans.Introspector. You are most likely running a version of Java against which JAXX has not been tested."); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.beans; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorHelper; +import jaxx.compiler.reflect.MethodDescriptor; + +import java.beans.BeanDescriptor; +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyChangeListener; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Enumeration; +import java.util.EventListener; +import java.util.HashMap; +import java.util.Map; + +/** + * Performs introspection on a <code>ClassDescriptor</code>. Ideally, I could just have copied Sun's Introspector + * and changed a few things, but the licensing terms are incompatible. This implementation is incomplete -- it only + * bothers to report info that JAXX actually checks. It also relaxes some of Introspector's rules a bit, but I + * don't believe it results in any meaningful incompatibilities. + * <p/> + * JAXX uses its own introspector rather than the built-in + * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, + * not just <code>java.lang.Class</code>. + */ +public class JAXXIntrospector { + + private ClassDescriptor classDescriptor; + private Map<String, JAXXPropertyDescriptor> propertyDescriptors = new HashMap<String, JAXXPropertyDescriptor>(); + private Map<String, JAXXEventSetDescriptor> eventSetDescriptors = new HashMap<String, JAXXEventSetDescriptor>(); + + private JAXXIntrospector(ClassDescriptor classDescriptor) { + this.classDescriptor = classDescriptor; + } + + /** + * Returns the <code>JAXXBeanInfo</code> for a given class. + * + * @param classDescriptor the class to introspect + * @return the <code>JAXXBeanInfo</code> for the bean class + * @throws IntrospectionException if an error occurs + */ + public static JAXXBeanInfo getJAXXBeanInfo(ClassDescriptor classDescriptor) throws IntrospectionException { + JAXXIntrospector introspector = new JAXXIntrospector(classDescriptor); + return introspector.createBeanInfo(); + } + + private JAXXBeanInfo createBeanInfo() { + ClassDescriptor explicitInfoClass = classDescriptor; + BeanInfo explicitBeanInfo = null; + while (explicitInfoClass != null) { + explicitBeanInfo = getExplicitBeanInfo(explicitInfoClass); + if (explicitBeanInfo != null) { + break; + } + explicitInfoClass = explicitInfoClass.getSuperclass(); + } + + if (explicitBeanInfo != null) { + PropertyDescriptor[] explicitProperties = explicitBeanInfo.getPropertyDescriptors(); + for (PropertyDescriptor explicitProperty : explicitProperties) { + Class type = explicitProperty.getPropertyType(); + Method readMethod = explicitProperty.getReadMethod(); + Method writeMethod = explicitProperty.getWriteMethod(); + try { + ClassDescriptor typeDescriptor = ClassDescriptorHelper.getClassDescriptor(type.getName(), type.getClassLoader()); + JAXXPropertyDescriptor propertyDescriptor = new JAXXPropertyDescriptor(classDescriptor, explicitProperty.getName(), + readMethod != null ? classDescriptor.getMethodDescriptor(readMethod.getName()) : null, + writeMethod != null ? classDescriptor.getMethodDescriptor(writeMethod.getName(), typeDescriptor) : null); + propertyDescriptor.setBound(explicitProperty.isBound()); + Enumeration<String> attributeNames = explicitProperty.attributeNames(); + while (attributeNames.hasMoreElements()) { + String name = attributeNames.nextElement(); + propertyDescriptor.setValue(name, explicitProperty.getValue(name)); + } + propertyDescriptors.put(propertyDescriptor.getName(), propertyDescriptor); + } catch (ClassNotFoundException e) { + throw new RuntimeException("Internal error: Could not find ClassDescriptor corresponding to Java " + type, e); + } catch (NoSuchMethodException e) { + throw new RuntimeException("Internal error: Could not find expected MethodDescriptor in " + classDescriptor, e); + } + } + } + + // if the class broadcasts PropertyChangeEvent, assume all properties are bound (java.beans.Introspector + // does the same) + boolean propertyChangeSource; + try { + classDescriptor.getMethodDescriptor("addPropertyChangeListener", ClassDescriptorHelper.getClassDescriptor(PropertyChangeListener.class)); + propertyChangeSource = true; + } catch (NoSuchMethodException e) { + propertyChangeSource = false; + } + + MethodDescriptor[] methods = classDescriptor.getMethodDescriptors(); + for (MethodDescriptor method : methods) { + String name = method.getName(); + if (name.startsWith("get") && name.length() > 3 && Character.isUpperCase(name.charAt(3)) && method.getParameterTypes().length == 0) { + String propertyName = Introspector.decapitalize(name.substring(3)); + if (!propertyDescriptors.containsKey(propertyName)) { + propertyDescriptors.put(propertyName, new JAXXPropertyDescriptor(classDescriptor, propertyName, method, null, propertyChangeSource)); + } + } else if (name.startsWith("is") && name.length() > 2 && Character.isUpperCase(name.charAt(2)) && method.getParameterTypes().length == 0) { + String propertyName = Introspector.decapitalize(name.substring(2)); + if (!propertyDescriptors.containsKey(propertyName)) { + propertyDescriptors.put(propertyName, new JAXXPropertyDescriptor(classDescriptor, propertyName, method, null, propertyChangeSource)); + } + } else if (name.startsWith("set") && name.length() > 3 && Character.isUpperCase(name.charAt(3)) && method.getParameterTypes().length == 1) { + String propertyName = Introspector.decapitalize(name.substring(3)); + if (!propertyDescriptors.containsKey(propertyName)) { + propertyDescriptors.put(propertyName, new JAXXPropertyDescriptor(classDescriptor, propertyName, null, method, propertyChangeSource)); + } + } else if (name.startsWith("add") && name.length() > 3 && Character.isUpperCase(name.charAt(3))) { + ClassDescriptor[] parameters = method.getParameterTypes(); + if (parameters.length != 1 || !ClassDescriptorHelper.getClassDescriptor(EventListener.class).isAssignableFrom(parameters[0])) { + continue; // not an event listener method + } + try { + String eventSetName = method.getName().substring(3); + MethodDescriptor remove = classDescriptor.getMethodDescriptor("remove" + eventSetName, parameters); + eventSetDescriptors.put(eventSetName, new JAXXEventSetDescriptor(classDescriptor, eventSetName, method, remove, parameters[0].getMethodDescriptors())); + } catch (NoSuchMethodException e) { + // no matching remove method, not a valid event + } + } + } + + JAXXBeanDescriptor beanDescriptor = new JAXXBeanDescriptor(classDescriptor); + if (explicitBeanInfo != null) { + BeanDescriptor explicitBeanDescriptor = explicitBeanInfo.getBeanDescriptor(); + if (explicitBeanDescriptor != null) { + Enumeration/*<String>*/ attributeNames = explicitBeanDescriptor.attributeNames(); + while (attributeNames.hasMoreElements()) { + String name = (String) attributeNames.nextElement(); + beanDescriptor.setValue(name, explicitBeanDescriptor.getValue(name)); + } + } + } + + return new JAXXBeanInfo(beanDescriptor, + propertyDescriptors.values().toArray(new JAXXPropertyDescriptor[propertyDescriptors.size()]), + eventSetDescriptors.values().toArray(new JAXXEventSetDescriptor[eventSetDescriptors.size()])); + } + + private static BeanInfo getExplicitBeanInfo(ClassDescriptor classDescriptor) { + try { + Class beanClass = Class.forName(classDescriptor.getName(), true, classDescriptor.getClassLoader()); // see if there is a class by that name in this package + Method findExplicitBeanInfo = Introspector.class.getDeclaredMethod("findExplicitBeanInfo", new Class[]{Class.class}); + findExplicitBeanInfo.setAccessible(true); + return (BeanInfo) findExplicitBeanInfo.invoke(null, beanClass); + } catch (ClassNotFoundException e) { + return null; // happens for uncompiled classes + } catch (NoClassDefFoundError e) { + return null; // wrong case, etc. + } catch (NoSuchMethodException e) { + throw new RuntimeException("Error: could not find method 'findExplicitBeanInfo' in java.beans.Introspector. You are most likely running a version of Java against which JAXX has not been tested."); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,112 +1,112 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.beans; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.MethodDescriptor; - -/** - * Mirrors the class <code>java.beans.PropertyDescriptor</code>. JAXX uses its own introspector rather than the built-in - * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, - * not just <code>java.lang.Class</code>. - */ -public class JAXXPropertyDescriptor extends JAXXFeatureDescriptor { - - private ClassDescriptor propertyType; - private MethodDescriptor readMethod; - private MethodDescriptor writeMethod; - private boolean bound; - - public JAXXPropertyDescriptor(ClassDescriptor classDescriptor, String propertyName) { - this(classDescriptor, propertyName, null, null); - } - - public JAXXPropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, - MethodDescriptor readMethod, MethodDescriptor writeMethod) { - this(classDescriptor, propertyName, readMethod, writeMethod, false); - } - - public JAXXPropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, - MethodDescriptor readMethod, MethodDescriptor writeMethod, - boolean bound) { - super(classDescriptor, propertyName); - this.readMethod = readMethod; - this.writeMethod = writeMethod; - this.bound = bound; - } - - public MethodDescriptor getReadMethodDescriptor() { - if (readMethod == null) { - try { - readMethod = getClassDescriptor().getMethodDescriptor("get" + capitalize(getName())); - } catch (NoSuchMethodException e) { - try { - readMethod = getClassDescriptor().getMethodDescriptor("is" + capitalize(getName())); - } catch (NoSuchMethodException e2) { - } - } - } - return readMethod; - } - - public MethodDescriptor getWriteMethodDescriptor() { - if (writeMethod == null) { - try { - String methodName = "set" + capitalize(getName()); - MethodDescriptor read = getReadMethodDescriptor(); - if (read != null) { - writeMethod = getClassDescriptor().getMethodDescriptor(methodName, read.getReturnType()); - } else { - throw new CompilerException("Internal error: requesting 'set' method for property of unknown type: '" + getName() + "' (in " + getClassDescriptor() + ")"); - } - } catch (NoSuchMethodException e) { - } - } - return writeMethod; - } - - public ClassDescriptor getPropertyType() { - if (propertyType == null) { - MethodDescriptor read = getReadMethodDescriptor(); - if (read != null) { - propertyType = read.getReturnType(); - } else { - MethodDescriptor write = getWriteMethodDescriptor(); - propertyType = write.getParameterTypes()[0]; - } - } - return propertyType; - } - - public boolean isBound() { - return bound; - } - - public void setBound(boolean bound) { - this.bound = bound; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.beans; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.MethodDescriptor; + +/** + * Mirrors the class <code>java.beans.PropertyDescriptor</code>. JAXX uses its own introspector rather than the built-in + * <code>java.beans.Introspector</code> so that it can introspect {@link ClassDescriptor}, + * not just <code>java.lang.Class</code>. + */ +public class JAXXPropertyDescriptor extends JAXXFeatureDescriptor { + + private ClassDescriptor propertyType; + private MethodDescriptor readMethod; + private MethodDescriptor writeMethod; + private boolean bound; + + public JAXXPropertyDescriptor(ClassDescriptor classDescriptor, String propertyName) { + this(classDescriptor, propertyName, null, null); + } + + public JAXXPropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, + MethodDescriptor readMethod, MethodDescriptor writeMethod) { + this(classDescriptor, propertyName, readMethod, writeMethod, false); + } + + public JAXXPropertyDescriptor(ClassDescriptor classDescriptor, String propertyName, + MethodDescriptor readMethod, MethodDescriptor writeMethod, + boolean bound) { + super(classDescriptor, propertyName); + this.readMethod = readMethod; + this.writeMethod = writeMethod; + this.bound = bound; + } + + public MethodDescriptor getReadMethodDescriptor() { + if (readMethod == null) { + try { + readMethod = getClassDescriptor().getMethodDescriptor("get" + capitalize(getName())); + } catch (NoSuchMethodException e) { + try { + readMethod = getClassDescriptor().getMethodDescriptor("is" + capitalize(getName())); + } catch (NoSuchMethodException e2) { + } + } + } + return readMethod; + } + + public MethodDescriptor getWriteMethodDescriptor() { + if (writeMethod == null) { + try { + String methodName = "set" + capitalize(getName()); + MethodDescriptor read = getReadMethodDescriptor(); + if (read != null) { + writeMethod = getClassDescriptor().getMethodDescriptor(methodName, read.getReturnType()); + } else { + throw new CompilerException("Internal error: requesting 'set' method for property of unknown type: '" + getName() + "' (in " + getClassDescriptor() + ")"); + } + } catch (NoSuchMethodException e) { + } + } + return writeMethod; + } + + public ClassDescriptor getPropertyType() { + if (propertyType == null) { + MethodDescriptor read = getReadMethodDescriptor(); + if (read != null) { + propertyType = read.getReturnType(); + } else { + MethodDescriptor write = getWriteMethodDescriptor(); + propertyType = write.getParameterTypes()[0]; + } + } + return propertyType; + } + + public boolean isBound() { + return bound; + } + + public void setBound(boolean bound) { + this.bound = bound; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBinding.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataBindingHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/JavaParserUtil.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/PseudoClassDataBinding.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/AbstractJAXXBindingWriter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/DefaultJAXXBindingWriter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/JAXXBindingWriter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/binding/writers/SimpleJAXXObjectBindingWriter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jj =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jj 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jj 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,587 +1,587 @@ -/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. .\CSS.jj */ -/*@egen*//* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ - -// I would love to have used an existing CSS parser, but all of the ones I could -// find are licensed under the LGPL. As JAXX is BSD licensed and I'm not a big -// fan of the LGPL, unfortunately that won't work. -options { - STATIC = false; - JDK_VERSION = "1.4"; -} - -PARSER_BEGIN(CSSParser) -package jaxx.css; - -public class CSSParser/*@bgen(jjtree)*/implements CSSParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/ - protected JJTCSSParserState jjtree = new JJTCSSParserState(); - -/*@egen*/ - public SimpleNode popNode() { - if ( jjtree.nodeArity() > 0) // number of child nodes - return (SimpleNode)jjtree.popNode(); - else - return null; - } - - void jjtreeOpenNodeScope(Node n) { - ((SimpleNode) n).firstToken = getToken(1); - } - - void jjtreeCloseNodeScope(Node n) { - ((SimpleNode) n).lastToken = getToken(0); - } - - public static void main(String args[]) { - System.out.println("Reading from standard input..."); - CSSParser css = new CSSParser(System.in); - try { - SimpleNode n = css.Stylesheet(); - n.dump(""); - System.out.println("Thank you."); - } catch (Exception e) { - System.out.println("Oops."); - System.out.println(e.getMessage()); - e.printStackTrace(); - } - } -} - -PARSER_END(CSSParser) - - -<DEFAULT, IN_RULE> SKIP : -{ - " " -| "\t" -| "\n" -| "\r" -| <"//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> -| <"/*" (~["*"])* "*" (~["/"] (~["*"])* "*")* "/"> -} - -<*> TOKEN : /* LITERALS */ -{ - <DECIMAL_LITERAL: <INTEGER_LITERAL> ("." <INTEGER_LITERAL>)?> -| - <#INTEGER_LITERAL: (["0"-"9"])+> -} - -<DEFAULT, IN_RULE> TOKEN : /* IDENTIFIER */ -{ - <IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)*> -| - <#LETTER: ["_", "-", "a"-"z", "A"-"Z"]> -| - <#DIGIT: ["0"-"9"]> -} - -<IN_PSEUDOCLASS> TOKEN : /* PSEUDOCLASS_IDENTIFIER */ -{ - <PSEUDOCLASS_IDENTIFIER: <IDENTIFIER>> : DEFAULT -} - -<DEFAULT> TOKEN: /* COLON */ -{ - <PSEUDOCLASS_COLON: ":"> : IN_PSEUDOCLASS -} - -<IN_RULE> TOKEN: /* COLON_IN_RULE */ -{ - <COLON: ":"> -} - -<*> TOKEN: /* SEMICOLON */ -{ - <SEMICOLON: ";"> -} - -TOKEN : /* LEFT BRACE */ -{ - <LEFT_BRACE: "{"> : IN_RULE -} - -<IN_RULE> TOKEN : /* RIGHT BRACE */ -{ - <RIGHT_BRACE: "}"> : DEFAULT -} - -<IN_RULE> TOKEN : /* JAVA_CODE_RULE START */ -{ - <JAVA_CODE_START: <LEFT_BRACE>> : JAVA_CODE_RULE -} - -<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE */ -{ - <JAVA_CODE: (~["}"])+ > -} - -<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE END */ -{ - <JAVA_CODE_END: <RIGHT_BRACE>> : IN_RULE -} - - -<IN_PSEUDOCLASS> TOKEN : /* PROGRAMMATIC_PSEUDOCLASS */ -{ - <PROGRAMMATIC_PSEUDOCLASS: "{" (~["}"])+ "}"> : DEFAULT -} - -<IN_RULE> TOKEN : /* STRINGS */ -{ - <STRING: "\"" (~["\"", "\\", "\n", "\r"])* "\""> -} - -<IN_RULE> TOKEN : /* COLORS */ -{ - <HEXCOLOR: "#" <HEXDIGIT> <HEXDIGIT> <HEXDIGIT> (<HEXDIGIT> <HEXDIGIT> <HEXDIGIT>)?> -| - <#HEXDIGIT: ["0"-"9", "a"-"f", "A"-"F"]> -} - - -<IN_RULE> TOKEN : /* EMS */ -{ - <EMS: <DECIMAL_LITERAL> "em"> -} - - -<IN_RULE> TOKEN : /* EXS */ -{ - <EXS: <DECIMAL_LITERAL> "ex"> -} - - -<IN_RULE> TOKEN : /* LENGTH */ -{ - <LENGTH: <DECIMAL_LITERAL> ("pt" | "mm" | "cm" | "pc" | "in")> -} - - -SimpleNode Stylesheet() : {/*@bgen(jjtree) Stylesheet */ - SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEET); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Stylesheet */ - try { -/*@egen*/ - (Rule())*/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtreeCloseNodeScope(jjtn000); - } -/*@egen*/ - { return jjtn000; }/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Rule() : {/*@bgen(jjtree) Rule */ - SimpleNode jjtn000 = new SimpleNode(JJTRULE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Rule */ - try { -/*@egen*/ - Selectors() - <LEFT_BRACE> Declaration() (";" (Declaration())?)* <RIGHT_BRACE>/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Selectors() : {/*@bgen(jjtree) Selectors */ - SimpleNode jjtn000 = new SimpleNode(JJTSELECTORS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Selectors */ - try { -/*@egen*/ - Selector() ("," Selector())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Selector() : {/*@bgen(jjtree) Selector */ - SimpleNode jjtn000 = new SimpleNode(JJTSELECTOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Selector */ - try { -/*@egen*/ - JavaClass() (Id())? (Class())? (PseudoClass())? -| - Id() (Class())? (PseudoClass())? -| - Class() (PseudoClass())? -| - PseudoClass()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void JavaClass() : {/*@bgen(jjtree) JavaClass */ - SimpleNode jjtn000 = new SimpleNode(JJTJAVACLASS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) JavaClass */ - try { -/*@egen*/ - <IDENTIFIER> | "*"/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Id() : {/*@bgen(jjtree) Id */ - SimpleNode jjtn000 = new SimpleNode(JJTID); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Id */ - try { -/*@egen*/ - "#" <IDENTIFIER>/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Class() : {/*@bgen(jjtree) Class */ - SimpleNode jjtn000 = new SimpleNode(JJTCLASS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Class */ - try { -/*@egen*/ - "." <IDENTIFIER>/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void PseudoClass() : {/*@bgen(jjtree) PseudoClass */ - SimpleNode jjtn000 = new SimpleNode(JJTPSEUDOCLASS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) PseudoClass */ - try { -/*@egen*/ - <PSEUDOCLASS_COLON> (<PSEUDOCLASS_IDENTIFIER> | <PROGRAMMATIC_PSEUDOCLASS>) (AnimationProperties())?/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void AnimationProperties() : {/*@bgen(jjtree) AnimationProperties */ - SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTIES); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) AnimationProperties */ - try { -/*@egen*/ - "[" AnimationProperty() ("," AnimationProperty())* "]"/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void AnimationProperty() : {/*@bgen(jjtree) AnimationProperty */ - SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) AnimationProperty */ - try { -/*@egen*/ - <IDENTIFIER> "=" <DECIMAL_LITERAL> (<IDENTIFIER>)?/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Declaration() : {/*@bgen(jjtree) Declaration */ - SimpleNode jjtn000 = new SimpleNode(JJTDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Declaration */ - try { -/*@egen*/ - Property() <COLON> Expression()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Property() : {/*@bgen(jjtree) Property */ - SimpleNode jjtn000 = new SimpleNode(JJTPROPERTY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Property */ - try { -/*@egen*/ - <IDENTIFIER>/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Expression() : {/*@bgen(jjtree) Expression */ - SimpleNode jjtn000 = new SimpleNode(JJTEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Expression */ - try { -/*@egen*/ - (<DECIMAL_LITERAL> | <STRING> | <IDENTIFIER> | <HEXCOLOR> | <EMS> | <EXS> | <LENGTH> | - JavaCode())/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void JavaCode() : {/*@bgen(jjtree) JavaCode */ - SimpleNode jjtn000 = new SimpleNode(JJTJAVACODE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) JavaCode */ - try { -/*@egen*/ - <JAVA_CODE_START> <JAVA_CODE> <JAVA_CODE_END>/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} - - -void Identifier() : {/*@bgen(jjtree) Identifier */ - SimpleNode jjtn000 = new SimpleNode(JJTIDENTIFIER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtreeOpenNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Identifier */ - try { -/*@egen*/ - <IDENTIFIER>/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtreeCloseNodeScope(jjtn000); - } - } -/*@egen*/ -} +/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. .\CSS.jj */ +/*@egen*//* + * Copyright 2006 Ethan Nicholas. All rights reserved. + * Use is subject to license terms. + */ + +// I would love to have used an existing CSS parser, but all of the ones I could +// find are licensed under the LGPL. As JAXX is BSD licensed and I'm not a big +// fan of the LGPL, unfortunately that won't work. +options { + STATIC = false; + JDK_VERSION = "1.4"; +} + +PARSER_BEGIN(CSSParser) +package jaxx.css; + +public class CSSParser/*@bgen(jjtree)*/implements CSSParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/ + protected JJTCSSParserState jjtree = new JJTCSSParserState(); + +/*@egen*/ + public SimpleNode popNode() { + if ( jjtree.nodeArity() > 0) // number of child nodes + return (SimpleNode)jjtree.popNode(); + else + return null; + } + + void jjtreeOpenNodeScope(Node n) { + ((SimpleNode) n).firstToken = getToken(1); + } + + void jjtreeCloseNodeScope(Node n) { + ((SimpleNode) n).lastToken = getToken(0); + } + + public static void main(String args[]) { + System.out.println("Reading from standard input..."); + CSSParser css = new CSSParser(System.in); + try { + SimpleNode n = css.Stylesheet(); + n.dump(""); + System.out.println("Thank you."); + } catch (Exception e) { + System.out.println("Oops."); + System.out.println(e.getMessage()); + e.printStackTrace(); + } + } +} + +PARSER_END(CSSParser) + + +<DEFAULT, IN_RULE> SKIP : +{ + " " +| "\t" +| "\n" +| "\r" +| <"//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> +| <"/*" (~["*"])* "*" (~["/"] (~["*"])* "*")* "/"> +} + +<*> TOKEN : /* LITERALS */ +{ + <DECIMAL_LITERAL: <INTEGER_LITERAL> ("." <INTEGER_LITERAL>)?> +| + <#INTEGER_LITERAL: (["0"-"9"])+> +} + +<DEFAULT, IN_RULE> TOKEN : /* IDENTIFIER */ +{ + <IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)*> +| + <#LETTER: ["_", "-", "a"-"z", "A"-"Z"]> +| + <#DIGIT: ["0"-"9"]> +} + +<IN_PSEUDOCLASS> TOKEN : /* PSEUDOCLASS_IDENTIFIER */ +{ + <PSEUDOCLASS_IDENTIFIER: <IDENTIFIER>> : DEFAULT +} + +<DEFAULT> TOKEN: /* COLON */ +{ + <PSEUDOCLASS_COLON: ":"> : IN_PSEUDOCLASS +} + +<IN_RULE> TOKEN: /* COLON_IN_RULE */ +{ + <COLON: ":"> +} + +<*> TOKEN: /* SEMICOLON */ +{ + <SEMICOLON: ";"> +} + +TOKEN : /* LEFT BRACE */ +{ + <LEFT_BRACE: "{"> : IN_RULE +} + +<IN_RULE> TOKEN : /* RIGHT BRACE */ +{ + <RIGHT_BRACE: "}"> : DEFAULT +} + +<IN_RULE> TOKEN : /* JAVA_CODE_RULE START */ +{ + <JAVA_CODE_START: <LEFT_BRACE>> : JAVA_CODE_RULE +} + +<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE */ +{ + <JAVA_CODE: (~["}"])+ > +} + +<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE END */ +{ + <JAVA_CODE_END: <RIGHT_BRACE>> : IN_RULE +} + + +<IN_PSEUDOCLASS> TOKEN : /* PROGRAMMATIC_PSEUDOCLASS */ +{ + <PROGRAMMATIC_PSEUDOCLASS: "{" (~["}"])+ "}"> : DEFAULT +} + +<IN_RULE> TOKEN : /* STRINGS */ +{ + <STRING: "\"" (~["\"", "\\", "\n", "\r"])* "\""> +} + +<IN_RULE> TOKEN : /* COLORS */ +{ + <HEXCOLOR: "#" <HEXDIGIT> <HEXDIGIT> <HEXDIGIT> (<HEXDIGIT> <HEXDIGIT> <HEXDIGIT>)?> +| + <#HEXDIGIT: ["0"-"9", "a"-"f", "A"-"F"]> +} + + +<IN_RULE> TOKEN : /* EMS */ +{ + <EMS: <DECIMAL_LITERAL> "em"> +} + + +<IN_RULE> TOKEN : /* EXS */ +{ + <EXS: <DECIMAL_LITERAL> "ex"> +} + + +<IN_RULE> TOKEN : /* LENGTH */ +{ + <LENGTH: <DECIMAL_LITERAL> ("pt" | "mm" | "cm" | "pc" | "in")> +} + + +SimpleNode Stylesheet() : {/*@bgen(jjtree) Stylesheet */ + SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEET); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Stylesheet */ + try { +/*@egen*/ + (Rule())*/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + jjtreeCloseNodeScope(jjtn000); + } +/*@egen*/ + { return jjtn000; }/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Rule() : {/*@bgen(jjtree) Rule */ + SimpleNode jjtn000 = new SimpleNode(JJTRULE); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Rule */ + try { +/*@egen*/ + Selectors() + <LEFT_BRACE> Declaration() (";" (Declaration())?)* <RIGHT_BRACE>/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Selectors() : {/*@bgen(jjtree) Selectors */ + SimpleNode jjtn000 = new SimpleNode(JJTSELECTORS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Selectors */ + try { +/*@egen*/ + Selector() ("," Selector())*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Selector() : {/*@bgen(jjtree) Selector */ + SimpleNode jjtn000 = new SimpleNode(JJTSELECTOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Selector */ + try { +/*@egen*/ + JavaClass() (Id())? (Class())? (PseudoClass())? +| + Id() (Class())? (PseudoClass())? +| + Class() (PseudoClass())? +| + PseudoClass()/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void JavaClass() : {/*@bgen(jjtree) JavaClass */ + SimpleNode jjtn000 = new SimpleNode(JJTJAVACLASS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) JavaClass */ + try { +/*@egen*/ + <IDENTIFIER> | "*"/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Id() : {/*@bgen(jjtree) Id */ + SimpleNode jjtn000 = new SimpleNode(JJTID); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Id */ + try { +/*@egen*/ + "#" <IDENTIFIER>/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Class() : {/*@bgen(jjtree) Class */ + SimpleNode jjtn000 = new SimpleNode(JJTCLASS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Class */ + try { +/*@egen*/ + "." <IDENTIFIER>/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void PseudoClass() : {/*@bgen(jjtree) PseudoClass */ + SimpleNode jjtn000 = new SimpleNode(JJTPSEUDOCLASS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) PseudoClass */ + try { +/*@egen*/ + <PSEUDOCLASS_COLON> (<PSEUDOCLASS_IDENTIFIER> | <PROGRAMMATIC_PSEUDOCLASS>) (AnimationProperties())?/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void AnimationProperties() : {/*@bgen(jjtree) AnimationProperties */ + SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTIES); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) AnimationProperties */ + try { +/*@egen*/ + "[" AnimationProperty() ("," AnimationProperty())* "]"/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void AnimationProperty() : {/*@bgen(jjtree) AnimationProperty */ + SimpleNode jjtn000 = new SimpleNode(JJTANIMATIONPROPERTY); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) AnimationProperty */ + try { +/*@egen*/ + <IDENTIFIER> "=" <DECIMAL_LITERAL> (<IDENTIFIER>)?/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Declaration() : {/*@bgen(jjtree) Declaration */ + SimpleNode jjtn000 = new SimpleNode(JJTDECLARATION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Declaration */ + try { +/*@egen*/ + Property() <COLON> Expression()/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Property() : {/*@bgen(jjtree) Property */ + SimpleNode jjtn000 = new SimpleNode(JJTPROPERTY); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Property */ + try { +/*@egen*/ + <IDENTIFIER>/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Expression() : {/*@bgen(jjtree) Expression */ + SimpleNode jjtn000 = new SimpleNode(JJTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Expression */ + try { +/*@egen*/ + (<DECIMAL_LITERAL> | <STRING> | <IDENTIFIER> | <HEXCOLOR> | <EMS> | <EXS> | <LENGTH> | + JavaCode())/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void JavaCode() : {/*@bgen(jjtree) JavaCode */ + SimpleNode jjtn000 = new SimpleNode(JJTJAVACODE); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) JavaCode */ + try { +/*@egen*/ + <JAVA_CODE_START> <JAVA_CODE> <JAVA_CODE_END>/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} + + +void Identifier() : {/*@bgen(jjtree) Identifier */ + SimpleNode jjtn000 = new SimpleNode(JJTIDENTIFIER); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + jjtreeOpenNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Identifier */ + try { +/*@egen*/ + <IDENTIFIER>/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + jjtreeCloseNodeScope(jjtn000); + } + } +/*@egen*/ +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jj ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jjt =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jjt 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jjt 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,256 +1,256 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ - -// I would love to have used an existing CSS parser, but all of the ones I could -// find are licensed under the LGPL. As JAXX is BSD licensed and I'm not a big -// fan of the LGPL, unfortunately that won't work. -options { - STATIC = false; - JDK_VERSION = "1.4"; - NODE_SCOPE_HOOK = true; -} - -PARSER_BEGIN(CSSParser) -package jaxx.css; - -public class CSSParser { - public SimpleNode popNode() { - if ( jjtree.nodeArity() > 0) // number of child nodes - return (SimpleNode)jjtree.popNode(); - else - return null; - } - - void jjtreeOpenNodeScope(Node n) { - ((SimpleNode) n).firstToken = getToken(1); - } - - void jjtreeCloseNodeScope(Node n) { - ((SimpleNode) n).lastToken = getToken(0); - } - - public static void main(String args[]) { - System.out.println("Reading from standard input..."); - CSSParser css = new CSSParser(System.in); - try { - SimpleNode n = css.Stylesheet(); - n.dump(""); - System.out.println("Thank you."); - } catch (Exception e) { - System.out.println("Oops."); - System.out.println(e.getMessage()); - e.printStackTrace(); - } - } -} - -PARSER_END(CSSParser) - - -<DEFAULT, IN_RULE> SKIP : -{ - " " -| "\t" -| "\n" -| "\r" -| <"//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> -| <"/*" (~["*"])* "*" (~["/"] (~["*"])* "*")* "/"> -} - -<*> TOKEN : /* LITERALS */ -{ - <DECIMAL_LITERAL: <INTEGER_LITERAL> ("." <INTEGER_LITERAL>)?> -| - <#INTEGER_LITERAL: (["0"-"9"])+> -} - -<DEFAULT, IN_RULE> TOKEN : /* IDENTIFIER */ -{ - <IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)*> -| - <#LETTER: ["_", "-", "a"-"z", "A"-"Z"]> -| - <#DIGIT: ["0"-"9"]> -} - -<IN_PSEUDOCLASS> TOKEN : /* PSEUDOCLASS_IDENTIFIER */ -{ - <PSEUDOCLASS_IDENTIFIER: <IDENTIFIER>> : DEFAULT -} - -<DEFAULT> TOKEN: /* COLON */ -{ - <PSEUDOCLASS_COLON: ":"> : IN_PSEUDOCLASS -} - -<IN_RULE> TOKEN: /* COLON_IN_RULE */ -{ - <COLON: ":"> -} - -<*> TOKEN: /* SEMICOLON */ -{ - <SEMICOLON: ";"> -} - -TOKEN : /* LEFT BRACE */ -{ - <LEFT_BRACE: "{"> : IN_RULE -} - -<IN_RULE> TOKEN : /* RIGHT BRACE */ -{ - <RIGHT_BRACE: "}"> : DEFAULT -} - -<IN_RULE> TOKEN : /* JAVA_CODE_RULE START */ -{ - <JAVA_CODE_START: <LEFT_BRACE>> : JAVA_CODE_RULE -} - -<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE */ -{ - <JAVA_CODE: (~["}"])+ > -} - -<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE END */ -{ - <JAVA_CODE_END: <RIGHT_BRACE>> : IN_RULE -} - - -<IN_PSEUDOCLASS> TOKEN : /* PROGRAMMATIC_PSEUDOCLASS */ -{ - <PROGRAMMATIC_PSEUDOCLASS: "{" (~["}"])+ "}"> : DEFAULT -} - -<IN_RULE> TOKEN : /* STRINGS */ -{ - <STRING: "\"" (~["\"", "\\", "\n", "\r"])* "\""> -} - -<IN_RULE> TOKEN : /* COLORS */ -{ - <HEXCOLOR: "#" <HEXDIGIT> <HEXDIGIT> <HEXDIGIT> (<HEXDIGIT> <HEXDIGIT> <HEXDIGIT>)?> -| - <#HEXDIGIT: ["0"-"9", "a"-"f", "A"-"F"]> -} - - -<IN_RULE> TOKEN : /* EMS */ -{ - <EMS: <DECIMAL_LITERAL> "em"> -} - - -<IN_RULE> TOKEN : /* EXS */ -{ - <EXS: <DECIMAL_LITERAL> "ex"> -} - - -<IN_RULE> TOKEN : /* LENGTH */ -{ - <LENGTH: <DECIMAL_LITERAL> ("pt" | "mm" | "cm" | "pc" | "in")> -} - - -SimpleNode Stylesheet() : {} -{ - (Rule())* - { return jjtThis; } -} - - -void Rule() : {} -{ - Selectors() - <LEFT_BRACE> Declaration() (";" (Declaration())?)* <RIGHT_BRACE> -} - - -void Selectors() : {} -{ - Selector() ("," Selector())* -} - - -void Selector() : {} -{ - JavaClass() (Id())? (Class())? (PseudoClass())? -| - Id() (Class())? (PseudoClass())? -| - Class() (PseudoClass())? -| - PseudoClass() -} - - -void JavaClass() : {} -{ - <IDENTIFIER> | "*" -} - - -void Id() : {} -{ - "#" <IDENTIFIER> -} - - -void Class() : {} -{ - "." <IDENTIFIER> -} - - -void PseudoClass() : {} -{ - <PSEUDOCLASS_COLON> (<PSEUDOCLASS_IDENTIFIER> | <PROGRAMMATIC_PSEUDOCLASS>) (AnimationProperties())? -} - - -void AnimationProperties() : {} -{ - "[" AnimationProperty() ("," AnimationProperty())* "]" -} - - -void AnimationProperty() : {} -{ - <IDENTIFIER> "=" <DECIMAL_LITERAL> (<IDENTIFIER>)? -} - - -void Declaration() : {} -{ - Property() <COLON> Expression() -} - - -void Property() : {} -{ - <IDENTIFIER> -} - - -void Expression() : {} -{ - (<DECIMAL_LITERAL> | <STRING> | <IDENTIFIER> | <HEXCOLOR> | <EMS> | <EXS> | <LENGTH> | - JavaCode()) -} - - -void JavaCode() : {} -{ - <JAVA_CODE_START> <JAVA_CODE> <JAVA_CODE_END> -} - - -void Identifier() : {} -{ - <IDENTIFIER> -} +/* + * Copyright 2006 Ethan Nicholas. All rights reserved. + * Use is subject to license terms. + */ + +// I would love to have used an existing CSS parser, but all of the ones I could +// find are licensed under the LGPL. As JAXX is BSD licensed and I'm not a big +// fan of the LGPL, unfortunately that won't work. +options { + STATIC = false; + JDK_VERSION = "1.4"; + NODE_SCOPE_HOOK = true; +} + +PARSER_BEGIN(CSSParser) +package jaxx.css; + +public class CSSParser { + public SimpleNode popNode() { + if ( jjtree.nodeArity() > 0) // number of child nodes + return (SimpleNode)jjtree.popNode(); + else + return null; + } + + void jjtreeOpenNodeScope(Node n) { + ((SimpleNode) n).firstToken = getToken(1); + } + + void jjtreeCloseNodeScope(Node n) { + ((SimpleNode) n).lastToken = getToken(0); + } + + public static void main(String args[]) { + System.out.println("Reading from standard input..."); + CSSParser css = new CSSParser(System.in); + try { + SimpleNode n = css.Stylesheet(); + n.dump(""); + System.out.println("Thank you."); + } catch (Exception e) { + System.out.println("Oops."); + System.out.println(e.getMessage()); + e.printStackTrace(); + } + } +} + +PARSER_END(CSSParser) + + +<DEFAULT, IN_RULE> SKIP : +{ + " " +| "\t" +| "\n" +| "\r" +| <"//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> +| <"/*" (~["*"])* "*" (~["/"] (~["*"])* "*")* "/"> +} + +<*> TOKEN : /* LITERALS */ +{ + <DECIMAL_LITERAL: <INTEGER_LITERAL> ("." <INTEGER_LITERAL>)?> +| + <#INTEGER_LITERAL: (["0"-"9"])+> +} + +<DEFAULT, IN_RULE> TOKEN : /* IDENTIFIER */ +{ + <IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)*> +| + <#LETTER: ["_", "-", "a"-"z", "A"-"Z"]> +| + <#DIGIT: ["0"-"9"]> +} + +<IN_PSEUDOCLASS> TOKEN : /* PSEUDOCLASS_IDENTIFIER */ +{ + <PSEUDOCLASS_IDENTIFIER: <IDENTIFIER>> : DEFAULT +} + +<DEFAULT> TOKEN: /* COLON */ +{ + <PSEUDOCLASS_COLON: ":"> : IN_PSEUDOCLASS +} + +<IN_RULE> TOKEN: /* COLON_IN_RULE */ +{ + <COLON: ":"> +} + +<*> TOKEN: /* SEMICOLON */ +{ + <SEMICOLON: ";"> +} + +TOKEN : /* LEFT BRACE */ +{ + <LEFT_BRACE: "{"> : IN_RULE +} + +<IN_RULE> TOKEN : /* RIGHT BRACE */ +{ + <RIGHT_BRACE: "}"> : DEFAULT +} + +<IN_RULE> TOKEN : /* JAVA_CODE_RULE START */ +{ + <JAVA_CODE_START: <LEFT_BRACE>> : JAVA_CODE_RULE +} + +<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE */ +{ + <JAVA_CODE: (~["}"])+ > +} + +<JAVA_CODE_RULE> TOKEN : /* JAVA_CODE_RULE END */ +{ + <JAVA_CODE_END: <RIGHT_BRACE>> : IN_RULE +} + + +<IN_PSEUDOCLASS> TOKEN : /* PROGRAMMATIC_PSEUDOCLASS */ +{ + <PROGRAMMATIC_PSEUDOCLASS: "{" (~["}"])+ "}"> : DEFAULT +} + +<IN_RULE> TOKEN : /* STRINGS */ +{ + <STRING: "\"" (~["\"", "\\", "\n", "\r"])* "\""> +} + +<IN_RULE> TOKEN : /* COLORS */ +{ + <HEXCOLOR: "#" <HEXDIGIT> <HEXDIGIT> <HEXDIGIT> (<HEXDIGIT> <HEXDIGIT> <HEXDIGIT>)?> +| + <#HEXDIGIT: ["0"-"9", "a"-"f", "A"-"F"]> +} + + +<IN_RULE> TOKEN : /* EMS */ +{ + <EMS: <DECIMAL_LITERAL> "em"> +} + + +<IN_RULE> TOKEN : /* EXS */ +{ + <EXS: <DECIMAL_LITERAL> "ex"> +} + + +<IN_RULE> TOKEN : /* LENGTH */ +{ + <LENGTH: <DECIMAL_LITERAL> ("pt" | "mm" | "cm" | "pc" | "in")> +} + + +SimpleNode Stylesheet() : {} +{ + (Rule())* + { return jjtThis; } +} + + +void Rule() : {} +{ + Selectors() + <LEFT_BRACE> Declaration() (";" (Declaration())?)* <RIGHT_BRACE> +} + + +void Selectors() : {} +{ + Selector() ("," Selector())* +} + + +void Selector() : {} +{ + JavaClass() (Id())? (Class())? (PseudoClass())? +| + Id() (Class())? (PseudoClass())? +| + Class() (PseudoClass())? +| + PseudoClass() +} + + +void JavaClass() : {} +{ + <IDENTIFIER> | "*" +} + + +void Id() : {} +{ + "#" <IDENTIFIER> +} + + +void Class() : {} +{ + "." <IDENTIFIER> +} + + +void PseudoClass() : {} +{ + <PSEUDOCLASS_COLON> (<PSEUDOCLASS_IDENTIFIER> | <PROGRAMMATIC_PSEUDOCLASS>) (AnimationProperties())? +} + + +void AnimationProperties() : {} +{ + "[" AnimationProperty() ("," AnimationProperty())* "]" +} + + +void AnimationProperty() : {} +{ + <IDENTIFIER> "=" <DECIMAL_LITERAL> (<IDENTIFIER>)? +} + + +void Declaration() : {} +{ + Property() <COLON> Expression() +} + + +void Property() : {} +{ + <IDENTIFIER> +} + + +void Expression() : {} +{ + (<DECIMAL_LITERAL> | <STRING> | <IDENTIFIER> | <HEXCOLOR> | <EMS> | <EXS> | <LENGTH> | + JavaCode()) +} + + +void JavaCode() : {} +{ + <JAVA_CODE_START> <JAVA_CODE> <JAVA_CODE_END> +} + + +void Identifier() : {} +{ + <IDENTIFIER> +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSS.jjt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -509,6 +509,8 @@ compiler.isSuperClassAware(JAXXObject.class); javaFile.setModifiers(PUBLIC); javaFile.setName(fullClassName); + javaFile.setSimpleName(className); + javaFile.setSuperClass(JAXXCompiler.getCanonicalName(superclass)); javaFile.setSuperclassIsJAXXObject(superclassIsJAXXObject); @@ -543,7 +545,7 @@ addPreviousValuesField(compiler, javaFile, root); - addConstructors(compiler, javaFile, className); +// addConstructors(compiler, javaFile, className); DataBinding[] bindings = compiler.getBindingHelper().getDataBindings(); Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/JAXXCompilerFinalizer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,86 +1,86 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.java; - -/** - * Represents an argument to a <code>JavaMethod</code>. - * - * @see JavaMethod - */ -public class JavaArgument extends JavaElement { - - private String type; - - private boolean isFinal; - - /** - * Creates a new <code>JavaArgument</code> with the specified name and type. For example, the method <code>main()</code> - * might have a <code>JavaArgument</code> with a name of <code>"arg"</code> and a type of <code>"java.lang.String[]"</code>. - * - * @param type the argument's type, as it would appear in Java source code - * @param name the argument's name - */ - JavaArgument(String type, String name) { - this(type, name, false); - } - - /** - * Creates a new <code>JavaArgument</code> with the specified name, type, and finality. For example, the method <code>main()</code> - * might have a <code>JavaArgument</code> with a name of <code>"arg"</code> and a type of <code>"java.lang.String[]"</code>. The - * <code>isFinal</code> parameter allows the presence of the <code>final</code> keyword on the argument to be controlled. - * - * @param type the argument's type, as it would appear in Java source code - * @param name the argument's name - * @param isFinal <code>true</code> if the argument should be marked final - */ - JavaArgument(String type, String name, boolean isFinal) { - super(0, name); - this.type = type; - this.isFinal = isFinal; - } - - /** - * Returns the argument's type as it would be represented in Java source code. - * - * @return the argument's type - */ - public String getType() { - return type; - } - - /** - * Returns <code>true</code> if the <code>final</code> keyword should appear before the argument. - * - * @return <code>true</code> if the argument is final - */ - public boolean isFinal() { - return isFinal; - } - - public void setType(String type) { - this.type = type; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.java; + +/** + * Represents an argument to a <code>JavaMethod</code>. + * + * @see JavaMethod + */ +public class JavaArgument extends JavaElement { + + private String type; + + private boolean isFinal; + + /** + * Creates a new <code>JavaArgument</code> with the specified name and type. For example, the method <code>main()</code> + * might have a <code>JavaArgument</code> with a name of <code>"arg"</code> and a type of <code>"java.lang.String[]"</code>. + * + * @param type the argument's type, as it would appear in Java source code + * @param name the argument's name + */ + JavaArgument(String type, String name) { + this(type, name, false); + } + + /** + * Creates a new <code>JavaArgument</code> with the specified name, type, and finality. For example, the method <code>main()</code> + * might have a <code>JavaArgument</code> with a name of <code>"arg"</code> and a type of <code>"java.lang.String[]"</code>. The + * <code>isFinal</code> parameter allows the presence of the <code>final</code> keyword on the argument to be controlled. + * + * @param type the argument's type, as it would appear in Java source code + * @param name the argument's name + * @param isFinal <code>true</code> if the argument should be marked final + */ + JavaArgument(String type, String name, boolean isFinal) { + super(0, name); + this.type = type; + this.isFinal = isFinal; + } + + /** + * Returns the argument's type as it would be represented in Java source code. + * + * @return the argument's type + */ + public String getType() { + return type; + } + + /** + * Returns <code>true</code> if the <code>final</code> keyword should appear before the argument. + * + * @return <code>true</code> if the argument is final + */ + public boolean isFinal() { + return isFinal; + } + + public void setType(String type) { + this.type = type; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaConstructor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaConstructor.java (rev 0) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaConstructor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -0,0 +1,74 @@ +package jaxx.compiler.java; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Modifier; + +/** + * To mirror a {@link Constructor}. + * <p/> + * In a constructor we need to keep all parameters types as fqn since when + * a jaxx object inheritates from anohter one, it is painfull (even impossible?) + * to find out from a simple name his fqn. + * <p/> + * So when using constructor, always keep fqn types. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.4 + */ +public class JavaConstructor extends JavaElement { + + /** arguments of the method (can be empty) */ + private JavaArgument[] arguments; + + /** exceptions thrown by the method (can be empty) */ + private String[] exceptions; + + /** body of the method (can be empty) */ + private String body; + + /** + * Constructs a new <code>JavaMethod</code> containing the specified body code. The <code>modifiers</code> parameter + * is a bit mask of the constants from {@link Modifier}, and the <code>returnType</code> and + * <code>exceptions</code> of the method should be represented as they would appear in Java source code (<code>null</code> + * for a constructor). The method body is initially empty. + * + * @param modifiers the modifier keywords that should appear as part of the method's declaration + * @param name the method's name + * @param arguments the method's arguments + * @param exceptions a list of exceptions the methods can throw, as they would be represented in Java source code + * @param bodyCode Java source code which should appear in the method body + */ + JavaConstructor(int modifiers, + String name, + JavaArgument[] arguments, + String[] exceptions, + String bodyCode) { + super(modifiers, name); + this.arguments = arguments; + this.exceptions = exceptions; + body = bodyCode == null ? "" : bodyCode; + } + + /** + * Returns a list of the method's arguments. + * + * @return the method's arguments + */ + public JavaArgument[] getArguments() { + return arguments; + } + + /** + * Returns a list of exceptions the method can throw. + * + * @return the method's exceptions + */ + public String[] getExceptions() { + return exceptions; + } + + public String getBody() { + return body; + } + +} \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaConstructor.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElementFactory.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElementFactory.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElementFactory.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -81,10 +81,35 @@ ); } + public static JavaConstructor newConstructor(int modifiers, + String name, + String body, + String[] exceptions, + JavaArgument... arguments) { + return new JavaConstructor(modifiers, + name, + arguments, + exceptions, + body + ); + } + + public static JavaConstructor newConstructor(int modifiers, + String name, + String body, + JavaArgument... arguments) { + return newConstructor(modifiers, + name, + body, + StringUtil.EMPTY_STRING_ARRAY, + arguments + ); + } + public static JavaMethod newMethod(int modifiers, String returnType, String name, - String initializer, + String body, boolean override, String[] exceptions, JavaArgument... arguments) { @@ -96,7 +121,7 @@ name, arguments, exceptions, - initializer, + body, override ); } @@ -104,13 +129,13 @@ public static JavaMethod newMethod(int modifiers, String returnType, String name, - String initializer, + String body, boolean override, JavaArgument... arguments) { return newMethod(modifiers, returnType, name, - initializer, + body, override, StringUtil.EMPTY_STRING_ARRAY, arguments Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,299 +1,299 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.java; - -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -/** - * Represents a field in a Java source file being generated for output. <code>JavaFields</code> are created - * and added to a {@link JavaFile}, which can then output Java source code. - */ -public class JavaField extends JavaElement implements Comparable<JavaField> { - - /** type of field (fqn) */ - private String type; - - /** initializer of field (can be null) */ - private String initializer; - - /** - * Types to apply to the initializer to try use simple type names. - * - * @since 2.4 - */ - private String[] initializerTypes; - - - /** flag to known where a field overrides a super-field */ - private boolean override; - - /** - * Constructs a new <code>JavaField</code>. The <code>modifiers</code> parameter is a bit mask of the - * constants from {@link Modifier}, and the <code>type</code> of the field should be - * represented as it would appear in Java source code. - * - * @param modifiers the modifier keywords that should appear as part of the field's declaration - * @param type the type of the field as it would appear in Java source code - * @param name the field's name - * @param override flag to add @Override annotation on getter and setter - */ - JavaField(int modifiers, - String type, - String name, - boolean override) { - this(modifiers, type, name, override, null); - } - - /** - * Constructs a new <code>JavaField</code>. The <code>modifiers</code> parameter is a bit mask of the - * constants from <code>java.lang.reflect.Modifier</code>, and the <code>type</code> of the field should be - * represented as it would appear in Java source code. The <code>initializer</code> is the initial - * value of the field as it would appear in Java source code, or <code>null</code> to leave it at the - * default value. - * - * @param modifiers the modifier keywords that should appear as part of the field's declaration - * @param type the type of the field as it would appear in Java source code - * @param name the field's name - * @param override {@code true} if method should be marked as overriden - * @param initializer the initial value of the field, as it would appear in Java source code - * @param initializerTypes initializer types to use - */ - JavaField(int modifiers, - String type, - String name, - boolean override, - String initializer, - String... initializerTypes) { - super(modifiers, name); - this.type = type; - this.initializer = initializer; - this.initializerTypes = initializerTypes; - this.override = override; - } - - /** - * Returns the field's type, as it would be represented in Java source code. - * - * @return the field's type - */ - public String getType() { - return type; - } - - public boolean isOverride() { - return override; - } - - public String getInitializer() { - return initializer; - } - - public String[] getInitializerTypes() { - return initializerTypes; - } - - public boolean hasInitializerTypes() { - return initializerTypes != null && initializerTypes.length > 0; - } - - @Override - public int compareTo(JavaField o) { - return JavaElementComparator.compare(this, o); - } - - @Override - public String toString() { - return super.toString() + " " + getName() + ", type:" + - getType() + ", modifiers:" + Modifier.toString(getModifiers()); - } - - public void setType(String type) { - this.type = type; - } - - public void setInitializer(String initializer) { - this.initializer = initializer; - } - - public enum FieldOrder { - - staticsBean(Modifier.STATIC | Modifier.PUBLIC, - "Constants for all javaBean properties") { - @Override - public boolean accept(JavaField field) { - return field.getName().startsWith("PROPERTY_"); - } - }, - - staticsPublicBindings(Modifier.STATIC | Modifier.PUBLIC, - "Constants for all public bindings") { - @Override - public boolean accept(JavaField field) { - return field.getName().startsWith("BINDING_") && - Modifier.isPublic(field.getModifiers()); - } - }, - - staticsPrivateBindings(Modifier.STATIC | Modifier.PRIVATE, - "Constants for all none public bindings") { - @Override - public boolean accept(JavaField field) { - return field.getName().startsWith("BINDING_$") && - Modifier.isPrivate(field.getModifiers()); - } - }, - - staticsOthers(Modifier.STATIC, "Other static fields"), - - internalFields(Modifier.PROTECTED | Modifier.PRIVATE, - "Internal states") { - - private final List<String> fields = Arrays.asList( - "delegateContext", - "$previousValues", - "$bindingSources", - "$objectMap", - "$activeBindings", - "$bindings", - "$propertyChangeSupport", - "allComponentsCreated", - "contextInitialized"); - - @Override - public boolean accept(JavaField field) { - return fields.contains(field.getName()); - } - }, - publicFields(Modifier.PUBLIC, "Public components"), - protectedFields(Modifier.PROTECTED, "Protected components"), - privateFields(Modifier.PRIVATE, "Private components"), - otherFields(0, "Other fields") { - @Override - public boolean accept(JavaField field) { - return true; - } - }; - - private final String header; - - private int modifier; - - FieldOrder(int modifier, String header) { - this.header = JavaFileGenerator.getHeader(header); - this.modifier = modifier; - } - - public String getHeader() { - return header; - } - - public boolean accept(JavaField field) { - return true; - } - - public boolean accept(int mod) { - return (mod & modifier) != 0; - } - - public boolean accept(int mod, JavaField method) { - return accept(mod) && accept(method); - } - - public static FieldOrder valueOf(JavaField method, int scope) { - for (FieldOrder o : values()) { - if (o.accept(scope, method)) { - return o; - } - } - throw new IllegalArgumentException( - "could not find a " + FieldOrder.class + - " for method " + method); - } - } - - public static EnumMap<FieldOrder, List<JavaField>> getSortedFields(List<JavaField> fields) { - - EnumMap<FieldOrder, List<JavaField>> result = - new EnumMap<FieldOrder, List<JavaField>>(FieldOrder.class); - for (FieldOrder fieldOrder : FieldOrder.values()) { - result.put(fieldOrder, new ArrayList<JavaField>()); - } - - EnumSet<FieldOrder> allConstants = EnumSet.allOf(FieldOrder.class); - List<JavaField> allFields = new ArrayList<JavaField>(fields); - int[] scopes = new int[]{Modifier.STATIC, - Modifier.PUBLIC, - Modifier.PROTECTED, - Modifier.PRIVATE - }; - for (int scope : scopes) { - EnumSet<FieldOrder> constants = - getFieldOrderScope(allConstants, scope); - - Iterator<JavaField> itMethods = allFields.iterator(); - while (itMethods.hasNext()) { - JavaField method = itMethods.next(); - for (FieldOrder constant : constants) { - if (constant.accept(method.getModifiers(), method)) { - result.get(constant).add(method); - itMethods.remove(); - break; - } - } - } - constants.clear(); - } - - if (!allFields.isEmpty()) { - - // probably package locale fields - result.get(FieldOrder.otherFields).addAll(allFields); - } - - for (FieldOrder fieldOrder : FieldOrder.values()) { - // sort fields - Collections.sort(result.get(fieldOrder)); - } - return result; - } - - public static EnumSet<FieldOrder> getFieldOrderScope(EnumSet<FieldOrder> allConstants, int scope) { - EnumSet<FieldOrder> constants = EnumSet.noneOf(FieldOrder.class); - for (FieldOrder order : allConstants) { - if (order.accept(scope)) { - constants.add(order); - } - } - return constants; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.java; + +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; + +/** + * Represents a field in a Java source file being generated for output. <code>JavaFields</code> are created + * and added to a {@link JavaFile}, which can then output Java source code. + */ +public class JavaField extends JavaElement implements Comparable<JavaField> { + + /** type of field (fqn) */ + private String type; + + /** initializer of field (can be null) */ + private String initializer; + + /** + * Types to apply to the initializer to try use simple type names. + * + * @since 2.4 + */ + private String[] initializerTypes; + + + /** flag to known where a field overrides a super-field */ + private boolean override; + + /** + * Constructs a new <code>JavaField</code>. The <code>modifiers</code> parameter is a bit mask of the + * constants from {@link Modifier}, and the <code>type</code> of the field should be + * represented as it would appear in Java source code. + * + * @param modifiers the modifier keywords that should appear as part of the field's declaration + * @param type the type of the field as it would appear in Java source code + * @param name the field's name + * @param override flag to add @Override annotation on getter and setter + */ + JavaField(int modifiers, + String type, + String name, + boolean override) { + this(modifiers, type, name, override, null); + } + + /** + * Constructs a new <code>JavaField</code>. The <code>modifiers</code> parameter is a bit mask of the + * constants from <code>java.lang.reflect.Modifier</code>, and the <code>type</code> of the field should be + * represented as it would appear in Java source code. The <code>initializer</code> is the initial + * value of the field as it would appear in Java source code, or <code>null</code> to leave it at the + * default value. + * + * @param modifiers the modifier keywords that should appear as part of the field's declaration + * @param type the type of the field as it would appear in Java source code + * @param name the field's name + * @param override {@code true} if method should be marked as overriden + * @param initializer the initial value of the field, as it would appear in Java source code + * @param initializerTypes initializer types to use + */ + JavaField(int modifiers, + String type, + String name, + boolean override, + String initializer, + String... initializerTypes) { + super(modifiers, name); + this.type = type; + this.initializer = initializer; + this.initializerTypes = initializerTypes; + this.override = override; + } + + /** + * Returns the field's type, as it would be represented in Java source code. + * + * @return the field's type + */ + public String getType() { + return type; + } + + public boolean isOverride() { + return override; + } + + public String getInitializer() { + return initializer; + } + + public String[] getInitializerTypes() { + return initializerTypes; + } + + public boolean hasInitializerTypes() { + return initializerTypes != null && initializerTypes.length > 0; + } + + @Override + public int compareTo(JavaField o) { + return JavaElementComparator.compare(this, o); + } + + @Override + public String toString() { + return super.toString() + " " + getName() + ", type:" + + getType() + ", modifiers:" + Modifier.toString(getModifiers()); + } + + public void setType(String type) { + this.type = type; + } + + public void setInitializer(String initializer) { + this.initializer = initializer; + } + + public enum FieldOrder { + + staticsBean(Modifier.STATIC | Modifier.PUBLIC, + "Constants for all javaBean properties") { + @Override + public boolean accept(JavaField field) { + return field.getName().startsWith("PROPERTY_"); + } + }, + + staticsPublicBindings(Modifier.STATIC | Modifier.PUBLIC, + "Constants for all public bindings") { + @Override + public boolean accept(JavaField field) { + return field.getName().startsWith("BINDING_") && + Modifier.isPublic(field.getModifiers()); + } + }, + + staticsPrivateBindings(Modifier.STATIC | Modifier.PRIVATE, + "Constants for all none public bindings") { + @Override + public boolean accept(JavaField field) { + return field.getName().startsWith("BINDING_$") && + Modifier.isPrivate(field.getModifiers()); + } + }, + + staticsOthers(Modifier.STATIC, "Other static fields"), + + internalFields(Modifier.PROTECTED | Modifier.PRIVATE, + "Internal states") { + + private final List<String> fields = Arrays.asList( + "delegateContext", + "$previousValues", + "$bindingSources", + "$objectMap", + "$activeBindings", + "$bindings", + "$propertyChangeSupport", + "allComponentsCreated", + "contextInitialized"); + + @Override + public boolean accept(JavaField field) { + return fields.contains(field.getName()); + } + }, + publicFields(Modifier.PUBLIC, "Public components"), + protectedFields(Modifier.PROTECTED, "Protected components"), + privateFields(Modifier.PRIVATE, "Private components"), + otherFields(0, "Other fields") { + @Override + public boolean accept(JavaField field) { + return true; + } + }; + + private final String header; + + private int modifier; + + FieldOrder(int modifier, String header) { + this.header = JavaFileGenerator.getHeader(header); + this.modifier = modifier; + } + + public String getHeader() { + return header; + } + + public boolean accept(JavaField field) { + return true; + } + + public boolean accept(int mod) { + return (mod & modifier) != 0; + } + + public boolean accept(int mod, JavaField method) { + return accept(mod) && accept(method); + } + + public static FieldOrder valueOf(JavaField method, int scope) { + for (FieldOrder o : values()) { + if (o.accept(scope, method)) { + return o; + } + } + throw new IllegalArgumentException( + "could not find a " + FieldOrder.class + + " for method " + method); + } + } + + public static EnumMap<FieldOrder, List<JavaField>> getSortedFields(List<JavaField> fields) { + + EnumMap<FieldOrder, List<JavaField>> result = + new EnumMap<FieldOrder, List<JavaField>>(FieldOrder.class); + for (FieldOrder fieldOrder : FieldOrder.values()) { + result.put(fieldOrder, new ArrayList<JavaField>()); + } + + EnumSet<FieldOrder> allConstants = EnumSet.allOf(FieldOrder.class); + List<JavaField> allFields = new ArrayList<JavaField>(fields); + int[] scopes = new int[]{Modifier.STATIC, + Modifier.PUBLIC, + Modifier.PROTECTED, + Modifier.PRIVATE + }; + for (int scope : scopes) { + EnumSet<FieldOrder> constants = + getFieldOrderScope(allConstants, scope); + + Iterator<JavaField> itMethods = allFields.iterator(); + while (itMethods.hasNext()) { + JavaField method = itMethods.next(); + for (FieldOrder constant : constants) { + if (constant.accept(method.getModifiers(), method)) { + result.get(constant).add(method); + itMethods.remove(); + break; + } + } + } + constants.clear(); + } + + if (!allFields.isEmpty()) { + + // probably package locale fields + result.get(FieldOrder.otherFields).addAll(allFields); + } + + for (FieldOrder fieldOrder : FieldOrder.values()) { + // sort fields + Collections.sort(result.get(fieldOrder)); + } + return result; + } + + public static EnumSet<FieldOrder> getFieldOrderScope(EnumSet<FieldOrder> allConstants, int scope) { + EnumSet<FieldOrder> constants = EnumSet.noneOf(FieldOrder.class); + for (FieldOrder order : allConstants) { + if (order.accept(scope)) { + constants.add(order); + } + } + return constants; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,470 +1,481 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.java; - -import jaxx.compiler.finalizers.JAXXCompilerFinalizer; -import jaxx.compiler.types.TypeManager; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.nuiton.eugene.java.extension.ImportsManager; - -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * A Java source file being generated for output. Once the class is completely initialized, use the - * {@link #toString} method to generate source code for it. - */ -public class JavaFile extends JavaElement { - - /** Logger. */ - static Log log = LogFactory.getLog(JavaFile.class); - - protected static final String GETTER_PATTERN = "return %1$s;"; - - protected static final String BOOLEAN_GETTER_PATTERN = "return %1$s !=null && %1$s;"; - - protected static final String SETTER_PATTERN = "%1$s oldValue = this.%2$s;\nthis.%2$s = %2$s;\nfirePropertyChange(%3$s, oldValue, %2$s);"; - - private Set<String> imports = new HashSet<String>(); - - private List<JavaField> fields = new ArrayList<JavaField>(); - - private List<JavaMethod> methods = new ArrayList<JavaMethod>(); - - private List<JavaMethod> constructors = new ArrayList<JavaMethod>(); - - private List<JavaFile> innerClasses = new ArrayList<JavaFile>(); - - private String superClass; - - private List<String> interfaces; - - private StringBuffer rawBodyCode = new StringBuffer(); - - private boolean superclassIsJAXXObject; - - private boolean abstractClass; - - private String genericType; - - private String superGenericType; - - private final ImportsManager importManager; - - JavaFile(int modifiers, String className) { - super(modifiers, className); - importManager = new ImportsManager(); - // add the fqn before all in the import manager to deal with alias classes - importManager.addImport(className); - } - - /** @deprecated since 2.4, never be used */ - @Deprecated - JavaFile() { - this(0, ""); - } - - /** - * @param modifiers - * @param className - * @param superClass - * @deprecated since 2.4, never be used - */ - @Deprecated - JavaFile(int modifiers, String className, String superClass) { - this(modifiers, className, superClass, null); - } - - /** - * @param modifiers - * @param className - * @param superClass - * @param interfaces - * @deprecated since 2.4, never be used - */ - @Deprecated - JavaFile(int modifiers, - String className, - String superClass, - List<String> interfaces) { - this(modifiers, className); - setSuperClass(superClass); - if (CollectionUtils.isNotEmpty(interfaces)) { - addInterface(interfaces.toArray(new String[interfaces.size()])); - } -// this.superClass = superClass; -// this.interfaces = interfaces; - } - - public String getPackageName() { - String name = getName(); - - String packageName; - if (name.contains(".")) { - packageName = name.substring(0, name.lastIndexOf(".")); - } else { - packageName = null; - } - return packageName; - } - - public ImportsManager getImportManager() { - return importManager; - } - - public String[] getImports() { - List<String> result = new ArrayList<String>(imports); - Collections.sort(result); - return result.toArray(new String[result.size()]); - } - - public List<String> getImportsList() { - List<String> result = new ArrayList<String>(imports); - Collections.sort(result); - return result; - } - - public String getSuperClass() { - return superClass; - } - - public List<String> getInterfaces() { - if (interfaces == null) { - interfaces = new ArrayList<String>(); - } - return interfaces; - } - - public List<JavaMethod> getMethods() { - return methods; - } - - public List<JavaField> getFields() { - return fields; - } - - public boolean isAbstractClass() { - return abstractClass; - } - - public String getGenericType() { - return genericType; - } - - public List<JavaFile> getInnerClasses() { - return innerClasses; - } - - public StringBuffer getRawBodyCode() { - return rawBodyCode; - } - - public String getSuperGenericType() { - return superGenericType; - } - - public boolean isSuperclassIsJAXXObject() { - return superclassIsJAXXObject; - } - - public JavaField getField(String componentId) { - for (JavaField field : fields) { - if (componentId.equals(field.getName())) { - return field; - } - } - return null; - } - - public void addImport(String importString) { - try { - importManager.addImport(importString); - } catch (Exception e) { - log.error("Could not determine simple name of import " + importString); - } - } - - public void addImport(Class<?> importString) { - addImport(importString.getName()); - } - - public void setImports(Collection<String> imports) { - this.imports = new HashSet<String>(imports); - } - - public void setGenericType(String genericType) { - this.genericType = genericType; - } - - public void setSuperClass(String superClass) { - this.superClass = superClass; - } - - public void addInterface(String... canonicalNames) { - if (canonicalNames == null) { - return; - } - for (String canonicalName : canonicalNames) { - if (interfaces == null || !interfaces.contains(canonicalName)) { - getInterfaces().add(canonicalName); - } - } - } - - public void setInterfaces(List<String> interfaces) { - List<String> simpleInterfaces = new ArrayList<String>(); - for (String anInterface : interfaces) { - try { - String type = importManager.getType(anInterface); - anInterface = type; - } catch (Exception e) { - log.error("Could not determine simple name of interface " + anInterface); - } - simpleInterfaces.add(anInterface); - } - this.interfaces = simpleInterfaces; - } - - public void addMethod(JavaMethod method) { - String returnType = method.getReturnType(); - try { - String type = importManager.getReturnType(returnType); - method.setReturnType(type); - } catch (Exception e) { - log.error("Could not determine simple name of return type " + returnType + " for method " + method.getName()); - } - for (JavaArgument argument : method.getArguments()) { - String argumentType = argument.getType(); - try { - String type = importManager.getType(argumentType); - argument.setType(type); - } catch (Exception e) { - log.error("Could not determine simple name of argument type " + argumentType + " of argument " + argument.getName() + " for method " + method.getName()); - } - } - - String[] exceptions = method.getExceptions(); - for (int i = 0, length = exceptions.length; i < length; i++) { - String exception = exceptions[i]; - try { - String exceptionSimple = importManager.getType(exception); - exceptions[i] = exceptionSimple; - } catch (Exception e) { - log.error("Could not determine simple name of exception " + exception + " for method " + method.getName()); - } - - } - - if (returnType == null) { - - // this is a constructor - constructors.add(method); - } else { - - // this is a mreal method - methods.add(method); - } - } - - public void addField(JavaField field) { - - addField(field, false); - } - - public JavaMethod addGetterMethod(String id, - int modifiers, - String type, - boolean overridde, - boolean useOverride) { - - String capitalizedName = StringUtils.capitalize(id); - String methodName = "get" + capitalizedName; - String bodyCode; - if (useOverride) { - bodyCode = "super." + methodName + "()"; - } else { - bodyCode = id; - } - String content = String.format(GETTER_PATTERN, bodyCode); - JavaMethod method = JavaElementFactory.newMethod(modifiers, - type, - methodName, - content, - overridde - ); - addMethod(method); - return method; - } - - public void addField(JavaField field, boolean javaBean) { - addSimpleField(field); - String id = field.getName(); - String capitalizedName = StringUtils.capitalize(id); - - // add accessor method - int modifiers = Modifier.isProtected(field.getModifiers()) ? - Modifier.PUBLIC : Modifier.PROTECTED; - - addGetterMethod(id, - modifiers, - field.getType(), - field.isOverride(), - false - ); - - if (javaBean) { - // add full javabean support accessor + mutator + constant with - // name of property to make it easier to use - // compute the property constant - String constantId = TypeManager.convertVariableNameToConstantName( - "property" + capitalizedName); - addSimpleField(JavaElementFactory.newField( - Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL, - JAXXCompilerFinalizer.TYPE_STRING, - constantId, false, "\"" + id + "\"") - ); - - if (Boolean.class.getSimpleName().equals(field.getType())) { - String content = String.format(BOOLEAN_GETTER_PATTERN, id); - JavaMethod method = JavaElementFactory.newMethod( - Modifier.PUBLIC, - field.getType(), - "is" + capitalizedName, - content, - field.isOverride() - ); - addMethod(method); - } - String content = String.format(SETTER_PATTERN, field.getType(), id, constantId); - JavaArgument arg = JavaElementFactory.newArgument(field.getType(), id); - JavaMethod method = JavaElementFactory.newMethod( - Modifier.PUBLIC, - JAXXCompilerFinalizer.TYPE_VOID, - "set" + capitalizedName, - content, - field.isOverride(), - arg); - addMethod(method); - } - } - - public void addSimpleField(JavaField field) { - if (log.isDebugEnabled()) { - log.debug("[" + getName() + "] Add field " + field.getName()); - } - String fieldType = field.getType(); - try { - String type = importManager.getType(fieldType); - field.setType(type); - } catch (Exception e) { - log.error("Could not determine simple name of field [" + - field.getName() + "] type " + fieldType); - } - if (field.hasInitializerTypes()) { - String code = simplifyCode(field.getInitializer(), field.getInitializerTypes()); - if (log.isDebugEnabled()) { - log.debug("Use simplify text : " + code); - } - field.setInitializer(code); - } - fields.add(field); - } - - public void setSuperclassIsJAXXObject(boolean superclassIsJAXXObject) { - this.superclassIsJAXXObject = superclassIsJAXXObject; - } - - public void setAbstractClass(boolean abstractClass) { - this.abstractClass = abstractClass; - } - - public void setSuperGenericType(String superGenericType) { - this.superGenericType = superGenericType; - } - - public void addBodyCode(String bodyCode) { - rawBodyCode.append(bodyCode); - } - - /** - * Try to use a simple type fro the given {@code type} and apply it on the - * given {@code pattern}. - * <p/> - * Example : - * <pre> - * type = java.io.File, pattern = new %s(""); - * returns : new File("") or new java.io.File("") if importManager can - * not import java.io.File - * </pre> - * - * @param types the types to simplify - * @param pattern the pattern where to apply simple types - * @return the input pattern with most simplest types - * @since 2.4 - */ - public String simplifyCode(String pattern, - String... types) { - String[] simpleTypes = new String[types.length]; - for (int i = 0; i < types.length; i++) { - String type = types[i]; - String simpleType = importManager.getType(type); - simpleTypes[i] = simpleType; - } - String format = String.format(pattern, (Object[]) simpleTypes); - return format; - } - - public void clear() { - importManager.clearImports(); - if (interfaces != null) { - interfaces.clear(); - interfaces = null; - } - if (methods != null) { - methods.clear(); - methods = null; - } - if (fields != null) { - fields.clear(); - fields = null; - } - if (imports != null) { - imports.clear(); - } - } - - public List<JavaMethod> getConstructors() { - return constructors; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.java; + +import jaxx.compiler.finalizers.JAXXCompilerFinalizer; +import jaxx.compiler.types.TypeManager; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.eugene.java.extension.ImportsManager; + +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * A Java source file being generated for output. Once the class is completely initialized, use the + * {@link #toString} method to generate source code for it. + */ +public class JavaFile extends JavaElement { + + /** Logger. */ + static Log log = LogFactory.getLog(JavaFile.class); + + protected static final String GETTER_PATTERN = "return %1$s;"; + + protected static final String BOOLEAN_GETTER_PATTERN = "return %1$s !=null && %1$s;"; + + protected static final String SETTER_PATTERN = "%1$s oldValue = this.%2$s;\nthis.%2$s = %2$s;\nfirePropertyChange(%3$s, oldValue, %2$s);"; + + private Set<String> imports = new HashSet<String>(); + + private List<JavaField> fields = new ArrayList<JavaField>(); + + private List<JavaMethod> methods = new ArrayList<JavaMethod>(); + + private List<JavaConstructor> constructors = new ArrayList<JavaConstructor>(); + + private List<JavaFile> innerClasses = new ArrayList<JavaFile>(); + + private String superClass; + + private List<String> interfaces; + + private StringBuffer rawBodyCode = new StringBuffer(); + + private boolean superclassIsJAXXObject; + + private boolean abstractClass; + + private String genericType; + + private String superGenericType; + + private final ImportsManager importManager; + + private String simpleName; + + JavaFile(int modifiers, String className) { + super(modifiers, className); + importManager = new ImportsManager(); + // add the fqn before all in the import manager to deal with alias classes + importManager.addImport(className); + } + + /** @deprecated since 2.4, never be used */ + @Deprecated + JavaFile() { + this(0, ""); + } + + /** + * @param modifiers + * @param className + * @param superClass + * @deprecated since 2.4, never be used + */ + @Deprecated + JavaFile(int modifiers, String className, String superClass) { + this(modifiers, className, superClass, null); + } + + /** + * @param modifiers + * @param className + * @param superClass + * @param interfaces + * @deprecated since 2.4, never be used + */ + @Deprecated + JavaFile(int modifiers, + String className, + String superClass, + List<String> interfaces) { + this(modifiers, className); + setSuperClass(superClass); + if (CollectionUtils.isNotEmpty(interfaces)) { + addInterface(interfaces.toArray(new String[interfaces.size()])); + } +// this.superClass = superClass; +// this.interfaces = interfaces; + } + + public String getPackageName() { + String name = getName(); + + String packageName; + if (name.contains(".")) { + packageName = name.substring(0, name.lastIndexOf(".")); + } else { + packageName = null; + } + return packageName; + } + + public ImportsManager getImportManager() { + return importManager; + } + + public String[] getImports() { + List<String> result = new ArrayList<String>(imports); + Collections.sort(result); + return result.toArray(new String[result.size()]); + } + + public List<String> getImportsList() { + List<String> result = new ArrayList<String>(imports); + Collections.sort(result); + return result; + } + + public String getSuperClass() { + return superClass; + } + + public List<String> getInterfaces() { + if (interfaces == null) { + interfaces = new ArrayList<String>(); + } + return interfaces; + } + + public List<JavaMethod> getMethods() { + return methods; + } + + public List<JavaField> getFields() { + return fields; + } + + public boolean isAbstractClass() { + return abstractClass; + } + + public String getGenericType() { + return genericType; + } + + public List<JavaFile> getInnerClasses() { + return innerClasses; + } + + public StringBuffer getRawBodyCode() { + return rawBodyCode; + } + + public String getSuperGenericType() { + return superGenericType; + } + + public boolean isSuperclassIsJAXXObject() { + return superclassIsJAXXObject; + } + + public String getSimpleName() { + return simpleName; + } + + public JavaField getField(String componentId) { + for (JavaField field : fields) { + if (componentId.equals(field.getName())) { + return field; + } + } + return null; + } + + public void addImport(String importString) { + try { + importManager.addImport(importString); + } catch (Exception e) { + log.error("Could not determine simple name of import " + importString); + } + } + + public void addImport(Class<?> importString) { + addImport(importString.getName()); + } + + public void setImports(Collection<String> imports) { + this.imports = new HashSet<String>(imports); + } + + public void setGenericType(String genericType) { + this.genericType = genericType; + } + + public void setSuperClass(String superClass) { + this.superClass = superClass; + } + + public void addInterface(String... canonicalNames) { + if (canonicalNames == null) { + return; + } + for (String canonicalName : canonicalNames) { + if (interfaces == null || !interfaces.contains(canonicalName)) { + getInterfaces().add(canonicalName); + } + } + } + + public void setInterfaces(List<String> interfaces) { + List<String> simpleInterfaces = new ArrayList<String>(); + for (String anInterface : interfaces) { + try { + String type = importManager.getType(anInterface); + anInterface = type; + } catch (Exception e) { + log.error("Could not determine simple name of interface " + anInterface); + } + simpleInterfaces.add(anInterface); + } + this.interfaces = simpleInterfaces; + } + + public void addConstructor(JavaConstructor constructor) { + constructors.add(constructor); + } + + public void addMethod(JavaMethod method) { + String returnType = method.getReturnType(); + try { + String type = importManager.getReturnType(returnType); + method.setReturnType(type); + } catch (Exception e) { + log.error("Could not determine simple name of return type " + returnType + " for method " + method.getName()); + } + for (JavaArgument argument : method.getArguments()) { + String argumentType = argument.getType(); + try { + String type = importManager.getType(argumentType); + argument.setType(type); + } catch (Exception e) { + log.error("Could not determine simple name of argument type " + argumentType + " of argument " + argument.getName() + " for method " + method.getName()); + } + } + + String[] exceptions = method.getExceptions(); + for (int i = 0, length = exceptions.length; i < length; i++) { + String exception = exceptions[i]; + try { + String exceptionSimple = importManager.getType(exception); + exceptions[i] = exceptionSimple; + } catch (Exception e) { + log.error("Could not determine simple name of exception " + exception + " for method " + method.getName()); + } + + } + + // this is a mreal method + methods.add(method); + } + + public void addField(JavaField field) { + + addField(field, false); + } + + public JavaMethod addGetterMethod(String id, + int modifiers, + String type, + boolean overridde, + boolean useOverride) { + + String capitalizedName = StringUtils.capitalize(id); + String methodName = "get" + capitalizedName; + String bodyCode; + if (useOverride) { + bodyCode = "super." + methodName + "()"; + } else { + bodyCode = id; + } + String content = String.format(GETTER_PATTERN, bodyCode); + JavaMethod method = JavaElementFactory.newMethod(modifiers, + type, + methodName, + content, + overridde + ); + addMethod(method); + return method; + } + + public void addField(JavaField field, boolean javaBean) { + addSimpleField(field); + String id = field.getName(); + String capitalizedName = StringUtils.capitalize(id); + + // add accessor method + int modifiers = Modifier.isProtected(field.getModifiers()) ? + Modifier.PUBLIC : Modifier.PROTECTED; + + addGetterMethod(id, + modifiers, + field.getType(), + field.isOverride(), + false + ); + + if (javaBean) { + // add full javabean support accessor + mutator + constant with + // name of property to make it easier to use + // compute the property constant + String constantId = TypeManager.convertVariableNameToConstantName( + "property" + capitalizedName); + addSimpleField(JavaElementFactory.newField( + Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL, + JAXXCompilerFinalizer.TYPE_STRING, + constantId, false, "\"" + id + "\"") + ); + + if (Boolean.class.getSimpleName().equals(field.getType())) { + String content = String.format(BOOLEAN_GETTER_PATTERN, id); + JavaMethod method = JavaElementFactory.newMethod( + Modifier.PUBLIC, + field.getType(), + "is" + capitalizedName, + content, + field.isOverride() + ); + addMethod(method); + } + String content = String.format(SETTER_PATTERN, field.getType(), id, constantId); + JavaArgument arg = JavaElementFactory.newArgument(field.getType(), id); + JavaMethod method = JavaElementFactory.newMethod( + Modifier.PUBLIC, + JAXXCompilerFinalizer.TYPE_VOID, + "set" + capitalizedName, + content, + field.isOverride(), + arg); + addMethod(method); + } + } + + public void addSimpleField(JavaField field) { + if (log.isDebugEnabled()) { + log.debug("[" + getName() + "] Add field " + field.getName()); + } + String fieldType = field.getType(); + try { + String type = importManager.getType(fieldType); + field.setType(type); + } catch (Exception e) { + log.error("Could not determine simple name of field [" + + field.getName() + "] type " + fieldType); + } + if (field.hasInitializerTypes()) { + String code = simplifyCode(field.getInitializer(), field.getInitializerTypes()); + if (log.isDebugEnabled()) { + log.debug("Use simplify text : " + code); + } + field.setInitializer(code); + } + fields.add(field); + } + + public void setSuperclassIsJAXXObject(boolean superclassIsJAXXObject) { + this.superclassIsJAXXObject = superclassIsJAXXObject; + } + + public void setAbstractClass(boolean abstractClass) { + this.abstractClass = abstractClass; + } + + public void setSuperGenericType(String superGenericType) { + this.superGenericType = superGenericType; + } + + public void addBodyCode(String bodyCode) { + rawBodyCode.append(bodyCode); + } + + /** + * Try to use a simple type fro the given {@code type} and apply it on the + * given {@code pattern}. + * <p/> + * Example : + * <pre> + * type = java.io.File, pattern = new %s(""); + * returns : new File("") or new java.io.File("") if importManager can + * not import java.io.File + * </pre> + * + * @param types the types to simplify + * @param pattern the pattern where to apply simple types + * @return the input pattern with most simplest types + * @since 2.4 + */ + public String simplifyCode(String pattern, + String... types) { + String[] simpleTypes = new String[types.length]; + for (int i = 0; i < types.length; i++) { + String type = types[i]; + String simpleType = importManager.getType(type); + simpleTypes[i] = simpleType; + } + String format = String.format(pattern, (Object[]) simpleTypes); + return format; + } + + public void clear() { + importManager.clearImports(); + if (interfaces != null) { + interfaces.clear(); + interfaces = null; + } + if (methods != null) { + methods.clear(); + methods = null; + } + if (constructors != null) { + constructors.clear(); + constructors = null; + } + if (fields != null) { + fields.clear(); + fields = null; + } + if (imports != null) { + imports.clear(); + } + } + + public List<JavaConstructor> getConstructors() { + return constructors; + } + + public void setSimpleName(String simpleName) { + this.simpleName = simpleName; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -82,7 +82,7 @@ } public static String addDebugLoggerInvocation(JAXXCompiler compiler, - String call) { + String call) { String eol = JAXXCompiler.getLineSeparator(); StringBuilder builder = new StringBuilder(); if (!compiler.getConfiguration().isAddLogger()) { @@ -236,10 +236,25 @@ } } + + // add constructors : + + result.append(addIndentation(MethodOrder.constructors.getHeader(), 4, eol)); + result.append(eol); + result.append(eol); + + // add all constructors + for (JavaConstructor method : f.getConstructors()) { + String txt = generateConstructor(method); + result.append(addIndentation(txt, 4, eol)); + result.append(eol); + result.append(eol); + } + // generate methods - EnumMap<MethodOrder, List<JavaMethod>> map = JavaMethod.getSortedMethods(f.getMethods()); + for (Entry<MethodOrder, List<JavaMethod>> entry : map.entrySet()) { List<JavaMethod> list = entry.getValue(); if (!list.isEmpty()) { @@ -297,6 +312,56 @@ } } + public String generateConstructor(JavaConstructor m) { + if (verbose) { + log.info(m.getName()); + } + + StringBuffer result = new StringBuffer(); + + generateAnnotations(m, result, eol); + result.append(m.getModifiersText()); + result.append(m.getName()); + result.append('('); + JavaArgument[] arguments = m.getArguments(); + + // adding arguments + + if (arguments != null && arguments.length > 0) { + result.append(generateArgument(arguments[0])); + for (int i = 1; i < arguments.length; i++) { + result.append(", ").append(generateArgument(arguments[i])); + } + } + result.append(")"); + + // adding exceptions + + String[] exceptions = m.getExceptions(); + if (exceptions != null && exceptions.length > 0) { + result.append(" throws ").append(exceptions[0]); + for (int i = 1; i < exceptions.length; i++) { + result.append(", ").append(exceptions[i]); + } + } + result.append(" {"); + result.append(eol); + + // adding body + + String body = m.getBody(); + + if (body != null) { + String formattedBodyCode = addIndentation(body.trim(), 4, eol); + if (formattedBodyCode.length() > 0) { + result.append(formattedBodyCode).append(eol); + } + } + result.append("}"); + return result.toString(); + + } + public String generateMethod(JavaMethod m) { if (verbose) { log.info(m.getName()); Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,342 +1,342 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.java; - -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -/** - * Represents a method in a Java source file being generated for output. <code>JavaMethods</code> are created - * and added to a {@link JavaFile}, which can then output Java source code. In addition to normal methods, a - * <code>JavaMethod</code> can represent a constructor -- constructors should be named after their containing - * classes and have a return type of <code>null</code>. - */ -public class JavaMethod extends JavaElement implements Comparable<JavaMethod> { - - /** return type of the method (null for constructors) */ - private String returnType; - - /** arguments of the method (can be empty) */ - private JavaArgument[] arguments; - - /** exceptions thrown by the method( can be empty) */ - private String[] exceptions; - - /** body of the mehotd (can be empty) */ - private String body; - - /** flag to known if the method overrids a super-method */ - private boolean override; - - /** - * Constructs a new <code>JavaMethod</code> containing the specified body code. The <code>modifiers</code> parameter - * is a bit mask of the constants from {@link Modifier}, and the <code>returnType</code> and - * <code>exceptions</code> of the method should be represented as they would appear in Java source code (<code>null</code> - * for a constructor). The method body is initially empty. - * - * @param modifiers the modifier keywords that should appear as part of the method's declaration - * @param returnType the return type of the method as it would appear in Java source code - * @param name the method's name - * @param arguments the method's arguments - * @param exceptions a list of exceptions the methods can throw, as they would be represented in Java source code - * @param bodyCode Java source code which should appear in the method body - * @param override flag with {@code true} value when the method overrides (or implements) a super class method - */ - JavaMethod(int modifiers, - String returnType, - String name, - JavaArgument[] arguments, - String[] exceptions, - String bodyCode, - boolean override) { - super(modifiers, name); - this.returnType = returnType; - this.override = override; - this.arguments = arguments; - this.exceptions = exceptions; - body = bodyCode == null ? "" : bodyCode; - } - - /** - * Returns the method's return type, as it would be represented - * in Java source code. - * - * @return the method's return type - */ - public String getReturnType() { - return returnType; - } - - /** - * Returns a list of the method's arguments. - * - * @return the method's arguments - */ - public JavaArgument[] getArguments() { - return arguments; - } - - /** - * Returns a list of exceptions the method can throw. - * - * @return the method's exceptions - */ - public String[] getExceptions() { - return exceptions; - } - - public boolean isOverride() { - return override; - } - - public String getBody() { - return body; - } - - @Override - public int compareTo(JavaMethod o) { - return JavaElementComparator.compare(this, o); - } - - public void setReturnType(String returnType) { - this.returnType = returnType; - } - - public enum MethodOrder { - - statics(Modifier.STATIC, "Statics methods"), - - constructors(Modifier.PUBLIC, "Constructors") { - @Override - public boolean accept(JavaMethod method) { - return method.returnType == null; - } - }, - JAXXObject(Modifier.PUBLIC, "JAXXObject implementation") { - - private final List<String> methods = Arrays.asList( - "applyDataBinding", - "firePropertyChange", - "getObjectById", - "get$objectMap", - "processDataBinding", - "removeDataBinding", - "registerDataBinding", - "getDataBindings"); - - @Override - public boolean accept(JavaMethod method) { - return methods.contains(method.getName()); - } - }, - JAXXContext(Modifier.PUBLIC, "JAXXContext implementation") { - - private final List<String> methods = Arrays.asList( - "getContextValue", - "getDelegateContext", - "getParentContainer", - "removeContextValue", - "setContextValue"); - - @Override - public boolean accept(JavaMethod method) { - return methods.contains(method.getName()); - } - }, - JAXXValidation(Modifier.PUBLIC, "JAXXValidation implementation") { - - private final List<String> methods = - Arrays.asList("getValidator", "getValidatorIds"); - - @Override - public boolean accept(JavaMethod method) { - return methods.contains(method.getName()); - } - }, - events(Modifier.PUBLIC, "Event methods") { - @Override - public boolean accept(JavaMethod method) { - return method.getName().startsWith("do") && - method.getName().contains("__"); - } - }, - publicGetters(Modifier.PUBLIC, "Public acessor methods") { - @Override - public boolean accept(JavaMethod method) { - return method.getName().startsWith("get") || - method.getName().startsWith("is"); - } - }, - publicSetters(Modifier.PUBLIC, "Public mutator methods") { - @Override - public boolean accept(JavaMethod method) { - return method.getName().startsWith("set"); - } - }, - otherPublic(Modifier.PUBLIC, "Public mutator methods") { - @Override - public boolean accept(int mod) { - return super.accept(mod) && !Modifier.isStatic(mod); - } - }, - protectedGetters(Modifier.PROTECTED, "Protected acessors methods") { - @Override - public boolean accept(JavaMethod method) { - return method.getName().startsWith("get") || - method.getName().startsWith("is"); - } - }, - createMethod(Modifier.PROTECTED | Modifier.PRIVATE, - "Components creation methods") { - @Override - public boolean accept(JavaMethod method) { - return method.getName().startsWith("create") || - method.getName().startsWith("add"); - } - }, - internalMethod(Modifier.PRIVATE, "Internal jaxx methods") { - private final List<String> methods = Arrays.asList( - "$completeSetup", - "$registerDefaultBindings", - "$initialize"); - - @Override - public boolean accept(JavaMethod method) { - return methods.contains(method.getName()); - } - }, - protecteds(Modifier.PROTECTED, "Other protected methods") { - }, - packageLocal(0, "Package methods") { - @Override - public boolean accept(int mod) { - return !Modifier.isStatic(mod) && - !Modifier.isPublic(mod) && - !Modifier.isProtected(mod); - } - }, - privates(Modifier.PRIVATE, "Other private methods"); - - private final String header; - - private int modifier; - - MethodOrder(int modifier, String header) { - this.header = JavaFileGenerator.getHeader(header); - this.modifier = modifier; - } - - public String getHeader() { - return header; - } - - public boolean accept(JavaMethod method) { - return true; - } - - public boolean accept(int mod) { - return (mod & modifier) != 0; - } - - public boolean accept(int mod, JavaMethod method) { - return accept(mod) && accept(method); - } - - public static MethodOrder valueOf(JavaMethod method, int scope) { - for (MethodOrder o : values()) { - if (o.accept(scope, method)) { - return o; - } - } - throw new IllegalArgumentException( - "could not find a " + MethodOrder.class + - " for method " + method); - } - } - - public static EnumMap<MethodOrder, List<JavaMethod>> getSortedMethods(List<JavaMethod> methods) { - - EnumMap<MethodOrder, List<JavaMethod>> result = - new EnumMap<MethodOrder, List<JavaMethod>>(MethodOrder.class); - for (MethodOrder methodOrder : MethodOrder.values()) { - result.put(methodOrder, new ArrayList<JavaMethod>()); - } - - EnumSet<MethodOrder> allConstants = EnumSet.allOf(MethodOrder.class); - List<JavaMethod> allMethods = new ArrayList<JavaMethod>(methods); - int[] scopes = new int[]{Modifier.STATIC, - Modifier.PUBLIC, - Modifier.PROTECTED, - Modifier.PRIVATE - }; - for (int scope : scopes) { - EnumSet<MethodOrder> constants = - getMethodOrderScope(allConstants, scope); - - Iterator<JavaMethod> itMethods = allMethods.iterator(); - while (itMethods.hasNext()) { - JavaMethod method = itMethods.next(); - for (MethodOrder constant : constants) { - if (constant.accept(method.getModifiers(), method)) { - result.get(constant).add(method); - itMethods.remove(); - break; - } - } - } - constants.clear(); - } - - if (!allMethods.isEmpty()) { - throw new IllegalArgumentException( - "could not find a " + MethodOrder.class + - " for method " + allMethods); - } - - for (MethodOrder methodOrder : MethodOrder.values()) { - // sort methods - Collections.sort(result.get(methodOrder)); - } - return result; - } - - public static EnumSet<MethodOrder> getMethodOrderScope(EnumSet<MethodOrder> allConstants, int scope) { - EnumSet<MethodOrder> constants = EnumSet.noneOf(MethodOrder.class); - for (MethodOrder order : allConstants) { - if (order.accept(scope)) { - constants.add(order); - } - } - return constants; - } - -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.java; + +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; + +/** + * Represents a method in a Java source file being generated for output. <code>JavaMethods</code> are created + * and added to a {@link JavaFile}, which can then output Java source code. In addition to normal methods, a + * <code>JavaMethod</code> can represent a constructor -- constructors should be named after their containing + * classes and have a return type of <code>null</code>. + */ +public class JavaMethod extends JavaElement implements Comparable<JavaMethod> { + + /** return type of the method (null for constructors) */ + private String returnType; + + /** arguments of the method (can be empty) */ + private JavaArgument[] arguments; + + /** exceptions thrown by the method (can be empty) */ + private String[] exceptions; + + /** body of the method (can be empty) */ + private String body; + + /** flag to known if the method overrids a super-method */ + private boolean override; + + /** + * Constructs a new <code>JavaMethod</code> containing the specified body code. The <code>modifiers</code> parameter + * is a bit mask of the constants from {@link Modifier}, and the <code>returnType</code> and + * <code>exceptions</code> of the method should be represented as they would appear in Java source code (<code>null</code> + * for a constructor). The method body is initially empty. + * + * @param modifiers the modifier keywords that should appear as part of the method's declaration + * @param returnType the return type of the method as it would appear in Java source code + * @param name the method's name + * @param arguments the method's arguments + * @param exceptions a list of exceptions the methods can throw, as they would be represented in Java source code + * @param bodyCode Java source code which should appear in the method body + * @param override flag with {@code true} value when the method overrides (or implements) a super class method + */ + JavaMethod(int modifiers, + String returnType, + String name, + JavaArgument[] arguments, + String[] exceptions, + String bodyCode, + boolean override) { + super(modifiers, name); + this.returnType = returnType; + this.override = override; + this.arguments = arguments; + this.exceptions = exceptions; + body = bodyCode == null ? "" : bodyCode; + } + + /** + * Returns the method's return type, as it would be represented + * in Java source code. + * + * @return the method's return type + */ + public String getReturnType() { + return returnType; + } + + /** + * Returns a list of the method's arguments. + * + * @return the method's arguments + */ + public JavaArgument[] getArguments() { + return arguments; + } + + /** + * Returns a list of exceptions the method can throw. + * + * @return the method's exceptions + */ + public String[] getExceptions() { + return exceptions; + } + + public boolean isOverride() { + return override; + } + + public String getBody() { + return body; + } + + @Override + public int compareTo(JavaMethod o) { + return JavaElementComparator.compare(this, o); + } + + public void setReturnType(String returnType) { + this.returnType = returnType; + } + + public enum MethodOrder { + + statics(Modifier.STATIC, "Statics methods"), + + constructors(Modifier.PUBLIC, "Constructors") { + @Override + public boolean accept(JavaMethod method) { + return method.returnType == null; + } + }, + JAXXObject(Modifier.PUBLIC, "JAXXObject implementation") { + + private final List<String> methods = Arrays.asList( + "applyDataBinding", + "firePropertyChange", + "getObjectById", + "get$objectMap", + "processDataBinding", + "removeDataBinding", + "registerDataBinding", + "getDataBindings"); + + @Override + public boolean accept(JavaMethod method) { + return methods.contains(method.getName()); + } + }, + JAXXContext(Modifier.PUBLIC, "JAXXContext implementation") { + + private final List<String> methods = Arrays.asList( + "getContextValue", + "getDelegateContext", + "getParentContainer", + "removeContextValue", + "setContextValue"); + + @Override + public boolean accept(JavaMethod method) { + return methods.contains(method.getName()); + } + }, + JAXXValidation(Modifier.PUBLIC, "JAXXValidation implementation") { + + private final List<String> methods = + Arrays.asList("getValidator", "getValidatorIds"); + + @Override + public boolean accept(JavaMethod method) { + return methods.contains(method.getName()); + } + }, + events(Modifier.PUBLIC, "Event methods") { + @Override + public boolean accept(JavaMethod method) { + return method.getName().startsWith("do") && + method.getName().contains("__"); + } + }, + publicGetters(Modifier.PUBLIC, "Public acessor methods") { + @Override + public boolean accept(JavaMethod method) { + return method.getName().startsWith("get") || + method.getName().startsWith("is"); + } + }, + publicSetters(Modifier.PUBLIC, "Public mutator methods") { + @Override + public boolean accept(JavaMethod method) { + return method.getName().startsWith("set"); + } + }, + otherPublic(Modifier.PUBLIC, "Public mutator methods") { + @Override + public boolean accept(int mod) { + return super.accept(mod) && !Modifier.isStatic(mod); + } + }, + protectedGetters(Modifier.PROTECTED, "Protected acessors methods") { + @Override + public boolean accept(JavaMethod method) { + return method.getName().startsWith("get") || + method.getName().startsWith("is"); + } + }, + createMethod(Modifier.PROTECTED | Modifier.PRIVATE, + "Components creation methods") { + @Override + public boolean accept(JavaMethod method) { + return method.getName().startsWith("create") || + method.getName().startsWith("add"); + } + }, + internalMethod(Modifier.PRIVATE, "Internal jaxx methods") { + private final List<String> methods = Arrays.asList( + "$completeSetup", + "$registerDefaultBindings", + "$initialize"); + + @Override + public boolean accept(JavaMethod method) { + return methods.contains(method.getName()); + } + }, + protecteds(Modifier.PROTECTED, "Other protected methods") { + }, + packageLocal(0, "Package methods") { + @Override + public boolean accept(int mod) { + return !Modifier.isStatic(mod) && + !Modifier.isPublic(mod) && + !Modifier.isProtected(mod); + } + }, + privates(Modifier.PRIVATE, "Other private methods"); + + private final String header; + + private int modifier; + + MethodOrder(int modifier, String header) { + this.header = JavaFileGenerator.getHeader(header); + this.modifier = modifier; + } + + public String getHeader() { + return header; + } + + public boolean accept(JavaMethod method) { + return true; + } + + public boolean accept(int mod) { + return (mod & modifier) != 0; + } + + public boolean accept(int mod, JavaMethod method) { + return accept(mod) && accept(method); + } + + public static MethodOrder valueOf(JavaMethod method, int scope) { + for (MethodOrder o : values()) { + if (o.accept(scope, method)) { + return o; + } + } + throw new IllegalArgumentException( + "could not find a " + MethodOrder.class + + " for method " + method); + } + } + + public static EnumMap<MethodOrder, List<JavaMethod>> getSortedMethods(List<JavaMethod> methods) { + + EnumMap<MethodOrder, List<JavaMethod>> result = + new EnumMap<MethodOrder, List<JavaMethod>>(MethodOrder.class); + for (MethodOrder methodOrder : MethodOrder.values()) { + result.put(methodOrder, new ArrayList<JavaMethod>()); + } + + EnumSet<MethodOrder> allConstants = EnumSet.allOf(MethodOrder.class); + List<JavaMethod> allMethods = new ArrayList<JavaMethod>(methods); + int[] scopes = new int[]{Modifier.STATIC, + Modifier.PUBLIC, + Modifier.PROTECTED, + Modifier.PRIVATE + }; + for (int scope : scopes) { + EnumSet<MethodOrder> constants = + getMethodOrderScope(allConstants, scope); + + Iterator<JavaMethod> itMethods = allMethods.iterator(); + while (itMethods.hasNext()) { + JavaMethod method = itMethods.next(); + for (MethodOrder constant : constants) { + if (constant.accept(method.getModifiers(), method)) { + result.get(constant).add(method); + itMethods.remove(); + break; + } + } + } + constants.clear(); + } + + if (!allMethods.isEmpty()) { + throw new IllegalArgumentException( + "could not find a " + MethodOrder.class + + " for method " + allMethods); + } + + for (MethodOrder methodOrder : MethodOrder.values()) { + // sort methods + Collections.sort(result.get(methodOrder)); + } + return result; + } + + public static EnumSet<MethodOrder> getMethodOrderScope(EnumSet<MethodOrder> allConstants, int scope) { + EnumSet<MethodOrder> constants = EnumSet.noneOf(MethodOrder.class); + for (MethodOrder order : allConstants) { + if (order.accept(scope)) { + constants.add(order); + } + } + return constants; + } + +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,258 +1,258 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.reflect; - -import jaxx.runtime.JAXXObjectDescriptor; - -import java.util.Arrays; - -/** - * Mirrors the class <code>java.lang.Class</code>. JAXX uses <code>ClassDescriptor</code> instead of <code>Class</code> - * almost everywhere so that it can handle circular dependencies (there can't be a <code>Class</code> object for an uncompiled - * JAXX or Java source file, and a compiler must be allow references to symbols in uncompiled source files in order to handle - * circular dependencies). - */ -public abstract class ClassDescriptor { - - private String name; - - private String packageName; - - private String superclass; - - private String[] interfaces; - - private boolean isInterface; - - private boolean isArray; - - private String componentType; - - private JAXXObjectDescriptor jaxxObjectDescriptor; - - private ClassLoader classLoader; - - private MethodDescriptor[] constructorDescriptors; - - private MethodDescriptor[] methodDescriptors; - - private FieldDescriptor[] fieldDescriptors; - - protected FieldDescriptor[] declaredFieldDescriptors; - - protected final ClassDescriptorHelper.ResolverType resolverType; - - public abstract MethodDescriptor getDeclaredMethodDescriptor( - String name, - ClassDescriptor... parameterTypes) throws NoSuchMethodException; - - public abstract FieldDescriptor getDeclaredFieldDescriptor( - String name) throws NoSuchFieldException; - - protected ClassDescriptor(ClassDescriptorHelper.ResolverType resolverType, - String name, - String packageName, - String superclass, - String[] interfaces, - boolean isInterface, - boolean isArray, - String componentType, - JAXXObjectDescriptor jaxxObjectDescriptor, - ClassLoader classLoader, - MethodDescriptor[] constructorDescriptors, - MethodDescriptor[] methodDescriptors, - FieldDescriptor[] fieldDescriptors) { - this( - resolverType, name, - packageName, - superclass, - interfaces, - isInterface, - isArray, - componentType, - jaxxObjectDescriptor, - classLoader, - constructorDescriptors, - methodDescriptors, - fieldDescriptors, - null - ); - } - - protected ClassDescriptor( - ClassDescriptorHelper.ResolverType resolverType, - String name, - String packageName, - String superclass, - String[] interfaces, - boolean isInterface, - boolean isArray, - String componentType, - JAXXObjectDescriptor jaxxObjectDescriptor, - ClassLoader classLoader, - MethodDescriptor[] constructorDescriptors, - MethodDescriptor[] methodDescriptors, - FieldDescriptor[] fieldDescriptors, - FieldDescriptor[] declaredFieldDescriptors) { - this.resolverType = resolverType; - this.name = name; - this.packageName = packageName; - this.superclass = superclass; - this.interfaces = interfaces; - this.isInterface = isInterface; - this.isArray = isArray; - this.componentType = componentType; - this.jaxxObjectDescriptor = jaxxObjectDescriptor; - this.classLoader = classLoader; - this.constructorDescriptors= constructorDescriptors; - this.methodDescriptors = methodDescriptors; - this.fieldDescriptors = fieldDescriptors; - this.declaredFieldDescriptors = declaredFieldDescriptors; - } - - - public ClassDescriptorHelper.ResolverType getResolverType() { - return resolverType; - } - - public String getName() { - return name; - } - - public String getSimpleName() { - int dot = name.lastIndexOf("."); - return dot == -1 ? name : name.substring(dot + 1); - } - - public String getPackageName() { - return packageName; - } - - public ClassDescriptor getSuperclass() { - return getClassDescriptor(superclass); - - } - - public ClassDescriptor[] getInterfaces() { - ClassDescriptor[] result = new ClassDescriptor[interfaces.length]; - for (int i = 0; i < result.length; i++) { - result[i] = getClassDescriptor(interfaces[i]); - } - return result; - } - - public boolean isInterface() { - return isInterface; - } - - public boolean isArray() { - return isArray; - } - - public ClassDescriptor getComponentType() { - return getClassDescriptor(componentType); - } - - public ClassLoader getClassLoader() { - return classLoader; - } - - public MethodDescriptor[] getConstructorDescriptors() { - return constructorDescriptors; - } - - public MethodDescriptor[] getMethodDescriptors() { - return methodDescriptors; - } - - public MethodDescriptor getMethodDescriptor(String name, - ClassDescriptor... parameterTypes) throws NoSuchMethodException { - for (MethodDescriptor m : methodDescriptors) { - if (m.getName().equals(name) && - m.getParameterTypes().length == parameterTypes.length && - Arrays.equals(m.getParameterTypes(), parameterTypes)) { - return m; - } - } - throw new NoSuchMethodException( - "Could not find method " + name + "(" + - Arrays.asList(parameterTypes) + ") in " + getName()); - } - - public FieldDescriptor[] getFieldDescriptors() { - return fieldDescriptors; - } - - public FieldDescriptor getFieldDescriptor(String name) throws NoSuchFieldException { - for (FieldDescriptor fieldDescriptor : fieldDescriptors) { - if (fieldDescriptor.getName().equals(name)) { - return fieldDescriptor; - } - } - throw new NoSuchFieldException( - "Could not find field " + name + " in " + getName()); - } - - public JAXXObjectDescriptor getJAXXObjectDescriptor() { - return jaxxObjectDescriptor; - } - - public boolean isAssignableFrom(ClassDescriptor descriptor) { - while (descriptor != null) { - if (equals(descriptor)) { - return true; - } - for (ClassDescriptor anInterface : descriptor.getInterfaces()) { - if (equals(anInterface)) { - return true; - } - } - descriptor = descriptor.getSuperclass(); - } - return false; - } - - @Override - public String toString() { - return "ClassDescriptor[" + getName() + "]"; - } - - protected ClassDescriptor getClassDescriptor(String fqn) { - if (fqn == null) { - return null; - } - - try { - ClassDescriptor result = ClassDescriptorHelper.getClassDescriptor( - fqn, - getClassLoader() - ); - return result; - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.reflect; + +import jaxx.runtime.JAXXObjectDescriptor; + +import java.util.Arrays; + +/** + * Mirrors the class <code>java.lang.Class</code>. JAXX uses <code>ClassDescriptor</code> instead of <code>Class</code> + * almost everywhere so that it can handle circular dependencies (there can't be a <code>Class</code> object for an uncompiled + * JAXX or Java source file, and a compiler must be allow references to symbols in uncompiled source files in order to handle + * circular dependencies). + */ +public abstract class ClassDescriptor { + + private String name; + + private String packageName; + + private String superclass; + + private String[] interfaces; + + private boolean isInterface; + + private boolean isArray; + + private String componentType; + + private JAXXObjectDescriptor jaxxObjectDescriptor; + + private ClassLoader classLoader; + + private MethodDescriptor[] constructorDescriptors; + + private MethodDescriptor[] methodDescriptors; + + private FieldDescriptor[] fieldDescriptors; + + protected FieldDescriptor[] declaredFieldDescriptors; + + protected final ClassDescriptorHelper.ResolverType resolverType; + + public abstract MethodDescriptor getDeclaredMethodDescriptor( + String name, + ClassDescriptor... parameterTypes) throws NoSuchMethodException; + + public abstract FieldDescriptor getDeclaredFieldDescriptor( + String name) throws NoSuchFieldException; + + protected ClassDescriptor(ClassDescriptorHelper.ResolverType resolverType, + String name, + String packageName, + String superclass, + String[] interfaces, + boolean isInterface, + boolean isArray, + String componentType, + JAXXObjectDescriptor jaxxObjectDescriptor, + ClassLoader classLoader, + MethodDescriptor[] constructorDescriptors, + MethodDescriptor[] methodDescriptors, + FieldDescriptor[] fieldDescriptors) { + this( + resolverType, name, + packageName, + superclass, + interfaces, + isInterface, + isArray, + componentType, + jaxxObjectDescriptor, + classLoader, + constructorDescriptors, + methodDescriptors, + fieldDescriptors, + null + ); + } + + protected ClassDescriptor( + ClassDescriptorHelper.ResolverType resolverType, + String name, + String packageName, + String superclass, + String[] interfaces, + boolean isInterface, + boolean isArray, + String componentType, + JAXXObjectDescriptor jaxxObjectDescriptor, + ClassLoader classLoader, + MethodDescriptor[] constructorDescriptors, + MethodDescriptor[] methodDescriptors, + FieldDescriptor[] fieldDescriptors, + FieldDescriptor[] declaredFieldDescriptors) { + this.resolverType = resolverType; + this.name = name; + this.packageName = packageName; + this.superclass = superclass; + this.interfaces = interfaces; + this.isInterface = isInterface; + this.isArray = isArray; + this.componentType = componentType; + this.jaxxObjectDescriptor = jaxxObjectDescriptor; + this.classLoader = classLoader; + this.constructorDescriptors= constructorDescriptors; + this.methodDescriptors = methodDescriptors; + this.fieldDescriptors = fieldDescriptors; + this.declaredFieldDescriptors = declaredFieldDescriptors; + } + + + public ClassDescriptorHelper.ResolverType getResolverType() { + return resolverType; + } + + public String getName() { + return name; + } + + public String getSimpleName() { + int dot = name.lastIndexOf("."); + return dot == -1 ? name : name.substring(dot + 1); + } + + public String getPackageName() { + return packageName; + } + + public ClassDescriptor getSuperclass() { + return getClassDescriptor(superclass); + + } + + public ClassDescriptor[] getInterfaces() { + ClassDescriptor[] result = new ClassDescriptor[interfaces.length]; + for (int i = 0; i < result.length; i++) { + result[i] = getClassDescriptor(interfaces[i]); + } + return result; + } + + public boolean isInterface() { + return isInterface; + } + + public boolean isArray() { + return isArray; + } + + public ClassDescriptor getComponentType() { + return getClassDescriptor(componentType); + } + + public ClassLoader getClassLoader() { + return classLoader; + } + + public MethodDescriptor[] getConstructorDescriptors() { + return constructorDescriptors; + } + + public MethodDescriptor[] getMethodDescriptors() { + return methodDescriptors; + } + + public MethodDescriptor getMethodDescriptor(String name, + ClassDescriptor... parameterTypes) throws NoSuchMethodException { + for (MethodDescriptor m : methodDescriptors) { + if (m.getName().equals(name) && + m.getParameterTypes().length == parameterTypes.length && + Arrays.equals(m.getParameterTypes(), parameterTypes)) { + return m; + } + } + throw new NoSuchMethodException( + "Could not find method " + name + "(" + + Arrays.asList(parameterTypes) + ") in " + getName()); + } + + public FieldDescriptor[] getFieldDescriptors() { + return fieldDescriptors; + } + + public FieldDescriptor getFieldDescriptor(String name) throws NoSuchFieldException { + for (FieldDescriptor fieldDescriptor : fieldDescriptors) { + if (fieldDescriptor.getName().equals(name)) { + return fieldDescriptor; + } + } + throw new NoSuchFieldException( + "Could not find field " + name + " in " + getName()); + } + + public JAXXObjectDescriptor getJAXXObjectDescriptor() { + return jaxxObjectDescriptor; + } + + public boolean isAssignableFrom(ClassDescriptor descriptor) { + while (descriptor != null) { + if (equals(descriptor)) { + return true; + } + for (ClassDescriptor anInterface : descriptor.getInterfaces()) { + if (equals(anInterface)) { + return true; + } + } + descriptor = descriptor.getSuperclass(); + } + return false; + } + + @Override + public String toString() { + return "ClassDescriptor[" + getName() + "]"; + } + + protected ClassDescriptor getClassDescriptor(String fqn) { + if (fqn == null) { + return null; + } + + try { + ClassDescriptor result = ClassDescriptorHelper.getClassDescriptor( + fqn, + getClassLoader() + ); + return result; + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorResolver.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,57 +1,57 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.reflect; - -/** - * Mirrors the class <code>java.lang.ref.Field</code>. JAXX uses <code>ClassDescriptor</code> instead of <code>Class</code> - * almost everywhere so that it can handle circular dependencies (there can't be a <code>Class</code> object for an uncompiled - * JAXX or Java source file, and a compiler must be allow references to symbols in uncompiled source files in order to handle - * circular dependencies). - */ -public class FieldDescriptor extends MemberDescriptor { - - private String type; - - public FieldDescriptor(String name, int modifiers, String type, ClassLoader classLoader) { - super(name, modifiers, classLoader); - this.type = type; - } - - public ClassDescriptor getType() { - try { - return ClassDescriptorHelper.getClassDescriptor(type, getClassLoader()); - } catch (ClassNotFoundException e) { - throw new RuntimeException("Type not found for field " + this, e); - } catch (Exception e) { - throw new RuntimeException("Type not found for field " + this, e); - } - } - - @Override - public String toString() { - return super.toString() + " type : [" + type + "]"; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.reflect; + +/** + * Mirrors the class <code>java.lang.ref.Field</code>. JAXX uses <code>ClassDescriptor</code> instead of <code>Class</code> + * almost everywhere so that it can handle circular dependencies (there can't be a <code>Class</code> object for an uncompiled + * JAXX or Java source file, and a compiler must be allow references to symbols in uncompiled source files in order to handle + * circular dependencies). + */ +public class FieldDescriptor extends MemberDescriptor { + + private String type; + + public FieldDescriptor(String name, int modifiers, String type, ClassLoader classLoader) { + super(name, modifiers, classLoader); + this.type = type; + } + + public ClassDescriptor getType() { + try { + return ClassDescriptorHelper.getClassDescriptor(type, getClassLoader()); + } catch (ClassNotFoundException e) { + throw new RuntimeException("Type not found for field " + this, e); + } catch (Exception e) { + throw new RuntimeException("Type not found for field " + this, e); + } + } + + @Override + public String toString() { + return super.toString() + " type : [" + type + "]"; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,62 +1,62 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.reflect; - -/** - * Mirrors the class <code>java.lang.ref.Member</code>. JAXX uses <code>ClassDescriptor</code> instead of <code>Class</code> - * almost everywhere so that it can handle circular dependencies (there can't be a <code>Class</code> object for an uncompiled - * JAXX or Java source file, and a compiler must be allow references to symbols in uncompiled source files in order to handle - * circular dependencies). - */ -public abstract class MemberDescriptor { - - private String name; - private int modifiers; - private ClassLoader classLoader; - - MemberDescriptor(String name, int modifiers, ClassLoader classLoader) { - this.name = name; - this.modifiers = modifiers; - this.classLoader = classLoader; - } - - public String getName() { - return name; - } - - public int getModifiers() { - return modifiers; - } - - protected ClassLoader getClassLoader() { - return classLoader; - } - - @Override - public String toString() { - return getClass().getName() + "[" + getName() + "]"; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.reflect; + +/** + * Mirrors the class <code>java.lang.ref.Member</code>. JAXX uses <code>ClassDescriptor</code> instead of <code>Class</code> + * almost everywhere so that it can handle circular dependencies (there can't be a <code>Class</code> object for an uncompiled + * JAXX or Java source file, and a compiler must be allow references to symbols in uncompiled source files in order to handle + * circular dependencies). + */ +public abstract class MemberDescriptor { + + private String name; + private int modifiers; + private ClassLoader classLoader; + + MemberDescriptor(String name, int modifiers, ClassLoader classLoader) { + this.name = name; + this.modifiers = modifiers; + this.classLoader = classLoader; + } + + public String getName() { + return name; + } + + public int getModifiers() { + return modifiers; + } + + protected ClassLoader getClassLoader() { + return classLoader; + } + + @Override + public String toString() { + return getClass().getName() + "[" + getName() + "]"; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJavaClass.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJavaFile.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJaxxFile.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -28,8 +28,8 @@ import jaxx.compiler.CompilerException; import jaxx.compiler.JAXXCompiler; import jaxx.compiler.java.JavaArgument; +import jaxx.compiler.java.JavaConstructor; import jaxx.compiler.java.JavaElementFactory; -import jaxx.compiler.java.JavaMethod; import jaxx.compiler.java.parser.JavaParser; import jaxx.compiler.java.parser.JavaParserTreeConstants; import jaxx.compiler.java.parser.SimpleNode; @@ -421,8 +421,8 @@ SimpleNode node = mainNode.getChild(0).getChild(1); int nbArguments = node.getChild(0).jjtGetNumChildren(); - if (log.isInfoEnabled()) { - log.info("Constructor found with " + nbArguments + " arguments : " + node.getText()); + if (log.isDebugEnabled()) { + log.debug("Constructor found with " + nbArguments + " arguments : " + node.getText()); } assert node.getId() == JavaParserTreeConstants.JJTCONSTRUCTORDECLARATION : "expected node to be ConstructorDeclaration, found " + JavaParserTreeConstants.jjtNodeName[node.getId()] + " instead"; assert node.getChild(0).getId() == JavaParserTreeConstants.JJTFORMALPARAMETERS : "expected node 0 to be FormalParameters, found " + JavaParserTreeConstants.jjtNodeName[node.getChild(1).getId()] + " instead"; @@ -465,25 +465,21 @@ } } - if (log.isDebugEnabled()) { - log.debug("Final modifier to use : " + Modifier.toString(finalModifiers)); - } if (!bodyContent.endsWith("$initialize();")) { bodyContent += JAXXCompiler.getLineSeparator() + " $initialize();"; } if (log.isDebugEnabled()) { + log.debug("Final modifier to use : " + Modifier.toString(finalModifiers)); log.debug("Constructor body :\n" + bodyContent); } - JavaMethod constructorMethod = JavaElementFactory.newMethod( + JavaConstructor constructorMethod = JavaElementFactory.newConstructor( finalModifiers, - null, className, bodyContent, - false, arguments ); - compiler.getJavaFile().addMethod(constructorMethod); + compiler.getJavaFile().addConstructor(constructorMethod); } } } Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,44 +1,44 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.spi; - -import java.util.ServiceLoader; - -/** - * Performs SPI initialization, typically to register new tags, beans and converter. - * <p/> - * <b>Note:</b> To load such Initializer, we use the {@link ServiceLoader} mecanism. - * - * @see DefaultInitializer - */ -public interface Initializer { - - /** - * Performs SPI initialization, typically to register new - * tags, beans and converter. - */ - void initialize(); -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.spi; + +import java.util.ServiceLoader; + +/** + * Performs SPI initialization, typically to register new tags, beans and converter. + * <p/> + * <b>Note:</b> To load such Initializer, we use the {@link ServiceLoader} mecanism. + * + * @see DefaultInitializer + */ +public interface Initializer { + + /** + * Performs SPI initialization, typically to register new + * tags, beans and converter. + */ + void initialize(); +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/ImportHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,67 +1,67 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorHelper; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import java.io.IOException; -import javax.swing.event.ListSelectionListener; -import javax.swing.JList; - -public class JListHandler extends DefaultComponentHandler { - - public JListHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorHelper.checkSupportClass(getClass(), beanClass, JList.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getSelectedIndex", ListSelectionListener.class, "selectionModel"); - addProxyEventInfo("getSelectedIndices", ListSelectionListener.class, "selectionModel"); - addProxyEventInfo("getSelectedValue", ListSelectionListener.class, "selectionModel"); - addProxyEventInfo("getSelectedValues", ListSelectionListener.class, "selectionModel"); - } - - @Override - public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - if (children.getLength() > 0) { - compiler.reportError("JList does not accept childs"); - throw new CompilerException("JList does not accept childs"); - } - } -} - - - +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorHelper; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import java.io.IOException; +import javax.swing.event.ListSelectionListener; +import javax.swing.JList; + +public class JListHandler extends DefaultComponentHandler { + + public JListHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorHelper.checkSupportClass(getClass(), beanClass, JList.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getSelectedIndex", ListSelectionListener.class, "selectionModel"); + addProxyEventInfo("getSelectedIndices", ListSelectionListener.class, "selectionModel"); + addProxyEventInfo("getSelectedValue", ListSelectionListener.class, "selectionModel"); + addProxyEventInfo("getSelectedValues", ListSelectionListener.class, "selectionModel"); + } + + @Override + public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + if (children.getLength() > 0) { + compiler.reportError("JList does not accept childs"); + throw new CompilerException("JList does not accept childs"); + } + } +} + + + Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,68 +1,68 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorHelper; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; - -import javax.swing.event.TreeSelectionListener; -import java.io.IOException; -import javax.swing.JTree; -import org.w3c.dom.NodeList; - -public class JTreeHandler extends DefaultComponentHandler { - - public JTreeHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorHelper.checkSupportClass(getClass(), beanClass, JTree.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getSelectionCount", TreeSelectionListener.class, "selectionModel"); - addProxyEventInfo("getSelectionPath", TreeSelectionListener.class, "selectionModel"); - addProxyEventInfo("getSelectionPaths", TreeSelectionListener.class, "selectionModel"); - addProxyEventInfo("getSelectionRows", TreeSelectionListener.class, "selectionModel"); - addProxyEventInfo("getSelectionValue", TreeSelectionListener.class, "selectionModel"); - } - - @Override - public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - if (children.getLength() > 0) { - compiler.reportError("JTree does not accept childs"); - throw new CompilerException("JTree does not accept childs"); - } - } -} - - - +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorHelper; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; + +import javax.swing.event.TreeSelectionListener; +import java.io.IOException; +import javax.swing.JTree; +import org.w3c.dom.NodeList; + +public class JTreeHandler extends DefaultComponentHandler { + + public JTreeHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorHelper.checkSupportClass(getClass(), beanClass, JTree.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getSelectionCount", TreeSelectionListener.class, "selectionModel"); + addProxyEventInfo("getSelectionPath", TreeSelectionListener.class, "selectionModel"); + addProxyEventInfo("getSelectionPaths", TreeSelectionListener.class, "selectionModel"); + addProxyEventInfo("getSelectionRows", TreeSelectionListener.class, "selectionModel"); + addProxyEventInfo("getSelectionValue", TreeSelectionListener.class, "selectionModel"); + } + + @Override + public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + if (children.getLength() > 0) { + compiler.reportError("JTree does not accept childs"); + throw new CompilerException("JTree does not accept childs"); + } + } +} + + + Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/CompileFirstPassTask.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/CompileSecondPassTask.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/FinalizeTask.java ___________________________________________________________________ Added: svn:eol-style + native Copied: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateConstructorsTask.java (from rev 2221, trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/FinalizeTask.java) =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateConstructorsTask.java (rev 0) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateConstructorsTask.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -0,0 +1,511 @@ +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package jaxx.compiler.tasks; + +import jaxx.compiler.CompiledObject; +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.JAXXCompilerFile; +import jaxx.compiler.JAXXEngine; +import jaxx.compiler.finalizers.DefaultFinalizer; +import jaxx.compiler.java.JavaArgument; +import jaxx.compiler.java.JavaConstructor; +import jaxx.compiler.java.JavaElementFactory; +import jaxx.compiler.java.JavaFile; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorHelper; +import jaxx.compiler.reflect.MethodDescriptor; +import jaxx.compiler.tags.TagManager; +import jaxx.runtime.JAXXContext; +import jaxx.runtime.JAXXUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import static java.lang.reflect.Modifier.PUBLIC; + +/** + * Task to execute just after finalize task to create all constructors for any + * compiler. + * <p/> + * In fact, we can not compute constructor in one time since some compiler may + * need of the constructors of previous compiler... + * <p/> + * This task will compute all constructors to generate. + * + * @author tchemit <chemit@codelutin.com> + * @see JavaConstructor + * @since 2.4 + */ +public class GenerateConstructorsTask extends JAXXEngineTask { + + /** Logger */ + private static final Log log = LogFactory.getLog(GenerateConstructorsTask.class); + + /** Task name */ + public static final String TASK_NAME = "PostFinalize"; + + private static final String PARAMETER_NAME_PARENT_CONTEXT = "parentContext"; + + public GenerateConstructorsTask() { + super(TASK_NAME); + } + + @Override + public boolean perform(JAXXEngine engine) throws Exception { + boolean success = true; + boolean isVerbose = engine.getConfiguration().isVerbose(); + + JAXXCompilerFile[] files = engine.getCompiledFiles(); + + // to contains all compilers + List<JAXXCompiler> compilers = new ArrayList<JAXXCompiler>(); + for (JAXXCompilerFile jaxxFile : files) { + compilers.add(jaxxFile.getCompiler()); + } + + int round = 0; + + while (!compilers.isEmpty()) { + + if (isVerbose) { + log.info("Round " + round++ + ", still " + + compilers.size() + " compilers to treat."); + } + + // launch a round since there is still some compiler to treat + Iterator<JAXXCompiler> itr = compilers.iterator(); + while (itr.hasNext()) { + JAXXCompiler compiler = itr.next(); + JavaFile javaFile = compiler.getJavaFile(); + + boolean isJAXXObject = javaFile.isSuperclassIsJAXXObject(); + if (!isJAXXObject) { + + // can directly compute constructors + + if (log.isDebugEnabled()) { + log.debug("Compute constructor from non super " + + "jaxx object file " + javaFile.getName()); + } + + // get the constructors of the parent class + + addConstructorsForNoneSuperClassJaxx(engine, compiler); + itr.remove(); + continue; + } + + // compiler inheritate from a jaxx object + CompiledObject rootObject = compiler.getRootObject(); + ClassDescriptor parentClassDescriptor = rootObject.getObjectClass(); + + if (parentClassDescriptor.getResolverType() + != ClassDescriptorHelper.ResolverType.JAXX_FILE) { + + // the parent was not generated by this engine; we can safely + // use it + + if (log.isDebugEnabled()) { + log.debug("Compute constructor from outside super " + + "jaxx object file " + javaFile.getName()); + } + addConstructorsForSuperClassJaxx(engine, compiler, null); + itr.remove(); + continue; + + } + + JAXXCompiler parentCompiler = engine.getJAXXCompiler( + JAXXCompiler.getCanonicalName(parentClassDescriptor)); + + + if (!compilers.contains(parentCompiler)) { + + // parent was generated by this engine and was laready + // treated, can now safely deal this the given compiler + + if (log.isDebugEnabled()) { + log.debug("Compute constructor from inside super " + + "jaxx object file " + javaFile.getName()); + } + + addConstructorsForSuperClassJaxx(engine, compiler, parentCompiler); + itr.remove(); + continue; + } + + // can not treate at the moment... + if (log.isDebugEnabled()) { + log.debug("Can not compute constructors for " + + compiler.getRootObject().getId() + + " waits fro his parent to be treated..."); + } + } + } + return success; + } + + /** + * To add constructor on the given {@code compiler}, knowing that the super + * class of it is not a jaxx class. + * <p/> + * In this mode, we takes all the constructors of the parent (if parent has + * some!) and for each of them add the simple one and another one with + * first parameter a {@link JAXXContext}. + * + * @param engine the current engine which compiled compiler + * @param compiler the current compiler to treat + * @throws ClassNotFoundException if a class could not be found (when wanted to have extact type for constructor parameters) + * @throws IllegalStateException if given {@code compiler has a super JAXX class}. + */ + protected void addConstructorsForNoneSuperClassJaxx(JAXXEngine engine, + JAXXCompiler compiler) throws ClassNotFoundException, IllegalStateException { + + JavaFile javaFile = compiler.getJavaFile(); + + if (javaFile.isSuperclassIsJAXXObject()) { + throw new IllegalStateException( + "This method does not accept compiler that " + + "inheritates from a jaxx file."); + } + + String className = javaFile.getSimpleName(); + + if (engine.isVerbose()) { + log.info("start " + javaFile.getName()); + } + + addStartProfileTime(engine, compiler); + + // get already registred constructors : need to keep the list of parameters + // not to generate a constructor with same prototype twice. + List<List<String>> prototypes = getDeclaredConstructorPrototypes(compiler, javaFile); + + MethodDescriptor[] constructorDescriptors = + compiler.getRootObject().getObjectClass().getConstructorDescriptors(); + + List<String> constructorTypes; + boolean canAddConstructor; + + if (constructorDescriptors == null || constructorDescriptors.length == 0) { + + // no constructors (use only a default constructor) + + constructorTypes = getConstructorTypes(); + canAddConstructor = canAddConstructor(prototypes, constructorTypes); + if (canAddConstructor) { + addConstructor(compiler, className, constructorTypes); + } + + constructorTypes.add(0, JAXXCompiler.getCanonicalName(JAXXContext.class)); + canAddConstructor = canAddConstructor(prototypes, constructorTypes); + if (canAddConstructor) { + addConstructorWithInitialContext(compiler, className, constructorTypes, false); + } + } else { + for (MethodDescriptor constructorDescriptor : constructorDescriptors) { + + constructorTypes = getConstructorTypes(constructorDescriptor.getParameterTypes()); + canAddConstructor = canAddConstructor(prototypes, constructorTypes); + if (canAddConstructor) { + addConstructor(compiler, className, constructorTypes); + } + + constructorTypes.add(0, JAXXCompiler.getCanonicalName(JAXXContext.class)); + canAddConstructor = canAddConstructor(prototypes, constructorTypes); + if (canAddConstructor) { + addConstructorWithInitialContext(compiler, className, constructorTypes, false); + } + } + } + + addEndProfileTime(engine, compiler); + } + + /** + * To add constructor on the given {@code compiler}, knowing that the super + * class of it is a jaxx class. + * <p/> + * In this mode, we takes all the constructors of the parent (if parent has + * some!) and for each of them add the simple one and another one with + * first parameter a {@link JAXXContext}. + * + * @param engine the current engine which compiled compiler + * @param compiler the current compiler to treat + * @param parentCompiler the compiler of the super class (can be + * {@code null} if super class was not generated by + * the given engine). + * @throws ClassNotFoundException if a class could not be found (when wanted to have extact type for constructor parameters) + * @throws IllegalStateException if given {@code compiler has not a super JAXX class}. + */ + protected void addConstructorsForSuperClassJaxx(JAXXEngine engine, + JAXXCompiler compiler, + JAXXCompiler parentCompiler) throws ClassNotFoundException, IllegalStateException { + + JavaFile javaFile = compiler.getJavaFile(); + + if (!javaFile.isSuperclassIsJAXXObject()) { + throw new IllegalStateException( + "This method does not accept compiler that " + + "inheritates not from a jaxx file."); + } + + String className = javaFile.getSimpleName(); + + if (engine.isVerbose()) { + log.info("start " + javaFile.getName()); + } + + addStartProfileTime(engine, compiler); + + // get already registred constructors : need to keep the list of parameters + // not to generate a constructor with same prototype twice. + List<List<String>> prototypes = getDeclaredConstructorPrototypes(compiler, javaFile); + + MethodDescriptor[] constructorDescriptors; + + if (parentCompiler == null) { + + // the parent was not generated by this engine, this means that is + // class descriptor can be used to obtain constructors + constructorDescriptors = compiler.getRootObject().getObjectClass().getConstructorDescriptors(); + } else { + + // the parent was generated by this engine, can not trust the class + // descriptor at the moment, so just seek in his java file for + // already generated constructor + List<JavaConstructor> constructors = parentCompiler.getJavaFile().getConstructors(); + constructorDescriptors = new MethodDescriptor[constructors.size()]; + + int i = 0; + for (JavaConstructor constructor : constructors) { + String[] parameters = new String[constructor.getArguments().length]; + int j = 0; + for (JavaArgument argument : constructor.getArguments()) { + String type = argument.getType(); + parameters[j++] = type; + } + constructorDescriptors[i++] = new MethodDescriptor( + null, + constructor.getModifiers(), + null, + parameters, + compiler.getClassLoader() + ); + } + } + + // dealing with a jsuper class JAXX we are sure to have at least two constructors : + // a default one + one with just a JAXXContext parameter + + List<String> constructorTypes; + boolean canAddConstructor; + + for (MethodDescriptor constructorDescriptor : constructorDescriptors) { + + ClassDescriptor[] parameterTypes = constructorDescriptor.getParameterTypes(); + + if (parentCompiler == null) { + + // we already have the good type ??? this is dangerous + // because we could miss an import ? must be improved + constructorTypes = new ArrayList<String>(parameterTypes.length); + + for (ClassDescriptor parameterType : parameterTypes) { + constructorTypes.add(parameterType.getName()); + } + } else { + + + constructorTypes = getConstructorTypes(parameterTypes); + } + canAddConstructor = canAddConstructor(prototypes, constructorTypes); + if (canAddConstructor) { + addConstructor(compiler, className, constructorTypes); + } + +// constructorTypes.add(0, JAXXCompiler.getCanonicalName(JAXXContext.class)); +// canAddConstructor = canAddConstructor(prototypes, constructorTypes); +// if (canAddConstructor) { +// addConstructorWithInitialContext(compiler, className, constructorTypes, true); +// } + } + + + addEndProfileTime(engine, compiler); + } + + protected List<List<String>> getDeclaredConstructorPrototypes(JAXXCompiler compiler, + JavaFile javaFile) throws ClassNotFoundException { + List<JavaConstructor> constructors = javaFile.getConstructors(); + List<List<String>> prototypes = new ArrayList<List<String>>(constructors.size()); + for (JavaConstructor constructor : constructors) { + List<String> prototype = new ArrayList<String>(); + for (JavaArgument argument : constructor.getArguments()) { + String type = argument.getType(); + String fqn = TagManager.resolveClassName(type, compiler); + ClassDescriptor classDescriptor = ClassDescriptorHelper.getClassDescriptor(fqn); + String canonicalName = JAXXCompiler.getCanonicalName(classDescriptor); + prototype.add(canonicalName); + } + prototypes.add(prototype); + } + return prototypes; + } + + private boolean canAddConstructor(List<List<String>> prototypes, List<String> constructorTypes) { + return !prototypes.contains(constructorTypes); + } + + private List<String> getConstructorTypes(ClassDescriptor... descriptors) { + List<String> result = new ArrayList<String>(); + // add all parameters from constructor + for (ClassDescriptor descriptor : descriptors) { + String fqn = JAXXCompiler.getCanonicalName(descriptor); + result.add(fqn); + } + return result; + } + + protected void addConstructor(JAXXCompiler compiler, + String className, + List<String> constructorTypes) throws CompilerException { + StringBuffer code = new StringBuffer(); + String eol = JAXXCompiler.getLineSeparator(); + + JavaArgument[] arguments = new JavaArgument[constructorTypes.size()]; + + if (!constructorTypes.isEmpty()) { + + // constructeur avec des paramètres + code.append(" super("); + int i = 0; + for (String constructorType : constructorTypes) { + JavaArgument argument = JavaElementFactory.newArgument( + constructorType, + "param" + i + ); + arguments[i] = argument; + if (i > 0) { + code.append(" ,"); + } + code.append(argument.getName()); + i++; + } + + code.append(");").append(eol); + } + code.append(DefaultFinalizer.METHOD_NAME_$INITIALIZE + "();"); + code.append(eol); + JavaConstructor constructor = JavaElementFactory.newConstructor(PUBLIC, + className, + code.toString(), + arguments + ); + compiler.getJavaFile().addConstructor(constructor); + } + + protected void addConstructorWithInitialContext(JAXXCompiler compiler, + String className, + List<String> constructorTypes, + boolean superclassIsJAXXObject) throws CompilerException { + StringBuffer code = new StringBuffer(); + String eol = JAXXCompiler.getLineSeparator(); + + JavaArgument firstArgument = JavaElementFactory.newArgument( + JAXXContext.class.getName(), + PARAMETER_NAME_PARENT_CONTEXT + ); + JavaArgument[] arguments = new JavaArgument[constructorTypes.size()]; + arguments[0] = firstArgument; + for (int i = 1, max = constructorTypes.size(); i < max; i++) { + String constructorType = constructorTypes.get(i); + JavaArgument argument = JavaElementFactory.newArgument( + constructorType, + "param" + i + ); + arguments[i] = argument; + } + if (superclassIsJAXXObject) { + + // we are sure to have at least the first parameter in the super code + code.append(" super("); + code.append(PARAMETER_NAME_PARENT_CONTEXT); + for (int i = 1, max = constructorTypes.size(); i < max; i++) { + String constructorType = constructorTypes.get(i); + JavaArgument argument = JavaElementFactory.newArgument( + constructorType, + "param" + i + ); + arguments[i] = argument; + code.append(" ,"); + code.append(argument.getName()); + } + code.append(");").append(eol); + } else { + + // only a super class only if more than the parentContext parameter + if (constructorTypes.size() > 1) { + + code.append(" super("); + + for (int i = 1, max = constructorTypes.size(); i < max; i++) { + String constructorType = constructorTypes.get(i); + JavaArgument argument = JavaElementFactory.newArgument( + constructorType, + "param" + i + ); + arguments[i] = argument; + if (i > 1) { + code.append(" ,"); + } + code.append(argument.getName()); + } + code.append(");").append(eol); + } + } + + if (!superclassIsJAXXObject) { + + // call explicitly the init code of the parentContext + String prefix = compiler.getImportManager().getType(JAXXUtil.class); + code.append(prefix); + code.append(".initContext(this, " + PARAMETER_NAME_PARENT_CONTEXT + ");"); + code.append(eol); + } + code.append(DefaultFinalizer.METHOD_NAME_$INITIALIZE + "();"); + code.append(eol); + JavaConstructor constructor = JavaElementFactory.newConstructor(PUBLIC, + className, + code.toString(), + arguments + ); + compiler.getJavaFile().addConstructor(constructor); + } +} \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateConstructorsTask.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -27,6 +27,8 @@ import jaxx.compiler.JAXXCompiler; import jaxx.compiler.JAXXCompilerFile; import jaxx.compiler.JAXXEngine; +import jaxx.compiler.java.JavaArgument; +import jaxx.compiler.java.JavaConstructor; import jaxx.compiler.java.JavaFile; import jaxx.compiler.java.JavaFileGenerator; import jaxx.runtime.JAXXUtil; @@ -167,6 +169,8 @@ } f.setInterfaces(interfaces2); + // optimize constructors parameters + optimizeConstructorParameters(f, importsManager); importsManager.addImport(JAXXUtil.class); if (!f.isSuperclassIsJAXXObject() || needSwingUtil) { @@ -183,12 +187,29 @@ log.debug(" " + s); } } - if (log.isDebugEnabled()) { - } - return result; + } + protected void optimizeConstructorParameters(JavaFile f, + ImportsManager importsManager) { + List<JavaConstructor> constructors = f.getConstructors(); + for (JavaConstructor constructor : constructors) { + JavaArgument[] arguments = constructor.getArguments(); + for (JavaArgument argument : arguments) { + String type = argument.getType(); + String simpleType = null; + try { + simpleType = importsManager.getType(type); + argument.setType(simpleType); + } catch (Exception e) { + log.error("file [" + f.getName() + + "] Could not get simple type of constructor paramter " + type + " :: " + + e.getMessage()); + } + + } + } } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/GenerateTask.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/InitTask.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/JAXXEngineTask.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/ProfileTask.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tasks/StyleSheetTask.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,144 +1,144 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools; - -import jaxx.compiler.DefaultCompilerConfiguration; -import jaxx.compiler.JAXXFactory; -import jaxx.compiler.tags.*; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.beans.JAXXPropertyDescriptor; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorHelper; -import jaxx.compiler.reflect.MethodDescriptor; - -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.IOException; -import java.io.OutputStreamWriter; - -/** Generates information about a tag for use on the jaxxframework.org web site. */ -public class PrintTagInfo { - /** - * Displays information about the class name in arg[0]. - * - * @param arg command-line arguments - * @throws Exception if an error occurs - */ - public static void main(String[] arg) throws Exception { - if (arg.length < 1) { - throw new IllegalArgumentException("programm needs at least two parameters : the file where to put the result, and at least one fqn class to treate"); - } - String firstarg = arg[0]; - boolean toFile = false; - BufferedWriter w; - if (firstarg.startsWith("file:")) { - w = new BufferedWriter(new FileWriter(firstarg.substring(5))); - toFile = true; - } else { - w = new BufferedWriter(new OutputStreamWriter(System.out)); - } - - try { - JAXXFactory.setConfiguration(new DefaultCompilerConfiguration()); - JAXXFactory.initFactory(); - for (int i = toFile ? 1 : 0; i < arg.length; i++) { - String className = arg[i]; - treateClass(w, className); - } - } finally { - w.flush(); - w.close(); - } - - } - - protected static void treateClass(BufferedWriter w, String className) throws ClassNotFoundException, IOException { - - ClassDescriptor beanClass = ClassDescriptorHelper.getClassDescriptor(className); - DefaultObjectHandler handler = TagManager.getTagHandler(beanClass); - - DefaultObjectHandler superHandler = TagManager.getTagHandler(beanClass.getSuperclass()); - - // dump all bean properties - w.append("Properties in ").append(String.valueOf(beanClass)); - w.newLine(); - JAXXPropertyDescriptor[] properties = handler.getJAXXBeanInfo().getJAXXPropertyDescriptors(); - JAXXPropertyDescriptor[] superProperties = superHandler.getJAXXBeanInfo().getJAXXPropertyDescriptors(); - for (JAXXPropertyDescriptor property : properties) { - if (property.getWriteMethodDescriptor() == null) { - continue; - } - - boolean found = false; - String name = property.getName(); - for (JAXXPropertyDescriptor superProperty : superProperties) { - if (superProperty.getName().equals(name)) { - found = true; - break; - } - } - if (!found) { - if (property.getPropertyType() == null) { - System.err.println(name + " has null type"); - } else { - w.append("{{EquivalentAttribute|"); - w.append(name); - w.append("|"); - w.append(className.replace('.', '/')); - w.append("|set"); - w.append(org.apache.commons.lang.StringUtils.capitalize(name)); - w.append("|"); - w.append(JAXXCompiler.getCanonicalName(property.getPropertyType())); - w.append("}}"); - w.append("|-"); - w.newLine(); - } - } - } - - w.newLine(); - w.newLine(); - - // dump all bound methods - dumpMethods(w, beanClass, handler); - } - - protected static void dumpMethods(BufferedWriter w, ClassDescriptor beanClass, DefaultObjectHandler handler) throws IOException { - MethodDescriptor[] methods = beanClass.getMethodDescriptors(); - w.append("Bound methods in ").append(String.valueOf(beanClass)); - w.newLine(); - for (MethodDescriptor method : methods) { - try { - if (handler.isMemberBound(method.getName())) { - w.append("* <tt>").append(method.getName()).append("()</tt>"); - w.newLine(); - } - } catch (Throwable e) { - // ignore ? - } - } - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools; + +import jaxx.compiler.DefaultCompilerConfiguration; +import jaxx.compiler.JAXXFactory; +import jaxx.compiler.tags.*; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.beans.JAXXPropertyDescriptor; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorHelper; +import jaxx.compiler.reflect.MethodDescriptor; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.OutputStreamWriter; + +/** Generates information about a tag for use on the jaxxframework.org web site. */ +public class PrintTagInfo { + /** + * Displays information about the class name in arg[0]. + * + * @param arg command-line arguments + * @throws Exception if an error occurs + */ + public static void main(String[] arg) throws Exception { + if (arg.length < 1) { + throw new IllegalArgumentException("programm needs at least two parameters : the file where to put the result, and at least one fqn class to treate"); + } + String firstarg = arg[0]; + boolean toFile = false; + BufferedWriter w; + if (firstarg.startsWith("file:")) { + w = new BufferedWriter(new FileWriter(firstarg.substring(5))); + toFile = true; + } else { + w = new BufferedWriter(new OutputStreamWriter(System.out)); + } + + try { + JAXXFactory.setConfiguration(new DefaultCompilerConfiguration()); + JAXXFactory.initFactory(); + for (int i = toFile ? 1 : 0; i < arg.length; i++) { + String className = arg[i]; + treateClass(w, className); + } + } finally { + w.flush(); + w.close(); + } + + } + + protected static void treateClass(BufferedWriter w, String className) throws ClassNotFoundException, IOException { + + ClassDescriptor beanClass = ClassDescriptorHelper.getClassDescriptor(className); + DefaultObjectHandler handler = TagManager.getTagHandler(beanClass); + + DefaultObjectHandler superHandler = TagManager.getTagHandler(beanClass.getSuperclass()); + + // dump all bean properties + w.append("Properties in ").append(String.valueOf(beanClass)); + w.newLine(); + JAXXPropertyDescriptor[] properties = handler.getJAXXBeanInfo().getJAXXPropertyDescriptors(); + JAXXPropertyDescriptor[] superProperties = superHandler.getJAXXBeanInfo().getJAXXPropertyDescriptors(); + for (JAXXPropertyDescriptor property : properties) { + if (property.getWriteMethodDescriptor() == null) { + continue; + } + + boolean found = false; + String name = property.getName(); + for (JAXXPropertyDescriptor superProperty : superProperties) { + if (superProperty.getName().equals(name)) { + found = true; + break; + } + } + if (!found) { + if (property.getPropertyType() == null) { + System.err.println(name + " has null type"); + } else { + w.append("{{EquivalentAttribute|"); + w.append(name); + w.append("|"); + w.append(className.replace('.', '/')); + w.append("|set"); + w.append(org.apache.commons.lang.StringUtils.capitalize(name)); + w.append("|"); + w.append(JAXXCompiler.getCanonicalName(property.getPropertyType())); + w.append("}}"); + w.append("|-"); + w.newLine(); + } + } + } + + w.newLine(); + w.newLine(); + + // dump all bound methods + dumpMethods(w, beanClass, handler); + } + + protected static void dumpMethods(BufferedWriter w, ClassDescriptor beanClass, DefaultObjectHandler handler) throws IOException { + MethodDescriptor[] methods = beanClass.getMethodDescriptors(); + w.append("Bound methods in ").append(String.valueOf(beanClass)); + w.newLine(); + for (MethodDescriptor method : methods) { + try { + if (handler.isMemberBound(method.getName())) { + w.append("* <tt>").append(method.getName()).append("()</tt>"); + w.newLine(); + } + } catch (Throwable e) { + // ignore ? + } + } + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,44 +1,44 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -import java.util.ArrayList; -import java.util.List; - -public abstract class AbstractContextNode implements ContextNode { - private List<ContextNode> arguments = new ArrayList<ContextNode>(); - - - @Override - public void addArgument(ContextNode node) { - arguments.add(node); - } - - @Override - public ContextNode[] getArguments() { - return arguments.toArray(new ContextNode[arguments.size()]); - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +import java.util.ArrayList; +import java.util.List; + +public abstract class AbstractContextNode implements ContextNode { + private List<ContextNode> arguments = new ArrayList<ContextNode>(); + + + @Override + public void addArgument(ContextNode node) { + arguments.add(node); + } + + @Override + public ContextNode[] getArguments() { + return arguments.toArray(new ContextNode[arguments.size()]); + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,171 +1,171 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.tools.jaxxcapture.handlers.ObjectHandler; - -import java.awt.Component; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -public class CapturedObject extends AbstractContextNode { - private String className; - private ObjectHandler handler; - /** Maps children to their constraints. */ - private Map<CapturedObject, ContextNode> children = new LinkedHashMap<CapturedObject, ContextNode>(); - private CapturedObject parent; - private Map<String, String> properties = new LinkedHashMap<String, String>(); - private Map<String, Object> additionalData = new HashMap<String, Object>(); - private StringBuffer innerXML = new StringBuffer(); - private StringBuffer script = new StringBuffer(); - private boolean inlineable = true; - private JAXXCapture capture; - - public CapturedObject(ObjectHandler handler, String className, JAXXCapture capture) { - this.handler = handler; - this.className = className; - this.capture = capture; - } - - - public ObjectHandler getObjectHandler() { - return handler; - } - - - public void addChild(CapturedObject child, ContextNode constraints) { - children.put(child, constraints); - child.setParent(this); - } - - - public CapturedObject[] getChildren() { - return children.keySet().toArray(new CapturedObject[children.size()]); - } - - - public CapturedObject getParent() { - return parent; - } - - - public void setParent(CapturedObject parent) { - this.parent = parent; - } - - - public ContextNode getConstraints(CapturedObject child) { - return children.get(child); - } - - - public String getClassName() { - return className; - } - - - public String getProperty(String key) { - return properties.get(key); - } - - - public void setProperty(String key, String value) { - properties.put(key, value); - } - - - public Map<String, String> getProperties() { - return properties; - } - - - public Object getAdditionalData(String key) { - return additionalData.get(key); - } - - - public void setAdditionalData(String key, Object value) { - additionalData.put(key, value); - } - - - public Map<String, Object> getAdditionalData() { - return additionalData; - } - - - public void setInlineable(boolean inlineable) { - this.inlineable = inlineable; - } - - - public boolean isInlineable() { - try { - return script.length() == 0 && !Component.class.isAssignableFrom(Class.forName(className, true, capture.getClassLoader())) && inlineable; - } - catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } - - - public void appendInnerXML(String xml) { - if (this.innerXML.length() > 0) { - this.innerXML.append(JAXXCompiler.getLineSeparator()); - } - this.innerXML.append(xml); - } - - - public String getInnerXML() { - return innerXML.toString(); - } - - - public void appendScriptCode(String script) { - if (this.script.length() > 0) { - this.script.append(JAXXCompiler.getLineSeparator()); - } - this.script.append(script); - } - - - public String getScriptCode() { - return script.toString(); - } - - - public String getXML(JAXXCapture capture) { - return getObjectHandler().getXML(this, capture); - } - - @Override - public String toString() { - return "CapturedObject[" + getProperty("id") + ", " + className + "]"; - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.tools.jaxxcapture.handlers.ObjectHandler; + +import java.awt.Component; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public class CapturedObject extends AbstractContextNode { + private String className; + private ObjectHandler handler; + /** Maps children to their constraints. */ + private Map<CapturedObject, ContextNode> children = new LinkedHashMap<CapturedObject, ContextNode>(); + private CapturedObject parent; + private Map<String, String> properties = new LinkedHashMap<String, String>(); + private Map<String, Object> additionalData = new HashMap<String, Object>(); + private StringBuffer innerXML = new StringBuffer(); + private StringBuffer script = new StringBuffer(); + private boolean inlineable = true; + private JAXXCapture capture; + + public CapturedObject(ObjectHandler handler, String className, JAXXCapture capture) { + this.handler = handler; + this.className = className; + this.capture = capture; + } + + + public ObjectHandler getObjectHandler() { + return handler; + } + + + public void addChild(CapturedObject child, ContextNode constraints) { + children.put(child, constraints); + child.setParent(this); + } + + + public CapturedObject[] getChildren() { + return children.keySet().toArray(new CapturedObject[children.size()]); + } + + + public CapturedObject getParent() { + return parent; + } + + + public void setParent(CapturedObject parent) { + this.parent = parent; + } + + + public ContextNode getConstraints(CapturedObject child) { + return children.get(child); + } + + + public String getClassName() { + return className; + } + + + public String getProperty(String key) { + return properties.get(key); + } + + + public void setProperty(String key, String value) { + properties.put(key, value); + } + + + public Map<String, String> getProperties() { + return properties; + } + + + public Object getAdditionalData(String key) { + return additionalData.get(key); + } + + + public void setAdditionalData(String key, Object value) { + additionalData.put(key, value); + } + + + public Map<String, Object> getAdditionalData() { + return additionalData; + } + + + public void setInlineable(boolean inlineable) { + this.inlineable = inlineable; + } + + + public boolean isInlineable() { + try { + return script.length() == 0 && !Component.class.isAssignableFrom(Class.forName(className, true, capture.getClassLoader())) && inlineable; + } + catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + + + public void appendInnerXML(String xml) { + if (this.innerXML.length() > 0) { + this.innerXML.append(JAXXCompiler.getLineSeparator()); + } + this.innerXML.append(xml); + } + + + public String getInnerXML() { + return innerXML.toString(); + } + + + public void appendScriptCode(String script) { + if (this.script.length() > 0) { + this.script.append(JAXXCompiler.getLineSeparator()); + } + this.script.append(script); + } + + + public String getScriptCode() { + return script.toString(); + } + + + public String getXML(JAXXCapture capture) { + return getObjectHandler().getXML(this, capture); + } + + @Override + public String toString() { + return "CapturedObject[" + getProperty("id") + ", " + className + "]"; + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,33 +1,33 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -public interface ContextNode { - - void addArgument(ContextNode node); - - ContextNode[] getArguments(); -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +public interface ContextNode { + + void addArgument(ContextNode node); + + ContextNode[] getArguments(); +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,403 +1,403 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -import jaxx.compiler.ClassMap; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorHelper; -import jaxx.compiler.tools.jaxxcapture.handlers.JTabbedPaneHandler; -import jaxx.compiler.tools.jaxxcapture.handlers.ObjectHandler; -import jaxx.compiler.tools.jaxxcapture.handlers.TableHandler; -import jaxx.compiler.types.TypeManager; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; -import org.xml.sax.SAXException; - -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JTabbedPane; -import javax.swing.JWindow; -import javax.swing.SwingUtilities; -import java.awt.AWTEvent; -import java.awt.Component; -import java.awt.Container; -import java.awt.EventQueue; -import java.awt.Toolkit; -import java.awt.Window; -import java.awt.event.MouseEvent; -import java.beans.XMLEncoder; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.Stack; -import java.util.jar.Attributes; -import java.util.jar.JarFile; -import java.util.jar.Manifest; - -public class JAXXCapture { - - private static ClassMap<Object> objectHandlers = new ClassMap<Object>(); - - static { - //TODO make a serviceLoader mecanism to allow inter-module loading - objectHandlers.put(ClassDescriptorHelper.getClassDescriptor(Object.class), new ObjectHandler()); - objectHandlers.put(ClassDescriptorHelper.getClassDescriptor(JTabbedPane.class), new JTabbedPaneHandler()); - try { - objectHandlers.put(ClassDescriptorHelper.getClassDescriptor("jaxx.runtime.swing.Table"), new TableHandler()); - } catch (ClassNotFoundException e) { - System.err.println(e); - } - } - private Map<String, Object> sourceObjects = new HashMap<String, Object>(); - private Map<String, CapturedObject> capturedObjects = new HashMap<String, CapturedObject>(); - private ClassLoader classLoader; - private int count; - - private static class CaptureEventQueue extends EventQueue { - - private ClassLoader classLoader; - - private CaptureEventQueue(ClassLoader classLoader) { - this.classLoader = classLoader; - } - - @Override - public void dispatchEvent(AWTEvent event) { - if (event.getID() == MouseEvent.MOUSE_PRESSED && ((MouseEvent) event).isControlDown()) { - Component target = ((MouseEvent) event).getComponent(); - if (!(target instanceof Window)) { - target = SwingUtilities.getWindowAncestor(target); - } - if (target instanceof JFrame) { - target = ((JFrame) target).getContentPane(); - } else if (target instanceof JDialog) { - target = ((JDialog) target).getContentPane(); - } - if (target instanceof JWindow) { - target = ((JWindow) target).getContentPane(); - } - if (target != null) { - Thread.currentThread().setContextClassLoader(classLoader); - JAXXCapture capture = new JAXXCapture(classLoader); - capture.applyNames(target); - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - XMLEncoder encoder = new XMLEncoder(buffer); - encoder.writeObject(target); - encoder.close(); - try { - System.err.println(new String(buffer.toByteArray())); - System.out.println(capture.convertToJAXX(new ByteArrayInputStream(buffer.toByteArray()))); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - super.dispatchEvent(event); - } - } - - private JAXXCapture(ClassLoader classLoader) { - this.classLoader = classLoader; - } - - public ClassLoader getClassLoader() { - return classLoader; - } - - public Map<String, CapturedObject> getCapturedObjects() { - return capturedObjects; - } - - private void applyNames(Component target) { - String name = target.getName(); - if (name == null || sourceObjects.containsKey(name) || !CompiledObject.isValidID(name)) { - do { - name = "Object" + ++count; - } while (sourceObjects.containsKey(name)); - } - target.setName(name); - assert !sourceObjects.containsKey(name) : "ID " + name + " is already registered"; - sourceObjects.put(name, target); - - if (target instanceof Container) { - Container container = (Container) target; - for (int i = 0; i < container.getComponentCount(); i++) { - applyNames(container.getComponent(i)); - } - } - } - - public static String getText(Element tag) { // NOT a safe general-purpose implementation! - return ((Text) tag.getChildNodes().item(0)).getData(); - } - - private String getArgumentsCode(ContextNode[] arguments) { - StringBuffer result = new StringBuffer(); - result.append('('); - for (int i = 0; i < arguments.length; i++) { - if (i != 0) { - result.append(", "); - } - result.append(getJavaCode(arguments[i])); - } - result.append(')'); - return result.toString(); - } - - public String getJavaCode(ContextNode node) { - StringBuffer result = new StringBuffer(); - if (node instanceof PropertyNode) { - ContextNode[] arguments = node.getArguments(); - result.append(arguments.length == 0 ? "get" : "set"); - result.append(org.apache.commons.lang.StringUtils.capitalize(((PropertyNode) node).getProperty())); - result.append(getArgumentsCode(arguments)); - } else if (node instanceof MethodNode) { - result.append((((MethodNode) node).getMethodName())); - result.append(getArgumentsCode(node.getArguments())); - } else if (node instanceof CapturedObject) { - CapturedObject object = (CapturedObject) node; - if (object.isInlineable()) { - result.append("new "); - result.append(object.getClassName()); - result.append(getArgumentsCode(node.getArguments())); - } else { - String id = object.getProperty("id"); - assert id != null; - result.append(id); - } - } else if (node instanceof ValueNode) { - result.append(TypeManager.getJavaCode(((ValueNode) node).getValue())); - } else if (node instanceof LiteralNode) { - result.append(((LiteralNode) node).getJavaCode()); - } else { - throw new IllegalArgumentException("unrecognized node type: " + node); - } - return result.toString(); - } - - // returns the best matching method for the specified argument types - private static Method getMethod(Class<?> target, String methodName, Class<?>[] arguments) { - try { - // use the package-private class java.beans.ReflectionUtils to resolve the method. This isn't 100% safe, but it's better than - // having to rewrite the resolution myself. - Class<?> reflectionUtils = Class.forName("java.beans.ReflectionUtils"); - Method getMethod = reflectionUtils.getDeclaredMethod("getMethod", new Class<?>[]{Class.class, String.class, Class[].class}); - getMethod.setAccessible(true); - return (Method) getMethod.invoke(null, target, methodName, arguments); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - // returns the best matching constructor for the specified argument types - private static Constructor<?> getConstructor(Class<?> target, Class<?>[] arguments) { - try { - // use the package-private class java.beans.ReflectionUtils to resolve the constructor. This isn't 100% safe, but it's better than - // having to rewrite the resolution myself. - Class<?> reflectionUtils = Class.forName("java.beans.ReflectionUtils"); - Method getConstructor = reflectionUtils.getDeclaredMethod("getConstructor", new Class<?>[]{Class.class, Class[].class}); - getConstructor.setAccessible(true); - return (Constructor<?>) getConstructor.invoke(null, target, arguments); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private Object createInstance(CapturedObject object) { - try { - ContextNode[] argumentNodes = object.getArguments(); - Object[] arguments = new Object[argumentNodes.length]; - Class<?>[] argumentTypes = new Class<?>[argumentNodes.length]; - for (int j = 0; j < argumentNodes.length; j++) { - if (argumentNodes[j] instanceof ValueNode) { - arguments[j] = ((ValueNode) argumentNodes[j]).getValue(); - argumentTypes[j] = arguments[j] != null ? arguments[j].getClass() : null; - } else if (argumentNodes[j] instanceof CapturedObject) { - arguments[j] = createInstance((CapturedObject) argumentNodes[j]); - argumentTypes[j] = arguments[j] != null ? arguments[j].getClass() : null; - } - } - Constructor<?> constructor = getConstructor(Class.forName(object.getClassName(), true, classLoader), argumentTypes); - return constructor.newInstance(arguments); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public String getJavaCode(Stack/*<ContextNode>*/ context) { - CapturedObject contextCapturedObject = (CapturedObject) context.get(0); - StringBuffer result = new StringBuffer(); - int start = 1; - for (int i = context.size() - 1; i > 1; i--) { - if (context.get(i) instanceof CapturedObject) { - start = i; - contextCapturedObject = (CapturedObject) context.get(i); - break; - } - } - Object contextObject = sourceObjects.get(contextCapturedObject.getProperty("id")); - Class<?> contextClass = contextObject != null ? contextObject.getClass() : null; - - for (int i = start; i < context.size(); i++) { - ContextNode node = (ContextNode) context.get(i); - if (contextObject != null && (node instanceof MethodNode || node instanceof PropertyNode)) { - // need to follow the call chain so we can insert typecasts as necessary - try { - String methodName; - ContextNode[] argumentNodes = node.getArguments(); - if (node instanceof MethodNode) { - methodName = ((MethodNode) node).getMethodName(); - } else { - methodName = (argumentNodes.length == 0 ? "get" : "set") + org.apache.commons.lang.StringUtils.capitalize(((PropertyNode) node).getProperty()); - } - Object[] arguments = new Object[argumentNodes.length]; - Class<?>[] argumentTypes = new Class<?>[argumentNodes.length]; - for (int j = 0; j < argumentNodes.length; j++) { - if (argumentNodes[j] instanceof ValueNode) { - arguments[j] = ((ValueNode) argumentNodes[j]).getValue(); - argumentTypes[j] = arguments[j] != null ? arguments[j].getClass() : null; - } else if (argumentNodes[j] instanceof CapturedObject) { - arguments[j] = createInstance((CapturedObject) argumentNodes[j]); - argumentTypes[j] = arguments[j].getClass(); - } else if (argumentNodes[j] instanceof LiteralNode) { - arguments[j] = ((LiteralNode) argumentNodes[j]).getValue(); - argumentTypes[j] = arguments[j].getClass(); - } else { - throw new IllegalArgumentException("unsupported argument type: " + argumentNodes[j]); - } - } - - Method method = getMethod(contextClass, methodName, argumentTypes); - if (method == null) { - // could not find method in contextClass, must be defined in a subclass -- insert a typecast - result.insert(0, "((" + getOutputName(contextObject.getClass()) + ") "); - result.append(')'); - method = getMethod(contextObject.getClass(), methodName, argumentTypes); - } - if (method == null) { - throw new RuntimeException("could not find method " + methodName + Arrays.asList(argumentTypes) + " in " + contextObject.getClass() + " (context: " + context + ")"); - } - contextObject = method.invoke(contextObject, arguments); - contextClass = method.getReturnType(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - if (i > start) { - result.append('.'); - } - - result.append(getJavaCode(node)); - } - return result + ";"; - } - - private String getOutputName(Class<?> c) { - return c.getName(); - } - - public CapturedObject processObject(Element objectTag, Stack<ContextNode> context) { - String className = objectTag.getAttribute("class"); - ObjectHandler handler; - if (className.length() > 0) { - try { - ClassDescriptor descriptor = ClassDescriptorHelper.getClassDescriptor(className, classLoader); - handler = (ObjectHandler) objectHandlers.get(descriptor); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } else { - handler = (ObjectHandler) objectHandlers.get(ClassDescriptorHelper.getClassDescriptor(Object.class)); - } - - return handler.processObject(objectTag, context, this); - } - - private synchronized String convertToJAXX(InputStream beansXML) throws IOException { - try { - Document document = JAXXCompiler.parseDocument(beansXML); - Element rootElement = document.getDocumentElement(); - NodeList nodes = rootElement.getChildNodes(); - Stack<ContextNode> context = new Stack<ContextNode>(); - for (int i = 0; i < nodes.getLength(); i++) { - Node child = nodes.item(i); - if (child.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element) child; - if (!element.getTagName().equals("object")) { - throw new Error("expected tag 'object', found '" + element.getTagName() + "'"); - } - CapturedObject root = processObject(element, context); - for (CapturedObject object : capturedObjects.values()) { // add all orphan objects to the root, so any non-inlineable ones have their XML created - if (object.getParent() == null && object != root) { - root.addChild(object, null); - } - } - return root.getXML(this); - } - } - return null; - } catch (SAXException e) { - throw new RuntimeException(e); - } finally { - reset(); - } - } - - private void reset() { - sourceObjects.clear(); - capturedObjects.clear(); - count = 0; - } - - public static void main(String[] arg) throws Exception { - File file = new File(arg[0]); - JarFile jarFile = new JarFile(file); - ClassLoader classLoader = new URLClassLoader(new URL[]{file.toURI().toURL()}); - Thread.currentThread().setContextClassLoader(classLoader); - EventQueue systemQueue = Toolkit.getDefaultToolkit().getSystemEventQueue(); - systemQueue.push(new CaptureEventQueue(classLoader)); - Manifest mf = jarFile.getManifest(); - String mainClassName = mf.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS); - Class<?> mainClass = Class.forName(mainClassName, true, classLoader); - Method main = mainClass.getMethod("main", String[].class); - main.invoke(null, new Object[]{new String[0]}); - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +import jaxx.compiler.ClassMap; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorHelper; +import jaxx.compiler.tools.jaxxcapture.handlers.JTabbedPaneHandler; +import jaxx.compiler.tools.jaxxcapture.handlers.ObjectHandler; +import jaxx.compiler.tools.jaxxcapture.handlers.TableHandler; +import jaxx.compiler.types.TypeManager; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; +import org.xml.sax.SAXException; + +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JTabbedPane; +import javax.swing.JWindow; +import javax.swing.SwingUtilities; +import java.awt.AWTEvent; +import java.awt.Component; +import java.awt.Container; +import java.awt.EventQueue; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.MouseEvent; +import java.beans.XMLEncoder; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; +import java.util.jar.Attributes; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + +public class JAXXCapture { + + private static ClassMap<Object> objectHandlers = new ClassMap<Object>(); + + static { + //TODO make a serviceLoader mecanism to allow inter-module loading + objectHandlers.put(ClassDescriptorHelper.getClassDescriptor(Object.class), new ObjectHandler()); + objectHandlers.put(ClassDescriptorHelper.getClassDescriptor(JTabbedPane.class), new JTabbedPaneHandler()); + try { + objectHandlers.put(ClassDescriptorHelper.getClassDescriptor("jaxx.runtime.swing.Table"), new TableHandler()); + } catch (ClassNotFoundException e) { + System.err.println(e); + } + } + private Map<String, Object> sourceObjects = new HashMap<String, Object>(); + private Map<String, CapturedObject> capturedObjects = new HashMap<String, CapturedObject>(); + private ClassLoader classLoader; + private int count; + + private static class CaptureEventQueue extends EventQueue { + + private ClassLoader classLoader; + + private CaptureEventQueue(ClassLoader classLoader) { + this.classLoader = classLoader; + } + + @Override + public void dispatchEvent(AWTEvent event) { + if (event.getID() == MouseEvent.MOUSE_PRESSED && ((MouseEvent) event).isControlDown()) { + Component target = ((MouseEvent) event).getComponent(); + if (!(target instanceof Window)) { + target = SwingUtilities.getWindowAncestor(target); + } + if (target instanceof JFrame) { + target = ((JFrame) target).getContentPane(); + } else if (target instanceof JDialog) { + target = ((JDialog) target).getContentPane(); + } + if (target instanceof JWindow) { + target = ((JWindow) target).getContentPane(); + } + if (target != null) { + Thread.currentThread().setContextClassLoader(classLoader); + JAXXCapture capture = new JAXXCapture(classLoader); + capture.applyNames(target); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + XMLEncoder encoder = new XMLEncoder(buffer); + encoder.writeObject(target); + encoder.close(); + try { + System.err.println(new String(buffer.toByteArray())); + System.out.println(capture.convertToJAXX(new ByteArrayInputStream(buffer.toByteArray()))); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + super.dispatchEvent(event); + } + } + + private JAXXCapture(ClassLoader classLoader) { + this.classLoader = classLoader; + } + + public ClassLoader getClassLoader() { + return classLoader; + } + + public Map<String, CapturedObject> getCapturedObjects() { + return capturedObjects; + } + + private void applyNames(Component target) { + String name = target.getName(); + if (name == null || sourceObjects.containsKey(name) || !CompiledObject.isValidID(name)) { + do { + name = "Object" + ++count; + } while (sourceObjects.containsKey(name)); + } + target.setName(name); + assert !sourceObjects.containsKey(name) : "ID " + name + " is already registered"; + sourceObjects.put(name, target); + + if (target instanceof Container) { + Container container = (Container) target; + for (int i = 0; i < container.getComponentCount(); i++) { + applyNames(container.getComponent(i)); + } + } + } + + public static String getText(Element tag) { // NOT a safe general-purpose implementation! + return ((Text) tag.getChildNodes().item(0)).getData(); + } + + private String getArgumentsCode(ContextNode[] arguments) { + StringBuffer result = new StringBuffer(); + result.append('('); + for (int i = 0; i < arguments.length; i++) { + if (i != 0) { + result.append(", "); + } + result.append(getJavaCode(arguments[i])); + } + result.append(')'); + return result.toString(); + } + + public String getJavaCode(ContextNode node) { + StringBuffer result = new StringBuffer(); + if (node instanceof PropertyNode) { + ContextNode[] arguments = node.getArguments(); + result.append(arguments.length == 0 ? "get" : "set"); + result.append(org.apache.commons.lang.StringUtils.capitalize(((PropertyNode) node).getProperty())); + result.append(getArgumentsCode(arguments)); + } else if (node instanceof MethodNode) { + result.append((((MethodNode) node).getMethodName())); + result.append(getArgumentsCode(node.getArguments())); + } else if (node instanceof CapturedObject) { + CapturedObject object = (CapturedObject) node; + if (object.isInlineable()) { + result.append("new "); + result.append(object.getClassName()); + result.append(getArgumentsCode(node.getArguments())); + } else { + String id = object.getProperty("id"); + assert id != null; + result.append(id); + } + } else if (node instanceof ValueNode) { + result.append(TypeManager.getJavaCode(((ValueNode) node).getValue())); + } else if (node instanceof LiteralNode) { + result.append(((LiteralNode) node).getJavaCode()); + } else { + throw new IllegalArgumentException("unrecognized node type: " + node); + } + return result.toString(); + } + + // returns the best matching method for the specified argument types + private static Method getMethod(Class<?> target, String methodName, Class<?>[] arguments) { + try { + // use the package-private class java.beans.ReflectionUtils to resolve the method. This isn't 100% safe, but it's better than + // having to rewrite the resolution myself. + Class<?> reflectionUtils = Class.forName("java.beans.ReflectionUtils"); + Method getMethod = reflectionUtils.getDeclaredMethod("getMethod", new Class<?>[]{Class.class, String.class, Class[].class}); + getMethod.setAccessible(true); + return (Method) getMethod.invoke(null, target, methodName, arguments); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + // returns the best matching constructor for the specified argument types + private static Constructor<?> getConstructor(Class<?> target, Class<?>[] arguments) { + try { + // use the package-private class java.beans.ReflectionUtils to resolve the constructor. This isn't 100% safe, but it's better than + // having to rewrite the resolution myself. + Class<?> reflectionUtils = Class.forName("java.beans.ReflectionUtils"); + Method getConstructor = reflectionUtils.getDeclaredMethod("getConstructor", new Class<?>[]{Class.class, Class[].class}); + getConstructor.setAccessible(true); + return (Constructor<?>) getConstructor.invoke(null, target, arguments); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private Object createInstance(CapturedObject object) { + try { + ContextNode[] argumentNodes = object.getArguments(); + Object[] arguments = new Object[argumentNodes.length]; + Class<?>[] argumentTypes = new Class<?>[argumentNodes.length]; + for (int j = 0; j < argumentNodes.length; j++) { + if (argumentNodes[j] instanceof ValueNode) { + arguments[j] = ((ValueNode) argumentNodes[j]).getValue(); + argumentTypes[j] = arguments[j] != null ? arguments[j].getClass() : null; + } else if (argumentNodes[j] instanceof CapturedObject) { + arguments[j] = createInstance((CapturedObject) argumentNodes[j]); + argumentTypes[j] = arguments[j] != null ? arguments[j].getClass() : null; + } + } + Constructor<?> constructor = getConstructor(Class.forName(object.getClassName(), true, classLoader), argumentTypes); + return constructor.newInstance(arguments); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public String getJavaCode(Stack/*<ContextNode>*/ context) { + CapturedObject contextCapturedObject = (CapturedObject) context.get(0); + StringBuffer result = new StringBuffer(); + int start = 1; + for (int i = context.size() - 1; i > 1; i--) { + if (context.get(i) instanceof CapturedObject) { + start = i; + contextCapturedObject = (CapturedObject) context.get(i); + break; + } + } + Object contextObject = sourceObjects.get(contextCapturedObject.getProperty("id")); + Class<?> contextClass = contextObject != null ? contextObject.getClass() : null; + + for (int i = start; i < context.size(); i++) { + ContextNode node = (ContextNode) context.get(i); + if (contextObject != null && (node instanceof MethodNode || node instanceof PropertyNode)) { + // need to follow the call chain so we can insert typecasts as necessary + try { + String methodName; + ContextNode[] argumentNodes = node.getArguments(); + if (node instanceof MethodNode) { + methodName = ((MethodNode) node).getMethodName(); + } else { + methodName = (argumentNodes.length == 0 ? "get" : "set") + org.apache.commons.lang.StringUtils.capitalize(((PropertyNode) node).getProperty()); + } + Object[] arguments = new Object[argumentNodes.length]; + Class<?>[] argumentTypes = new Class<?>[argumentNodes.length]; + for (int j = 0; j < argumentNodes.length; j++) { + if (argumentNodes[j] instanceof ValueNode) { + arguments[j] = ((ValueNode) argumentNodes[j]).getValue(); + argumentTypes[j] = arguments[j] != null ? arguments[j].getClass() : null; + } else if (argumentNodes[j] instanceof CapturedObject) { + arguments[j] = createInstance((CapturedObject) argumentNodes[j]); + argumentTypes[j] = arguments[j].getClass(); + } else if (argumentNodes[j] instanceof LiteralNode) { + arguments[j] = ((LiteralNode) argumentNodes[j]).getValue(); + argumentTypes[j] = arguments[j].getClass(); + } else { + throw new IllegalArgumentException("unsupported argument type: " + argumentNodes[j]); + } + } + + Method method = getMethod(contextClass, methodName, argumentTypes); + if (method == null) { + // could not find method in contextClass, must be defined in a subclass -- insert a typecast + result.insert(0, "((" + getOutputName(contextObject.getClass()) + ") "); + result.append(')'); + method = getMethod(contextObject.getClass(), methodName, argumentTypes); + } + if (method == null) { + throw new RuntimeException("could not find method " + methodName + Arrays.asList(argumentTypes) + " in " + contextObject.getClass() + " (context: " + context + ")"); + } + contextObject = method.invoke(contextObject, arguments); + contextClass = method.getReturnType(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + if (i > start) { + result.append('.'); + } + + result.append(getJavaCode(node)); + } + return result + ";"; + } + + private String getOutputName(Class<?> c) { + return c.getName(); + } + + public CapturedObject processObject(Element objectTag, Stack<ContextNode> context) { + String className = objectTag.getAttribute("class"); + ObjectHandler handler; + if (className.length() > 0) { + try { + ClassDescriptor descriptor = ClassDescriptorHelper.getClassDescriptor(className, classLoader); + handler = (ObjectHandler) objectHandlers.get(descriptor); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } else { + handler = (ObjectHandler) objectHandlers.get(ClassDescriptorHelper.getClassDescriptor(Object.class)); + } + + return handler.processObject(objectTag, context, this); + } + + private synchronized String convertToJAXX(InputStream beansXML) throws IOException { + try { + Document document = JAXXCompiler.parseDocument(beansXML); + Element rootElement = document.getDocumentElement(); + NodeList nodes = rootElement.getChildNodes(); + Stack<ContextNode> context = new Stack<ContextNode>(); + for (int i = 0; i < nodes.getLength(); i++) { + Node child = nodes.item(i); + if (child.getNodeType() == Node.ELEMENT_NODE) { + Element element = (Element) child; + if (!element.getTagName().equals("object")) { + throw new Error("expected tag 'object', found '" + element.getTagName() + "'"); + } + CapturedObject root = processObject(element, context); + for (CapturedObject object : capturedObjects.values()) { // add all orphan objects to the root, so any non-inlineable ones have their XML created + if (object.getParent() == null && object != root) { + root.addChild(object, null); + } + } + return root.getXML(this); + } + } + return null; + } catch (SAXException e) { + throw new RuntimeException(e); + } finally { + reset(); + } + } + + private void reset() { + sourceObjects.clear(); + capturedObjects.clear(); + count = 0; + } + + public static void main(String[] arg) throws Exception { + File file = new File(arg[0]); + JarFile jarFile = new JarFile(file); + ClassLoader classLoader = new URLClassLoader(new URL[]{file.toURI().toURL()}); + Thread.currentThread().setContextClassLoader(classLoader); + EventQueue systemQueue = Toolkit.getDefaultToolkit().getSystemEventQueue(); + systemQueue.push(new CaptureEventQueue(classLoader)); + Manifest mf = jarFile.getManifest(); + String mainClassName = mf.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS); + Class<?> mainClass = Class.forName(mainClassName, true, classLoader); + Method main = mainClass.getMethod("main", String[].class); + main.invoke(null, new Object[]{new String[0]}); + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,45 +1,45 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -public class LiteralNode extends AbstractContextNode { - private String javaCode; - private Object value; - - public LiteralNode(String javaCode, Object value) { - this.javaCode = javaCode; - this.value = value; - } - - - public String getJavaCode() { - return javaCode; - } - - public Object getValue() { - return value; - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +public class LiteralNode extends AbstractContextNode { + private String javaCode; + private Object value; + + public LiteralNode(String javaCode, Object value) { + this.javaCode = javaCode; + this.value = value; + } + + + public String getJavaCode() { + return javaCode; + } + + public Object getValue() { + return value; + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,44 +1,44 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -public class MethodNode extends AbstractContextNode { - private String methodName; - - public MethodNode(String methodName) { - this.methodName = methodName; - } - - - public String getMethodName() { - return methodName; - } - - @Override - public String toString() { - return "Method[" + methodName + ", " + java.util.Arrays.asList(getArguments()) + "]"; - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +public class MethodNode extends AbstractContextNode { + private String methodName; + + public MethodNode(String methodName) { + this.methodName = methodName; + } + + + public String getMethodName() { + return methodName; + } + + @Override + public String toString() { + return "Method[" + methodName + ", " + java.util.Arrays.asList(getArguments()) + "]"; + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,44 +1,44 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -public class PropertyNode extends AbstractContextNode { - private String property; - - public PropertyNode(String property) { - this.property = property; - } - - - public String getProperty() { - return property; - } - - - public String toString() { - return "Property[" + property + ", " + java.util.Arrays.asList(getArguments()) + "]"; - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +public class PropertyNode extends AbstractContextNode { + private String property; + + public PropertyNode(String property) { + this.property = property; + } + + + public String getProperty() { + return property; + } + + + public String toString() { + return "Property[" + property + ", " + java.util.Arrays.asList(getArguments()) + "]"; + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,39 +1,39 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture; - -public class ValueNode extends AbstractContextNode { - private Object value; - - public ValueNode(Object value) { - this.value = value; - } - - - public Object getValue() { - return value; - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture; + +public class ValueNode extends AbstractContextNode { + private Object value; + + public ValueNode(Object value) { + this.value = value; + } + + + public Object getValue() { + return value; + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,51 +1,51 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture.handlers; - -import jaxx.compiler.tools.jaxxcapture.ContextNode; -import jaxx.compiler.tools.jaxxcapture.JAXXCapture; -import jaxx.compiler.tools.jaxxcapture.MethodNode; -import org.w3c.dom.Element; - -import java.util.Arrays; -import java.util.Stack; - -public class JTabbedPaneHandler extends ObjectHandler { - - @Override - protected void evaluateMethod(Element tag, Stack<ContextNode> context, JAXXCapture capture) { - String methodName = tag.getAttribute("method"); - if (methodName.equals("addTab")) { - MethodNode addTab = new MethodNode(methodName); - context.push(addTab); - processChildren(tag, context, capture); - context.pop(); - System.err.println(Arrays.asList(addTab.getArguments())); - } else { - super.evaluateMethod(tag, context, capture); - } - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture.handlers; + +import jaxx.compiler.tools.jaxxcapture.ContextNode; +import jaxx.compiler.tools.jaxxcapture.JAXXCapture; +import jaxx.compiler.tools.jaxxcapture.MethodNode; +import org.w3c.dom.Element; + +import java.util.Arrays; +import java.util.Stack; + +public class JTabbedPaneHandler extends ObjectHandler { + + @Override + protected void evaluateMethod(Element tag, Stack<ContextNode> context, JAXXCapture capture) { + String methodName = tag.getAttribute("method"); + if (methodName.equals("addTab")) { + MethodNode addTab = new MethodNode(methodName); + context.push(addTab); + processChildren(tag, context, capture); + context.pop(); + System.err.println(Arrays.asList(addTab.getArguments())); + } else { + super.evaluateMethod(tag, context, capture); + } + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,351 +1,351 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture.handlers; - -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.finalizers.JAXXCompilerFinalizer; -import jaxx.compiler.java.JavaFileGenerator; -import jaxx.compiler.tools.jaxxcapture.CapturedObject; -import jaxx.compiler.tools.jaxxcapture.ContextNode; -import jaxx.compiler.tools.jaxxcapture.JAXXCapture; -import jaxx.compiler.tools.jaxxcapture.LiteralNode; -import jaxx.compiler.tools.jaxxcapture.MethodNode; -import jaxx.compiler.tools.jaxxcapture.PropertyNode; -import jaxx.compiler.tools.jaxxcapture.ValueNode; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import java.awt.Container; -import java.lang.reflect.Field; -import java.util.Map; -import java.util.Stack; - -public class ObjectHandler { - private static int count; - - public static final String ATTRIBUTE_PROPERTY = "property"; - - protected CapturedObject createCapturedObject(String className, JAXXCapture capture) { - return new CapturedObject(this, className, capture); - } - - - // returns true if the tag has any "void" children - protected boolean processChildren(Element tag, Stack<ContextNode> context, JAXXCapture capture) { - boolean result = false; - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - if (child.getNodeType() == Node.ELEMENT_NODE) { - Element innerTag = (Element) child; - if (innerTag.getTagName().equals(JAXXCompilerFinalizer.TYPE_VOID)) { - result = true; - } - evaluate(innerTag, context, capture); - } - } - return result; - } - - - protected void evaluateProperty(Element tag, Stack<ContextNode> context, JAXXCapture capture) { - // determine containing object - CapturedObject contextObject = null; - for (int i = context.size() - 1; i >= 0; i--) { - if (context.get(i) instanceof CapturedObject) { - contextObject = (CapturedObject) context.get(i); - break; - } - } - assert contextObject != null; - - String property = tag.getAttribute(ATTRIBUTE_PROPERTY); - if (!property.equals("actionCommand")) { // filter out actionCommand due to screwiness in XMLEncoder's handling of it - Object current = context.peek(); - PropertyNode newContext = new PropertyNode(property); - context.push(newContext); - boolean voidChildren = processChildren(tag, context, capture); - - ContextNode[] arguments = newContext.getArguments(); - if (arguments.length == 1) { - if (current instanceof CapturedObject && arguments[0] instanceof ValueNode) // simple property assignment - { - ((CapturedObject) current).setProperty(property, dataBindingEncode(String.valueOf(((ValueNode) arguments[0]).getValue()))); - } else if (current instanceof CapturedObject && arguments[0] instanceof CapturedObject && ((CapturedObject) arguments[0]).isInlineable()) // simple data binding - { - ((CapturedObject) current).setProperty(property, "{" + capture.getJavaCode(arguments[0]) + "}"); - } else { - contextObject.setInlineable(false); - contextObject.appendScriptCode(capture.getJavaCode(context)); - } - } else if (!voidChildren) { - contextObject.setInlineable(false); - contextObject.appendScriptCode(capture.getJavaCode(context)); - } - - assert context.peek() == newContext; - context.pop(); - } - } - - - protected void evaluateAdd(CapturedObject contextObject, CapturedObject child, ContextNode constraints) { - contextObject.addChild(child, constraints); - } - - - protected void evaluateMethod(Element tag, Stack<ContextNode> context, JAXXCapture capture) { - // determine containing object - CapturedObject contextObject = null; - for (int i = context.size() - 1; i >= 0; i--) { - if (context.get(i) instanceof CapturedObject) { - contextObject = (CapturedObject) context.get(i); - break; - } - } - assert contextObject != null; - - try { - String methodName = tag.getAttribute("method"); - MethodNode newContext = new MethodNode(methodName); - context.push(newContext); - boolean voidChildren = processChildren(tag, context, capture); - boolean add = false; - - ContextNode[] arguments = newContext.getArguments(); - if (methodName.equals("add") && arguments.length >= 1 && arguments[0] instanceof CapturedObject) { - Class<?> contextClass = Class.forName(contextObject.getClassName(), true, capture.getClassLoader()); - if (Container.class.isAssignableFrom(contextClass)) { - add = true; - evaluateAdd(contextObject, (CapturedObject) arguments[0], null); - } - } - - if (!voidChildren && !add) { - contextObject.appendScriptCode(capture.getJavaCode(context)); - } - - assert context.peek() == newContext; - context.pop(); - } - catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } - - - protected void evaluate(Element tag, Stack<ContextNode> context, JAXXCapture capture) { - String tagName = tag.getTagName(); - if (tagName.equals("object")) { - String fieldName = tag.getAttribute("field"); - ContextNode currentNode = context.peek(); - if (fieldName.length() > 0) { - try { - String className = tag.getAttribute("class"); - Field field = Class.forName(className, true, capture.getClassLoader()).getField(fieldName); - Object value = field.get(null); - currentNode.addArgument(new LiteralNode(className + "." + fieldName, value)); - } - catch (Exception e) { - throw new RuntimeException(e); - } - } else { - currentNode.addArgument(capture.processObject(tag, context)); - } - } else if (tagName.equals(JAXXCompilerFinalizer.TYPE_VOID)) { - String property = tag.getAttribute(ATTRIBUTE_PROPERTY); - if (property.length() > 0) { - evaluateProperty(tag, context, capture); - } else { - evaluateMethod(tag, context, capture); - } - } else if (tagName.equals("string")) { - context.peek().addArgument(new ValueNode(JAXXCapture.getText(tag))); - } else if (tagName.equals("boolean")) { - context.peek().addArgument(new ValueNode(Boolean.valueOf(JAXXCapture.getText(tag)))); - } else if (tagName.equals("char")) { - context.peek().addArgument(new ValueNode(JAXXCapture.getText(tag).charAt(0))); - } else if (tagName.equals("short")) { - context.peek().addArgument(new ValueNode(Short.valueOf(JAXXCapture.getText(tag)))); - } else if (tagName.equals("int")) { - context.peek().addArgument(new ValueNode(Integer.valueOf(JAXXCapture.getText(tag)))); - } else if (tagName.equals("long")) { - context.peek().addArgument(new ValueNode(Long.valueOf(JAXXCapture.getText(tag)))); - } else if (tagName.equals("float")) { - context.peek().addArgument(new ValueNode(Float.valueOf(JAXXCapture.getText(tag)))); - } else if (tagName.equals("double")) { - context.peek().addArgument(new ValueNode(Double.valueOf(JAXXCapture.getText(tag)))); - } else if (tagName.equals("null")) { - context.peek().addArgument(new ValueNode(null)); - } else { - System.err.println("unsupported tag: " + tag.getTagName()); - } - } - - - private static String dataBindingEncode(String value) { - return value.replaceAll("\\{", "\\\\{").replaceAll("\\}", "\\\\}"); - } - - - public CapturedObject processObject(Element objectTag, Stack<ContextNode> context, JAXXCapture capture) { - String className = objectTag.getAttribute("class"); - if (className.length() > 0) { - CapturedObject capturedObject = createCapturedObject(className, capture); - context.push(capturedObject); - NodeList children = objectTag.getChildNodes(); - String id = objectTag.getAttribute("id"); - if (id.length() == 0 || capture.getCapturedObjects().containsKey(id)) { - id = "Auto" + ++count; - } - assert !capture.getCapturedObjects().containsKey(id); - capture.getCapturedObjects().put(id, capturedObject); - capturedObject.setProperty("id", id); - // process object's name before anything else - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - if (child.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element) child; - if (element.getTagName().equals(JAXXCompilerFinalizer.TYPE_VOID) && element.getAttribute(ATTRIBUTE_PROPERTY).equals("name")) { - evaluate(element, context, capture); - String name = capturedObject.getProperty("name"); - if (name != null && !capture.getCapturedObjects().containsKey(name)) { - capture.getCapturedObjects().put(name, capturedObject); - capturedObject.setProperty("id", name); - capturedObject.getProperties().remove("name"); - } - } - } - } - // process remaining children - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - if (child.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element) child; - if (!JAXXCompilerFinalizer.TYPE_VOID.equals(element.getTagName()) || !element.getAttribute(ATTRIBUTE_PROPERTY).equals("name")) { - evaluate(element, context, capture); - } - } - } - assert context.peek() == capturedObject; - context.pop(); - - return capturedObject; - } else { - CapturedObject result = capture.getCapturedObjects().get(objectTag.getAttribute("idref")); - if (result == null) { - throw new RuntimeException("Internal error: could not find tag with id " + objectTag.getAttribute("idref")); - } - result.setInlineable(false); // we have at least two references to it, and so can't inline it - return result; - } - } - - - private static String xmlEncode(String src) { - return src.replaceAll("'", "&").replaceAll("<", "<"); - } - - - public String getXML(CapturedObject object, JAXXCapture capture) { - StringBuffer result = new StringBuffer(); - result.append('<'); - String className = object.getClassName(); - if (className.startsWith("javax.swing.")) { - className = className.substring("javax.swing.".length()); - } - result.append(className); - Map<String, String> properties = object.getProperties(); - for (Map.Entry<String, String> e : properties.entrySet()) { - result.append(' '); - result.append(e.getKey()); - result.append("='"); - result.append(xmlEncode(e.getValue())); - result.append('\''); - } - ContextNode[] arguments = object.getArguments(); - if (arguments != null && arguments.length > 0) { - result.append(" constructorParams='"); - for (int j = 0; j < arguments.length; j++) { - if (j != 0) { - result.append(", "); - } - result.append(capture.getJavaCode(arguments[j])); - } - result.append('\''); - } - boolean tagClosed = false; - - String children = getChildXML(object, capture); - String lineSeparator = JAXXCompiler.getLineSeparator(); - if (children != null && children.length() > 0) { - if (!tagClosed) { - tagClosed = true; - result.append('>'); - result.append(lineSeparator); - } - result.append(children); - } - - String script = object.getScriptCode(); - if (script != null && script.length() > 0) { - if (!tagClosed) { - tagClosed = true; - result.append('>'); - result.append(lineSeparator); - } - result.append(" <script>"); - result.append(lineSeparator); - result.append(JavaFileGenerator.indent(script, 4, false, lineSeparator)); - result.append(lineSeparator); - result.append(" </script>"); - result.append(lineSeparator); - } - if (tagClosed) { - result.append("</"); - result.append(className); - result.append('>'); - } else { - result.append("/>"); - } - return result.toString(); - } - - - protected String getChildXML(CapturedObject object, JAXXCapture capture) { - StringBuffer result = new StringBuffer(); - CapturedObject[] children = object.getChildren(); - String lineSeparator = JAXXCompiler.getLineSeparator(); - for (CapturedObject aChildren : children) { - if (!aChildren.isInlineable()) { - result.append(JavaFileGenerator.indent(aChildren.getXML(capture), 2, false, lineSeparator)); - result.append(lineSeparator); - } - } - return result.toString(); - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture.handlers; + +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.finalizers.JAXXCompilerFinalizer; +import jaxx.compiler.java.JavaFileGenerator; +import jaxx.compiler.tools.jaxxcapture.CapturedObject; +import jaxx.compiler.tools.jaxxcapture.ContextNode; +import jaxx.compiler.tools.jaxxcapture.JAXXCapture; +import jaxx.compiler.tools.jaxxcapture.LiteralNode; +import jaxx.compiler.tools.jaxxcapture.MethodNode; +import jaxx.compiler.tools.jaxxcapture.PropertyNode; +import jaxx.compiler.tools.jaxxcapture.ValueNode; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import java.awt.Container; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.Stack; + +public class ObjectHandler { + private static int count; + + public static final String ATTRIBUTE_PROPERTY = "property"; + + protected CapturedObject createCapturedObject(String className, JAXXCapture capture) { + return new CapturedObject(this, className, capture); + } + + + // returns true if the tag has any "void" children + protected boolean processChildren(Element tag, Stack<ContextNode> context, JAXXCapture capture) { + boolean result = false; + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + if (child.getNodeType() == Node.ELEMENT_NODE) { + Element innerTag = (Element) child; + if (innerTag.getTagName().equals(JAXXCompilerFinalizer.TYPE_VOID)) { + result = true; + } + evaluate(innerTag, context, capture); + } + } + return result; + } + + + protected void evaluateProperty(Element tag, Stack<ContextNode> context, JAXXCapture capture) { + // determine containing object + CapturedObject contextObject = null; + for (int i = context.size() - 1; i >= 0; i--) { + if (context.get(i) instanceof CapturedObject) { + contextObject = (CapturedObject) context.get(i); + break; + } + } + assert contextObject != null; + + String property = tag.getAttribute(ATTRIBUTE_PROPERTY); + if (!property.equals("actionCommand")) { // filter out actionCommand due to screwiness in XMLEncoder's handling of it + Object current = context.peek(); + PropertyNode newContext = new PropertyNode(property); + context.push(newContext); + boolean voidChildren = processChildren(tag, context, capture); + + ContextNode[] arguments = newContext.getArguments(); + if (arguments.length == 1) { + if (current instanceof CapturedObject && arguments[0] instanceof ValueNode) // simple property assignment + { + ((CapturedObject) current).setProperty(property, dataBindingEncode(String.valueOf(((ValueNode) arguments[0]).getValue()))); + } else if (current instanceof CapturedObject && arguments[0] instanceof CapturedObject && ((CapturedObject) arguments[0]).isInlineable()) // simple data binding + { + ((CapturedObject) current).setProperty(property, "{" + capture.getJavaCode(arguments[0]) + "}"); + } else { + contextObject.setInlineable(false); + contextObject.appendScriptCode(capture.getJavaCode(context)); + } + } else if (!voidChildren) { + contextObject.setInlineable(false); + contextObject.appendScriptCode(capture.getJavaCode(context)); + } + + assert context.peek() == newContext; + context.pop(); + } + } + + + protected void evaluateAdd(CapturedObject contextObject, CapturedObject child, ContextNode constraints) { + contextObject.addChild(child, constraints); + } + + + protected void evaluateMethod(Element tag, Stack<ContextNode> context, JAXXCapture capture) { + // determine containing object + CapturedObject contextObject = null; + for (int i = context.size() - 1; i >= 0; i--) { + if (context.get(i) instanceof CapturedObject) { + contextObject = (CapturedObject) context.get(i); + break; + } + } + assert contextObject != null; + + try { + String methodName = tag.getAttribute("method"); + MethodNode newContext = new MethodNode(methodName); + context.push(newContext); + boolean voidChildren = processChildren(tag, context, capture); + boolean add = false; + + ContextNode[] arguments = newContext.getArguments(); + if (methodName.equals("add") && arguments.length >= 1 && arguments[0] instanceof CapturedObject) { + Class<?> contextClass = Class.forName(contextObject.getClassName(), true, capture.getClassLoader()); + if (Container.class.isAssignableFrom(contextClass)) { + add = true; + evaluateAdd(contextObject, (CapturedObject) arguments[0], null); + } + } + + if (!voidChildren && !add) { + contextObject.appendScriptCode(capture.getJavaCode(context)); + } + + assert context.peek() == newContext; + context.pop(); + } + catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + + + protected void evaluate(Element tag, Stack<ContextNode> context, JAXXCapture capture) { + String tagName = tag.getTagName(); + if (tagName.equals("object")) { + String fieldName = tag.getAttribute("field"); + ContextNode currentNode = context.peek(); + if (fieldName.length() > 0) { + try { + String className = tag.getAttribute("class"); + Field field = Class.forName(className, true, capture.getClassLoader()).getField(fieldName); + Object value = field.get(null); + currentNode.addArgument(new LiteralNode(className + "." + fieldName, value)); + } + catch (Exception e) { + throw new RuntimeException(e); + } + } else { + currentNode.addArgument(capture.processObject(tag, context)); + } + } else if (tagName.equals(JAXXCompilerFinalizer.TYPE_VOID)) { + String property = tag.getAttribute(ATTRIBUTE_PROPERTY); + if (property.length() > 0) { + evaluateProperty(tag, context, capture); + } else { + evaluateMethod(tag, context, capture); + } + } else if (tagName.equals("string")) { + context.peek().addArgument(new ValueNode(JAXXCapture.getText(tag))); + } else if (tagName.equals("boolean")) { + context.peek().addArgument(new ValueNode(Boolean.valueOf(JAXXCapture.getText(tag)))); + } else if (tagName.equals("char")) { + context.peek().addArgument(new ValueNode(JAXXCapture.getText(tag).charAt(0))); + } else if (tagName.equals("short")) { + context.peek().addArgument(new ValueNode(Short.valueOf(JAXXCapture.getText(tag)))); + } else if (tagName.equals("int")) { + context.peek().addArgument(new ValueNode(Integer.valueOf(JAXXCapture.getText(tag)))); + } else if (tagName.equals("long")) { + context.peek().addArgument(new ValueNode(Long.valueOf(JAXXCapture.getText(tag)))); + } else if (tagName.equals("float")) { + context.peek().addArgument(new ValueNode(Float.valueOf(JAXXCapture.getText(tag)))); + } else if (tagName.equals("double")) { + context.peek().addArgument(new ValueNode(Double.valueOf(JAXXCapture.getText(tag)))); + } else if (tagName.equals("null")) { + context.peek().addArgument(new ValueNode(null)); + } else { + System.err.println("unsupported tag: " + tag.getTagName()); + } + } + + + private static String dataBindingEncode(String value) { + return value.replaceAll("\\{", "\\\\{").replaceAll("\\}", "\\\\}"); + } + + + public CapturedObject processObject(Element objectTag, Stack<ContextNode> context, JAXXCapture capture) { + String className = objectTag.getAttribute("class"); + if (className.length() > 0) { + CapturedObject capturedObject = createCapturedObject(className, capture); + context.push(capturedObject); + NodeList children = objectTag.getChildNodes(); + String id = objectTag.getAttribute("id"); + if (id.length() == 0 || capture.getCapturedObjects().containsKey(id)) { + id = "Auto" + ++count; + } + assert !capture.getCapturedObjects().containsKey(id); + capture.getCapturedObjects().put(id, capturedObject); + capturedObject.setProperty("id", id); + // process object's name before anything else + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + if (child.getNodeType() == Node.ELEMENT_NODE) { + Element element = (Element) child; + if (element.getTagName().equals(JAXXCompilerFinalizer.TYPE_VOID) && element.getAttribute(ATTRIBUTE_PROPERTY).equals("name")) { + evaluate(element, context, capture); + String name = capturedObject.getProperty("name"); + if (name != null && !capture.getCapturedObjects().containsKey(name)) { + capture.getCapturedObjects().put(name, capturedObject); + capturedObject.setProperty("id", name); + capturedObject.getProperties().remove("name"); + } + } + } + } + // process remaining children + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + if (child.getNodeType() == Node.ELEMENT_NODE) { + Element element = (Element) child; + if (!JAXXCompilerFinalizer.TYPE_VOID.equals(element.getTagName()) || !element.getAttribute(ATTRIBUTE_PROPERTY).equals("name")) { + evaluate(element, context, capture); + } + } + } + assert context.peek() == capturedObject; + context.pop(); + + return capturedObject; + } else { + CapturedObject result = capture.getCapturedObjects().get(objectTag.getAttribute("idref")); + if (result == null) { + throw new RuntimeException("Internal error: could not find tag with id " + objectTag.getAttribute("idref")); + } + result.setInlineable(false); // we have at least two references to it, and so can't inline it + return result; + } + } + + + private static String xmlEncode(String src) { + return src.replaceAll("'", "&").replaceAll("<", "<"); + } + + + public String getXML(CapturedObject object, JAXXCapture capture) { + StringBuffer result = new StringBuffer(); + result.append('<'); + String className = object.getClassName(); + if (className.startsWith("javax.swing.")) { + className = className.substring("javax.swing.".length()); + } + result.append(className); + Map<String, String> properties = object.getProperties(); + for (Map.Entry<String, String> e : properties.entrySet()) { + result.append(' '); + result.append(e.getKey()); + result.append("='"); + result.append(xmlEncode(e.getValue())); + result.append('\''); + } + ContextNode[] arguments = object.getArguments(); + if (arguments != null && arguments.length > 0) { + result.append(" constructorParams='"); + for (int j = 0; j < arguments.length; j++) { + if (j != 0) { + result.append(", "); + } + result.append(capture.getJavaCode(arguments[j])); + } + result.append('\''); + } + boolean tagClosed = false; + + String children = getChildXML(object, capture); + String lineSeparator = JAXXCompiler.getLineSeparator(); + if (children != null && children.length() > 0) { + if (!tagClosed) { + tagClosed = true; + result.append('>'); + result.append(lineSeparator); + } + result.append(children); + } + + String script = object.getScriptCode(); + if (script != null && script.length() > 0) { + if (!tagClosed) { + tagClosed = true; + result.append('>'); + result.append(lineSeparator); + } + result.append(" <script>"); + result.append(lineSeparator); + result.append(JavaFileGenerator.indent(script, 4, false, lineSeparator)); + result.append(lineSeparator); + result.append(" </script>"); + result.append(lineSeparator); + } + if (tagClosed) { + result.append("</"); + result.append(className); + result.append('>'); + } else { + result.append("/>"); + } + return result.toString(); + } + + + protected String getChildXML(CapturedObject object, JAXXCapture capture) { + StringBuffer result = new StringBuffer(); + CapturedObject[] children = object.getChildren(); + String lineSeparator = JAXXCompiler.getLineSeparator(); + for (CapturedObject aChildren : children) { + if (!aChildren.isInlineable()) { + result.append(JavaFileGenerator.indent(aChildren.getXML(capture), 2, false, lineSeparator)); + result.append(lineSeparator); + } + } + return result.toString(); + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,39 +1,39 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tools.jaxxcapture.handlers; - -import jaxx.compiler.tools.jaxxcapture.CapturedObject; -import jaxx.compiler.tools.jaxxcapture.JAXXCapture; - -public class TableHandler extends ObjectHandler { - - @Override - protected CapturedObject createCapturedObject(String className, JAXXCapture capture) { - CapturedObject result = new CapturedObject(this, "javax.swing.JPanel", capture); - result.setProperty("layout", "{new GridBagLayout()}"); - return result; - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tools.jaxxcapture.handlers; + +import jaxx.compiler.tools.jaxxcapture.CapturedObject; +import jaxx.compiler.tools.jaxxcapture.JAXXCapture; + +public class TableHandler extends ObjectHandler { + + @Override + protected CapturedObject createCapturedObject(String className, JAXXCapture capture) { + CapturedObject result = new CapturedObject(this, "javax.swing.JPanel", capture); + result.setProperty("layout", "{new GridBagLayout()}"); + return result; + } +} Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.CompiledObjectDecorator ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.JAXXCompilerFinalizer ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.spi.Initializer ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/main/resources/META-INF/services/jaxx.compiler.types.TypeConverter ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/binding/JavaParserUtilTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/java/JavaFieldTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/java/JavaMethodTest.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java =================================================================== --- trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,149 +1,149 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.reflect; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public class ClassDescriptorTest { - - @BeforeClass - public static void before() { - ClassDescriptorHelper.setShowLoading(true); - } - - @AfterClass - public static void after() { - ClassDescriptorHelper.setShowLoading(true); - } - - /*@Test - public void testGetClassDescriptor() throws Exception { - ClassDescriptorHelper.getClassDescriptor("jaxx.runtime.swing.navigation.tree.NavigationTreeModel.NavigationTreeNode"); - }*/ - @Test - public void testBuiltInClassName() throws ClassNotFoundException, NoSuchMethodException { - ClassDescriptor object = ClassDescriptorHelper.getClassDescriptor("java.lang.Object"); - MethodDescriptor toString = object.getMethodDescriptor("toString"); - assertEquals(toString.getName(), "toString"); - assertEquals(toString.getParameterTypes().length, 0); - - MethodDescriptor equals = object.getMethodDescriptor("equals", object); - assertEquals(equals.getName(), "equals"); - assertEquals(equals.getParameterTypes().length, 1); - assertEquals(equals.getParameterTypes()[0], object); - } - - @Test - public void testBuiltInClass() throws ClassNotFoundException, NoSuchMethodException { - ClassDescriptor object1 = ClassDescriptorHelper.getClassDescriptor("java.lang.Object"); - ClassDescriptor object2 = ClassDescriptorHelper.getClassDescriptor(Object.class); - assertEquals(object1, object2); - } - - @Test - public void testUserClassName() throws ClassNotFoundException, NoSuchMethodException { - ClassDescriptor me = ClassDescriptorHelper.getClassDescriptor(ClassDescriptorTest.class.getName(), getClass().getClassLoader()); - MethodDescriptor testUserClassName = me.getMethodDescriptor("testUserClassName"); - assertEquals(testUserClassName.getName(), "testUserClassName"); - assertEquals(testUserClassName.getParameterTypes().length, 0); - } - - @Test(expected = ClassNotFoundException.class) - public void testWrongCase() throws ClassNotFoundException { - ClassDescriptorHelper.getClassDescriptor("jaxx.junit.classdescriptortest", getClass().getClassLoader()); - } - - @Test - public void testArrays() throws ClassNotFoundException { - ClassDescriptor intArray = ClassDescriptorHelper.getClassDescriptor(int[].class); - assertNotNull(intArray); - ClassDescriptor objectArray = ClassDescriptorHelper.getClassDescriptor(Object[].class); - assertNotNull(objectArray); - } - - @Test - public void testConstructorFromClass() throws ClassNotFoundException, MalformedURLException { - String className = MyClass.class.getName(); - ClassDescriptor descriptor = ClassDescriptorHelper.getClassDescriptor(className); - ClassLoader classLoader = getClass().getClassLoader(); - assertNotNull(descriptor); - assertEquals(ClassDescriptorHelper.ResolverType.JAVA_CLASS, descriptor.getResolverType()); - MethodDescriptor[] constructorDescriptors = descriptor.getConstructorDescriptors(); - assertNotNull(constructorDescriptors); - assertEquals(2, constructorDescriptors.length); - } - - @Test - public void testConstructorFromJavaFile() throws ClassNotFoundException, MalformedURLException { - String className = MyClass.class.getName(); - ClassLoader classLoader = getClass().getClassLoader(); - - - File testSourceDir = new File(getBasedir(), "src" + File.separator + "test" + File.separator + "java"); - - ClassLoader myClassLoader = new URLClassLoader(new URL[]{testSourceDir.toURI().toURL()}, classLoader); - - URL javaFileUrl = ClassDescriptorHelper.getURL(myClassLoader, className, "java"); - assertNotNull(javaFileUrl); - - ClassDescriptor descriptorFromFile = ClassDescriptorHelper.getClassDescriptor0( - ClassDescriptorHelper.ResolverType.JAVA_FILE, - className, - javaFileUrl, - myClassLoader - ); - assertNotNull(descriptorFromFile); - MethodDescriptor[] constructorDescriptorsfromFile = descriptorFromFile.getConstructorDescriptors(); - assertNotNull(constructorDescriptorsfromFile); - assertEquals(2, constructorDescriptorsfromFile.length); - } - - - static File basedir; - - public static File getBasedir() { - if (basedir == null) { - String tmp = System.getProperty("basedir"); - if (tmp == null) { - tmp = new File("").getAbsolutePath(); - } - basedir = new File(tmp); - - } - return basedir; - } - -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.reflect; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class ClassDescriptorTest { + + @BeforeClass + public static void before() { + ClassDescriptorHelper.setShowLoading(true); + } + + @AfterClass + public static void after() { + ClassDescriptorHelper.setShowLoading(true); + } + + /*@Test + public void testGetClassDescriptor() throws Exception { + ClassDescriptorHelper.getClassDescriptor("jaxx.runtime.swing.navigation.tree.NavigationTreeModel.NavigationTreeNode"); + }*/ + @Test + public void testBuiltInClassName() throws ClassNotFoundException, NoSuchMethodException { + ClassDescriptor object = ClassDescriptorHelper.getClassDescriptor("java.lang.Object"); + MethodDescriptor toString = object.getMethodDescriptor("toString"); + assertEquals(toString.getName(), "toString"); + assertEquals(toString.getParameterTypes().length, 0); + + MethodDescriptor equals = object.getMethodDescriptor("equals", object); + assertEquals(equals.getName(), "equals"); + assertEquals(equals.getParameterTypes().length, 1); + assertEquals(equals.getParameterTypes()[0], object); + } + + @Test + public void testBuiltInClass() throws ClassNotFoundException, NoSuchMethodException { + ClassDescriptor object1 = ClassDescriptorHelper.getClassDescriptor("java.lang.Object"); + ClassDescriptor object2 = ClassDescriptorHelper.getClassDescriptor(Object.class); + assertEquals(object1, object2); + } + + @Test + public void testUserClassName() throws ClassNotFoundException, NoSuchMethodException { + ClassDescriptor me = ClassDescriptorHelper.getClassDescriptor(ClassDescriptorTest.class.getName(), getClass().getClassLoader()); + MethodDescriptor testUserClassName = me.getMethodDescriptor("testUserClassName"); + assertEquals(testUserClassName.getName(), "testUserClassName"); + assertEquals(testUserClassName.getParameterTypes().length, 0); + } + + @Test(expected = ClassNotFoundException.class) + public void testWrongCase() throws ClassNotFoundException { + ClassDescriptorHelper.getClassDescriptor("jaxx.junit.classdescriptortest", getClass().getClassLoader()); + } + + @Test + public void testArrays() throws ClassNotFoundException { + ClassDescriptor intArray = ClassDescriptorHelper.getClassDescriptor(int[].class); + assertNotNull(intArray); + ClassDescriptor objectArray = ClassDescriptorHelper.getClassDescriptor(Object[].class); + assertNotNull(objectArray); + } + + @Test + public void testConstructorFromClass() throws ClassNotFoundException, MalformedURLException { + String className = MyClass.class.getName(); + ClassDescriptor descriptor = ClassDescriptorHelper.getClassDescriptor(className); + ClassLoader classLoader = getClass().getClassLoader(); + assertNotNull(descriptor); + assertEquals(ClassDescriptorHelper.ResolverType.JAVA_CLASS, descriptor.getResolverType()); + MethodDescriptor[] constructorDescriptors = descriptor.getConstructorDescriptors(); + assertNotNull(constructorDescriptors); + assertEquals(2, constructorDescriptors.length); + } + + @Test + public void testConstructorFromJavaFile() throws ClassNotFoundException, MalformedURLException { + String className = MyClass.class.getName(); + ClassLoader classLoader = getClass().getClassLoader(); + + + File testSourceDir = new File(getBasedir(), "src" + File.separator + "test" + File.separator + "java"); + + ClassLoader myClassLoader = new URLClassLoader(new URL[]{testSourceDir.toURI().toURL()}, classLoader); + + URL javaFileUrl = ClassDescriptorHelper.getURL(myClassLoader, className, "java"); + assertNotNull(javaFileUrl); + + ClassDescriptor descriptorFromFile = ClassDescriptorHelper.getClassDescriptor0( + ClassDescriptorHelper.ResolverType.JAVA_FILE, + className, + javaFileUrl, + myClassLoader + ); + assertNotNull(descriptorFromFile); + MethodDescriptor[] constructorDescriptorsfromFile = descriptorFromFile.getConstructorDescriptors(); + assertNotNull(constructorDescriptorsfromFile); + assertEquals(2, constructorDescriptorsfromFile.length); + } + + + static File basedir; + + public static File getBasedir() { + if (basedir == null) { + String tmp = System.getProperty("basedir"); + if (tmp == null) { + tmp = new File("").getAbsolutePath(); + } + basedir = new File(tmp); + + } + return basedir; + } + +} Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyAbstractClass.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyClass.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyEnum.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyInterface.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyInterface2.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/MyInterface3.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/reflect/resolvers/ClassDescriptorResolverFromJavaFileTest.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java =================================================================== --- trunk/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,171 +1,171 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.tags; - -import jaxx.compiler.CompilerConfiguration; -import jaxx.compiler.DefaultCompilerConfiguration; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.JAXXFactory; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorHelper; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -import javax.swing.JPopupMenu; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintStream; - -public class TagManagerTest { - - protected static CompilerConfiguration configuration; - - protected JAXXCompiler compiler; - - public static class TestHandler extends DefaultObjectHandler { - - public TestHandler(ClassDescriptor beanClass) { - super(beanClass); - } - } - - @BeforeClass - public static void init() throws Exception { - if (configuration == null) { - configuration = new DefaultCompilerConfiguration(); - } -// TagManager.reset(); - JAXXFactory.setConfiguration(configuration); - JAXXFactory.initFactory(); - - } - - @Before - public void setUp() { - JAXXFactory.newDummyEngine(); - compiler = JAXXFactory.newDummyCompiler(JAXXCompiler.class.getClassLoader()); -// compiler = new JAXXCompiler(JAXXCompiler.class.getClassLoader()); - compiler.addImport("javax.swing.*"); - - } - - @Test - public void testRegisterBean() { - TagManager.registerBean(ClassDescriptorHelper.getClassDescriptor(InputStream.class), TestHandler.class); - - Assert.assertTrue(TagManager.getTagHandler(ClassDescriptorHelper.getClassDescriptor(InputStream.class)) instanceof TestHandler); - Assert.assertTrue(TagManager.getTagHandler(ClassDescriptorHelper.getClassDescriptor(FileInputStream.class)) instanceof TestHandler); - } - - @Test - public void testRegisterDefaultNamespace() { - - TagManager.registerBean(ClassDescriptorHelper.getClassDescriptor(OutputStream.class), TestHandler.class); - - TagManager.registerDefaultNamespace("OutputStream", "java.io.*"); - Assert.assertTrue("Could not find handler for OutputStream despite default namespace", TagManager.getTagHandler(null, "OutputStream", compiler) instanceof TestHandler); - - PrintStream oldErr = System.err; - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - System.setErr(new PrintStream(buffer)); - TagManager.registerDefaultNamespace("OutputStream", "java.dummy.*"); - Assert.assertNull("Found handler for OutputStream despite ambiguous default namespace", TagManager.getTagHandler(null, "OutputStream", compiler)); - System.setErr(oldErr); - Assert.assertTrue("No errors were produced with an ambiguous default namespace", buffer.size() > 0); - Assert.assertTrue(buffer.size() > 0); - } - - @Test - public void testResolveClassName() { - Assert.assertEquals("Could not resolve class name 'Object'", TagManager.resolveClassName("Object", compiler), "java.lang.Object"); - Assert.assertEquals("Could not resolve class name 'java.lang.Object'", TagManager.resolveClassName("java.lang.Object", compiler), "java.lang.Object"); - Assert.assertNull("Unexpectedly resolved class name 'java.awt.Object'", TagManager.resolveClassName("java.awt.Object", compiler)); - } - - @Test - public void testPackages() { - Assert.assertNull("Unexpectedly found handler for java.awt.JButton", TagManager.getTagHandler(null, "java.awt.JButton", compiler)); - Assert.assertNotNull("Did not find handler for JButton with default namespace of java.awt.*", TagManager.getTagHandler("java.awt.*", "JButton", compiler)); - Assert.assertNull("Unexpectedly found handler for java.awt.*:JButton", TagManager.getTagHandler("java.awt.*", "JButton", true, compiler)); - Assert.assertNotNull("Did not find handler for javax.swing.JButton", TagManager.getTagHandler(null, "javax.swing.JButton", compiler)); - Assert.assertNotNull("Did not find handler for JButton with default namespace of java.swing.*", TagManager.getTagHandler("java.swing.*", "JButton", compiler)); - Assert.assertNotNull("Did not find handler for javax.swing.*:JButton", TagManager.getTagHandler("javax.swing.*", "JButton", true, compiler)); - } - - @Test - public void testImport() throws Exception { - Assert.assertNull("Found handler for ActionListener despite no java.awt.event.* import", TagManager.getTagHandler(null, "ActionListener", compiler)); - - compiler.addImport("java.awt.event.*"); - - Assert.assertNotNull("Did not find ActionListener with java.awt.event.* import", TagManager.getTagHandler(null, "ActionListener", compiler)); - } - - @Test - public void testAmbiguousImport() throws Exception { - compiler.addImport("java.sql.*"); - Assert.assertNotNull("Did not find java.sql.Date with only java.sql.* imported", TagManager.getTagHandler(null, "Date", compiler)); - - PrintStream oldErr = System.err; - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - System.setErr(new PrintStream(buffer)); - compiler.addImport("java.util.*"); - init(); - Assert.assertNull("Still found a handler for Date with an ambiguous import", TagManager.getTagHandler(null, "Date", compiler)); - System.setErr(oldErr); - Assert.assertTrue("No errors were produced with an ambiguous import", buffer.size() > 0); - - compiler.addImport("java.util.Date"); - Assert.assertNotNull("Did not find java.util.Date with a disambiguating import", TagManager.getTagHandler(null, "Date", compiler)); - } - - @Test - public void testInnerClass() { - TagHandler handler = TagManager.getTagHandler(null, "JPopupMenu.Separator", compiler); - Assert.assertTrue("Unable to resolve tag <JPopupMenu.Separator>", handler instanceof DefaultComponentHandler); - Assert.assertTrue(((DefaultComponentHandler) handler).getBeanClass().getName().equals(JPopupMenu.Separator.class.getName())); - - handler = TagManager.getTagHandler(null, "javax.swing.JPopupMenu.Separator", compiler); - Assert.assertTrue("Unable to resolve tag <javax.swing.JPopupMenu.Separator>", handler instanceof DefaultComponentHandler); - Assert.assertTrue(((DefaultComponentHandler) handler).getBeanClass().getName().equals(JPopupMenu.Separator.class.getName())); - } - - @Test - public void testWrongCase() { - Assert.assertNull("Unexpectedly found handler for 'object'", TagManager.getTagHandler(null, "object", compiler)); - Assert.assertNull("Unexpectedly found handler for 'tagmanagertest'", TagManager.getTagHandler(null, "tagmanagertest", compiler)); - } - - @Test - public void testAliasing() { - Assert.assertEquals("ButtonGroup is not aliased to jaxx.runtime.swing.JAXXButtonGroup", "jaxx.runtime.swing.JAXXButtonGroup", TagManager.resolveClassName("ButtonGroup", compiler)); - Assert.assertEquals("javax.swing.ButtonGroup is not aliased to jaxx.runtime.swing.JAXXButtonGroup", "jaxx.runtime.swing.JAXXButtonGroup", TagManager.resolveClassName("javax.swing.ButtonGroup", compiler)); - } -} +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.tags; + +import jaxx.compiler.CompilerConfiguration; +import jaxx.compiler.DefaultCompilerConfiguration; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.JAXXFactory; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorHelper; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import javax.swing.JPopupMenu; +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintStream; + +public class TagManagerTest { + + protected static CompilerConfiguration configuration; + + protected JAXXCompiler compiler; + + public static class TestHandler extends DefaultObjectHandler { + + public TestHandler(ClassDescriptor beanClass) { + super(beanClass); + } + } + + @BeforeClass + public static void init() throws Exception { + if (configuration == null) { + configuration = new DefaultCompilerConfiguration(); + } +// TagManager.reset(); + JAXXFactory.setConfiguration(configuration); + JAXXFactory.initFactory(); + + } + + @Before + public void setUp() { + JAXXFactory.newDummyEngine(); + compiler = JAXXFactory.newDummyCompiler(JAXXCompiler.class.getClassLoader()); +// compiler = new JAXXCompiler(JAXXCompiler.class.getClassLoader()); + compiler.addImport("javax.swing.*"); + + } + + @Test + public void testRegisterBean() { + TagManager.registerBean(ClassDescriptorHelper.getClassDescriptor(InputStream.class), TestHandler.class); + + Assert.assertTrue(TagManager.getTagHandler(ClassDescriptorHelper.getClassDescriptor(InputStream.class)) instanceof TestHandler); + Assert.assertTrue(TagManager.getTagHandler(ClassDescriptorHelper.getClassDescriptor(FileInputStream.class)) instanceof TestHandler); + } + + @Test + public void testRegisterDefaultNamespace() { + + TagManager.registerBean(ClassDescriptorHelper.getClassDescriptor(OutputStream.class), TestHandler.class); + + TagManager.registerDefaultNamespace("OutputStream", "java.io.*"); + Assert.assertTrue("Could not find handler for OutputStream despite default namespace", TagManager.getTagHandler(null, "OutputStream", compiler) instanceof TestHandler); + + PrintStream oldErr = System.err; + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + System.setErr(new PrintStream(buffer)); + TagManager.registerDefaultNamespace("OutputStream", "java.dummy.*"); + Assert.assertNull("Found handler for OutputStream despite ambiguous default namespace", TagManager.getTagHandler(null, "OutputStream", compiler)); + System.setErr(oldErr); + Assert.assertTrue("No errors were produced with an ambiguous default namespace", buffer.size() > 0); + Assert.assertTrue(buffer.size() > 0); + } + + @Test + public void testResolveClassName() { + Assert.assertEquals("Could not resolve class name 'Object'", TagManager.resolveClassName("Object", compiler), "java.lang.Object"); + Assert.assertEquals("Could not resolve class name 'java.lang.Object'", TagManager.resolveClassName("java.lang.Object", compiler), "java.lang.Object"); + Assert.assertNull("Unexpectedly resolved class name 'java.awt.Object'", TagManager.resolveClassName("java.awt.Object", compiler)); + } + + @Test + public void testPackages() { + Assert.assertNull("Unexpectedly found handler for java.awt.JButton", TagManager.getTagHandler(null, "java.awt.JButton", compiler)); + Assert.assertNotNull("Did not find handler for JButton with default namespace of java.awt.*", TagManager.getTagHandler("java.awt.*", "JButton", compiler)); + Assert.assertNull("Unexpectedly found handler for java.awt.*:JButton", TagManager.getTagHandler("java.awt.*", "JButton", true, compiler)); + Assert.assertNotNull("Did not find handler for javax.swing.JButton", TagManager.getTagHandler(null, "javax.swing.JButton", compiler)); + Assert.assertNotNull("Did not find handler for JButton with default namespace of java.swing.*", TagManager.getTagHandler("java.swing.*", "JButton", compiler)); + Assert.assertNotNull("Did not find handler for javax.swing.*:JButton", TagManager.getTagHandler("javax.swing.*", "JButton", true, compiler)); + } + + @Test + public void testImport() throws Exception { + Assert.assertNull("Found handler for ActionListener despite no java.awt.event.* import", TagManager.getTagHandler(null, "ActionListener", compiler)); + + compiler.addImport("java.awt.event.*"); + + Assert.assertNotNull("Did not find ActionListener with java.awt.event.* import", TagManager.getTagHandler(null, "ActionListener", compiler)); + } + + @Test + public void testAmbiguousImport() throws Exception { + compiler.addImport("java.sql.*"); + Assert.assertNotNull("Did not find java.sql.Date with only java.sql.* imported", TagManager.getTagHandler(null, "Date", compiler)); + + PrintStream oldErr = System.err; + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + System.setErr(new PrintStream(buffer)); + compiler.addImport("java.util.*"); + init(); + Assert.assertNull("Still found a handler for Date with an ambiguous import", TagManager.getTagHandler(null, "Date", compiler)); + System.setErr(oldErr); + Assert.assertTrue("No errors were produced with an ambiguous import", buffer.size() > 0); + + compiler.addImport("java.util.Date"); + Assert.assertNotNull("Did not find java.util.Date with a disambiguating import", TagManager.getTagHandler(null, "Date", compiler)); + } + + @Test + public void testInnerClass() { + TagHandler handler = TagManager.getTagHandler(null, "JPopupMenu.Separator", compiler); + Assert.assertTrue("Unable to resolve tag <JPopupMenu.Separator>", handler instanceof DefaultComponentHandler); + Assert.assertTrue(((DefaultComponentHandler) handler).getBeanClass().getName().equals(JPopupMenu.Separator.class.getName())); + + handler = TagManager.getTagHandler(null, "javax.swing.JPopupMenu.Separator", compiler); + Assert.assertTrue("Unable to resolve tag <javax.swing.JPopupMenu.Separator>", handler instanceof DefaultComponentHandler); + Assert.assertTrue(((DefaultComponentHandler) handler).getBeanClass().getName().equals(JPopupMenu.Separator.class.getName())); + } + + @Test + public void testWrongCase() { + Assert.assertNull("Unexpectedly found handler for 'object'", TagManager.getTagHandler(null, "object", compiler)); + Assert.assertNull("Unexpectedly found handler for 'tagmanagertest'", TagManager.getTagHandler(null, "tagmanagertest", compiler)); + } + + @Test + public void testAliasing() { + Assert.assertEquals("ButtonGroup is not aliased to jaxx.runtime.swing.JAXXButtonGroup", "jaxx.runtime.swing.JAXXButtonGroup", TagManager.resolveClassName("ButtonGroup", compiler)); + Assert.assertEquals("javax.swing.ButtonGroup is not aliased to jaxx.runtime.swing.JAXXButtonGroup", "jaxx.runtime.swing.JAXXButtonGroup", TagManager.resolveClassName("javax.swing.ButtonGroup", compiler)); + } +} Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java =================================================================== --- trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,75 +1,75 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.types; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import java.awt.*; - -public class ColorConverterTest { - - ColorConverter converter; - - @Before - public void setUp() { - converter = new ColorConverter(); - } - - @Test - public void testHexValue() { - Color value = (Color) converter.convertFromString("#3000FF", Color.class); - Assert.assertEquals(value, new Color(48, 0, 255)); - } - - @Test - public void testUpperCaseConstant() { - Color value = (Color) converter.convertFromString("RED", Color.class); - Assert.assertEquals(value, Color.RED); - } - - @Test - public void testLowerCaseConstant() { - Color value = (Color) converter.convertFromString("blue", Color.class); - Assert.assertEquals(value, Color.blue); - } - - @Test(expected = IllegalArgumentException.class) - public void testMissingHash() { - converter.convertFromString("ABCDEF", Color.class); - } - - @Test(expected = IllegalArgumentException.class) - public void testInvalidNumber() { - converter.convertFromString("#ABCDEG", Color.class); - } - - @Test(expected = IllegalArgumentException.class) - public void testInvalidConstant() { - converter.convertFromString("rEd", Color.class); - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.types; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.awt.*; + +public class ColorConverterTest { + + ColorConverter converter; + + @Before + public void setUp() { + converter = new ColorConverter(); + } + + @Test + public void testHexValue() { + Color value = (Color) converter.convertFromString("#3000FF", Color.class); + Assert.assertEquals(value, new Color(48, 0, 255)); + } + + @Test + public void testUpperCaseConstant() { + Color value = (Color) converter.convertFromString("RED", Color.class); + Assert.assertEquals(value, Color.RED); + } + + @Test + public void testLowerCaseConstant() { + Color value = (Color) converter.convertFromString("blue", Color.class); + Assert.assertEquals(value, Color.blue); + } + + @Test(expected = IllegalArgumentException.class) + public void testMissingHash() { + converter.convertFromString("ABCDEF", Color.class); + } + + @Test(expected = IllegalArgumentException.class) + public void testInvalidNumber() { + converter.convertFromString("#ABCDEG", Color.class); + } + + @Test(expected = IllegalArgumentException.class) + public void testInvalidConstant() { + converter.convertFromString("rEd", Color.class); + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java =================================================================== --- trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,74 +1,74 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.types; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import java.awt.Insets; - -public class InsetsConverterTest { - - InsetsConverter converter; - - @Before - public void setUp() { - converter = new InsetsConverter(); - } - - @Test - public void testSingleValue() { - Insets value = (Insets) converter.convertFromString("3", Insets.class); - Assert.assertEquals(value, new Insets(3, 3, 3, 3)); - } - - @Test - public void testFourValues() { - Insets value = (Insets) converter.convertFromString("3, 0, 12, 1000000", Insets.class); - Assert.assertEquals(value, new Insets(3, 0, 12, 1000000)); - } - - @Test(expected = IllegalArgumentException.class) - public void testTwoValues() { - converter.convertFromString("0, 4", Insets.class); - } - - @Test(expected = IllegalArgumentException.class) - public void testThreeValues() { - converter.convertFromString("0, 4, 9", Insets.class); - } - - @Test(expected = IllegalArgumentException.class) - public void testInvalidNumber() { - converter.convertFromString("0, 4, 9, A", Insets.class); - } - - @Test(expected = IllegalArgumentException.class) - public void testBadFormatting() { - converter.convertFromString("0 - 1 - 2 - 3", Insets.class); - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.types; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.awt.Insets; + +public class InsetsConverterTest { + + InsetsConverter converter; + + @Before + public void setUp() { + converter = new InsetsConverter(); + } + + @Test + public void testSingleValue() { + Insets value = (Insets) converter.convertFromString("3", Insets.class); + Assert.assertEquals(value, new Insets(3, 3, 3, 3)); + } + + @Test + public void testFourValues() { + Insets value = (Insets) converter.convertFromString("3, 0, 12, 1000000", Insets.class); + Assert.assertEquals(value, new Insets(3, 0, 12, 1000000)); + } + + @Test(expected = IllegalArgumentException.class) + public void testTwoValues() { + converter.convertFromString("0, 4", Insets.class); + } + + @Test(expected = IllegalArgumentException.class) + public void testThreeValues() { + converter.convertFromString("0, 4, 9", Insets.class); + } + + @Test(expected = IllegalArgumentException.class) + public void testInvalidNumber() { + converter.convertFromString("0, 4, 9, A", Insets.class); + } + + @Test(expected = IllegalArgumentException.class) + public void testBadFormatting() { + converter.convertFromString("0 - 1 - 2 - 3", Insets.class); + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java =================================================================== --- trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,137 +1,137 @@ -/* - * #%L - * JAXX :: Compiler - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package jaxx.compiler.types; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -public class PrimitiveConverterTest { - - PrimitiveConverter converter; - - - @Before - public void setUp() { - converter = new PrimitiveConverter(); - } - - @Test - public void testBoolean() { - Boolean value = (Boolean) converter.convertFromString("true", Boolean.class); - Assert.assertTrue(value); - - value = (Boolean) converter.convertFromString("false", Boolean.class); - Assert.assertFalse(value); - - } - - @Test(expected = IllegalArgumentException.class) - public void testBoolean2() { - converter.convertFromString("yes", Boolean.class); - } - - @Test - public void testByte() { - Byte value = (Byte) converter.convertFromString(String.valueOf(Byte.MAX_VALUE), Byte.class); - Assert.assertEquals(value.byteValue(), Byte.MAX_VALUE); - - } - - @Test(expected = IllegalArgumentException.class) - public void testByte2() { - - converter.convertFromString(String.valueOf(1 + Byte.MAX_VALUE), Byte.class); - } - - @Test - public void testShort() { - Short value = (Short) converter.convertFromString(String.valueOf(Short.MAX_VALUE), Short.class); - Assert.assertEquals(value.shortValue(), Short.MAX_VALUE); - - - } - - @Test(expected = IllegalArgumentException.class) - public void testShort2() { - - converter.convertFromString(String.valueOf(1 + Short.MAX_VALUE), Short.class); - } - - @Test - public void testInteger() { - Integer value = (Integer) converter.convertFromString(String.valueOf(Integer.MAX_VALUE), Integer.class); - Assert.assertEquals(value.intValue(), Integer.MAX_VALUE); - } - - @Test(expected = IllegalArgumentException.class) - public void testInteger2() { - - converter.convertFromString(String.valueOf(1L + Integer.MAX_VALUE), Integer.class); - } - - @Test - public void testLong() { - Long value = (Long) converter.convertFromString(String.valueOf(Long.MAX_VALUE), Long.class); - Assert.assertEquals(value.longValue(), Long.MAX_VALUE); - } - - @Test - public void testFloat() { - Float value = (Float) converter.convertFromString("3.1415", Float.class); - Assert.assertTrue(value == 3.1415f); - } - - @Test - public void testDouble() { - Double value = (Double) converter.convertFromString("3.1415", Double.class); - Assert.assertTrue(value == 3.1415); - } - - @Test - public void testCharacter() { - Character value = (Character) converter.convertFromString("A", Character.class); - Assert.assertEquals(value.charValue(), 'A'); - } - - @Test(expected = IllegalArgumentException.class) - public void testCharacter2() { - - converter.convertFromString("12", Character.class); - - } - - @Test(expected = IllegalArgumentException.class) - public void testCharacter3() { - converter.convertFromString("", Character.class); - } - - @Test - public void testString() { - String value = (String) converter.convertFromString("Test", String.class); - Assert.assertEquals(value, "Test"); - } +/* + * #%L + * JAXX :: Compiler + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package jaxx.compiler.types; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class PrimitiveConverterTest { + + PrimitiveConverter converter; + + + @Before + public void setUp() { + converter = new PrimitiveConverter(); + } + + @Test + public void testBoolean() { + Boolean value = (Boolean) converter.convertFromString("true", Boolean.class); + Assert.assertTrue(value); + + value = (Boolean) converter.convertFromString("false", Boolean.class); + Assert.assertFalse(value); + + } + + @Test(expected = IllegalArgumentException.class) + public void testBoolean2() { + converter.convertFromString("yes", Boolean.class); + } + + @Test + public void testByte() { + Byte value = (Byte) converter.convertFromString(String.valueOf(Byte.MAX_VALUE), Byte.class); + Assert.assertEquals(value.byteValue(), Byte.MAX_VALUE); + + } + + @Test(expected = IllegalArgumentException.class) + public void testByte2() { + + converter.convertFromString(String.valueOf(1 + Byte.MAX_VALUE), Byte.class); + } + + @Test + public void testShort() { + Short value = (Short) converter.convertFromString(String.valueOf(Short.MAX_VALUE), Short.class); + Assert.assertEquals(value.shortValue(), Short.MAX_VALUE); + + + } + + @Test(expected = IllegalArgumentException.class) + public void testShort2() { + + converter.convertFromString(String.valueOf(1 + Short.MAX_VALUE), Short.class); + } + + @Test + public void testInteger() { + Integer value = (Integer) converter.convertFromString(String.valueOf(Integer.MAX_VALUE), Integer.class); + Assert.assertEquals(value.intValue(), Integer.MAX_VALUE); + } + + @Test(expected = IllegalArgumentException.class) + public void testInteger2() { + + converter.convertFromString(String.valueOf(1L + Integer.MAX_VALUE), Integer.class); + } + + @Test + public void testLong() { + Long value = (Long) converter.convertFromString(String.valueOf(Long.MAX_VALUE), Long.class); + Assert.assertEquals(value.longValue(), Long.MAX_VALUE); + } + + @Test + public void testFloat() { + Float value = (Float) converter.convertFromString("3.1415", Float.class); + Assert.assertTrue(value == 3.1415f); + } + + @Test + public void testDouble() { + Double value = (Double) converter.convertFromString("3.1415", Double.class); + Assert.assertTrue(value == 3.1415); + } + + @Test + public void testCharacter() { + Character value = (Character) converter.convertFromString("A", Character.class); + Assert.assertEquals(value.charValue(), 'A'); + } + + @Test(expected = IllegalArgumentException.class) + public void testCharacter2() { + + converter.convertFromString("12", Character.class); + + } + + @Test(expected = IllegalArgumentException.class) + public void testCharacter3() { + converter.convertFromString("", Character.class); + } + + @Test + public void testString() { + String value = (String) converter.convertFromString("Test", String.class); + Assert.assertEquals(value, "Test"); + } } \ No newline at end of file Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/java/jaxx/compiler/types/TypeManagerTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-compiler/src/test/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/filters/jaxx-demo.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSourcesHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTab.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemoModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/HidorButtonDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx 2011-02-19 20:15:00 UTC (rev 2225) @@ -22,7 +22,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --> - + <jaxx.demo.DemoPanel> <Table constraints='BorderLayout.CENTER'> <row> Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/AbstractDemoBean.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/DemoDecoratorProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Identity.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Model.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BindingExtremeDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DefaultDemoUIModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/DemoUIModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoDataProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/AbstractContentUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorContentUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorsContentUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MovieContentUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MoviesContentUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/ActorsTreeNodeLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/MoviesTreeNodeLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeNode.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/ActorsTreeTableNodeLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/MoviesTreeTableNodeLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableNode.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,29 +1,29 @@ -/* - * #%L - * JAXX :: Demo - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -JSlider { - paintTicks: true; - minorTickSpacing: 5; - majorTickSpacing: 10; -} +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +JSlider { + paintTicks: true; + minorTickSpacing: 5; + majorTickSpacing: 10; +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.css 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.css 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,76 +1,76 @@ -/* - * #%L - * JAXX :: Demo - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -#table { - border: {BorderFactory.createEmptyBorder(4, 4, 4, 4)}; - font-face:"Trebuchet MS"; -} - -#display { - background: #BCE5AD; - opaque: true; - horizontalAlignment: right; - border: {BorderFactory.createBevelBorder(BevelBorder.LOWERED)}; - font-size:22; - font-weight: bold; -} - -#display:{object.getText().startsWith( "-" )} { -foreground: red; -} - -JButton { - font-size: 18; - width: 80; - height: 35; -} - -JButton.digit { - foreground: blue; -} - -JButton#dot { - font-size: 20; -} - -JButton.operator { - font-size: 16; - foreground: #009900; -} - -JButton.clear { - foreground: red; -} - -/*JButton:mouseover { - font-weight: bold; -}*/ - -JButton.operator:mouseover { - font-weight: bold; -} - -JButton.operator:mouseover { - font-weight: normal; +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +#table { + border: {BorderFactory.createEmptyBorder(4, 4, 4, 4)}; + font-face:"Trebuchet MS"; +} + +#display { + background: #BCE5AD; + opaque: true; + horizontalAlignment: right; + border: {BorderFactory.createBevelBorder(BevelBorder.LOWERED)}; + font-size:22; + font-weight: bold; +} + +#display:{object.getText().startsWith( "-" )} { +foreground: red; +} + +JButton { + font-size: 18; + width: 80; + height: 35; +} + +JButton.digit { + foreground: blue; +} + +JButton#dot { + font-size: 20; +} + +JButton.operator { + font-size: 16; + foreground: #009900; +} + +JButton.clear { + foreground: red; +} + +/*JButton:mouseover { + font-weight: bold; +}*/ + +JButton.operator:mouseover { + font-weight: bold; +} + +JButton.operator:mouseover { + font-weight: normal; } \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.css 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.css 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,58 +1,58 @@ -/* - * #%L - * JAXX :: Demo - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -JSlider { - paintTicks: true; -} - -JSlider.color { - minorTickSpacing: 10; - majorTickSpacing: 50; - border: {BorderFactory.createEmptyBorder(1, 1, 1, 1)}; -} - -JSlider.color:focused { - border: {BorderFactory.createLineBorder(Color.BLACK, 1)}; -} - -JSlider#red:focused { - background: #E7ADAD; -} - -JSlider#green:focused { - background: #B2E7AD; -} - -JSlider#blue:focused { - background: #ADB2E7; -} - -JSlider#dummySize { - minorTickSpacing: 2; - majorTickSpacing: 6; -} - -JRadioButton { - enabled: {backgroundCheckbox.isSelected()}; +/* + * #%L + * JAXX :: Demo + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +JSlider { + paintTicks: true; +} + +JSlider.color { + minorTickSpacing: 10; + majorTickSpacing: 50; + border: {BorderFactory.createEmptyBorder(1, 1, 1, 1)}; +} + +JSlider.color:focused { + border: {BorderFactory.createLineBorder(Color.BLACK, 1)}; +} + +JSlider#red:focused { + background: #E7ADAD; +} + +JSlider#green:focused { + background: #B2E7AD; +} + +JSlider#blue:focused { + background: #ADB2E7; +} + +JSlider#dummySize { + minorTickSpacing: 2; + majorTickSpacing: 6; +} + +JRadioButton { + enabled: {backgroundCheckbox.isSelected()}; } \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNode.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoNodeLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoTreeHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-error-validation.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-info-validation.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Identity-warning-validation.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-error-validation.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-info-validation.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/entities/Model-warning-validation.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/main/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXBinding.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/JAXXUtil.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/binding/DefaultJAXXBinding.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/binding/SimpleJAXXObjectBinding.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java =================================================================== --- trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,205 +1,205 @@ -/* - * #%L - * JAXX :: Runtime - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package jaxx.runtime.css; - -import jaxx.runtime.JAXXObject; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; - -public class Pseudoclasses { - - public static final String NO_PSEUDOCLASS = "no pseudoclass"; - - private static Map<Object, Map<String, List<PropertyValue>>> properties = new WeakHashMap<Object, Map<String, List<PropertyValue>>>(); - - private static class PropertyValue implements Comparable<PropertyValue> { - - private Object value; - - private int id; - - public PropertyValue(Object value, int id) { - this.value = value; - this.id = id; - } - - public Object getValue() { - return value; - } - - public int getId() { - return id; - } - - @Override - public int compareTo(PropertyValue o) { - return getId() - o.getId(); - } - - @Override - public boolean equals(Object o) { - if (!(o instanceof PropertyValue)) { - return false; - } - PropertyValue that = (PropertyValue) o; - if (that.getId() != getId()) { - return false; - } - if (that.getValue() == null) { - return getValue() == null; - } - return that.getValue().equals(getValue()); - } - - @Override - public int hashCode() { - return (value != null ? value.hashCode() : 0) ^ id; - } - - @Override - public String toString() { - return "PropertyValue[" + value + ", " + id + "]"; - } - } - - private static List<PropertyValue> getPropertyList(Object object, String property) { - Map<String, List<PropertyValue>> propertyMap = properties.get(object); - if (propertyMap == null) { - propertyMap = new HashMap<String, List<PropertyValue>>(); - properties.put(object, propertyMap); - } - - List<PropertyValue> propertyList = propertyMap.get(property); - if (propertyList == null) { - propertyList = new ArrayList<PropertyValue>(); - propertyMap.put(property, propertyList); - } - - return propertyList; - } - - public static boolean isPropertyApplied(Object object, String property, int id) { - for (PropertyValue aPropertyList : getPropertyList(object, property)) { - if (aPropertyList.getId() == id) { - return true; - } - } - return false; - } - - public static void propertyApplied(Object object, String property, Object value, int id) { - List<PropertyValue> propertyList = getPropertyList(object, property); - propertyList.add(new PropertyValue(value, id)); - Collections.sort(propertyList); - } - - public static void propertyRemoved(Object object, String property, Object value, int id) { - List<PropertyValue> propertyList = getPropertyList(object, property); - propertyList.remove(new PropertyValue(value, id)); - } - - public static Object getCurrentValue(Object object, String property) { - List<PropertyValue> propertyList = getPropertyList(object, property); - if (propertyList.size() > 0) { - return propertyList.get(propertyList.size() - 1).getValue(); - } - return NO_PSEUDOCLASS; - } - - public static Object applyProperty(JAXXObject parent, Object object, String property, Object newValue, Object currentValue, int id) { - if (!isPropertyApplied(object, property, id)) { - Object value = getCurrentValue(object, property); - if (value == NO_PSEUDOCLASS) { - propertyApplied(object, property, wrap(currentValue), -1); - } - propertyApplied(object, property, wrap(newValue), id); - value = getCurrentValue(object, property); - if (value instanceof DataBinding) { - parent.applyDataBinding(((DataBinding) value).getId()); - } - return value; - } else { - return currentValue; - } - } - - public static Object removeProperty(JAXXObject parent, Object object, String property, Object oldValue, Object currentValue, int id) { - if (isPropertyApplied(object, property, id)) { - Object value = getCurrentValue(object, property); - if (value == NO_PSEUDOCLASS) { - throw new IllegalStateException("found NO_PSEUDOCLASS value for a property which does not have a default value"); - } - if (value instanceof DataBinding) { - parent.removeDataBinding(((DataBinding) value).getId()); - } - propertyRemoved(object, property, wrap(oldValue), id); - value = getCurrentValue(object, property); - return value; - } else { - return currentValue; - } - } - - public static Object wrap(boolean value) { - return value; - } - - public static Object wrap(byte value) { - return value; - } - - public static Object wrap(short value) { - return value; - } - - public static Object wrap(int value) { - return value; - } - - public static Object wrap(long value) { - return value; - } - - public static Object wrap(float value) { - return value; - } - - public static Object wrap(double value) { - return value; - } - - public static Object wrap(char value) { - return value; - } - - public static Object wrap(Object value) { - return value; - } -} +/* + * #%L + * JAXX :: Runtime + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package jaxx.runtime.css; + +import jaxx.runtime.JAXXObject; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.WeakHashMap; + +public class Pseudoclasses { + + public static final String NO_PSEUDOCLASS = "no pseudoclass"; + + private static Map<Object, Map<String, List<PropertyValue>>> properties = new WeakHashMap<Object, Map<String, List<PropertyValue>>>(); + + private static class PropertyValue implements Comparable<PropertyValue> { + + private Object value; + + private int id; + + public PropertyValue(Object value, int id) { + this.value = value; + this.id = id; + } + + public Object getValue() { + return value; + } + + public int getId() { + return id; + } + + @Override + public int compareTo(PropertyValue o) { + return getId() - o.getId(); + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof PropertyValue)) { + return false; + } + PropertyValue that = (PropertyValue) o; + if (that.getId() != getId()) { + return false; + } + if (that.getValue() == null) { + return getValue() == null; + } + return that.getValue().equals(getValue()); + } + + @Override + public int hashCode() { + return (value != null ? value.hashCode() : 0) ^ id; + } + + @Override + public String toString() { + return "PropertyValue[" + value + ", " + id + "]"; + } + } + + private static List<PropertyValue> getPropertyList(Object object, String property) { + Map<String, List<PropertyValue>> propertyMap = properties.get(object); + if (propertyMap == null) { + propertyMap = new HashMap<String, List<PropertyValue>>(); + properties.put(object, propertyMap); + } + + List<PropertyValue> propertyList = propertyMap.get(property); + if (propertyList == null) { + propertyList = new ArrayList<PropertyValue>(); + propertyMap.put(property, propertyList); + } + + return propertyList; + } + + public static boolean isPropertyApplied(Object object, String property, int id) { + for (PropertyValue aPropertyList : getPropertyList(object, property)) { + if (aPropertyList.getId() == id) { + return true; + } + } + return false; + } + + public static void propertyApplied(Object object, String property, Object value, int id) { + List<PropertyValue> propertyList = getPropertyList(object, property); + propertyList.add(new PropertyValue(value, id)); + Collections.sort(propertyList); + } + + public static void propertyRemoved(Object object, String property, Object value, int id) { + List<PropertyValue> propertyList = getPropertyList(object, property); + propertyList.remove(new PropertyValue(value, id)); + } + + public static Object getCurrentValue(Object object, String property) { + List<PropertyValue> propertyList = getPropertyList(object, property); + if (propertyList.size() > 0) { + return propertyList.get(propertyList.size() - 1).getValue(); + } + return NO_PSEUDOCLASS; + } + + public static Object applyProperty(JAXXObject parent, Object object, String property, Object newValue, Object currentValue, int id) { + if (!isPropertyApplied(object, property, id)) { + Object value = getCurrentValue(object, property); + if (value == NO_PSEUDOCLASS) { + propertyApplied(object, property, wrap(currentValue), -1); + } + propertyApplied(object, property, wrap(newValue), id); + value = getCurrentValue(object, property); + if (value instanceof DataBinding) { + parent.applyDataBinding(((DataBinding) value).getId()); + } + return value; + } else { + return currentValue; + } + } + + public static Object removeProperty(JAXXObject parent, Object object, String property, Object oldValue, Object currentValue, int id) { + if (isPropertyApplied(object, property, id)) { + Object value = getCurrentValue(object, property); + if (value == NO_PSEUDOCLASS) { + throw new IllegalStateException("found NO_PSEUDOCLASS value for a property which does not have a default value"); + } + if (value instanceof DataBinding) { + parent.removeDataBinding(((DataBinding) value).getId()); + } + propertyRemoved(object, property, wrap(oldValue), id); + value = getCurrentValue(object, property); + return value; + } else { + return currentValue; + } + } + + public static Object wrap(boolean value) { + return value; + } + + public static Object wrap(byte value) { + return value; + } + + public static Object wrap(short value) { + return value; + } + + public static Object wrap(int value) { + return value; + } + + public static Object wrap(long value) { + return value; + } + + public static Object wrap(float value) { + return value; + } + + public static Object wrap(double value) { + return value; + } + + public static Object wrap(char value) { + return value; + } + + public static Object wrap(Object value) { + return value; + } +} Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MapPropertyHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java =================================================================== --- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,76 +1,76 @@ -/* - * #%L - * JAXX :: Runtime - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package jaxx.runtime.swing; - -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.beans.SimpleBeanInfo; - -public class HBoxBeanInfo extends SimpleBeanInfo { - - @Override - public BeanInfo[] getAdditionalBeanInfo() { - try { - return new BeanInfo[]{Introspector.getBeanInfo(JPanel.class)}; - } catch (IntrospectionException e) { - throw new RuntimeException(e); - } - } - - @Override - public PropertyDescriptor[] getPropertyDescriptors() { - try { - PropertyDescriptor spacing = new PropertyDescriptor("spacing", HBox.class); - spacing.setBound(true); - - PropertyDescriptor margin = new PropertyDescriptor("margin", HBox.class); - margin.setBound(true); - - PropertyDescriptor horizontalAlignment = new PropertyDescriptor("horizontalAlignment", HBox.class); - horizontalAlignment.setBound(true); - horizontalAlignment.setValue("enumerationValues", new Object[]{ - "left", SwingConstants.LEFT, "SwingConstants.LEFT", - "center", SwingConstants.CENTER, "SwingConstants.CENTER", - "right", SwingConstants.RIGHT, "SwingConstants.RIGHT" - }); - - PropertyDescriptor verticalAlignment = new PropertyDescriptor("verticalAlignment", HBox.class); - verticalAlignment.setBound(true); - verticalAlignment.setValue("enumerationValues", new Object[]{ - "top", SwingConstants.TOP, "SwingConstants.TOP", - "middle", SwingConstants.CENTER, "SwingConstants.CENTER", - "bottom", SwingConstants.BOTTOM, "SwingConstants.BOTTOM" - }); - - return new PropertyDescriptor[]{spacing, margin, horizontalAlignment, verticalAlignment}; - } catch (IntrospectionException e) { - throw new RuntimeException(e); - } - } -} +/* + * #%L + * JAXX :: Runtime + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package jaxx.runtime.swing; + +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.beans.SimpleBeanInfo; + +public class HBoxBeanInfo extends SimpleBeanInfo { + + @Override + public BeanInfo[] getAdditionalBeanInfo() { + try { + return new BeanInfo[]{Introspector.getBeanInfo(JPanel.class)}; + } catch (IntrospectionException e) { + throw new RuntimeException(e); + } + } + + @Override + public PropertyDescriptor[] getPropertyDescriptors() { + try { + PropertyDescriptor spacing = new PropertyDescriptor("spacing", HBox.class); + spacing.setBound(true); + + PropertyDescriptor margin = new PropertyDescriptor("margin", HBox.class); + margin.setBound(true); + + PropertyDescriptor horizontalAlignment = new PropertyDescriptor("horizontalAlignment", HBox.class); + horizontalAlignment.setBound(true); + horizontalAlignment.setValue("enumerationValues", new Object[]{ + "left", SwingConstants.LEFT, "SwingConstants.LEFT", + "center", SwingConstants.CENTER, "SwingConstants.CENTER", + "right", SwingConstants.RIGHT, "SwingConstants.RIGHT" + }); + + PropertyDescriptor verticalAlignment = new PropertyDescriptor("verticalAlignment", HBox.class); + verticalAlignment.setBound(true); + verticalAlignment.setValue("enumerationValues", new Object[]{ + "top", SwingConstants.TOP, "SwingConstants.TOP", + "middle", SwingConstants.CENTER, "SwingConstants.CENTER", + "bottom", SwingConstants.BOTTOM, "SwingConstants.BOTTOM" + }); + + return new PropertyDescriptor[]{spacing, margin, horizontalAlignment, verticalAlignment}; + } catch (IntrospectionException e) { + throw new RuntimeException(e); + } + } +} Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java =================================================================== --- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,76 +1,76 @@ -/* - * #%L - * JAXX :: Runtime - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package jaxx.runtime.swing; - -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.beans.SimpleBeanInfo; - -public class VBoxBeanInfo extends SimpleBeanInfo { - - @Override - public BeanInfo[] getAdditionalBeanInfo() { - try { - return new BeanInfo[]{Introspector.getBeanInfo(JPanel.class)}; - } catch (IntrospectionException e) { - throw new RuntimeException(e); - } - } - - @Override - public PropertyDescriptor[] getPropertyDescriptors() { - try { - PropertyDescriptor spacing = new PropertyDescriptor("spacing", VBox.class); - spacing.setBound(true); - - PropertyDescriptor margin = new PropertyDescriptor("margin", VBox.class); - margin.setBound(true); - - PropertyDescriptor horizontalAlignment = new PropertyDescriptor("horizontalAlignment", VBox.class); - horizontalAlignment.setBound(true); - horizontalAlignment.setValue("enumerationValues", new Object[]{ - "left", SwingConstants.LEFT, "SwingConstants.LEFT", - "center", SwingConstants.CENTER, "SwingConstants.CENTER", - "right", SwingConstants.RIGHT, "SwingConstants.RIGHT" - }); - - PropertyDescriptor verticalAlignment = new PropertyDescriptor("verticalAlignment", VBox.class); - verticalAlignment.setBound(true); - verticalAlignment.setValue("enumerationValues", new Object[]{ - "top", SwingConstants.TOP, "SwingConstants.TOP", - "middle", SwingConstants.CENTER, "SwingConstants.CENTER", - "bottom", SwingConstants.BOTTOM, "SwingConstants.BOTTOM" - }); - - return new PropertyDescriptor[]{spacing, margin, horizontalAlignment, verticalAlignment}; - } catch (IntrospectionException e) { - throw new RuntimeException(e); - } - } -} +/* + * #%L + * JAXX :: Runtime + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package jaxx.runtime.swing; + +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.beans.SimpleBeanInfo; + +public class VBoxBeanInfo extends SimpleBeanInfo { + + @Override + public BeanInfo[] getAdditionalBeanInfo() { + try { + return new BeanInfo[]{Introspector.getBeanInfo(JPanel.class)}; + } catch (IntrospectionException e) { + throw new RuntimeException(e); + } + } + + @Override + public PropertyDescriptor[] getPropertyDescriptors() { + try { + PropertyDescriptor spacing = new PropertyDescriptor("spacing", VBox.class); + spacing.setBound(true); + + PropertyDescriptor margin = new PropertyDescriptor("margin", VBox.class); + margin.setBound(true); + + PropertyDescriptor horizontalAlignment = new PropertyDescriptor("horizontalAlignment", VBox.class); + horizontalAlignment.setBound(true); + horizontalAlignment.setValue("enumerationValues", new Object[]{ + "left", SwingConstants.LEFT, "SwingConstants.LEFT", + "center", SwingConstants.CENTER, "SwingConstants.CENTER", + "right", SwingConstants.RIGHT, "SwingConstants.RIGHT" + }); + + PropertyDescriptor verticalAlignment = new PropertyDescriptor("verticalAlignment", VBox.class); + verticalAlignment.setBound(true); + verticalAlignment.setValue("enumerationValues", new Object[]{ + "top", SwingConstants.TOP, "SwingConstants.TOP", + "middle", SwingConstants.CENTER, "SwingConstants.CENTER", + "bottom", SwingConstants.BOTTOM, "SwingConstants.BOTTOM" + }); + + return new PropertyDescriptor[]{spacing, margin, horizontalAlignment, verticalAlignment}; + } catch (IntrospectionException e) { + throw new RuntimeException(e); + } + } +} Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionExecutor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ActionWorker.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/application/ApplicationRunner.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavBridge.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavDataProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavNode.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/NavNodeChildLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/AbstractNavTreeCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeBridge.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeNode.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/NavTreeNodeChildLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableBridge.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableNode.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/NavTreeTableNodeChildLoador.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/treetable/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorListCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorProviderListCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorProviderTableCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/DecoratorTableCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorListCellRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/MultiDecoratorTableCelleRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/BusyChangeListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtStep.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtStepModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardExtUtil.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/WizardState.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/ext/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/resources/i18n/jaxx-runtime_en_GB.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/resources/i18n/jaxx-runtime_fr_FR.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/main/resources/validators.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java =================================================================== --- trunk/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,53 +1,53 @@ -/* - * #%L - * JAXX :: Runtime - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package jaxx.runtime; - -import org.junit.Assert; -import org.junit.Test; - -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; - -public class UtilTest { - - int count; - - @Test - public void testGetEventListener() { - count = 0; - DocumentListener listener = JAXXUtil.getEventListener(DocumentListener.class, this, "incCount"); - listener.insertUpdate(null); - Assert.assertEquals(count, 1); - DocumentListener listener2 = JAXXUtil.getEventListener(DocumentListener.class, this, "incCount"); - listener2.removeUpdate(null); - Assert.assertEquals(count, 2); - //assertTrue("Received two different event listeners despite using identical parameters", listener == listener2); - } - - - public void incCount(DocumentEvent e) { - count++; - } +/* + * #%L + * JAXX :: Runtime + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package jaxx.runtime; + +import org.junit.Assert; +import org.junit.Test; + +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; + +public class UtilTest { + + int count; + + @Test + public void testGetEventListener() { + count = 0; + DocumentListener listener = JAXXUtil.getEventListener(DocumentListener.class, this, "incCount"); + listener.insertUpdate(null); + Assert.assertEquals(count, 1); + DocumentListener listener2 = JAXXUtil.getEventListener(DocumentListener.class, this, "incCount"); + listener2.removeUpdate(null); + Assert.assertEquals(count, 2); + //assertTrue("Received two different event listeners despite using identical parameters", listener == listener2); + } + + + public void incCount(DocumentEvent e) { + count++; + } } \ No newline at end of file Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/context/DataContextEntryIteratorTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/DecoratorProviderTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathContextTester.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MapPropertyHandlerTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-runtime/src/test/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/resources/META-INF/services/javax.annotation.processing.Processor ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/resources/i18n/jaxx-swing-action-en_GB.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/main/resources/i18n/jaxx-swing-action-fr_FR.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/site/rst/Todo.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-swing-action/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/main/java/jaxx/demo/config/DemoConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/main/java/jaxx/demo/config/RunDemo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/main/resources/i18n/jaxx-tutorial-config_en_GB.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/main/resources/i18n/jaxx-tutorial-config_fr_FR.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/main/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-config/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/src/main/java/org/nuiton/jaxx/tutorials/css/Css.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/src/main/java/org/nuiton/jaxx/tutorials/css/Css.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-css/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/src/main/java/org/nuiton/jaxx/tutorials/databinding/data-binding.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/src/main/java/org/nuiton/jaxx/tutorials/databinding/databinding.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-databinding/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/src/main/java/org/nuiton/jaxx/tutorials/helloworld/helloworld.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/src/main/java/org/nuiton/jaxx/tutorials/helloworld/helloworld.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-helloworld2/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/filters/jaxx-demo.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/DemoConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/RunDemo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/model/AbstractDemoBean.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/model/Movie.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/model/People.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/DemoUI.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/DemoUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/DemoUIHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/main/java/jaxx/demo/validation/ui/ValidationTableDemo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-tutorial-validation/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/JAXXValidator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/site/apt/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/test/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-validator/src/test/resources/validators.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/AboutPanel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ClockWidget.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ErrorDialogUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/FontSizor.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/MemoryStatusWidget.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditor.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditor.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorPopup.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditor.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditor.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBoxHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeaderHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanUIUtil.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCallBackUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCallBackUIHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCategoryUI.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigCategoryUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUI.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUI.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIHandler.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBackEntry.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBackFinalizer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBackMap.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CallBacksManager.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModelBuilder.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/MainCallBackFinalizer.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/package.html ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_en_GB.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_fr_FR.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/config/model/ConfigUIModelBuilderTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/test/java/jaxx/runtime/swing/editor/config/model/MyConfig.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/jaxx-widgets/src/test/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/LICENSE.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/README.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/changelog.txt ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractGenerateHelpMojo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpFilesMojo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpSearchMojo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/resources/defaultContent.html.vm ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/resources/defaultHelpSet.hs.vm ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/resources/defaultI18n.java.vm ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/resources/defaultIndex.xml.vm ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/resources/defaultMap.jhm.vm ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/resources/defaultToc.xml.vm ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/main/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/site/rst/Todo.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug184Test.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java =================================================================== --- trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,325 +1,325 @@ -/* - * #%L - * JAXX :: Maven plugin - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package org.nuiton.jaxx.plugin; - -import jaxx.runtime.context.DefaultJAXXContext; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugin.logging.SystemStreamLog; -import org.junit.Test; - -import java.io.File; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class CompilerTest extends JaxxBaseTest { - - @Test - public void InnerClasses() throws Exception { - getMojo().execute(); - assertNumberJaxxFiles(1); - } - - @Test - public void Icon() throws Exception { - GenerateMojo mojo = getMojo(); - mojo.execute(); - checkPattern(mojo, ".createImageIcon(\"myIcon.png\")", true); - checkPattern(mojo, ".createActionIcon(\"myActionIcon.png\")", true); - checkPattern(mojo, ".getUIManagerIcon(\"myIcon.png\")", false); - checkPattern(mojo, ".getUIManagerActionIcon(\"myActionIcon.png\")", false); - assertNumberJaxxFiles(1); - mojo.useUIManagerForIcon = true; - mojo.execute(); - checkPattern(mojo, ".createImageIcon(\"myIcon.png\")", false); - checkPattern(mojo, ".createActionIcon(\"myActionIcon.png\")", false); - checkPattern(mojo, ".getUIManagerIcon(\"myIcon.png\")", true); - checkPattern(mojo, ".getUIManagerActionIcon(\"myActionIcon.png\")", true); - } - - @Test - public void ClientProperty() throws Exception { - GenerateMojo mojo = getMojo(); - mojo.execute(); - checkPattern(mojo, ".putClientProperty(\"testOne\", \"oneTest\")", true); - checkPattern(mojo, ".putClientProperty(\"testTwo\", \"anotherTest\")", true); - } - - @Test - public void SpecialSubclassing() throws Exception { - getMojo().execute(); - assertNumberJaxxFiles(7); - } - - @Test - public void CSSTests() throws Exception { - executeMojo(); - assertNumberJaxxFiles(7); - } - - @Test - public void WithLog() throws Exception { - GenerateMojo mojo = getMojo(); - executeMojo(); - String[] files = mojo.files; - assertNumberJaxxFiles(2); - - String withLogFile = files[0]; - checkPattern(mojo, "Log log = LogFactory.getLog(", true, withLogFile); - checkPattern(mojo, "import org.apache.commons.logging.Log;", true, withLogFile); - checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", true, withLogFile); - - withLogFile = files[1]; - checkPattern(mojo, "Log log = LogFactory.getLog(", true, withLogFile); - checkPattern(mojo, "import org.apache.commons.logging.Log;", true, withLogFile); - checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", true, withLogFile); - } - - @Test - public void NoLog() throws Exception { - GenerateMojo mojo = getMojo(); - executeMojo(); - assertNumberJaxxFiles(2); - checkPattern(mojo, "Log log = LogFactory.getLog(", false); - checkPattern(mojo, "import org.apache.commons.logging.Log;", false); - checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", false); - } - - @SuppressWarnings({"unchecked"}) - @Test - public void Errors() throws Exception { - GenerateMojo mojo = getMojo(); - // init mojo to get alls files to treate - mojo.init(); - - assertNumberJaxxFiles(33); - mojo.setLog(new SystemStreamLog() { - - @Override - public boolean isErrorEnabled() { - return false; - } - - @Override - public void error(Throwable error) { - //do nothing - } - - @Override - public void error(CharSequence content) { - //do nothing - } - - @Override - public void error(CharSequence content, Throwable error) { - //do nothing - } - }); - - // execute mjo on each jaxx file to produce the error - for (String file : mojo.files) { - log.info("test bad file " + file); - mojo.files = new String[]{file}; - try { - mojo.doAction(); - // should never pass - fail(); - } catch (MojoExecutionException e) { - // ok jaxx compiler failed - assertTrue(true); - assertError(mojo.getEngine(), file, 1); - } - } - } - - - @SuppressWarnings({"unchecked"}) - @Test - public void ErrorsCss() throws Exception { - GenerateMojo mojo = getMojo(); - // init mojo to get alls files to treate - mojo.init(); - - assertNumberJaxxFiles(1); - mojo.setLog(new SystemStreamLog() { - - @Override - public boolean isErrorEnabled() { - return false; - } - - @Override - public void error(Throwable error) { - //do nothing - } - - @Override - public void error(CharSequence content) { - //do nothing - } - - @Override - public void error(CharSequence content, Throwable error) { - //do nothing - } - }); - - // execute mjo on each jaxx file to produce the error - for (String file : mojo.files) { - log.info("test bad file " + file); - mojo.files = new String[]{file}; - try { - mojo.doAction(); - // should never pass - fail(); - } catch (MojoExecutionException e) { - // ok jaxx compiler failed - assertTrue(true); - assertError(mojo.getEngine(), file, 1); - } - } - } - - @Test - public void Initializers() throws Exception { - executeMojo(); - assertNumberJaxxFiles(1); - } - - - @Test - public void ImportTag() throws Exception { - executeMojo(); - assertNumberJaxxFiles(1); - } - - @Test - public void ErrorJaxxContextImplementorClass() throws Exception { - GenerateMojo mojo = getMojo(); - mojo.jaxxContextFQN = null; - try { - mojo.init(); - fail(); - } catch (NullPointerException e) { - assertTrue(true); - } - - mojo.jaxxContextFQN = String.class.getName(); - try { - mojo.init(); - fail(); - } catch (MojoExecutionException e) { - assertTrue(true); - } -// -// mojo.jaxxContextFQN = JAXXContext.class.getName(); -// try { -// mojo.init(); -// fail(); -// } catch (IllegalArgumentException e) { -// assertTrue(true); -// } - - mojo.jaxxContextFQN = DefaultJAXXContext.class.getName(); - mojo.init(); - assertTrue(true); - - } - - @Test - public void Script() throws Exception { - executeMojo(); - assertNumberJaxxFiles(1); - } - - @Test - public void OverridingDataBindings() throws Exception { - executeMojo(); - assertNumberJaxxFiles(3); - } - - @Test - public void ClassReferences() throws Exception { - executeMojo(); - assertNumberJaxxFiles(6); - } - - @Test - public void Force() throws Exception { - - // first round, with force option so will generate theonly JButton.jaxx file - GenerateMojo mojo = getMojo(); - executeMojo(); - String[] files = mojo.files; - assertNumberJaxxFiles(1); - - File srcFile = new File(mojo.src, files[0]); - - File dstFile = mojo.updater.getMirrorFile(srcFile); - - long oldTime = dstFile.lastModified(); - // second round, no force so will not the file - mojo.setForce(false); - executeMojo(); - assertNumberJaxxFiles(0); - - Thread.sleep(1000); - - assertEquals(oldTime, mojo.updater.getMirrorFile(srcFile).lastModified()); - - // three round : modify a source with no force option - if (!srcFile.setLastModified(System.currentTimeMillis())) { - log.warn("failed to set LastModified for file " + srcFile); - } - - executeMojo(); - assertNumberJaxxFiles(1); - assertTrue(mojo.updater.getMirrorFile(srcFile).lastModified() > oldTime); - - // last round, reforce file generation for an no modify source - mojo.setForce(true); - executeMojo(); - assertNumberJaxxFiles(1); - assertTrue(mojo.updater.getMirrorFile(srcFile).lastModified() > oldTime); - } - - protected void executeMojo() throws MojoExecutionException, MojoFailureException { - - try { - getMojo().execute(); - } catch (MojoExecutionException e) { - log.error(e); - throw e; - } catch (MojoFailureException e) { - log.error(e); - throw e; - } - - } - -} +/* + * #%L + * JAXX :: Maven plugin + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.nuiton.jaxx.plugin; + +import jaxx.runtime.context.DefaultJAXXContext; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.SystemStreamLog; +import org.junit.Test; + +import java.io.File; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class CompilerTest extends JaxxBaseTest { + + @Test + public void InnerClasses() throws Exception { + getMojo().execute(); + assertNumberJaxxFiles(1); + } + + @Test + public void Icon() throws Exception { + GenerateMojo mojo = getMojo(); + mojo.execute(); + checkPattern(mojo, ".createImageIcon(\"myIcon.png\")", true); + checkPattern(mojo, ".createActionIcon(\"myActionIcon.png\")", true); + checkPattern(mojo, ".getUIManagerIcon(\"myIcon.png\")", false); + checkPattern(mojo, ".getUIManagerActionIcon(\"myActionIcon.png\")", false); + assertNumberJaxxFiles(1); + mojo.useUIManagerForIcon = true; + mojo.execute(); + checkPattern(mojo, ".createImageIcon(\"myIcon.png\")", false); + checkPattern(mojo, ".createActionIcon(\"myActionIcon.png\")", false); + checkPattern(mojo, ".getUIManagerIcon(\"myIcon.png\")", true); + checkPattern(mojo, ".getUIManagerActionIcon(\"myActionIcon.png\")", true); + } + + @Test + public void ClientProperty() throws Exception { + GenerateMojo mojo = getMojo(); + mojo.execute(); + checkPattern(mojo, ".putClientProperty(\"testOne\", \"oneTest\")", true); + checkPattern(mojo, ".putClientProperty(\"testTwo\", \"anotherTest\")", true); + } + + @Test + public void SpecialSubclassing() throws Exception { + getMojo().execute(); + assertNumberJaxxFiles(7); + } + + @Test + public void CSSTests() throws Exception { + executeMojo(); + assertNumberJaxxFiles(7); + } + + @Test + public void WithLog() throws Exception { + GenerateMojo mojo = getMojo(); + executeMojo(); + String[] files = mojo.files; + assertNumberJaxxFiles(2); + + String withLogFile = files[0]; + checkPattern(mojo, "Log log = LogFactory.getLog(", true, withLogFile); + checkPattern(mojo, "import org.apache.commons.logging.Log;", true, withLogFile); + checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", true, withLogFile); + + withLogFile = files[1]; + checkPattern(mojo, "Log log = LogFactory.getLog(", true, withLogFile); + checkPattern(mojo, "import org.apache.commons.logging.Log;", true, withLogFile); + checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", true, withLogFile); + } + + @Test + public void NoLog() throws Exception { + GenerateMojo mojo = getMojo(); + executeMojo(); + assertNumberJaxxFiles(2); + checkPattern(mojo, "Log log = LogFactory.getLog(", false); + checkPattern(mojo, "import org.apache.commons.logging.Log;", false); + checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", false); + } + + @SuppressWarnings({"unchecked"}) + @Test + public void Errors() throws Exception { + GenerateMojo mojo = getMojo(); + // init mojo to get alls files to treate + mojo.init(); + + assertNumberJaxxFiles(33); + mojo.setLog(new SystemStreamLog() { + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public void error(Throwable error) { + //do nothing + } + + @Override + public void error(CharSequence content) { + //do nothing + } + + @Override + public void error(CharSequence content, Throwable error) { + //do nothing + } + }); + + // execute mjo on each jaxx file to produce the error + for (String file : mojo.files) { + log.info("test bad file " + file); + mojo.files = new String[]{file}; + try { + mojo.doAction(); + // should never pass + fail(); + } catch (MojoExecutionException e) { + // ok jaxx compiler failed + assertTrue(true); + assertError(mojo.getEngine(), file, 1); + } + } + } + + + @SuppressWarnings({"unchecked"}) + @Test + public void ErrorsCss() throws Exception { + GenerateMojo mojo = getMojo(); + // init mojo to get alls files to treate + mojo.init(); + + assertNumberJaxxFiles(1); + mojo.setLog(new SystemStreamLog() { + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public void error(Throwable error) { + //do nothing + } + + @Override + public void error(CharSequence content) { + //do nothing + } + + @Override + public void error(CharSequence content, Throwable error) { + //do nothing + } + }); + + // execute mjo on each jaxx file to produce the error + for (String file : mojo.files) { + log.info("test bad file " + file); + mojo.files = new String[]{file}; + try { + mojo.doAction(); + // should never pass + fail(); + } catch (MojoExecutionException e) { + // ok jaxx compiler failed + assertTrue(true); + assertError(mojo.getEngine(), file, 1); + } + } + } + + @Test + public void Initializers() throws Exception { + executeMojo(); + assertNumberJaxxFiles(1); + } + + + @Test + public void ImportTag() throws Exception { + executeMojo(); + assertNumberJaxxFiles(1); + } + + @Test + public void ErrorJaxxContextImplementorClass() throws Exception { + GenerateMojo mojo = getMojo(); + mojo.jaxxContextFQN = null; + try { + mojo.init(); + fail(); + } catch (NullPointerException e) { + assertTrue(true); + } + + mojo.jaxxContextFQN = String.class.getName(); + try { + mojo.init(); + fail(); + } catch (MojoExecutionException e) { + assertTrue(true); + } +// +// mojo.jaxxContextFQN = JAXXContext.class.getName(); +// try { +// mojo.init(); +// fail(); +// } catch (IllegalArgumentException e) { +// assertTrue(true); +// } + + mojo.jaxxContextFQN = DefaultJAXXContext.class.getName(); + mojo.init(); + assertTrue(true); + + } + + @Test + public void Script() throws Exception { + executeMojo(); + assertNumberJaxxFiles(1); + } + + @Test + public void OverridingDataBindings() throws Exception { + executeMojo(); + assertNumberJaxxFiles(3); + } + + @Test + public void ClassReferences() throws Exception { + executeMojo(); + assertNumberJaxxFiles(6); + } + + @Test + public void Force() throws Exception { + + // first round, with force option so will generate theonly JButton.jaxx file + GenerateMojo mojo = getMojo(); + executeMojo(); + String[] files = mojo.files; + assertNumberJaxxFiles(1); + + File srcFile = new File(mojo.src, files[0]); + + File dstFile = mojo.updater.getMirrorFile(srcFile); + + long oldTime = dstFile.lastModified(); + // second round, no force so will not the file + mojo.setForce(false); + executeMojo(); + assertNumberJaxxFiles(0); + + Thread.sleep(1000); + + assertEquals(oldTime, mojo.updater.getMirrorFile(srcFile).lastModified()); + + // three round : modify a source with no force option + if (!srcFile.setLastModified(System.currentTimeMillis())) { + log.warn("failed to set LastModified for file " + srcFile); + } + + executeMojo(); + assertNumberJaxxFiles(1); + assertTrue(mojo.updater.getMirrorFile(srcFile).lastModified() > oldTime); + + // last round, reforce file generation for an no modify source + mojo.setForce(true); + executeMojo(); + assertNumberJaxxFiles(1); + assertTrue(mojo.updater.getMirrorFile(srcFile).lastModified() > oldTime); + } + + protected void executeMojo() throws MojoExecutionException, MojoFailureException { + + try { + getMojo().execute(); + } catch (MojoExecutionException e) { + log.error(e); + throw e; + } catch (MojoFailureException e) { + log.error(e); + throw e; + } + + } + +} Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java =================================================================== --- trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,91 +1,91 @@ -/* - * #%L - * JAXX :: Maven plugin - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package org.nuiton.jaxx.plugin; - -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.logging.SystemStreamLog; - - - -import org.junit.Test; -import static org.junit.Assert.*; - -public class CompilerValidatorTest extends JaxxBaseTest { - - @Test - public void ValidatorOk() throws Exception { - getMojo().execute(); - assertNumberJaxxFiles(2); - - } - - @Test - @SuppressWarnings({"unchecked"}) - public void ValidatorErrors() throws Exception { - // init mojo to get alls files to treate - GenerateMojo mojo = getMojo(); - mojo.init(); - String[] files = mojo.files; - assertNumberJaxxFiles(19); - mojo.setLog(new SystemStreamLog() { - - @Override - public boolean isErrorEnabled() { - return false; - } - - @Override - public void error(Throwable error) { - //do nothing - } - - @Override - public void error(CharSequence content) { - //do nothing - } - - @Override - public void error(CharSequence content, Throwable error) { - //do nothing - } - }); - - // execute mjo on each jaxx file to produce the error - for (String file : files) { - log.info("test bad file " + file); - mojo.files = new String[]{file}; - try { - mojo.doAction(); - // should never pass - fail("for file " + file); - } catch (MojoExecutionException e) { - // ok jaxx compiler failed - assertTrue(true); - assertError(mojo.getEngine(), file, 1); - } - } - } -} +/* + * #%L + * JAXX :: Maven plugin + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.nuiton.jaxx.plugin; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.logging.SystemStreamLog; + + + +import org.junit.Test; +import static org.junit.Assert.*; + +public class CompilerValidatorTest extends JaxxBaseTest { + + @Test + public void ValidatorOk() throws Exception { + getMojo().execute(); + assertNumberJaxxFiles(2); + + } + + @Test + @SuppressWarnings({"unchecked"}) + public void ValidatorErrors() throws Exception { + // init mojo to get alls files to treate + GenerateMojo mojo = getMojo(); + mojo.init(); + String[] files = mojo.files; + assertNumberJaxxFiles(19); + mojo.setLog(new SystemStreamLog() { + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public void error(Throwable error) { + //do nothing + } + + @Override + public void error(CharSequence content) { + //do nothing + } + + @Override + public void error(CharSequence content, Throwable error) { + //do nothing + } + }); + + // execute mjo on each jaxx file to produce the error + for (String file : files) { + log.info("test bad file " + file); + mojo.files = new String[]{file}; + try { + mojo.doAction(); + // should never pass + fail("for file " + file); + } catch (MojoExecutionException e) { + // ok jaxx compiler failed + assertTrue(true); + assertError(mojo.getEngine(), file, 1); + } + } + } +} Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/Bean.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBinding/BeanImpl.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DataBindingTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java =================================================================== --- trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,70 +1,70 @@ -/* - * #%L - * JAXX :: Maven plugin - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package org.nuiton.jaxx.plugin; - -import org.junit.Test; - -public class I18nTest extends JaxxBaseTest { - - @Test - public void I18nText() throws Exception { - GenerateMojo mojo = getMojo(); - mojo.i18nable = false; - mojo.execute(); - checkPattern(mojo, "setText(_(\"test.text\"));", false); - - mojo.i18nable = true; - mojo.execute(); - checkPattern(mojo, "setText(_(\"test.text\"));", true); - checkPattern(mojo, "\"_(\\\"test.text\\\")\"", false); - } - - @Test - public void I18nTitle() throws Exception { - GenerateMojo mojo = getMojo(); - mojo.i18nable = false; - mojo.execute(); - checkPattern(mojo, "setTitle(_(\"test.title\"));", false); - - mojo.i18nable = true; - mojo.execute(); - checkPattern(mojo, "setTitle(_(\"test.title\"));", true); - checkPattern(mojo, "\"_(\\\"test.title\\\")\"", false); - } - - @Test - public void I18nToolTipText() throws Exception { - GenerateMojo mojo = getMojo(); - mojo.i18nable = false; - mojo.execute(); - checkPattern(mojo, "setToolTipText(_(\"test.toolTipText\"));", false); - - mojo.i18nable = true; - mojo.execute(); - checkPattern(mojo, "setToolTipText(_(\"test.toolTipText\"));", true); - checkPattern(mojo, "\"_(\\\"test.toolTipText\\\")\"", false); - } -} +/* + * #%L + * JAXX :: Maven plugin + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.nuiton.jaxx.plugin; + +import org.junit.Test; + +public class I18nTest extends JaxxBaseTest { + + @Test + public void I18nText() throws Exception { + GenerateMojo mojo = getMojo(); + mojo.i18nable = false; + mojo.execute(); + checkPattern(mojo, "setText(_(\"test.text\"));", false); + + mojo.i18nable = true; + mojo.execute(); + checkPattern(mojo, "setText(_(\"test.text\"));", true); + checkPattern(mojo, "\"_(\\\"test.text\\\")\"", false); + } + + @Test + public void I18nTitle() throws Exception { + GenerateMojo mojo = getMojo(); + mojo.i18nable = false; + mojo.execute(); + checkPattern(mojo, "setTitle(_(\"test.title\"));", false); + + mojo.i18nable = true; + mojo.execute(); + checkPattern(mojo, "setTitle(_(\"test.title\"));", true); + checkPattern(mojo, "\"_(\\\"test.title\\\")\"", false); + } + + @Test + public void I18nToolTipText() throws Exception { + GenerateMojo mojo = getMojo(); + mojo.i18nable = false; + mojo.execute(); + checkPattern(mojo, "setToolTipText(_(\"test.toolTipText\"));", false); + + mojo.i18nable = true; + mojo.execute(); + checkPattern(mojo, "setToolTipText(_(\"test.toolTipText\"));", true); + checkPattern(mojo, "\"_(\\\"test.toolTipText\\\")\"", false); + } +} Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerTest/classReferences/JavaTaist.java =================================================================== --- trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerTest/classReferences/JavaTaist.java 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerTest/classReferences/JavaTaist.java 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,33 +1,33 @@ -/* - * #%L - * JAXX :: Maven plugin - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package org.nuiton.jaxx.plugin.compilerTest.classReferences; - -import javax.swing.*; - -public class JavaTaist extends JLabel { - public void setCustomProperty(String label) { - setText(label); - } +/* + * #%L + * JAXX :: Maven plugin + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package org.nuiton.jaxx.plugin.compilerTest.classReferences; + +import javax.swing.*; + +public class JavaTaist extends JLabel { + public void setCustomProperty(String label) { + setText(label); + } } \ No newline at end of file Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerTest/classReferences/JavaTaist.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/Identity.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/Model.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/log4j.properties ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1722Test/Bug_1722.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1750Test/Bug_1750.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1750Test/ComboBox.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Bug_1751.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Test1.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Test2.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug1751Test/Test3.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/Bug_184.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/MyPanel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/CSSTests.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ClassReferences.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ClientProperty.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ErrorJaxxContextImplementorClass.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Errors.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ErrorsCss.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Force.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Icon.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/ImportTag.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Initializers.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/InnerClasses.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/NoLog.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/OverridingDataBindings.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/Script.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/SpecialSubclassing.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/WithLog.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/Child.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/Child2.jaxx ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/GrandChild.jaxx =================================================================== --- trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/GrandChild.jaxx 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/GrandChild.jaxx 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,55 +1,55 @@ -<!-- - #%L - JAXX :: Maven plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - --> -<JPanel layout='{new BorderLayout()}'> - <import> - java.awt.Color - </import> - <script> - public String getText() { - return grandChild.getText(); - } - - - public void setText(String Text) { - grandChild.setText(Text); - } - - - public Color getForeground() { - if (grandChild != null) - return grandChild.getForeground(); - else - return Color.BLACK; - } - - - public void setForeground(Color foreground) { - if (grandChild != null) - grandChild.setForeground(foreground); - } - </script> - - <GrandChildButton id='grandChild'/> +<!-- + #%L + JAXX :: Maven plugin + + $Id$ + $HeadURL$ + %% + Copyright (C) 2008 - 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> +<JPanel layout='{new BorderLayout()}'> + <import> + java.awt.Color + </import> + <script> + public String getText() { + return grandChild.getText(); + } + + + public void setText(String Text) { + grandChild.setText(Text); + } + + + public Color getForeground() { + if (grandChild != null) + return grandChild.getForeground(); + else + return Color.BLACK; + } + + + public void setForeground(Color foreground) { + if (grandChild != null) + grandChild.setForeground(foreground); + } + </script> + + <GrandChildButton id='grandChild'/> </JPanel> \ No newline at end of file Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/GrandChild.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/GrandChildButton.jaxx ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/SimpleCSS.jaxx =================================================================== --- trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/SimpleCSS.jaxx 2011-02-18 10:12:27 UTC (rev 2224) +++ trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/SimpleCSS.jaxx 2011-02-19 20:15:00 UTC (rev 2225) @@ -1,56 +1,56 @@ -<!-- - #%L - JAXX :: Maven plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - --> -<VBox> - <JPanel layout='{new GridLayout(0, 1, 6, 6)}'> - <import> - java.awt.Color - </import> - <style> - JPanel { border: {null}; font-size: 18; } - - JButton { foreground: red } - JButton.green { foreground: green; } - AbstractButton.blue { foreground: blue } - .blue { foreground: white; } - #B4:enabled { foreground: { Color.orange } } - .yellow { foreground: yellow; } - #child.idTest { foreground: white } - #B7:{true} { foreground: cyan; } - #B8 { foreground: black } - #B8.yellow { foreground: { new Color(0, 0, 0) } } - </style> - - <JButton id='B1' text='Red'/> - <JButton id='B2' text='Green' styleClass='green'/> - <JButton id='B3' text='Blue' styleClass='blue'/> - <GrandChild id='B4' text='Orange'/> - <Child id='B5' text='Yellow'/> - <Child id='B6' text='White' styleClass='idTest'/> - <Child id='B7' text='Cyan'/> - <Child2 id='B8' text='Pink' styleClass='yellow'/> - <Child2 id='B9' text='Purple' foreground='#aa20ff'/> - <GrandChild text='Red'/> - </JPanel> -</VBox> +<!-- + #%L + JAXX :: Maven plugin + + $Id$ + $HeadURL$ + %% + Copyright (C) 2008 - 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> +<VBox> + <JPanel layout='{new GridLayout(0, 1, 6, 6)}'> + <import> + java.awt.Color + </import> + <style> + JPanel { border: {null}; font-size: 18; } + + JButton { foreground: red } + JButton.green { foreground: green; } + AbstractButton.blue { foreground: blue } + .blue { foreground: white; } + #B4:enabled { foreground: { Color.orange } } + .yellow { foreground: yellow; } + #child.idTest { foreground: white } + #B7:{true} { foreground: cyan; } + #B8 { foreground: black } + #B8.yellow { foreground: { new Color(0, 0, 0) } } + </style> + + <JButton id='B1' text='Red'/> + <JButton id='B2' text='Green' styleClass='green'/> + <JButton id='B3' text='Blue' styleClass='blue'/> + <GrandChild id='B4' text='Orange'/> + <Child id='B5' text='Yellow'/> + <Child id='B6' text='White' styleClass='idTest'/> + <Child id='B7' text='Cyan'/> + <Child2 id='B8' text='Pink' styleClass='yellow'/> + <Child2 id='B9' text='Purple' foreground='#aa20ff'/> + <GrandChild text='Red'/> + </JPanel> +</VBox> Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/cSSTests/SimpleCSS.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/classReferences/TypeReference.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/clientProperty/TestOne.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/ConflictingPackages.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/InvalidRootTag.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/ScriptNotFound.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/StyleNotFound.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/dependencies/test.css ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/errors/dependencies/test.script ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/force/JButton.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/icon/Test1.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/nolog/NoLog.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/nolog/NoLogSon.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/withlog/WithLog.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/log/withlog/WithLogTwo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/overridingDataBindings/OverriddenCurrentTime.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerTest/script/JScriptInitializer.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/ValidatorErrors.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/ValidatorOk.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/AutoFieldComponentNotFound.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedBean.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedBean2.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedErrorListModel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedErrorTableModel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/DuplicatedFieldInSameValidator.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldBeanPropertyNotFound.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldComponentDuplicated.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldComponentNotFound.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldComponentNotFound2.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldNoName.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/FieldNoName2.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/Model.java ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/NoBean.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundBean.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorList.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorListModel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorTable.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundErrorTableModel.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/errors/UnfoundParentValidator.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/Validation.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/compilerValidatorTest/validator/ok/ValidationBeanClass.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/dataBindingTest/First.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/dataBindingTest/simpleBinding.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/decoratorTest/BoxedDecorator.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/decoratorTest/Decorator.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error/swingcombo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error/swinglist.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error/swingtree.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/error.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/jaxxcombo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/jaxxlist.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/jaxxtree.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/swingcombo.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/swinglist.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok/swingtree.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/evolution74Test/ok.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/I18nText.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/I18nTitle.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/I18nToolTipText.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/text/JButton.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/title/JDialog.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/title/JTabbedPane.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/title/JTabbedPane2.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JButton.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JTabbedPane.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JTabbedPane2.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/i18nTest/tooltiptext/JTabbedPane3.jaxx ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/pom.xml ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/BeanValidator.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/Core.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/I18n.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/JAXXContext.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/JAXXFile.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/NavigationModel.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/Todo.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/contractProgramming.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/dataBinding.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/demo.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/index.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/javaBeans.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/migration.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/old-compiler-doc/BeanValidator.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/old-compiler-doc/I18n.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/old-compiler-doc/Interface.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/old-compiler-doc/JAXXContext.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/old-compiler-doc/JavaBean.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/old-compiler-doc/NavigationTreeModel.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/presentation.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/scripting.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/spec-validator2.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/tutos/config.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/tutos/css.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/tutos/data-binding.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/tutos/helloworld.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/tutos/helloworld2.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/useStylesheets.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/rst/useSwingObjects.rst ___________________________________________________________________ Added: svn:eol-style + native Property changes on: trunk/src/site/site_fr.xml ___________________________________________________________________ Added: svn:eol-style + native
participants (1)
-
tchemit@users.nuiton.org