Author: tchemit Date: 2009-10-26 20:13:36 +0100 (Mon, 26 Oct 2009) New Revision: 1602 Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java Log: update java files license header Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/ClassMap.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,96 +1,112 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -/** - * A Map implementation which uses Classes as keys. <code>ClassMap</code> differs from typical maps - * in that it takes subclasses into account; mapping a class to a value also maps all subclasses of - * that class to the value. - * <p/> - * A <code>get</code> operation will return the value associated with the class itself, or failing - * that, with its nearest ancestor for which there exists a mapping. - * @param <T> type of the class - */ -public class ClassMap<T> extends HashMap<ClassDescriptor, T> { - - private static final long serialVersionUID = 5149779660675529037L; - /** - * Logger - */ - protected static final Log log = LogFactory.getLog(ClassMap.class); - /** - * Keeps track of automatically-added Classes so we can distinguish them from user-added - * Classes. Unknown Classes are automatically added to the map during <code>get</code> - * calls to speed up subsequent requests, but they must be updated when the mappings - * for their superclasses are modified. - */ - private List<ClassDescriptor> autoKeys = new ArrayList<ClassDescriptor>(); - - /** - * Returns the value associated with the key <code>Class</code>. If the class itself does not have - * a mapping, its superclass will be checked, and so on until an ancestor class with a mapping is - * located. If none of the class' ancestors have a mapping, <code>null</code> is returned. - * - * @param key the class to check - * @return the mapping for the class - */ - @Override - public T get(Object key) { - T result = null; - ClassDescriptor c = (ClassDescriptor) key; - while (c != null) { - result = super.get(c); - if (result != null) { - break; - } - c = c.getSuperclass(); - } - - if (result == null && ((ClassDescriptor) key).isInterface()) { - result = get(ClassDescriptorLoader.getClassDescriptor(Object.class)); - } - - if (c != key && result != null) { // no mapping for the class itself, but found one for a superclass - put((ClassDescriptor) key, result); - autoKeys.add((ClassDescriptor) key); - } - return result; - } - - /** - * Associates a value with a class and all of its descendents. - * - * @param key the class to map - * @param value the value to map to the class - * @return the old value associated with the class - */ - @Override - public T put(ClassDescriptor key, T value) { - //if (!(key instanceof ClassDescriptor)) { - // throw new IllegalArgumentException("expected ClassDescriptor, got " + key); - //} - if (autoKeys.size() > 0) { // remove all automatic keys which descend from the class being modified - Iterator<ClassDescriptor> i = autoKeys.iterator(); - while (i.hasNext()) { - ClassDescriptor auto = i.next(); - if (key.isAssignableFrom(auto)) { - i.remove(); - remove(auto); - } - } - } - return super.put(key, value); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +/** + * A Map implementation which uses Classes as keys. <code>ClassMap</code> differs from typical maps + * in that it takes subclasses into account; mapping a class to a value also maps all subclasses of + * that class to the value. + * <p/> + * A <code>get</code> operation will return the value associated with the class itself, or failing + * that, with its nearest ancestor for which there exists a mapping. + * @param <T> type of the class + */ +public class ClassMap<T> extends HashMap<ClassDescriptor, T> { + + private static final long serialVersionUID = 5149779660675529037L; + /** + * Logger + */ + protected static final Log log = LogFactory.getLog(ClassMap.class); + /** + * Keeps track of automatically-added Classes so we can distinguish them from user-added + * Classes. Unknown Classes are automatically added to the map during <code>get</code> + * calls to speed up subsequent requests, but they must be updated when the mappings + * for their superclasses are modified. + */ + private List<ClassDescriptor> autoKeys = new ArrayList<ClassDescriptor>(); + + /** + * Returns the value associated with the key <code>Class</code>. If the class itself does not have + * a mapping, its superclass will be checked, and so on until an ancestor class with a mapping is + * located. If none of the class' ancestors have a mapping, <code>null</code> is returned. + * + * @param key the class to check + * @return the mapping for the class + */ + @Override + public T get(Object key) { + T result = null; + ClassDescriptor c = (ClassDescriptor) key; + while (c != null) { + result = super.get(c); + if (result != null) { + break; + } + c = c.getSuperclass(); + } + + if (result == null && ((ClassDescriptor) key).isInterface()) { + result = get(ClassDescriptorLoader.getClassDescriptor(Object.class)); + } + + if (c != key && result != null) { // no mapping for the class itself, but found one for a superclass + put((ClassDescriptor) key, result); + autoKeys.add((ClassDescriptor) key); + } + return result; + } + + /** + * Associates a value with a class and all of its descendents. + * + * @param key the class to map + * @param value the value to map to the class + * @return the old value associated with the class + */ + @Override + public T put(ClassDescriptor key, T value) { + //if (!(key instanceof ClassDescriptor)) { + // throw new IllegalArgumentException("expected ClassDescriptor, got " + key); + //} + if (autoKeys.size() > 0) { // remove all automatic keys which descend from the class being modified + Iterator<ClassDescriptor> i = autoKeys.iterator(); + while (i.hasNext()) { + ClassDescriptor auto = i.next(); + if (key.isAssignableFrom(auto)) { + i.remove(); + remove(auto); + } + } + } + return super.put(key, value); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObject.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,690 +1,706 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.reflect.MethodDescriptor; -import jaxx.compiler.tags.DefaultComponentHandler; -import jaxx.compiler.tags.TagHandler; -import jaxx.compiler.tags.TagManager; - -import java.awt.Container; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.apache.commons.lang.StringUtils; - -/** - * Represents an object in the <code>.java</code> file being generated during compilation. There is - * a <code>CompiledObject</code> for each class tag encountered, and certain tags may generate - * additional objects for various reasons. - */ -public class CompiledObject { - - /** - * The object's id. - */ - private String id; - /** - * Java code referring to the object. - */ - private String javaCode; - /** - * The object's class. - */ - private ClassDescriptor objectClass; - /** - * The style class. - */ - private String styleClass; - /** - * The container containing this CompiledObject. - */ - private CompiledObject parent; - /** - * true if this object overrides an object of the same id in a superclass - * of the object being compiled - */ - private boolean override; - /** - * Comma-separated Java code snippets representing the parameters that - * should be passed to the object's constructor. - */ - private String constructorParams; - /** - * Java code snippet which performs basic initialization of the object (after it has already been constructed). - * Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other - * CompiledObjects from initializationCode -- you must refer to them from additionCode instead. - */ - private StringBuffer initializationCode = new StringBuffer(); - /** - * Java code snippet which completes setup by adding any child objects, or otherwise manipulates any refererenced - * objects. Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other - * CompiledObjects from initializationCode -- you must refer to them from additionCode instead. - */ - private StringBuffer additionCode = new StringBuffer(); - /** - * List of all registered event handlers. - */ - private List<EventHandler> eventHandlers = new ArrayList<EventHandler>(); - /** - * All properties that have been applied to this CompiledObject. - */ - private Map<String, String> properties = new HashMap<String, String>(); - /** - * generic types of the compiled object - */ - private String[] genericTypes; - /** - * a flag to indicate if javaBean full support must be support for this - * object by root object - */ - private boolean javaBean; - /** - * code to initialize the bean (can be null) - */ - private String javaBeanInitCode; - /** - * the type of the override object (can be null if no overide) - */ - private ClassDescriptor overrideType; - /** - * the decorator - */ - private CompiledObjectDecorator decorator; - /** - * client properties - */ - private Map<String, String> clientProperties; - - public class ChildRef { - - CompiledObject child; - String constraints; - String childJavaCode; - String delegateCode; - - public ChildRef(CompiledObject child, String constraints, String childJavaCode, String delegateCode) { - this.child = child; - this.constraints = constraints; - this.childJavaCode = childJavaCode; - this.delegateCode = delegateCode; - } - - public CompiledObject getChild() { - return child; - } - - public void setChild(CompiledObject child) { - this.child = child; - } - - public String getConstraints() { - return constraints; - } - - public void setConstraints(String constraints) { - this.constraints = constraints; - } - - public String getChildJavaCode() { - return childJavaCode; - } - - public void setChildJavaCode(String childJavaCode) { - this.childJavaCode = childJavaCode; - } - - public String getDelegateCode() { - return delegateCode; - } - - public void setDelegateCode(String delegateCode) { - this.delegateCode = delegateCode; - } - - public void addToAdditionCode(StringBuffer buffer, boolean isRootObject) { - //TC-20091026 do not prefix if on root object - String prefix; - if (isRootObject) { - prefix = ""; - } else { - prefix = javaCode + delegateCode + "."; - } - if (constraints != null) { -// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(", ").append(constraints).append(");"); - buffer.append(prefix).append("add(").append(childJavaCode).append(", ").append(constraints).append(");"); - } else { -// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(");"); - buffer.append(prefix).append("add(").append(childJavaCode).append(");"); - } - buffer.append(JAXXCompiler.getLineSeparator()); - } - } - private List<ChildRef> childs; - - /** - * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a - * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}. - * - * @param id the object's id - * @param objectClass the object's class - * @param compiler the current <code>JAXXCompiler</code> - * @throws NullPointerException if id or class is null - */ - public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler) { - this(id, objectClass, compiler, false); - } - - /** - * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a - * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}. - * - * @param id the object's id - * @param objectClass the object's class - * @param compiler the current <code>JAXXCompiler</code> - * @param force <code>true</code> to force acceptance of invalid ids - * @throws NullPointerException if id or class is null - */ - public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) { - this(id, id, objectClass, compiler, force); - } - - /** - * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a - * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}. - * - * @param id the object's id - * @param javaCode Java code referring to the object - * @param objectClass the object's class - * @param force <code>true</code> to force acceptance of invalid ids - * @param compiler the current <code>JAXXCompiler</code> - * @throws CompilerException if the id is not a valid Java identifier - * @throws NullPointerException if id or class is null - */ - public CompiledObject(String id, String javaCode, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) throws CompilerException { - if (!force) { - if (!isValidID(id)) { - compiler.reportError("the id '" + id + "' is not a valid Java identifier"); - } - } - this.id = id; - this.javaCode = javaCode; - - if (objectClass == null) { - throw new NullPointerException(); - } - this.objectClass = objectClass; - this.childs = new ArrayList<ChildRef>(); - } - - public static boolean isValidID(String id) { - boolean valid = true; - if (id.length() == 0) { - valid = false; - } - if (valid) { - if (!Character.isJavaIdentifierStart(id.charAt(0))) { - valid = false; - } - if (valid) { - for (int i = 1; i < id.length(); i++) { - if (!Character.isJavaIdentifierPart(id.charAt(i))) { - valid = false; - break; - } - } - } - } - return valid; - } - - /** - * True if this object overrides an object in the superclass of the class - * being compiled. For this to be true, the class currently being compiled - * must be a subclass of another <code>JAXXObject</code> which has an - * identically-named object. - * - * @return <code>true</code> if this object is an override - * @see #setOverride - */ - public boolean isOverride() { - return override; - } - - /** - * Sets whether this class overrides an identically-named object in the - * parent class. - * - * @param override <code>true</code> if this object is an override - * @see #isOverride - */ - public void setOverride(boolean override) { - this.override = override; - } - - /** - * Returns this object's CSS style class. - * - * @return the value of the <code>styleClass</code> attribute - */ - public String getStyleClass() { - return styleClass; - } - - /** - * Sets this object's CSS style class. - * - * @param styleClass the new style class - */ - public void setStyleClass(String styleClass) { - this.styleClass = styleClass; - } - - /** - * Returns this object's parent container. Non-visual components (and - * the root container) return <code>null</code>. - * - * @return the object's parent container - */ - public CompiledObject getParent() { - return parent; - } - - /** - * Sets this object's parent container. - * - * @param parent the parent container - * @throws IllegalArgumentException if parent is not a {@link Container} - */ - public void setParent(CompiledObject parent) throws IllegalArgumentException { - if (!ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(parent.getObjectClass())) { - throw new IllegalArgumentException("parent must descend from java.awt.Container"); - } - this.parent = parent; - } - - /** - * Returns the name of the method that should be generated in the compiled - * <code>.java</code> file - * in order to create this object. This is just a suggestion and may be - * ignored. - * - * @return the suggested name of the method which initializes this object - */ - public String getCreationMethodName() { - return "create" + StringUtils.capitalize(getId()); - } - - /** - * Returns the name of the method that should be generated in the compiled - * <code>.java</code> file in order to add children to this object. This - * is just a suggestion and may be ignored. - * - * @return the suggested name of the method which completes this object's setup - */ - public String getAdditionMethodName() { - return "addChildrenTo" + StringUtils.capitalize(getId()); - } - - /** - * Returns the type of this object. - * - * @return the class this <code>CompiledObject</code> represents - */ - public ClassDescriptor getObjectClass() { - return objectClass; - } - - /** - * Returns this object's id. Generally, a field with this name will be - * created in the compiled <code>.java</code> - * file in order to represent this object. - * - * @return the id used to refer to this object - */ - public String getId() { - return id; - } - - /** - * Returns Java code used to refer to this object in the compiled Java file. - * This is usually the same as its id. - * - * @return the Java code for this object - */ - public String getJavaCode() { - String result = javaCode; - if (isOverride()) { - // handle cases where object is overridden to be a different class - result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")"; - } - return result; - } - - public String getJavaCodeForProperty(String property) { - if (!override) { - return javaCode; - } - String result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")"; - - String methodName = StringUtils.capitalize(property); - try { - MethodDescriptor methodDescriptor = overrideType.getMethodDescriptor("get" + methodName); - if (methodDescriptor != null) { - if (overrideType.getMethodDescriptor("set" + methodName, methodDescriptor.getReturnType()) != null) { - // handle cases where object is overridden to be a different class - result = javaCode; - } - } - } catch (NoSuchMethodException e) { - // lazy error, do nothing - } - return result; - } - - /** - * Returns a list of comma-separated Java code snippets that represent the - * parameters to pass to this object's constructor. - * - * @return the raw constructor params - * @see #setConstructorParams - */ - public String getConstructorParams() { - return constructorParams; - } - - /** - * Sets the parameters to pass to this object's constructor. - * - * @param constructorParams comma-separated Java code snippets representing - * constructor params - * @see #getConstructorParams - */ - public void setConstructorParams(String constructorParams) { - this.constructorParams = constructorParams; - } - - /** - * Returns the code that performs basic initialization of this object, - * after it has already been constructed. - * This basic code should not reference any other - * <code>CompiledObjects</code> as they may not have been created yet. - * - * @param compiler compiler to use - * @return the code which initializes this object - */ - public String getInitializationCode(JAXXCompiler compiler) { - StringBuffer result = new StringBuffer(initializationCode.toString()); - for (Object eventHandler : eventHandlers) { - EventHandler handler = (EventHandler) eventHandler; - result.append(getInitializationCode(handler, compiler)); - } - return result.toString(); - } - - protected String getInitializationCode(EventHandler handler, JAXXCompiler compiler) { - MethodDescriptor addMethod = handler.getAddMethod(); - ClassDescriptor listenerClass = addMethod.getParameterTypes()[0]; - //TC-20091026 use 'this' instead of root object javaCode - return getJavaCode() + '.' + addMethod.getName() + "((" + JAXXCompiler.getCanonicalName(listenerClass) + - ") jaxx.runtime.Util.getEventListener(" + JAXXCompiler.getCanonicalName(listenerClass) + ".class, " + - compiler.getJavaCode(handler.getListenerMethod().getName()) + ", this, " + - // compiler.getJavaCode(handler.getListenerMethod().getName()) + ", " + compiler.getRootObject().getJavaCode() + ", " + - compiler.getJavaCode(compiler.getEventHandlerMethodName(handler)) + "));" + JAXXCompiler.getLineSeparator(); - } - - /** - * Returns Java code to complete final setup on this object. This code may - * reference other <code>CompiledObjects</code>, as they are guaranteed to - * have all been created by this point. - * - * @return code which adds children and performs final setup - */ - public String getAdditionCode() { - return additionCode.toString(); - } - - /** - * Appends code to the initialization code block. A line separator is - * automatically appended to the end. - * - * @param code the code to add to the initialization block - * @see #getInitializationCode - */ - public void appendInitializationCode(String code) { - if (!code.isEmpty()) { - this.initializationCode.append(code); - this.initializationCode.append(JAXXCompiler.getLineSeparator()); - } - } - - /** - * Appends code to the addition code block. A line separator is - * automatically appended to the end. - * - * @param code the code to add to the addition block - * @see #getAdditionCode - */ - public void appendAdditionCode(String code) { - if (!code.isEmpty()) { - this.additionCode.append(code); - this.additionCode.append(JAXXCompiler.getLineSeparator()); - } - } - - /** - * Stores a property for this object. The only effect of calling this - * method is that the property will be returned by {@code getProperties()}. - * - * @param property the name of the property - * @param value the property's value - * @see #getProperties - */ - public void addProperty(String property, String value) { - properties.put(property, value); - } - - public boolean hasClientProperties() { - return clientProperties != null && !clientProperties.isEmpty(); - } - - public void addClientProperty(String property, String value) { - getClientProperties().put(property, value); - } - - public String getClientProperty(String key) { - if (!hasClientProperties()) { - return null; - } - return clientProperties.get(key); - } - - public Map<String, String> getClientProperties() { - if (clientProperties == null) { - clientProperties = new HashMap<String, String>(); - } - return clientProperties; - } - - /** - * Returns all properties which have been set for this object. - * - * @return a <code>Map</code> containing all properties defined for this object - * @see #addProperty - */ - public Map<?, ?>/*<String, String>*/ getProperties() { - return properties; - } - - // TODO: remove this temporary method and complete switchover to MethodDescriptors - public void addEventHandler(String eventId, Method addMethod, Method listenerMethod, String code, JAXXCompiler compiler) { - try { - ClassDescriptor descriptor = ClassDescriptorLoader.getClassDescriptor(getObjectClass().getName()); - String listenerClassName = addMethod.getParameterTypes()[0].getName(); - ClassDescriptor listenerDescriptor = ClassDescriptorLoader.getClassDescriptor(listenerClassName); - MethodDescriptor addMethodDescriptor = descriptor.getMethodDescriptor(addMethod.getName(), listenerDescriptor); - MethodDescriptor listenerMethodDescriptor = listenerDescriptor.getMethodDescriptor(listenerMethod.getName(), ClassDescriptorLoader.getClassDescriptor(listenerMethod.getParameterTypes()[0].getName())); - addEventHandler(eventId, addMethodDescriptor, listenerMethodDescriptor, code, compiler); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Adds an event listener to this object. The generated code will appear - * in the initialization block. - * - * @param eventId unique (per CompiledObject) identifier for the event handler - * @param addMethod the method which adds the event listener - * @param listenerMethod the method (in the listener class) which is called when the event is fired - * @param code the Java code for the listenerMethod's body - * @param compiler the current <code>JAXXCompiler</code> - * @see #getInitializationCode - */ - public void addEventHandler(String eventId, MethodDescriptor addMethod, MethodDescriptor listenerMethod, String code, JAXXCompiler compiler) { - EventHandler handler = new EventHandler(getId() + "." + eventId, getJavaCode(), addMethod, addMethod.getParameterTypes()[0], listenerMethod, code); - compiler.registerEventHandler(handler); - eventHandlers.add(handler); - - if (getJavaCode().indexOf(".") != -1) { - // object lives in another JAXX file and consequently its initialization code won't be output - compiler.appendInitializerCode(getInitializationCode(handler, compiler)); - } - } - - /** - * Adds a child component to this container. The child is added without - * layout constraints. - * - * @param child the component to add - * @param compiler the current <code>JAXXCompiler</code> - * @throws CompilerException if this object is not a container - * @see #addChild(CompiledObject, String, JAXXCompiler) - */ - public void addChild(CompiledObject child, JAXXCompiler compiler) throws CompilerException { - addChild(child, null, compiler); - } - - /** - * Adds a child component to this container. This variant allows the Java - * code for a layout constraints object to be specified. - * - * @param child the component to add - * @param constraints Java code for the layout constraints object - * @param compiler the current <code>JAXXCompiler</code> - * @throws CompilerException if this object is not a container - * @see #addChild(CompiledObject, JAXXCompiler) - */ - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - try { - if (constraints != null) { - constraints = compiler.checkJavaCode(constraints); - } - } catch (CompilerException e) { - compiler.reportError("While parsing 'constraints' attribute: " + e.getMessage()); - } - - if (!child.isOverride()) { - TagHandler tagHandler = TagManager.getTagHandler(getObjectClass()); - if (tagHandler instanceof DefaultComponentHandler && - !((DefaultComponentHandler) tagHandler).isContainer()) { - compiler.reportError("component " + this + " may not have children"); - } - - String containerDelegate = ((DefaultComponentHandler) tagHandler).getContainerDelegate(); - String delegateCode = containerDelegate != null ? "." + containerDelegate + "()" : ""; - - child.setParent(this); - - childs.add(new ChildRef(child, constraints, child.getJavaCode(), delegateCode)); - } - } - - @Override - public String toString() { - return getObjectClass().getName() + "[id='" + id + "']"; - } - - public String getGenericTypes() { - if (getGenericTypesLength() == 0) { - // not using it - return ""; - } - String result = ""; - for (int i = 0, j = getGenericTypesLength(); i < j; i++) { - result += ", " + genericTypes[i]; - } - return "< " + result.substring(2) + " >"; - } - - public void setGenericTypes(String[] genericTypes) { - if (genericTypes == null) { - this.genericTypes = null; - return; - } - this.genericTypes = new String[genericTypes.length]; - for (int i = 0, j = genericTypes.length; i < j; i++) { - this.genericTypes[i] = genericTypes[i].trim(); - } - } - - public boolean isJavaBean() { - return javaBean; - } - - public void setJavaBean(boolean javaBean) { - this.javaBean = javaBean; - } - - public ClassDescriptor getOverrideType() { - return overrideType; - } - - public void setOverrideType(ClassDescriptor overrideType) { - this.overrideType = overrideType; - } - - public String getJavaBeanInitCode() { - return javaBeanInitCode; - } - - public void setJavaBeanInitCode(String javaBeanInitCode) { - this.javaBeanInitCode = javaBeanInitCode; - } - - public List<ChildRef> getChilds() { - return childs; - } - - public CompiledObjectDecorator getDecorator() { - return decorator; - } - - public void setDecorator(CompiledObjectDecorator decorator) { - this.decorator = decorator; - } - - public void finalizeCompiler(JAXXCompiler compiler) { - - List<CompiledObject.ChildRef> refList = getChilds(); - if (refList != null && !refList.isEmpty()) { - // compute additionCode for all childs - StringBuffer buffer = new StringBuffer(); - for (ChildRef childRef : refList) { - childRef.addToAdditionCode(buffer, compiler.getRootObject() == this); - } - additionCode = buffer.append(additionCode); - return; - } - } - - public int getGenericTypesLength() { - return genericTypes == null ? 0 : genericTypes.length; - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.reflect.MethodDescriptor; +import jaxx.compiler.tags.DefaultComponentHandler; +import jaxx.compiler.tags.TagHandler; +import jaxx.compiler.tags.TagManager; + +import java.awt.Container; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.lang.StringUtils; + +/** + * Represents an object in the <code>.java</code> file being generated during compilation. There is + * a <code>CompiledObject</code> for each class tag encountered, and certain tags may generate + * additional objects for various reasons. + */ +public class CompiledObject { + + /** + * The object's id. + */ + private String id; + /** + * Java code referring to the object. + */ + private String javaCode; + /** + * The object's class. + */ + private ClassDescriptor objectClass; + /** + * The style class. + */ + private String styleClass; + /** + * The container containing this CompiledObject. + */ + private CompiledObject parent; + /** + * true if this object overrides an object of the same id in a superclass + * of the object being compiled + */ + private boolean override; + /** + * Comma-separated Java code snippets representing the parameters that + * should be passed to the object's constructor. + */ + private String constructorParams; + /** + * Java code snippet which performs basic initialization of the object (after it has already been constructed). + * Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other + * CompiledObjects from initializationCode -- you must refer to them from additionCode instead. + */ + private StringBuffer initializationCode = new StringBuffer(); + /** + * Java code snippet which completes setup by adding any child objects, or otherwise manipulates any refererenced + * objects. Because CompiledObject initialization order cannot be guaranteed, it is not safe to refer to other + * CompiledObjects from initializationCode -- you must refer to them from additionCode instead. + */ + private StringBuffer additionCode = new StringBuffer(); + /** + * List of all registered event handlers. + */ + private List<EventHandler> eventHandlers = new ArrayList<EventHandler>(); + /** + * All properties that have been applied to this CompiledObject. + */ + private Map<String, String> properties = new HashMap<String, String>(); + /** + * generic types of the compiled object + */ + private String[] genericTypes; + /** + * a flag to indicate if javaBean full support must be support for this + * object by root object + */ + private boolean javaBean; + /** + * code to initialize the bean (can be null) + */ + private String javaBeanInitCode; + /** + * the type of the override object (can be null if no overide) + */ + private ClassDescriptor overrideType; + /** + * the decorator + */ + private CompiledObjectDecorator decorator; + /** + * client properties + */ + private Map<String, String> clientProperties; + + public class ChildRef { + + CompiledObject child; + String constraints; + String childJavaCode; + String delegateCode; + + public ChildRef(CompiledObject child, String constraints, String childJavaCode, String delegateCode) { + this.child = child; + this.constraints = constraints; + this.childJavaCode = childJavaCode; + this.delegateCode = delegateCode; + } + + public CompiledObject getChild() { + return child; + } + + public void setChild(CompiledObject child) { + this.child = child; + } + + public String getConstraints() { + return constraints; + } + + public void setConstraints(String constraints) { + this.constraints = constraints; + } + + public String getChildJavaCode() { + return childJavaCode; + } + + public void setChildJavaCode(String childJavaCode) { + this.childJavaCode = childJavaCode; + } + + public String getDelegateCode() { + return delegateCode; + } + + public void setDelegateCode(String delegateCode) { + this.delegateCode = delegateCode; + } + + public void addToAdditionCode(StringBuffer buffer, boolean isRootObject) { + //TC-20091026 do not prefix if on root object + String prefix; + if (isRootObject) { + prefix = ""; + } else { + prefix = javaCode + delegateCode + "."; + } + if (constraints != null) { +// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(", ").append(constraints).append(");"); + buffer.append(prefix).append("add(").append(childJavaCode).append(", ").append(constraints).append(");"); + } else { +// buffer.append(javaCode).append(delegateCode).append(".add(").append(childJavaCode).append(");"); + buffer.append(prefix).append("add(").append(childJavaCode).append(");"); + } + buffer.append(JAXXCompiler.getLineSeparator()); + } + } + private List<ChildRef> childs; + + /** + * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a + * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}. + * + * @param id the object's id + * @param objectClass the object's class + * @param compiler the current <code>JAXXCompiler</code> + * @throws NullPointerException if id or class is null + */ + public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler) { + this(id, objectClass, compiler, false); + } + + /** + * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a + * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}. + * + * @param id the object's id + * @param objectClass the object's class + * @param compiler the current <code>JAXXCompiler</code> + * @param force <code>true</code> to force acceptance of invalid ids + * @throws NullPointerException if id or class is null + */ + public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) { + this(id, id, objectClass, compiler, force); + } + + /** + * Creates a new <code>CompiledObject</code>. To be useful, the object should be registered with a + * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledObject registerCompiledObject}. + * + * @param id the object's id + * @param javaCode Java code referring to the object + * @param objectClass the object's class + * @param force <code>true</code> to force acceptance of invalid ids + * @param compiler the current <code>JAXXCompiler</code> + * @throws CompilerException if the id is not a valid Java identifier + * @throws NullPointerException if id or class is null + */ + public CompiledObject(String id, String javaCode, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) throws CompilerException { + if (!force) { + if (!isValidID(id)) { + compiler.reportError("the id '" + id + "' is not a valid Java identifier"); + } + } + this.id = id; + this.javaCode = javaCode; + + if (objectClass == null) { + throw new NullPointerException(); + } + this.objectClass = objectClass; + this.childs = new ArrayList<ChildRef>(); + } + + public static boolean isValidID(String id) { + boolean valid = true; + if (id.length() == 0) { + valid = false; + } + if (valid) { + if (!Character.isJavaIdentifierStart(id.charAt(0))) { + valid = false; + } + if (valid) { + for (int i = 1; i < id.length(); i++) { + if (!Character.isJavaIdentifierPart(id.charAt(i))) { + valid = false; + break; + } + } + } + } + return valid; + } + + /** + * True if this object overrides an object in the superclass of the class + * being compiled. For this to be true, the class currently being compiled + * must be a subclass of another <code>JAXXObject</code> which has an + * identically-named object. + * + * @return <code>true</code> if this object is an override + * @see #setOverride + */ + public boolean isOverride() { + return override; + } + + /** + * Sets whether this class overrides an identically-named object in the + * parent class. + * + * @param override <code>true</code> if this object is an override + * @see #isOverride + */ + public void setOverride(boolean override) { + this.override = override; + } + + /** + * Returns this object's CSS style class. + * + * @return the value of the <code>styleClass</code> attribute + */ + public String getStyleClass() { + return styleClass; + } + + /** + * Sets this object's CSS style class. + * + * @param styleClass the new style class + */ + public void setStyleClass(String styleClass) { + this.styleClass = styleClass; + } + + /** + * Returns this object's parent container. Non-visual components (and + * the root container) return <code>null</code>. + * + * @return the object's parent container + */ + public CompiledObject getParent() { + return parent; + } + + /** + * Sets this object's parent container. + * + * @param parent the parent container + * @throws IllegalArgumentException if parent is not a {@link Container} + */ + public void setParent(CompiledObject parent) throws IllegalArgumentException { + if (!ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(parent.getObjectClass())) { + throw new IllegalArgumentException("parent must descend from java.awt.Container"); + } + this.parent = parent; + } + + /** + * Returns the name of the method that should be generated in the compiled + * <code>.java</code> file + * in order to create this object. This is just a suggestion and may be + * ignored. + * + * @return the suggested name of the method which initializes this object + */ + public String getCreationMethodName() { + return "create" + StringUtils.capitalize(getId()); + } + + /** + * Returns the name of the method that should be generated in the compiled + * <code>.java</code> file in order to add children to this object. This + * is just a suggestion and may be ignored. + * + * @return the suggested name of the method which completes this object's setup + */ + public String getAdditionMethodName() { + return "addChildrenTo" + StringUtils.capitalize(getId()); + } + + /** + * Returns the type of this object. + * + * @return the class this <code>CompiledObject</code> represents + */ + public ClassDescriptor getObjectClass() { + return objectClass; + } + + /** + * Returns this object's id. Generally, a field with this name will be + * created in the compiled <code>.java</code> + * file in order to represent this object. + * + * @return the id used to refer to this object + */ + public String getId() { + return id; + } + + /** + * Returns Java code used to refer to this object in the compiled Java file. + * This is usually the same as its id. + * + * @return the Java code for this object + */ + public String getJavaCode() { + String result = javaCode; + if (isOverride()) { + // handle cases where object is overridden to be a different class + result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")"; + } + return result; + } + + public String getJavaCodeForProperty(String property) { + if (!override) { + return javaCode; + } + String result = "((" + JAXXCompiler.getCanonicalName(getObjectClass()) + ") " + javaCode + ")"; + + String methodName = StringUtils.capitalize(property); + try { + MethodDescriptor methodDescriptor = overrideType.getMethodDescriptor("get" + methodName); + if (methodDescriptor != null) { + if (overrideType.getMethodDescriptor("set" + methodName, methodDescriptor.getReturnType()) != null) { + // handle cases where object is overridden to be a different class + result = javaCode; + } + } + } catch (NoSuchMethodException e) { + // lazy error, do nothing + } + return result; + } + + /** + * Returns a list of comma-separated Java code snippets that represent the + * parameters to pass to this object's constructor. + * + * @return the raw constructor params + * @see #setConstructorParams + */ + public String getConstructorParams() { + return constructorParams; + } + + /** + * Sets the parameters to pass to this object's constructor. + * + * @param constructorParams comma-separated Java code snippets representing + * constructor params + * @see #getConstructorParams + */ + public void setConstructorParams(String constructorParams) { + this.constructorParams = constructorParams; + } + + /** + * Returns the code that performs basic initialization of this object, + * after it has already been constructed. + * This basic code should not reference any other + * <code>CompiledObjects</code> as they may not have been created yet. + * + * @param compiler compiler to use + * @return the code which initializes this object + */ + public String getInitializationCode(JAXXCompiler compiler) { + StringBuffer result = new StringBuffer(initializationCode.toString()); + for (Object eventHandler : eventHandlers) { + EventHandler handler = (EventHandler) eventHandler; + result.append(getInitializationCode(handler, compiler)); + } + return result.toString(); + } + + protected String getInitializationCode(EventHandler handler, JAXXCompiler compiler) { + MethodDescriptor addMethod = handler.getAddMethod(); + ClassDescriptor listenerClass = addMethod.getParameterTypes()[0]; + //TC-20091026 use 'this' instead of root object javaCode + return getJavaCode() + '.' + addMethod.getName() + "((" + JAXXCompiler.getCanonicalName(listenerClass) + + ") jaxx.runtime.Util.getEventListener(" + JAXXCompiler.getCanonicalName(listenerClass) + ".class, " + + compiler.getJavaCode(handler.getListenerMethod().getName()) + ", this, " + + // compiler.getJavaCode(handler.getListenerMethod().getName()) + ", " + compiler.getRootObject().getJavaCode() + ", " + + compiler.getJavaCode(compiler.getEventHandlerMethodName(handler)) + "));" + JAXXCompiler.getLineSeparator(); + } + + /** + * Returns Java code to complete final setup on this object. This code may + * reference other <code>CompiledObjects</code>, as they are guaranteed to + * have all been created by this point. + * + * @return code which adds children and performs final setup + */ + public String getAdditionCode() { + return additionCode.toString(); + } + + /** + * Appends code to the initialization code block. A line separator is + * automatically appended to the end. + * + * @param code the code to add to the initialization block + * @see #getInitializationCode + */ + public void appendInitializationCode(String code) { + if (!code.isEmpty()) { + this.initializationCode.append(code); + this.initializationCode.append(JAXXCompiler.getLineSeparator()); + } + } + + /** + * Appends code to the addition code block. A line separator is + * automatically appended to the end. + * + * @param code the code to add to the addition block + * @see #getAdditionCode + */ + public void appendAdditionCode(String code) { + if (!code.isEmpty()) { + this.additionCode.append(code); + this.additionCode.append(JAXXCompiler.getLineSeparator()); + } + } + + /** + * Stores a property for this object. The only effect of calling this + * method is that the property will be returned by {@code getProperties()}. + * + * @param property the name of the property + * @param value the property's value + * @see #getProperties + */ + public void addProperty(String property, String value) { + properties.put(property, value); + } + + public boolean hasClientProperties() { + return clientProperties != null && !clientProperties.isEmpty(); + } + + public void addClientProperty(String property, String value) { + getClientProperties().put(property, value); + } + + public String getClientProperty(String key) { + if (!hasClientProperties()) { + return null; + } + return clientProperties.get(key); + } + + public Map<String, String> getClientProperties() { + if (clientProperties == null) { + clientProperties = new HashMap<String, String>(); + } + return clientProperties; + } + + /** + * Returns all properties which have been set for this object. + * + * @return a <code>Map</code> containing all properties defined for this object + * @see #addProperty + */ + public Map<?, ?>/*<String, String>*/ getProperties() { + return properties; + } + + // TODO: remove this temporary method and complete switchover to MethodDescriptors + public void addEventHandler(String eventId, Method addMethod, Method listenerMethod, String code, JAXXCompiler compiler) { + try { + ClassDescriptor descriptor = ClassDescriptorLoader.getClassDescriptor(getObjectClass().getName()); + String listenerClassName = addMethod.getParameterTypes()[0].getName(); + ClassDescriptor listenerDescriptor = ClassDescriptorLoader.getClassDescriptor(listenerClassName); + MethodDescriptor addMethodDescriptor = descriptor.getMethodDescriptor(addMethod.getName(), listenerDescriptor); + MethodDescriptor listenerMethodDescriptor = listenerDescriptor.getMethodDescriptor(listenerMethod.getName(), ClassDescriptorLoader.getClassDescriptor(listenerMethod.getParameterTypes()[0].getName())); + addEventHandler(eventId, addMethodDescriptor, listenerMethodDescriptor, code, compiler); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * Adds an event listener to this object. The generated code will appear + * in the initialization block. + * + * @param eventId unique (per CompiledObject) identifier for the event handler + * @param addMethod the method which adds the event listener + * @param listenerMethod the method (in the listener class) which is called when the event is fired + * @param code the Java code for the listenerMethod's body + * @param compiler the current <code>JAXXCompiler</code> + * @see #getInitializationCode + */ + public void addEventHandler(String eventId, MethodDescriptor addMethod, MethodDescriptor listenerMethod, String code, JAXXCompiler compiler) { + EventHandler handler = new EventHandler(getId() + "." + eventId, getJavaCode(), addMethod, addMethod.getParameterTypes()[0], listenerMethod, code); + compiler.registerEventHandler(handler); + eventHandlers.add(handler); + + if (getJavaCode().indexOf(".") != -1) { + // object lives in another JAXX file and consequently its initialization code won't be output + compiler.appendInitializerCode(getInitializationCode(handler, compiler)); + } + } + + /** + * Adds a child component to this container. The child is added without + * layout constraints. + * + * @param child the component to add + * @param compiler the current <code>JAXXCompiler</code> + * @throws CompilerException if this object is not a container + * @see #addChild(CompiledObject, String, JAXXCompiler) + */ + public void addChild(CompiledObject child, JAXXCompiler compiler) throws CompilerException { + addChild(child, null, compiler); + } + + /** + * Adds a child component to this container. This variant allows the Java + * code for a layout constraints object to be specified. + * + * @param child the component to add + * @param constraints Java code for the layout constraints object + * @param compiler the current <code>JAXXCompiler</code> + * @throws CompilerException if this object is not a container + * @see #addChild(CompiledObject, JAXXCompiler) + */ + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + try { + if (constraints != null) { + constraints = compiler.checkJavaCode(constraints); + } + } catch (CompilerException e) { + compiler.reportError("While parsing 'constraints' attribute: " + e.getMessage()); + } + + if (!child.isOverride()) { + TagHandler tagHandler = TagManager.getTagHandler(getObjectClass()); + if (tagHandler instanceof DefaultComponentHandler && + !((DefaultComponentHandler) tagHandler).isContainer()) { + compiler.reportError("component " + this + " may not have children"); + } + + String containerDelegate = ((DefaultComponentHandler) tagHandler).getContainerDelegate(); + String delegateCode = containerDelegate != null ? "." + containerDelegate + "()" : ""; + + child.setParent(this); + + childs.add(new ChildRef(child, constraints, child.getJavaCode(), delegateCode)); + } + } + + @Override + public String toString() { + return getObjectClass().getName() + "[id='" + id + "']"; + } + + public String getGenericTypes() { + if (getGenericTypesLength() == 0) { + // not using it + return ""; + } + String result = ""; + for (int i = 0, j = getGenericTypesLength(); i < j; i++) { + result += ", " + genericTypes[i]; + } + return "< " + result.substring(2) + " >"; + } + + public void setGenericTypes(String[] genericTypes) { + if (genericTypes == null) { + this.genericTypes = null; + return; + } + this.genericTypes = new String[genericTypes.length]; + for (int i = 0, j = genericTypes.length; i < j; i++) { + this.genericTypes[i] = genericTypes[i].trim(); + } + } + + public boolean isJavaBean() { + return javaBean; + } + + public void setJavaBean(boolean javaBean) { + this.javaBean = javaBean; + } + + public ClassDescriptor getOverrideType() { + return overrideType; + } + + public void setOverrideType(ClassDescriptor overrideType) { + this.overrideType = overrideType; + } + + public String getJavaBeanInitCode() { + return javaBeanInitCode; + } + + public void setJavaBeanInitCode(String javaBeanInitCode) { + this.javaBeanInitCode = javaBeanInitCode; + } + + public List<ChildRef> getChilds() { + return childs; + } + + public CompiledObjectDecorator getDecorator() { + return decorator; + } + + public void setDecorator(CompiledObjectDecorator decorator) { + this.decorator = decorator; + } + + public void finalizeCompiler(JAXXCompiler compiler) { + + List<CompiledObject.ChildRef> refList = getChilds(); + if (refList != null && !refList.isEmpty()) { + // compute additionCode for all childs + StringBuffer buffer = new StringBuffer(); + for (ChildRef childRef : refList) { + childRef.addToAdditionCode(buffer, compiler.getRootObject() == this); + } + additionCode = buffer.append(additionCode); + return; + } + } + + public int getGenericTypesLength() { + return genericTypes == null ? 0 : genericTypes.length; + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import jaxx.compiler.java.JavaFile; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerConfiguration.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import java.io.File; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/CompilerException.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,50 +1,66 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler; - -/** Thrown by the compiler when an error occurs. */ -public class CompilerException extends RuntimeException { - - private static final long serialVersionUID = -9099889519671482440L; - - /** Creates a new <code>ParseException</code>. */ - public CompilerException() { - } - - /** - * Creates a new <code>ParseException</code> with the specified detail message. - * - * @param msg the exception's detail message - */ - public CompilerException(String msg) { - super(msg); - } - - /** - * Creates a new <code>ParseException</code> with the specified cause. - * - * @param initCause the exception's initCause - */ - public CompilerException(Throwable initCause) { - super(initCause); - } - - /** - * Creates a new <code>ParseException</code> with the specified detail message and cause. - * - * @param msg the exception's detail message - * @param initCause the exception's initCause - */ - public CompilerException(String msg, Throwable initCause) { - super(msg, initCause); - } - - @Override - public void printStackTrace() { - super.printStackTrace(); - System.err.println("CompilerException printed from:"); - Thread.dumpStack(); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler; + +/** Thrown by the compiler when an error occurs. */ +public class CompilerException extends RuntimeException { + + private static final long serialVersionUID = -9099889519671482440L; + + /** Creates a new <code>ParseException</code>. */ + public CompilerException() { + } + + /** + * Creates a new <code>ParseException</code> with the specified detail message. + * + * @param msg the exception's detail message + */ + public CompilerException(String msg) { + super(msg); + } + + /** + * Creates a new <code>ParseException</code> with the specified cause. + * + * @param initCause the exception's initCause + */ + public CompilerException(Throwable initCause) { + super(initCause); + } + + /** + * Creates a new <code>ParseException</code> with the specified detail message and cause. + * + * @param msg the exception's detail message + * @param initCause the exception's initCause + */ + public CompilerException(String msg, Throwable initCause) { + super(msg, initCause); + } + + @Override + public void printStackTrace() { + super.printStackTrace(); + System.err.println("CompilerException printed from:"); + Thread.dumpStack(); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataBinding.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import org.apache.commons.logging.Log; @@ -5,7 +25,8 @@ /** * Represents a data binding in a JAXX file. <code>DataBinding</code> uses - * {@link DataSource} to track changes to a source expression and update the destination. + * {@link DataSource} to track changes to a source expression and update + * the destination. */ public class DataBinding { Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DataSource.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,469 +1,485 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler; - -import jaxx.compiler.java.JavaField; -import jaxx.compiler.java.parser.JavaParser; -import jaxx.compiler.java.parser.JavaParserConstants; -import jaxx.compiler.java.parser.JavaParserTreeConstants; -import jaxx.compiler.java.parser.SimpleNode; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.reflect.FieldDescriptor; -import jaxx.compiler.reflect.MethodDescriptor; -import jaxx.compiler.tags.DefaultObjectHandler; -import jaxx.compiler.tags.TagManager; -import jaxx.compiler.types.TypeManager; - -import java.beans.Introspector; -import java.beans.PropertyChangeListener; -import java.io.StringReader; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -/** - * Represents a Java expression which fires a <code>PropertyChangeEvent</code> when it can be - * determined that its value may have changed. Events are fired on a "best effort" basis, and events - * may either be fired too often (the value has not actually changed) or not often enough (the value - * changed but no event was fired). - */ -public class DataSource { - - /** - * type attached to "null" constants in parsed expressions - */ - private class NULL { - } - /** - * id of data source - */ - private String id; - /** - * The Java source code for the expression. - */ - private String source; - /** - * The current <code>JAXXCompiler</code>. - */ - private JAXXCompiler compiler; - /** - * List of symbols which this data source expression depends on. - */ - private List<String> dependencySymbols = new ArrayList<String>(); - /** - * - */ - private StringBuffer addListenerCode = new StringBuffer(); - /** - * - */ - private StringBuffer removeListenerCode = new StringBuffer(); - /** - * - */ - private boolean compiled; - /** - * the delegate of property to be required - */ - private String objectCode; - - /** - * Creates a new data source. After creating a <code>DataSource</code>, use {@link #compile} - * to cause it to function at runtime. - * - * @param id the DataSource's id - * @param source the Java source code for the data source expression - * @param compiler the current <code>JAXXCompiler</code> - */ - public DataSource(String id, String source, JAXXCompiler compiler) { - this.id = id; - this.source = source; - this.compiler = compiler; - } - - public String getId() { - return id; - } - - public String getSource() { - return source; - } - - public String getObjectCode() { - return objectCode; - } - - /** - * Compiles the data source expression and listener. This method calls methods in <code>JAXXCompiler</code> - * to add the Java code that performs the data source setup. Adding listeners to <code>DataSource</code> is - * slightly more complicated than with ordinary classes, because <code>DataSource</code> only exists at compile - * time. You must pass in a Java expression which evaluates to a <code>PropertyChangeListener</code>; this - * expression will be compiled and evaluated at runtime to yield the <code>DataSource's</code> listener. - * - * @param propertyChangeListenerCode Java code snippet which evaluates to a <code>PropertyChangeListener</code> - * @return <code>true</code> if the expression has dependencies, <code>false</code> otherwise - * @throws CompilerException if a compilation error occurs - * @throws IllegalStateException if data source was already compiled - */ - public boolean compile(String propertyChangeListenerCode) throws CompilerException, IllegalStateException { - if (compiled) { - throw new IllegalStateException(this + " has already been compiled"); - } - String autoId = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(getClass())); - JavaParser p = new JavaParser(new StringReader(source + ";")); - while (!p.Line()) { - SimpleNode node = p.popNode(); - scanNode(node, autoId); - } - - if (dependencySymbols.size() > 0) { - //TC 20081108 prefer add a real JavaField instead of raw code - //compiler.appendBodyCode("private PropertyChangeListener " + id + " = " + propertyChangeListenerCode + ";\n"); - compiler.addSimpleField(new JavaField(Modifier.PRIVATE, PropertyChangeListener.class.getSimpleName(), autoId, false, propertyChangeListenerCode)); - } - - compileListeners(); - compiled = true; - - return dependencySymbols.size() > 0; - } - - /** @return a list of symbols on which this data source depends. */ - public Collection<String> getDependencies() { - return Collections.unmodifiableList(dependencySymbols); - } - - /** - * Examines a node to identify any dependencies it contains. - * - * @param node node to scan - * @param listenerId id of listener - * @throws CompilerException ? - */ - private void scanNode(SimpleNode node, String listenerId) throws CompilerException { - switch (node.getId()) { - case JavaParserTreeConstants.JJTMETHODDECLARATION: - break; - case JavaParserTreeConstants.JJTFIELDDECLARATION: - break; - - default: - int count = node.jjtGetNumChildren(); - for (int i = 0; i < count; i++) { - scanNode(node.getChild(i), listenerId); - } - determineNodeType(node, listenerId); - } - } - - private ClassDescriptor determineLiteralType(SimpleNode node) { - assert node.getId() == JavaParserTreeConstants.JJTLITERAL; - if (node.jjtGetNumChildren() == 1) { - int childId = node.getChild(0).getId(); - if (childId == JavaParserTreeConstants.JJTBOOLEANLITERAL) { - return ClassDescriptorLoader.getClassDescriptor(boolean.class); - } - if (childId == JavaParserTreeConstants.JJTNULLLITERAL) { - return ClassDescriptorLoader.getClassDescriptor(NULL.class); - } - throw new RuntimeException("Expected BooleanLiteral or NullLiteral, found " + JavaParserTreeConstants.jjtNodeName[childId]); - } - int nodeId = node.firstToken.kind; - switch (nodeId) { - case JavaParserConstants.INTEGER_LITERAL: - if (node.firstToken.image.toLowerCase().endsWith("l")) { - return ClassDescriptorLoader.getClassDescriptor(long.class); - } - return ClassDescriptorLoader.getClassDescriptor(int.class); - case JavaParserConstants.CHARACTER_LITERAL: - return ClassDescriptorLoader.getClassDescriptor(char.class); - case JavaParserConstants.FLOATING_POINT_LITERAL: - if (node.firstToken.image.toLowerCase().endsWith("f")) { - return ClassDescriptorLoader.getClassDescriptor(float.class); - } - return ClassDescriptorLoader.getClassDescriptor(double.class); - case JavaParserConstants.STRING_LITERAL: - return ClassDescriptorLoader.getClassDescriptor(String.class); - default: - throw new RuntimeException("Expected literal token, found " + JavaParserConstants.tokenImage[nodeId]); - } - } - - /** - * Scans through a compound symbol (foo.bar.baz) to identify and track all trackable pieces of it. - * - * @param symbol symbol to scan - * @param contextClass current class context - * @param isMethod flag to search a method - * @param listenerId id of the listener - * @return the type of the symbol (or null if it could not be determined). - */ - private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescriptor contextClass, boolean isMethod, String listenerId) { - String[] tokens = symbol.split("\\s*\\.\\s*"); - StringBuffer currentSymbol = new StringBuffer(); - StringBuffer tokensSeenSoFar = new StringBuffer(); - boolean accepted; // if this ends up false, it means we weren't able to figure out - // which object the method is being invoked on - boolean recognizeClassNames = true; - for (int j = 0; j < tokens.length - (isMethod ? 1 : 0); j++) { - accepted = false; - - if (tokensSeenSoFar.length() > 0) { - tokensSeenSoFar.append('.'); - } - tokensSeenSoFar.append(tokens[j]); - if (currentSymbol.length() > 0) { - currentSymbol.append('.'); - } - currentSymbol.append(tokens[j]); - - if (currentSymbol.indexOf(".") == -1) { - String memberName = currentSymbol.toString(); - CompiledObject object = compiler.getCompiledObject(memberName); - if (object != null) { - contextClass = object.getObjectClass(); - currentSymbol.setLength(0); - accepted = true; - recognizeClassNames = false; - } else { - try { - FieldDescriptor field = contextClass.getFieldDescriptor(memberName); - trackMemberIfPossible(tokensSeenSoFar.toString(), contextClass, field.getName(), false, listenerId); - contextClass = field.getType(); - currentSymbol.setLength(0); - accepted = true; - recognizeClassNames = false; - } catch (NoSuchFieldException e) { - if (j == 0 || j == 1 && tokens[0].equals(compiler.getRootObject().getId())) { // still in root context - FieldDescriptor[] newFields = compiler.getScriptFields(); - for (FieldDescriptor newField : newFields) { - if (newField.getName().equals(memberName)) { - addListener(tokensSeenSoFar.toString(), - null, - "addPropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(), - "removePropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator()); - contextClass = newField.getType(); - assert contextClass != null : "script field '" + memberName + "' is defined, but has type null"; - currentSymbol.setLength(0); - accepted = true; - recognizeClassNames = false; - break; - } - } - } - } - } - } - if (currentSymbol.length() > 0 && recognizeClassNames) { - contextClass = TagManager.resolveClass(currentSymbol.toString(), compiler); - if (contextClass != null) { - currentSymbol.setLength(0); - //accepted = true; - //recognizeClassNames = false; - // TODO: for now we don't handle statics - return null; - } - } - if (!accepted) { - return null; - } - } - - return contextClass; - } - - /** - * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which - * can be tracked. - * - * @param expression the node to scan - * @param listenerId id of the listener - * @return the class descriptor of the return type or null - */ - private ClassDescriptor determineExpressionType(SimpleNode expression, String listenerId) { - assert expression.getId() == JavaParserTreeConstants.JJTPRIMARYEXPRESSION; - SimpleNode prefix = expression.getChild(0); - if (prefix.jjtGetNumChildren() == 1) { - int type = prefix.getChild(0).getId(); - if (type == JavaParserTreeConstants.JJTLITERAL || type == JavaParserTreeConstants.JJTEXPRESSION) { - prefix.setJavaType(prefix.getChild(0).getJavaType()); - } else if (type == JavaParserTreeConstants.JJTNAME && expression.jjtGetNumChildren() == 1) // name with no arguments after it - { - prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(), compiler.getRootObject().getObjectClass(), false, listenerId)); - } - } - - if (expression.jjtGetNumChildren() == 1) { - return prefix.getJavaType(); - } - - ClassDescriptor contextClass = prefix.getJavaType(); - if (contextClass == null) { - contextClass = compiler.getRootObject().getObjectClass(); - } - String lastNode = prefix.getText().trim(); - - for (int i = 1; i < expression.jjtGetNumChildren(); i++) { - SimpleNode suffix = expression.getChild(i); - if (suffix.jjtGetNumChildren() == 1 && suffix.getChild(0).getId() == JavaParserTreeConstants.JJTARGUMENTS) { - if (suffix.getChild(0).jjtGetNumChildren() == 0) { - // at the moment only no-argument methods are trackable - contextClass = scanCompoundSymbol(lastNode, contextClass, true, listenerId); - if (contextClass == null) { - return null; - } - int dotPos = lastNode.lastIndexOf("."); - String code = dotPos == -1 ? "" : lastNode.substring(0, dotPos); - for (int j = i - 2; j >= 0; j--) { - code = expression.getChild(j).getText() + code; - } - if (code.length() == 0) { - code = compiler.getRootObject().getJavaCode(); - } - String methodName = lastNode.substring(dotPos + 1).trim(); - try { - MethodDescriptor method = contextClass.getMethodDescriptor(methodName); - trackMemberIfPossible(code, contextClass, method.getName(), true, listenerId); - return method.getReturnType(); - } catch (NoSuchMethodException e) { - // happens for methods defined in the current JAXX file via scripts - String propertyName = null; - if (methodName.startsWith("is")) { - propertyName = Introspector.decapitalize(methodName.substring("is".length())); - } else if (methodName.startsWith("get")) { - propertyName = Introspector.decapitalize(methodName.substring("get".length())); - } - if (propertyName != null) { - MethodDescriptor[] newMethods = compiler.getScriptMethods(); - for (MethodDescriptor newMethod : newMethods) { - if (newMethod.getName().equals(methodName)) { - addListener(compiler.getRootObject().getId(), - null, - "addPropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(), - "removePropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator()); - contextClass = newMethod.getReturnType(); - break; - } - } - } - } - } - } - lastNode = suffix.getText().trim(); - if (lastNode.startsWith(".")) { - lastNode = lastNode.substring(1); - } - } - - return null; - } - - private void trackMemberIfPossible(String objectCode, ClassDescriptor objectClass, String memberName, boolean method, String listenerId) { - if (objectClass.isInterface()) { - // might be technically possible to track in some cases, but for now - // we can't create a DefaultObjectHandler for interfaces - return; - } - - DefaultObjectHandler handler = TagManager.getTagHandler(objectClass); - try { - if (handler.isMemberBound(memberName)) { - addListener(objectCode + "." + memberName + (method ? "()" : ""), - objectCode, - handler.getAddMemberListenerCode(objectCode, id, memberName, listenerId, compiler), - handler.getRemoveMemberListenerCode(objectCode, id, memberName, listenerId, compiler)); - } - } catch (UnsupportedAttributeException e) { - // ignore -- this is thrown for methods like toString(), for which there is no tracking and - // no setting support - } - } - - /** - * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which - * can be tracked. - * - * @param node node to scan - * @param listenerId the listener id - */ - private void determineNodeType(SimpleNode node, String listenerId) { - ClassDescriptor type = null; - if (node.jjtGetNumChildren() == 1) { - type = node.getChild(0).getJavaType(); - } - switch (node.getId()) { - case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE: - type = ClassDescriptorLoader.getClassDescriptor(Class.class); - break; - case JavaParserTreeConstants.JJTPRIMARYEXPRESSION: - type = determineExpressionType(node, listenerId); - break; - case JavaParserTreeConstants.JJTLITERAL: - type = determineLiteralType(node); - break; - case JavaParserTreeConstants.JJTCASTEXPRESSION: - type = TagManager.resolveClass(node.getChild(0).getText(), compiler); - break; - } - node.setJavaType(type); - } - - private void addListener(String dependencySymbol, String objectCode, String addCode, String removeCode) { - this.objectCode = objectCode; - //TC-20091026 no need to test objectCode not null if on root object - boolean needTest = objectCode != null && !compiler.getRootObject().getId().equals(objectCode); -// boolean needTest = objectCode != null; - if (!dependencySymbols.contains(dependencySymbol)) { - dependencySymbols.add(dependencySymbol); - String eol = JAXXCompiler.getLineSeparator(); - addListenerCode.append(eol); - if (needTest) { - addListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol); - addListenerCode.append(" "); - } - addListenerCode.append(" ").append(addCode.trim()); - if (needTest) { - addListenerCode.append(eol).append(" }"); - } - - removeListenerCode.append(eol); - if (needTest) { - removeListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol); - removeListenerCode.append(" "); - } - removeListenerCode.append(" ").append(removeCode.trim()); - if (needTest) { - removeListenerCode.append(eol).append(" }"); - } - } - } - - private void compileListeners() { - String javaCodeId = TypeManager.getJavaCode(id); - String eol = JAXXCompiler.getLineSeparator(); - if (addListenerCode.length() > 0) { - if (compiler.hasApplyDataBinding()) { - compiler.appendApplyDataBinding(" else "); - } -// compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol); - compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {"); - compiler.appendApplyDataBinding(" " + addListenerCode + eol); - compiler.appendApplyDataBinding("}"); - } - - if (removeListenerCode.length() > 0) { - if (compiler.hasRemoveDataBinding()) { - compiler.appendRemoveDataBinding(" else "); - } -// compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol); - compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {"); - compiler.appendRemoveDataBinding(" " + removeListenerCode + eol); - compiler.appendRemoveDataBinding("}"); - } - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler; + +import jaxx.compiler.java.JavaField; +import jaxx.compiler.java.parser.JavaParser; +import jaxx.compiler.java.parser.JavaParserConstants; +import jaxx.compiler.java.parser.JavaParserTreeConstants; +import jaxx.compiler.java.parser.SimpleNode; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.reflect.FieldDescriptor; +import jaxx.compiler.reflect.MethodDescriptor; +import jaxx.compiler.tags.DefaultObjectHandler; +import jaxx.compiler.tags.TagManager; +import jaxx.compiler.types.TypeManager; + +import java.beans.Introspector; +import java.beans.PropertyChangeListener; +import java.io.StringReader; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * Represents a Java expression which fires a <code>PropertyChangeEvent</code> when it can be + * determined that its value may have changed. Events are fired on a "best effort" basis, and events + * may either be fired too often (the value has not actually changed) or not often enough (the value + * changed but no event was fired). + */ +public class DataSource { + + /** + * type attached to "null" constants in parsed expressions + */ + private class NULL { + } + /** + * id of data source + */ + private String id; + /** + * The Java source code for the expression. + */ + private String source; + /** + * The current <code>JAXXCompiler</code>. + */ + private JAXXCompiler compiler; + /** + * List of symbols which this data source expression depends on. + */ + private List<String> dependencySymbols = new ArrayList<String>(); + /** + * + */ + private StringBuffer addListenerCode = new StringBuffer(); + /** + * + */ + private StringBuffer removeListenerCode = new StringBuffer(); + /** + * + */ + private boolean compiled; + /** + * the delegate of property to be required + */ + private String objectCode; + + /** + * Creates a new data source. After creating a <code>DataSource</code>, use {@link #compile} + * to cause it to function at runtime. + * + * @param id the DataSource's id + * @param source the Java source code for the data source expression + * @param compiler the current <code>JAXXCompiler</code> + */ + public DataSource(String id, String source, JAXXCompiler compiler) { + this.id = id; + this.source = source; + this.compiler = compiler; + } + + public String getId() { + return id; + } + + public String getSource() { + return source; + } + + public String getObjectCode() { + return objectCode; + } + + /** + * Compiles the data source expression and listener. This method calls methods in <code>JAXXCompiler</code> + * to add the Java code that performs the data source setup. Adding listeners to <code>DataSource</code> is + * slightly more complicated than with ordinary classes, because <code>DataSource</code> only exists at compile + * time. You must pass in a Java expression which evaluates to a <code>PropertyChangeListener</code>; this + * expression will be compiled and evaluated at runtime to yield the <code>DataSource's</code> listener. + * + * @param propertyChangeListenerCode Java code snippet which evaluates to a <code>PropertyChangeListener</code> + * @return <code>true</code> if the expression has dependencies, <code>false</code> otherwise + * @throws CompilerException if a compilation error occurs + * @throws IllegalStateException if data source was already compiled + */ + public boolean compile(String propertyChangeListenerCode) throws CompilerException, IllegalStateException { + if (compiled) { + throw new IllegalStateException(this + " has already been compiled"); + } + String autoId = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(getClass())); + JavaParser p = new JavaParser(new StringReader(source + ";")); + while (!p.Line()) { + SimpleNode node = p.popNode(); + scanNode(node, autoId); + } + + if (dependencySymbols.size() > 0) { + //TC 20081108 prefer add a real JavaField instead of raw code + //compiler.appendBodyCode("private PropertyChangeListener " + id + " = " + propertyChangeListenerCode + ";\n"); + compiler.addSimpleField(new JavaField(Modifier.PRIVATE, PropertyChangeListener.class.getSimpleName(), autoId, false, propertyChangeListenerCode)); + } + + compileListeners(); + compiled = true; + + return dependencySymbols.size() > 0; + } + + /** @return a list of symbols on which this data source depends. */ + public Collection<String> getDependencies() { + return Collections.unmodifiableList(dependencySymbols); + } + + /** + * Examines a node to identify any dependencies it contains. + * + * @param node node to scan + * @param listenerId id of listener + * @throws CompilerException ? + */ + private void scanNode(SimpleNode node, String listenerId) throws CompilerException { + switch (node.getId()) { + case JavaParserTreeConstants.JJTMETHODDECLARATION: + break; + case JavaParserTreeConstants.JJTFIELDDECLARATION: + break; + + default: + int count = node.jjtGetNumChildren(); + for (int i = 0; i < count; i++) { + scanNode(node.getChild(i), listenerId); + } + determineNodeType(node, listenerId); + } + } + + private ClassDescriptor determineLiteralType(SimpleNode node) { + assert node.getId() == JavaParserTreeConstants.JJTLITERAL; + if (node.jjtGetNumChildren() == 1) { + int childId = node.getChild(0).getId(); + if (childId == JavaParserTreeConstants.JJTBOOLEANLITERAL) { + return ClassDescriptorLoader.getClassDescriptor(boolean.class); + } + if (childId == JavaParserTreeConstants.JJTNULLLITERAL) { + return ClassDescriptorLoader.getClassDescriptor(NULL.class); + } + throw new RuntimeException("Expected BooleanLiteral or NullLiteral, found " + JavaParserTreeConstants.jjtNodeName[childId]); + } + int nodeId = node.firstToken.kind; + switch (nodeId) { + case JavaParserConstants.INTEGER_LITERAL: + if (node.firstToken.image.toLowerCase().endsWith("l")) { + return ClassDescriptorLoader.getClassDescriptor(long.class); + } + return ClassDescriptorLoader.getClassDescriptor(int.class); + case JavaParserConstants.CHARACTER_LITERAL: + return ClassDescriptorLoader.getClassDescriptor(char.class); + case JavaParserConstants.FLOATING_POINT_LITERAL: + if (node.firstToken.image.toLowerCase().endsWith("f")) { + return ClassDescriptorLoader.getClassDescriptor(float.class); + } + return ClassDescriptorLoader.getClassDescriptor(double.class); + case JavaParserConstants.STRING_LITERAL: + return ClassDescriptorLoader.getClassDescriptor(String.class); + default: + throw new RuntimeException("Expected literal token, found " + JavaParserConstants.tokenImage[nodeId]); + } + } + + /** + * Scans through a compound symbol (foo.bar.baz) to identify and track all trackable pieces of it. + * + * @param symbol symbol to scan + * @param contextClass current class context + * @param isMethod flag to search a method + * @param listenerId id of the listener + * @return the type of the symbol (or null if it could not be determined). + */ + private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescriptor contextClass, boolean isMethod, String listenerId) { + String[] tokens = symbol.split("\\s*\\.\\s*"); + StringBuffer currentSymbol = new StringBuffer(); + StringBuffer tokensSeenSoFar = new StringBuffer(); + boolean accepted; // if this ends up false, it means we weren't able to figure out + // which object the method is being invoked on + boolean recognizeClassNames = true; + for (int j = 0; j < tokens.length - (isMethod ? 1 : 0); j++) { + accepted = false; + + if (tokensSeenSoFar.length() > 0) { + tokensSeenSoFar.append('.'); + } + tokensSeenSoFar.append(tokens[j]); + if (currentSymbol.length() > 0) { + currentSymbol.append('.'); + } + currentSymbol.append(tokens[j]); + + if (currentSymbol.indexOf(".") == -1) { + String memberName = currentSymbol.toString(); + CompiledObject object = compiler.getCompiledObject(memberName); + if (object != null) { + contextClass = object.getObjectClass(); + currentSymbol.setLength(0); + accepted = true; + recognizeClassNames = false; + } else { + try { + FieldDescriptor field = contextClass.getFieldDescriptor(memberName); + trackMemberIfPossible(tokensSeenSoFar.toString(), contextClass, field.getName(), false, listenerId); + contextClass = field.getType(); + currentSymbol.setLength(0); + accepted = true; + recognizeClassNames = false; + } catch (NoSuchFieldException e) { + if (j == 0 || j == 1 && tokens[0].equals(compiler.getRootObject().getId())) { // still in root context + FieldDescriptor[] newFields = compiler.getScriptFields(); + for (FieldDescriptor newField : newFields) { + if (newField.getName().equals(memberName)) { + addListener(tokensSeenSoFar.toString(), + null, + "addPropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(), + "removePropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator()); + contextClass = newField.getType(); + assert contextClass != null : "script field '" + memberName + "' is defined, but has type null"; + currentSymbol.setLength(0); + accepted = true; + recognizeClassNames = false; + break; + } + } + } + } + } + } + if (currentSymbol.length() > 0 && recognizeClassNames) { + contextClass = TagManager.resolveClass(currentSymbol.toString(), compiler); + if (contextClass != null) { + currentSymbol.setLength(0); + //accepted = true; + //recognizeClassNames = false; + // TODO: for now we don't handle statics + return null; + } + } + if (!accepted) { + return null; + } + } + + return contextClass; + } + + /** + * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which + * can be tracked. + * + * @param expression the node to scan + * @param listenerId id of the listener + * @return the class descriptor of the return type or null + */ + private ClassDescriptor determineExpressionType(SimpleNode expression, String listenerId) { + assert expression.getId() == JavaParserTreeConstants.JJTPRIMARYEXPRESSION; + SimpleNode prefix = expression.getChild(0); + if (prefix.jjtGetNumChildren() == 1) { + int type = prefix.getChild(0).getId(); + if (type == JavaParserTreeConstants.JJTLITERAL || type == JavaParserTreeConstants.JJTEXPRESSION) { + prefix.setJavaType(prefix.getChild(0).getJavaType()); + } else if (type == JavaParserTreeConstants.JJTNAME && expression.jjtGetNumChildren() == 1) // name with no arguments after it + { + prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(), compiler.getRootObject().getObjectClass(), false, listenerId)); + } + } + + if (expression.jjtGetNumChildren() == 1) { + return prefix.getJavaType(); + } + + ClassDescriptor contextClass = prefix.getJavaType(); + if (contextClass == null) { + contextClass = compiler.getRootObject().getObjectClass(); + } + String lastNode = prefix.getText().trim(); + + for (int i = 1; i < expression.jjtGetNumChildren(); i++) { + SimpleNode suffix = expression.getChild(i); + if (suffix.jjtGetNumChildren() == 1 && suffix.getChild(0).getId() == JavaParserTreeConstants.JJTARGUMENTS) { + if (suffix.getChild(0).jjtGetNumChildren() == 0) { + // at the moment only no-argument methods are trackable + contextClass = scanCompoundSymbol(lastNode, contextClass, true, listenerId); + if (contextClass == null) { + return null; + } + int dotPos = lastNode.lastIndexOf("."); + String code = dotPos == -1 ? "" : lastNode.substring(0, dotPos); + for (int j = i - 2; j >= 0; j--) { + code = expression.getChild(j).getText() + code; + } + if (code.length() == 0) { + code = compiler.getRootObject().getJavaCode(); + } + String methodName = lastNode.substring(dotPos + 1).trim(); + try { + MethodDescriptor method = contextClass.getMethodDescriptor(methodName); + trackMemberIfPossible(code, contextClass, method.getName(), true, listenerId); + return method.getReturnType(); + } catch (NoSuchMethodException e) { + // happens for methods defined in the current JAXX file via scripts + String propertyName = null; + if (methodName.startsWith("is")) { + propertyName = Introspector.decapitalize(methodName.substring("is".length())); + } else if (methodName.startsWith("get")) { + propertyName = Introspector.decapitalize(methodName.substring("get".length())); + } + if (propertyName != null) { + MethodDescriptor[] newMethods = compiler.getScriptMethods(); + for (MethodDescriptor newMethod : newMethods) { + if (newMethod.getName().equals(methodName)) { + addListener(compiler.getRootObject().getId(), + null, + "addPropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(), + "removePropertyChangeListener(\"" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator()); + contextClass = newMethod.getReturnType(); + break; + } + } + } + } + } + } + lastNode = suffix.getText().trim(); + if (lastNode.startsWith(".")) { + lastNode = lastNode.substring(1); + } + } + + return null; + } + + private void trackMemberIfPossible(String objectCode, ClassDescriptor objectClass, String memberName, boolean method, String listenerId) { + if (objectClass.isInterface()) { + // might be technically possible to track in some cases, but for now + // we can't create a DefaultObjectHandler for interfaces + return; + } + + DefaultObjectHandler handler = TagManager.getTagHandler(objectClass); + try { + if (handler.isMemberBound(memberName)) { + addListener(objectCode + "." + memberName + (method ? "()" : ""), + objectCode, + handler.getAddMemberListenerCode(objectCode, id, memberName, listenerId, compiler), + handler.getRemoveMemberListenerCode(objectCode, id, memberName, listenerId, compiler)); + } + } catch (UnsupportedAttributeException e) { + // ignore -- this is thrown for methods like toString(), for which there is no tracking and + // no setting support + } + } + + /** + * Adds type information to nodes where possible, and as a side effect adds event listeners to nodes which + * can be tracked. + * + * @param node node to scan + * @param listenerId the listener id + */ + private void determineNodeType(SimpleNode node, String listenerId) { + ClassDescriptor type = null; + if (node.jjtGetNumChildren() == 1) { + type = node.getChild(0).getJavaType(); + } + switch (node.getId()) { + case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE: + type = ClassDescriptorLoader.getClassDescriptor(Class.class); + break; + case JavaParserTreeConstants.JJTPRIMARYEXPRESSION: + type = determineExpressionType(node, listenerId); + break; + case JavaParserTreeConstants.JJTLITERAL: + type = determineLiteralType(node); + break; + case JavaParserTreeConstants.JJTCASTEXPRESSION: + type = TagManager.resolveClass(node.getChild(0).getText(), compiler); + break; + } + node.setJavaType(type); + } + + private void addListener(String dependencySymbol, String objectCode, String addCode, String removeCode) { + this.objectCode = objectCode; + //TC-20091026 no need to test objectCode not null if on root object + boolean needTest = objectCode != null && !compiler.getRootObject().getId().equals(objectCode); +// boolean needTest = objectCode != null; + if (!dependencySymbols.contains(dependencySymbol)) { + dependencySymbols.add(dependencySymbol); + String eol = JAXXCompiler.getLineSeparator(); + addListenerCode.append(eol); + if (needTest) { + addListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol); + addListenerCode.append(" "); + } + addListenerCode.append(" ").append(addCode.trim()); + if (needTest) { + addListenerCode.append(eol).append(" }"); + } + + removeListenerCode.append(eol); + if (needTest) { + removeListenerCode.append(" if (").append(objectCode).append(" != null) {").append(eol); + removeListenerCode.append(" "); + } + removeListenerCode.append(" ").append(removeCode.trim()); + if (needTest) { + removeListenerCode.append(eol).append(" }"); + } + } + } + + private void compileListeners() { + String javaCodeId = TypeManager.getJavaCode(id); + String eol = JAXXCompiler.getLineSeparator(); + if (addListenerCode.length() > 0) { + if (compiler.hasApplyDataBinding()) { + compiler.appendApplyDataBinding(" else "); + } +// compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol); + compiler.appendApplyDataBinding("if (" + javaCodeId + ".equals($binding)) {"); + compiler.appendApplyDataBinding(" " + addListenerCode + eol); + compiler.appendApplyDataBinding("}"); + } + + if (removeListenerCode.length() > 0) { + if (compiler.hasRemoveDataBinding()) { + compiler.appendRemoveDataBinding(" else "); + } +// compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {" + eol); + compiler.appendRemoveDataBinding("if (" + javaCodeId + ".equals($binding)) {"); + compiler.appendRemoveDataBinding(" " + removeListenerCode + eol); + compiler.appendRemoveDataBinding("}"); + } + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/DefaultCompilerConfiguration.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import org.apache.commons.lang.builder.ToStringBuilder; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/EventHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,56 +1,72 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.MethodDescriptor; - -public class EventHandler { - - private String eventId; - private String objectCode; - private ClassDescriptor listenerClass; - private MethodDescriptor addMethod; - private MethodDescriptor listenerMethod; - private String javaCode; - - public EventHandler(String eventId, String objectCode, MethodDescriptor addMethod, ClassDescriptor listenerClass, MethodDescriptor listenerMethod, String javaCode) { - this.eventId = eventId; - this.objectCode = objectCode; - this.addMethod = addMethod; - this.listenerClass = listenerClass; - this.listenerMethod = listenerMethod; - this.javaCode = javaCode; - } - - public String getEventId() { - return eventId; - } - - public String getObjectCode() { - return objectCode; - } - - public MethodDescriptor getAddMethod() { - return addMethod; - } - - public ClassDescriptor getListenerClass() { - return listenerClass; - } - - public MethodDescriptor getListenerMethod() { - return listenerMethod; - } - - public String getJavaCode() { - return javaCode; - } - - @Override - public String toString() { - return "EventHandler[" + eventId + ", " + listenerClass.getName() + ", " + objectCode + ", " + javaCode + "]"; - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.MethodDescriptor; + +public class EventHandler { + + private String eventId; + private String objectCode; + private ClassDescriptor listenerClass; + private MethodDescriptor addMethod; + private MethodDescriptor listenerMethod; + private String javaCode; + + public EventHandler(String eventId, String objectCode, MethodDescriptor addMethod, ClassDescriptor listenerClass, MethodDescriptor listenerMethod, String javaCode) { + this.eventId = eventId; + this.objectCode = objectCode; + this.addMethod = addMethod; + this.listenerClass = listenerClass; + this.listenerMethod = listenerMethod; + this.javaCode = javaCode; + } + + public String getEventId() { + return eventId; + } + + public String getObjectCode() { + return objectCode; + } + + public MethodDescriptor getAddMethod() { + return addMethod; + } + + public ClassDescriptor getListenerClass() { + return listenerClass; + } + + public MethodDescriptor getListenerMethod() { + return listenerMethod; + } + + public String getJavaCode() { + return javaCode; + } + + @Override + public String toString() { + return "EventHandler[" + eventId + ", " + listenerClass.getName() + ", " + objectCode + ", " + javaCode + "]"; + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/I18nHelper.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import org.apache.commons.logging.Log; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.compiler; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompilerFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import jaxx.compiler.java.JavaFile; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXEngine.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import jaxx.compiler.java.JavaFileGenerator; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/JAXXProfile.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import java.util.Arrays; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import jaxx.compiler.reflect.FieldDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedAttributeException.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,47 +1,63 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler; - -/** - * Thrown by <code>TagHandler</code> when an unsupported attribute is encountered. - * - * @see jaxx.compiler.tags.TagHandler - */ -public class UnsupportedAttributeException extends CompilerException { - - private static final long serialVersionUID = -6919583037172920343L; - - /** Creates a new <code>UnsupportedAttributeException</code>. */ - public UnsupportedAttributeException() { - } - - /** - * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message. - * - * @param msg the exception's detail message - */ - public UnsupportedAttributeException(String msg) { - super(msg); - } - - /** - * Creates a new <code>UnsupportedAttributeException</code> with the specified cause. - * - * @param initCause the exception's initCause - */ - public UnsupportedAttributeException(Throwable initCause) { - super(initCause); - } - - /** - * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message and cause. - * - * @param msg the exception's detail message - * @param initCause the exception's initCause - */ - public UnsupportedAttributeException(String msg, Throwable initCause) { - super(msg, initCause); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler; + +/** + * Thrown by <code>TagHandler</code> when an unsupported attribute is encountered. + * + * @see jaxx.compiler.tags.TagHandler + */ +public class UnsupportedAttributeException extends CompilerException { + + private static final long serialVersionUID = -6919583037172920343L; + + /** Creates a new <code>UnsupportedAttributeException</code>. */ + public UnsupportedAttributeException() { + } + + /** + * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message. + * + * @param msg the exception's detail message + */ + public UnsupportedAttributeException(String msg) { + super(msg); + } + + /** + * Creates a new <code>UnsupportedAttributeException</code> with the specified cause. + * + * @param initCause the exception's initCause + */ + public UnsupportedAttributeException(Throwable initCause) { + super(initCause); + } + + /** + * Creates a new <code>UnsupportedAttributeException</code> with the specified detail message and cause. + * + * @param msg the exception's detail message + * @param initCause the exception's initCause + */ + public UnsupportedAttributeException(String msg, Throwable initCause) { + super(msg, initCause); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/UnsupportedTagException.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,45 +1,61 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler; - -/** Thrown by the compiler when an unregistered tag is encountered. */ -public class UnsupportedTagException extends CompilerException { - private static final long serialVersionUID = 3199732135804426699L; - - /** Creates a new <code>UnsupportedTagException</code>. */ - public UnsupportedTagException() { - } - - - /** - * Creates a new <code>UnsupportedTagException</code> with the specified detail message. - * - * @param msg the exception's detail message - */ - public UnsupportedTagException(String msg) { - super(msg); - } - - - /** - * Creates a new <code>UnsupportedTagException</code> with the specified cause. - * - * @param initCause the exception's initCause - */ - public UnsupportedTagException(Throwable initCause) { - super(initCause); - } - - - /** - * Creates a new <code>UnsupportedTagException</code> with the specified detail message and cause. - * - * @param msg the exception's detail message - * @param initCause the exception's initCause - */ - public UnsupportedTagException(String msg, Throwable initCause) { - super(msg, initCause); - } +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler; + +/** Thrown by the compiler when an unregistered tag is encountered. */ +public class UnsupportedTagException extends CompilerException { + private static final long serialVersionUID = 3199732135804426699L; + + /** Creates a new <code>UnsupportedTagException</code>. */ + public UnsupportedTagException() { + } + + + /** + * Creates a new <code>UnsupportedTagException</code> with the specified detail message. + * + * @param msg the exception's detail message + */ + public UnsupportedTagException(String msg) { + super(msg); + } + + + /** + * Creates a new <code>UnsupportedTagException</code> with the specified cause. + * + * @param initCause the exception's initCause + */ + public UnsupportedTagException(Throwable initCause) { + super(initCause); + } + + + /** + * Creates a new <code>UnsupportedTagException</code> with the specified detail message and cause. + * + * @param msg the exception's detail message + * @param initCause the exception's initCause + */ + public UnsupportedTagException(String msg, Throwable initCause) { + super(msg, initCause); + } } \ No newline at end of file Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/BeanInfoUtil.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import java.beans.Introspector; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import jaxx.compiler.reflect.ClassDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXBeanInfo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import jaxx.compiler.reflect.ClassDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXEventSetDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import jaxx.compiler.reflect.ClassDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXFeatureDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import jaxx.compiler.reflect.ClassDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXIntrospector.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import jaxx.compiler.reflect.ClassDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/beans/JAXXPropertyDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import jaxx.compiler.CompilerException; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/StylesheetHelper.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.css; import jaxx.compiler.*; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParser.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree&JavaCC: Do not edit this line. CSSParser.java */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserConstants.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserConstants.java */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTokenManager.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree&JavaCC: Do not edit this line. CSSParserTokenManager.java */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/CSSParserTreeConstants.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. .\CSSParserTreeConstants.java */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/JJTCSSParserState.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. .\JJTCSSParserState.java */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Node.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. Node.java */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/ParseException.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleCharStream.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/SimpleNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. SimpleNode.java */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/Token.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/css/parser/TokenMgrError.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */ package jaxx.compiler.css.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/BoxedCompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.decorators; import jaxx.compiler.CompiledObject; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/DefaultCompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.decorators; import jaxx.compiler.CompiledObject; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/decorators/HelpRootCompiledObjectDecorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.decorators; import jaxx.compiler.CompiledObject; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/DefaultFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.finalizers; import jaxx.compiler.JAXXCompilerFinalizer; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/SwingFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.finalizers; import jaxx.compiler.java.JavaArgument; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/finalizers/ValidatorFinalizer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.finalizers; import jaxx.compiler.java.JavaArgument; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaArgument.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.java; /** Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.java; import java.lang.reflect.Modifier; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaField.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.java; import java.lang.reflect.Modifier; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.java; import java.lang.reflect.Modifier; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.java; import java.io.PrintWriter; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaMethod.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.java; import java.lang.reflect.Modifier; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JJTJavaParserState.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. .\JJTJavaParserState.java */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaCharStream.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.0 */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParser.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree&JavaCC: Do not edit this line. JavaParser.java */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserConstants.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserConstants.java */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTokenManager.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree&JavaCC: Do not edit this line. JavaParserTokenManager.java */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/JavaParserTreeConstants.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. ./JavaParserTreeConstants.java */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Node.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. Node.java */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/ParseException.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/SimpleNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JJTree: Do not edit this line. SimpleNode.java */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/Token.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/java/parser/TokenMgrError.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */ package jaxx.compiler.java.parser; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.reflect; import jaxx.runtime.JAXXObjectDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/ClassDescriptorLoader.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.reflect; import jaxx.compiler.CompilerException; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/FieldDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.reflect; /** Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/JavaFileParser.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.reflect; import jaxx.compiler.CompilerException; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MemberDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.reflect; /** Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/reflect/MethodDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.reflect; import jaxx.compiler.JAXXCompiler; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptInitializer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,23 +1,39 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.script; - -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptorLoader; - -/** - * A dummy CompiledObject which serves to initialize scripted field. This is handled by - * a CompiledObject rather than (say) simply inlining the initialization code in order to - * ensure that the field is initialized in document order. - */ -public class ScriptInitializer extends CompiledObject { - - public ScriptInitializer(String initializer, JAXXCompiler compiler) { - super(compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class)), - ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class), compiler, false); - appendInitializationCode(initializer); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.script; + +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptorLoader; + +/** + * A dummy CompiledObject which serves to initialize scripted field. This is handled by + * a CompiledObject rather than (say) simply inlining the initialization code in order to + * ensure that the field is initialized in document order. + */ +public class ScriptInitializer extends CompiledObject { + + public ScriptInitializer(String initializer, JAXXCompiler compiler) { + super(compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class)), + ClassDescriptorLoader.getClassDescriptor(ScriptInitializer.class), compiler, false); + appendInitializationCode(initializer); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/script/ScriptManager.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.script; import jaxx.compiler.*; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/DefaultInitializer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,203 +1,219 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.spi; - -import java.awt.Component; -import javax.swing.JCheckBox; -import javax.swing.JCheckBoxMenuItem; -import javax.swing.JComboBox; -import javax.swing.JDialog; -import javax.swing.JEditorPane; -import javax.swing.JFormattedTextField; -import javax.swing.JFrame; -import javax.swing.JInternalFrame; -import javax.swing.JList; -import javax.swing.JMenu; -import javax.swing.JPasswordField; -import javax.swing.JPopupMenu; -import javax.swing.JProgressBar; -import javax.swing.JRadioButton; -import javax.swing.JRadioButtonMenuItem; -import javax.swing.JScrollPane; -import javax.swing.JSlider; -import javax.swing.JSpinner; -import javax.swing.JSplitPane; -import javax.swing.JTabbedPane; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JTextPane; -import javax.swing.JToggleButton; -import javax.swing.JToolBar; -import javax.swing.JTree; -import javax.swing.JWindow; -import javax.swing.text.JTextComponent; - -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.beans.BeanInfoUtil; - -import jaxx.compiler.reflect.ClassDescriptorLoader; - -import jaxx.compiler.tags.DefaultComponentHandler; -import jaxx.compiler.tags.DefaultObjectHandler; -import jaxx.compiler.tags.ScriptHandler; -import jaxx.compiler.tags.StyleHandler; -import jaxx.compiler.tags.TagHandler; -import jaxx.compiler.tags.TagManager; -import jaxx.compiler.tags.swing.ApplicationHandler; -import jaxx.compiler.tags.swing.CellHandler; -import jaxx.compiler.tags.swing.ItemHandler; -import jaxx.compiler.tags.swing.JAXXComboBoxHandler; -import jaxx.compiler.tags.swing.JAXXListHandler; -import jaxx.compiler.tags.swing.JAXXTabHandler; -import jaxx.compiler.tags.swing.JAXXTreeHandler; -import jaxx.compiler.tags.swing.JCheckBoxHandler; -import jaxx.compiler.tags.swing.JComboBoxHandler; -import jaxx.compiler.tags.swing.JInternalFrameHandler; -import jaxx.compiler.tags.swing.JListHandler; -import jaxx.compiler.tags.swing.JMenuHandler; -import jaxx.compiler.tags.swing.JPasswordFieldHandler; -import jaxx.compiler.tags.swing.JPopupMenuHandler; -import jaxx.compiler.tags.swing.JProgressBarHandler; -import jaxx.compiler.tags.swing.JRadioButtonHandler; -import jaxx.compiler.tags.swing.JScrollPaneHandler; -import jaxx.compiler.tags.swing.JSliderHandler; -import jaxx.compiler.tags.swing.JSpinnerHandler; -import jaxx.compiler.tags.swing.JSplitPaneHandler; -import jaxx.compiler.tags.swing.JTabbedPaneHandler; -import jaxx.compiler.tags.swing.JTextComponentHandler; -import jaxx.compiler.tags.swing.JToolBarHandler; -import jaxx.compiler.tags.swing.JTreeHandler; -import jaxx.compiler.tags.swing.JWindowHandler; -import jaxx.compiler.tags.swing.RowHandler; -import jaxx.compiler.tags.swing.TabHandler; -import jaxx.compiler.tags.swing.TableHandler; -import jaxx.compiler.tags.validator.BeanValidatorHandler; -import jaxx.compiler.tags.validator.ExcludeFieldValidatorHandler; -import jaxx.compiler.tags.validator.FieldValidatorHandler; - - -import jaxx.runtime.swing.Application; -import jaxx.runtime.swing.JAXXButtonGroup; -import jaxx.runtime.swing.JAXXComboBox; -import jaxx.runtime.swing.JAXXList; -import jaxx.runtime.swing.JAXXTab; -import jaxx.runtime.swing.JAXXTree; -import jaxx.runtime.swing.Table; -import jaxx.runtime.swing.editor.EnumEditor; -import jaxx.runtime.swing.editor.LocaleEditor; -import jaxx.runtime.validator.swing.SwingValidator; - -/** - * Initializes support provided from JAXX (java, swing and validation). - * - */ -public class DefaultInitializer implements Initializer { - - @Override - public void initialize() { - - BeanInfoUtil.addJaxxBeanInfoPath("jaxx.runtime.swing"); - - registerDefaultNamespace("javax.swing.*", - JEditorPane.class, - JFormattedTextField.class, - JPasswordField.class, - JTextArea.class, - JTextField.class, - JTextPane.class); - - // - // Register tags - // - - registerTag(JAXXCompiler.JAXX_NAMESPACE, "script", new ScriptHandler()); - registerTag(JAXXCompiler.JAXX_NAMESPACE, "style", new StyleHandler()); - - //TC-20091005 why the namespace was on awt ? ButtonGroup is from javax.swing - registerTag("javax.swing.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class))); -// TagManager.registerTag("java.awt.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class))); - - registerTag(JAXXCompiler.JAXX_NAMESPACE, "tab", new TabHandler()); - registerTag(JAXXCompiler.JAXX_NAMESPACE, "row", new RowHandler()); - registerTag(JAXXCompiler.JAXX_NAMESPACE, "cell", new CellHandler()); - registerTag(JAXXCompiler.JAXX_NAMESPACE, "item", new ItemHandler()); - - - registerTag(JAXXCompiler.JAXX_NAMESPACE, BeanValidatorHandler.TAG, new BeanValidatorHandler(ClassDescriptorLoader.getClassDescriptor(SwingValidator.class))); - registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHandler.TAG, new FieldValidatorHandler()); - registerTag(JAXXCompiler.JAXX_NAMESPACE, ExcludeFieldValidatorHandler.TAG, new FieldValidatorHandler()); - - // - // Register beans - // - - registerBean(Object.class, DefaultObjectHandler.class); - registerBean(Component.class, DefaultComponentHandler.class); - - // check boxes - registerBean(JCheckBox.class, JCheckBoxHandler.class); - registerBean(JCheckBoxMenuItem.class, JCheckBoxHandler.class); - - // combo boxes - registerBean(JComboBox.class, JComboBoxHandler.class); - registerBean(EnumEditor.class, JComboBoxHandler.class); - registerBean(LocaleEditor.class, JComboBoxHandler.class); - registerBean(JAXXComboBox.class, JAXXComboBoxHandler.class); - - // radio boxes - registerBean(JRadioButton.class, JRadioButtonHandler.class); - registerBean(JRadioButtonMenuItem.class, JRadioButtonHandler.class); - registerBean(JToggleButton.class, JRadioButtonHandler.class); - - // Lists - registerBean(JList.class, JListHandler.class); - registerBean(JAXXList.class, JAXXListHandler.class); - - // Trees - registerBean(JTree.class, JTreeHandler.class); - registerBean(JAXXTree.class, JAXXTreeHandler.class); - - // Windows - registerBean(JDialog.class, JWindowHandler.class); - registerBean(JFrame.class, JWindowHandler.class); - registerBean(JWindow.class, JWindowHandler.class); - - registerBean(Application.class, ApplicationHandler.class); - - registerBean(JInternalFrame.class, JInternalFrameHandler.class); - registerBean(JMenu.class, JMenuHandler.class); - registerBean(JPasswordField.class, JPasswordFieldHandler.class); - registerBean(JPopupMenu.class, JPopupMenuHandler.class); - registerBean(JProgressBar.class, JProgressBarHandler.class); - registerBean(JScrollPane.class, JScrollPaneHandler.class); - registerBean(JSlider.class, JSliderHandler.class); - registerBean(JSpinner.class, JSpinnerHandler.class); - registerBean(JSplitPane.class, JSplitPaneHandler.class); - registerBean(JTabbedPane.class, JTabbedPaneHandler.class); - registerBean(JTextComponent.class, JTextComponentHandler.class); - registerBean(JToolBar.class, JToolBarHandler.class); - - registerBean(Table.class, TableHandler.class); - registerBean(JAXXTab.class, JAXXTabHandler.class); - - registerBean(SwingValidator.class, BeanValidatorHandler.class); - - } - - protected void registerBean(Class<?> beanClass, Class<? extends TagHandler> handlerClass) { - TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(beanClass), handlerClass); - } - - protected void registerTag(String namespace, String tagName, TagHandler handler) { - TagManager.registerTag(namespace, tagName, handler); - } - - protected void registerDefaultNamespace(String namespace, Class<?>... beanClass) { - - for (Class<?> c : beanClass) { - TagManager.registerDefaultNamespace(c.getSimpleName(), namespace); - } - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.spi; + +import java.awt.Component; +import javax.swing.JCheckBox; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JFormattedTextField; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.JList; +import javax.swing.JMenu; +import javax.swing.JPasswordField; +import javax.swing.JPopupMenu; +import javax.swing.JProgressBar; +import javax.swing.JRadioButton; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JScrollPane; +import javax.swing.JSlider; +import javax.swing.JSpinner; +import javax.swing.JSplitPane; +import javax.swing.JTabbedPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.JToggleButton; +import javax.swing.JToolBar; +import javax.swing.JTree; +import javax.swing.JWindow; +import javax.swing.text.JTextComponent; + +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.beans.BeanInfoUtil; + +import jaxx.compiler.reflect.ClassDescriptorLoader; + +import jaxx.compiler.tags.DefaultComponentHandler; +import jaxx.compiler.tags.DefaultObjectHandler; +import jaxx.compiler.tags.ScriptHandler; +import jaxx.compiler.tags.StyleHandler; +import jaxx.compiler.tags.TagHandler; +import jaxx.compiler.tags.TagManager; +import jaxx.compiler.tags.swing.ApplicationHandler; +import jaxx.compiler.tags.swing.CellHandler; +import jaxx.compiler.tags.swing.ItemHandler; +import jaxx.compiler.tags.swing.JAXXComboBoxHandler; +import jaxx.compiler.tags.swing.JAXXListHandler; +import jaxx.compiler.tags.swing.JAXXTabHandler; +import jaxx.compiler.tags.swing.JAXXTreeHandler; +import jaxx.compiler.tags.swing.JCheckBoxHandler; +import jaxx.compiler.tags.swing.JComboBoxHandler; +import jaxx.compiler.tags.swing.JInternalFrameHandler; +import jaxx.compiler.tags.swing.JListHandler; +import jaxx.compiler.tags.swing.JMenuHandler; +import jaxx.compiler.tags.swing.JPasswordFieldHandler; +import jaxx.compiler.tags.swing.JPopupMenuHandler; +import jaxx.compiler.tags.swing.JProgressBarHandler; +import jaxx.compiler.tags.swing.JRadioButtonHandler; +import jaxx.compiler.tags.swing.JScrollPaneHandler; +import jaxx.compiler.tags.swing.JSliderHandler; +import jaxx.compiler.tags.swing.JSpinnerHandler; +import jaxx.compiler.tags.swing.JSplitPaneHandler; +import jaxx.compiler.tags.swing.JTabbedPaneHandler; +import jaxx.compiler.tags.swing.JTextComponentHandler; +import jaxx.compiler.tags.swing.JToolBarHandler; +import jaxx.compiler.tags.swing.JTreeHandler; +import jaxx.compiler.tags.swing.JWindowHandler; +import jaxx.compiler.tags.swing.RowHandler; +import jaxx.compiler.tags.swing.TabHandler; +import jaxx.compiler.tags.swing.TableHandler; +import jaxx.compiler.tags.validator.BeanValidatorHandler; +import jaxx.compiler.tags.validator.ExcludeFieldValidatorHandler; +import jaxx.compiler.tags.validator.FieldValidatorHandler; + + +import jaxx.runtime.swing.Application; +import jaxx.runtime.swing.JAXXButtonGroup; +import jaxx.runtime.swing.JAXXComboBox; +import jaxx.runtime.swing.JAXXList; +import jaxx.runtime.swing.JAXXTab; +import jaxx.runtime.swing.JAXXTree; +import jaxx.runtime.swing.Table; +import jaxx.runtime.swing.editor.EnumEditor; +import jaxx.runtime.swing.editor.LocaleEditor; +import jaxx.runtime.validator.swing.SwingValidator; + +/** + * Initializes support provided from JAXX (java, swing and validation). + * + */ +public class DefaultInitializer implements Initializer { + + @Override + public void initialize() { + + BeanInfoUtil.addJaxxBeanInfoPath("jaxx.runtime.swing"); + + registerDefaultNamespace("javax.swing.*", + JEditorPane.class, + JFormattedTextField.class, + JPasswordField.class, + JTextArea.class, + JTextField.class, + JTextPane.class); + + // + // Register tags + // + + registerTag(JAXXCompiler.JAXX_NAMESPACE, "script", new ScriptHandler()); + registerTag(JAXXCompiler.JAXX_NAMESPACE, "style", new StyleHandler()); + + //TC-20091005 why the namespace was on awt ? ButtonGroup is from javax.swing + registerTag("javax.swing.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class))); +// TagManager.registerTag("java.awt.*", "ButtonGroup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class))); + + registerTag(JAXXCompiler.JAXX_NAMESPACE, "tab", new TabHandler()); + registerTag(JAXXCompiler.JAXX_NAMESPACE, "row", new RowHandler()); + registerTag(JAXXCompiler.JAXX_NAMESPACE, "cell", new CellHandler()); + registerTag(JAXXCompiler.JAXX_NAMESPACE, "item", new ItemHandler()); + + + registerTag(JAXXCompiler.JAXX_NAMESPACE, BeanValidatorHandler.TAG, new BeanValidatorHandler(ClassDescriptorLoader.getClassDescriptor(SwingValidator.class))); + registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHandler.TAG, new FieldValidatorHandler()); + registerTag(JAXXCompiler.JAXX_NAMESPACE, ExcludeFieldValidatorHandler.TAG, new FieldValidatorHandler()); + + // + // Register beans + // + + registerBean(Object.class, DefaultObjectHandler.class); + registerBean(Component.class, DefaultComponentHandler.class); + + // check boxes + registerBean(JCheckBox.class, JCheckBoxHandler.class); + registerBean(JCheckBoxMenuItem.class, JCheckBoxHandler.class); + + // combo boxes + registerBean(JComboBox.class, JComboBoxHandler.class); + registerBean(EnumEditor.class, JComboBoxHandler.class); + registerBean(LocaleEditor.class, JComboBoxHandler.class); + registerBean(JAXXComboBox.class, JAXXComboBoxHandler.class); + + // radio boxes + registerBean(JRadioButton.class, JRadioButtonHandler.class); + registerBean(JRadioButtonMenuItem.class, JRadioButtonHandler.class); + registerBean(JToggleButton.class, JRadioButtonHandler.class); + + // Lists + registerBean(JList.class, JListHandler.class); + registerBean(JAXXList.class, JAXXListHandler.class); + + // Trees + registerBean(JTree.class, JTreeHandler.class); + registerBean(JAXXTree.class, JAXXTreeHandler.class); + + // Windows + registerBean(JDialog.class, JWindowHandler.class); + registerBean(JFrame.class, JWindowHandler.class); + registerBean(JWindow.class, JWindowHandler.class); + + registerBean(Application.class, ApplicationHandler.class); + + registerBean(JInternalFrame.class, JInternalFrameHandler.class); + registerBean(JMenu.class, JMenuHandler.class); + registerBean(JPasswordField.class, JPasswordFieldHandler.class); + registerBean(JPopupMenu.class, JPopupMenuHandler.class); + registerBean(JProgressBar.class, JProgressBarHandler.class); + registerBean(JScrollPane.class, JScrollPaneHandler.class); + registerBean(JSlider.class, JSliderHandler.class); + registerBean(JSpinner.class, JSpinnerHandler.class); + registerBean(JSplitPane.class, JSplitPaneHandler.class); + registerBean(JTabbedPane.class, JTabbedPaneHandler.class); + registerBean(JTextComponent.class, JTextComponentHandler.class); + registerBean(JToolBar.class, JToolBarHandler.class); + + registerBean(Table.class, TableHandler.class); + registerBean(JAXXTab.class, JAXXTabHandler.class); + + registerBean(SwingValidator.class, BeanValidatorHandler.class); + + } + + protected void registerBean(Class<?> beanClass, Class<? extends TagHandler> handlerClass) { + TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(beanClass), handlerClass); + } + + protected void registerTag(String namespace, String tagName, TagHandler handler) { + TagManager.registerTag(namespace, tagName, handler); + } + + protected void registerDefaultNamespace(String namespace, Class<?>... beanClass) { + + for (Class<?> c : beanClass) { + TagManager.registerDefaultNamespace(c.getSimpleName(), namespace); + } + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/spi/Initializer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.spi; /** Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultComponentHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,347 +1,363 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.UnsupportedAttributeException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.I18nHelper; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Element; - -import java.awt.Component; -import java.awt.Container; -import java.awt.event.ComponentListener; -import java.awt.event.ContainerListener; -import java.awt.event.FocusListener; -import java.beans.IntrospectionException; -import java.io.IOException; -import java.lang.reflect.Field; -import jaxx.runtime.Util; -import org.w3c.dom.Attr; -import org.w3c.dom.NamedNodeMap; - -public class DefaultComponentHandler extends DefaultObjectHandler { - - public static final String ACTION_ICON_ATTRIBUTE = "actionIcon"; - public static final String CONTAINER_DELEGATE_ATTRIBUTE = "containerDelegate"; - public static final String FONT_FACE_ATTRIBUTE = "font-face"; - public static final String FONT_SIZE_ATTRIBUTE = "font-size"; - public static final String FONT_STYLE_ATTRIBUTE = "font-style"; - public static final String FONT_WEIGHT_ATTRIBUTE = "font-weight"; - public static final String HEIGHT_ATTRIBUTE = "height"; - public static final String ICON_ATTRIBUTE = "icon"; - public static final String NAME_ATTRIBUTE = "name"; - public static final String WIDTH_ATTRIBUTE = "width"; - public static final String X_ATTRIBUTE = "x"; - public static final String Y_ATTRIBUTE = "y"; - /** - * Logger - */ - protected static final Log log = LogFactory.getLog(DefaultComponentHandler.class); - /** - * container delegate (if any) - */ - private String containerDelegate; - - public DefaultComponentHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Component.class); - } - - @Override - protected void init() throws IntrospectionException { - if (jaxxBeanInfo == null) { - super.init(); - - containerDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE); - if (containerDelegate == null && ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass().getSuperclass())) { - containerDelegate = ((DefaultComponentHandler) TagManager.getTagHandler(getBeanClass().getSuperclass())).getContainerDelegate(); - } - } - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("hasFocus", FocusListener.class); - addProxyEventInfo("isVisible", ComponentListener.class); - addProxyEventInfo("getBounds", ComponentListener.class); - addProxyEventInfo("getLocation", ComponentListener.class); - addProxyEventInfo("getLocationOnScreen", ComponentListener.class); - addProxyEventInfo("getSize", ComponentListener.class); - addProxyEventInfo("getX", ComponentListener.class); - addProxyEventInfo("getY", ComponentListener.class); - addProxyEventInfo("getWidth", ComponentListener.class); - addProxyEventInfo("getHeight", ComponentListener.class); - if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass())) { - addProxyEventInfo("getComponentCount", ContainerListener.class); - } - } - - @Override - protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - super.setDefaults(object, tag, compiler); - setAttribute(object, NAME_ATTRIBUTE, object.getId(), false, compiler); - openComponent(object, tag, compiler); - } - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - super.compileFirstPass(tag, compiler); - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - super.compileSecondPass(tag, compiler); - closeComponent(compiler.getOpenComponent(), tag, compiler); - } - - protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - String constraints = tag.getAttribute(CONSTRAINTS_ATTRIBUTE); - if (constraints != null && constraints.length() > 0) { - compiler.openComponent(object, constraints); - } else { - compiler.openComponent(object); - } - } - - protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - compiler.closeComponent(object); - } - - @Override - public boolean isPropertyInherited(String property) throws UnsupportedAttributeException { - return property.equals("font") || property.startsWith("font-") || property.equals("foreground") || property.equals("enabled"); - } - - @Override - public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException { - if (propertyName.equals(X_ATTRIBUTE) || - propertyName.equals(Y_ATTRIBUTE) || - propertyName.equals(WIDTH_ATTRIBUTE) || - propertyName.equals(HEIGHT_ATTRIBUTE) || - FONT_SIZE_ATTRIBUTE.equals(propertyName)) { - return ClassDescriptorLoader.getClassDescriptor(Integer.class); - } - if (propertyName.equals(FONT_FACE_ATTRIBUTE) || - propertyName.equals(FONT_STYLE_ATTRIBUTE) || - propertyName.equals(FONT_WEIGHT_ATTRIBUTE)) { - return ClassDescriptorLoader.getClassDescriptor(String.class); - } - return super.getPropertyType(object, propertyName, compiler); - } - - @Override - public String getGetPropertyCode(String id, String name, JAXXCompiler compiler) throws CompilerException { - if (name.equals(FONT_FACE_ATTRIBUTE)) { - return id + ".getFont().getFontName()"; - } - if (name.equals(FONT_SIZE_ATTRIBUTE)) { - return id + ".getFont().getSize()"; - } - if (name.equals(FONT_WEIGHT_ATTRIBUTE)) { - return "(" + id + ".getFont().getStyle() & Font.BOLD) != 0 ? \"bold\" : \"normal\""; - } - if (name.equals(FONT_STYLE_ATTRIBUTE)) { - return "(" + id + ".getFont().getStyle() & Font.ITALIC) != 0 ? \"italic\" : \"normal\""; - } - return super.getGetPropertyCode(id, name, compiler); - } - - @Override - public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException { - if (name.equals(X_ATTRIBUTE)) { - return id + ".setLocation(" + valueCode + ", " + id + ".getY());"; - } - if (name.equals(Y_ATTRIBUTE)) { - return id + ".setLocation(" + id + ".getX(), " + valueCode + ");"; - } - if (name.equals(WIDTH_ATTRIBUTE)) { - // need to optimize case when both width and height are being assigned - return Util.class.getName() + ".setComponentWidth(" + id + "," + valueCode + ");"; - } - if (name.equals(HEIGHT_ATTRIBUTE)) { - return Util.class.getName() + ".setComponentHeight(" + id + "," + valueCode + ");"; - } - if (name.equals(FONT_FACE_ATTRIBUTE)) { - return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(new Font(" + valueCode + ", " + id + ".getFont().getStyle(), " + id + ".getFont().getSize()));\n}"; - } - if (name.equals(FONT_SIZE_ATTRIBUTE)) { - return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont((float) " + valueCode + "));\n}"; - } - if (name.equals(FONT_WEIGHT_ATTRIBUTE)) { - if (valueCode.equals("\"bold\"")) { - return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n}"; - } - if (valueCode.equals("\"normal\"")) { - return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n}"; - } - if (!valueCode.startsWith("\"")) { - return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"bold\")) {\n " + - id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n } else {\n " + - id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n }\n}"; - } - compiler.reportError("font-weight must be either \"normal\" or \"bold\", found " + valueCode); - return ""; - } - if (name.equals(FONT_STYLE_ATTRIBUTE)) { - if (valueCode.equals("\"italic\"")) { - return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n}"; - } - if (valueCode.equals("\"normal\"")) { - return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n}"; - } - if (!valueCode.startsWith("\"")) { - return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"italic\")) {\n " + - id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n } else {\n " + - id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n }\n}"; - } - compiler.reportError("font-style must be either \"normal\" or \"italic\", found " + valueCode); - return ""; - } - if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass()) && name.equals(LAYOUT_ATTRIBUTE)) { - // handle containerDelegate (e.g. contentPane on JFrame) - String cDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE); - if (cDelegate != null) { - return id + '.' + cDelegate + "().setLayout(" + valueCode + ");"; - } - } - // ajout du support i18n - if (I18nHelper.isI18nableAttribute(name, compiler)) { - valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler); - } - - return super.getSetPropertyCode(id, name, valueCode, compiler); - } - - @Override - public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) { - - if (propertyName.startsWith("_")) { - // client property - if (stringValue.startsWith("{")) { - stringValue = stringValue.substring(1, stringValue.length() - 1); - } - object.addClientProperty(propertyName.substring(1), stringValue); - //TC-20090327 rather not generating code here - //object.appendAdditionCode(object.getJavaCode() + ".putClientProperty(\"" + propertyName.substring(1) + "\", " + stringValue + ");"); - return; - } - if (ICON_ATTRIBUTE.equals(propertyName)) { - if (!(stringValue.startsWith("{") || stringValue.endsWith("}"))) { - // this is a customized icon, add the icon creation code - if (compiler.getConfiguration().isUseUIManagerForIcon()) { - stringValue = "{" + Util.class.getName() + ".getUIManagerIcon(\"" + stringValue + "\")}"; - } else { - stringValue = "{" + Util.class.getName() + ".createImageIcon(\"" + stringValue + "\")}"; - } - } - } else if (ACTION_ICON_ATTRIBUTE.equals(propertyName)) { - // customized actionIcon property - if (stringValue.startsWith("{") && stringValue.endsWith("}")) { - // there is a script to define the action icon, this is forbidden - compiler.reportError("the actionIcon does not support script, remove braces..., fix the file " + compiler.getOutputClassName()); - return; - } - propertyName = ICON_ATTRIBUTE; - if (compiler.getConfiguration().isUseUIManagerForIcon()) { - stringValue = "{" + Util.class.getName() + ".getUIManagerActionIcon(\"" + stringValue + "\")}"; - } else { - stringValue = "{" + Util.class.getName() + ".createActionIcon(\"" + stringValue + "\")}"; - } - } - super.setAttribute(object, propertyName, stringValue, inline, compiler); - } - - @Override - protected void scanAttributesForDependencies(Element tag, JAXXCompiler compiler) { - super.scanAttributesForDependencies(tag, compiler); - // check for clientProperty attributes - //FIXME make this works,... it seems jaxx compiler does not come here ? - //FIXME see the the firstPassHandler in JAXXCompiler ? - NamedNodeMap children = tag.getAttributes(); - for (int i = 0, max = children.getLength(); i < max; i++) { - Attr attr = (Attr) children.item(i); - String name = attr.getName(); - if (!name.startsWith("_")) { - continue; - } - String value = attr.getValue(); - if (value.startsWith("{")) { - compiler.reportWarning(tag, "an clientProperty attribute " + name.substring(1) + " does not required curly value but was : " + value, 0); - } - } - - } - - /** - * Maps string values onto integers, so that int-valued enumeration properties can be specified by strings. For - * example, when passed a key of 'alignment', this method should normally map the values 'left', 'center', and - * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingConstants.RIGHT respectively. - * <p/> - * You do not normally need to call this method yourself; it is invoked by {@link #convertFromString} when an - * int-valued property has a value which is not a valid number. By default, this method looks at the - * <code>enumerationValues</code> value of the <code>JAXXPropertyDescriptor</code>. - * - * @param key the name of the int-typed property - * @param value the non-numeric value that was specified for the property - * @throws IllegalArgumentException if the property is an enumeration, but the value is not valid - * @throws NumberFormatException if the property is not an enumeration - */ - @Override - protected int constantValue(String key, String value) { - if ((key.equals(MNEMONIC_ATTRIBUTE) || key.equals(DISPLAYED_MNEMONIC_ATTRIBUTE))) { - if (value.length() == 1) { - return value.charAt(0); - } - try { - Field vk = java.awt.event.KeyEvent.class.getField(value); - return (Integer) vk.get(null); - } catch (NoSuchFieldException e) { - throw new IllegalArgumentException("mnemonics must be either a single character or the name of a field in KeyEvent (found: '" + value + "')"); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - } - return super.constantValue(key, value); - } - - /** - * Returns <code>true</code> if this component can contain other components. For children to be - * allowed, the component must be a subclass of <code>Container</code> and its <code>JAXXBeanInfo</code> - * must not have the value <code>false</code> for its <code>isContainer</code> value. - * - * @return <code>true</code> if children are allowed - */ - public boolean isContainer() { - boolean container = ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass()); - if (container) { - try { - init(); - if (Boolean.FALSE.equals(getJAXXBeanInfo().getJAXXBeanDescriptor().getValue("isContainer"))) { - container = false; - } - } catch (IntrospectionException e) { - throw new RuntimeException(e); - } - } - return container; - } - - public String getContainerDelegate() { - try { - init(); - return containerDelegate; - } catch (IntrospectionException e) { - throw new RuntimeException(e); - } - - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.UnsupportedAttributeException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.I18nHelper; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Element; + +import java.awt.Component; +import java.awt.Container; +import java.awt.event.ComponentListener; +import java.awt.event.ContainerListener; +import java.awt.event.FocusListener; +import java.beans.IntrospectionException; +import java.io.IOException; +import java.lang.reflect.Field; +import jaxx.runtime.Util; +import org.w3c.dom.Attr; +import org.w3c.dom.NamedNodeMap; + +public class DefaultComponentHandler extends DefaultObjectHandler { + + public static final String ACTION_ICON_ATTRIBUTE = "actionIcon"; + public static final String CONTAINER_DELEGATE_ATTRIBUTE = "containerDelegate"; + public static final String FONT_FACE_ATTRIBUTE = "font-face"; + public static final String FONT_SIZE_ATTRIBUTE = "font-size"; + public static final String FONT_STYLE_ATTRIBUTE = "font-style"; + public static final String FONT_WEIGHT_ATTRIBUTE = "font-weight"; + public static final String HEIGHT_ATTRIBUTE = "height"; + public static final String ICON_ATTRIBUTE = "icon"; + public static final String NAME_ATTRIBUTE = "name"; + public static final String WIDTH_ATTRIBUTE = "width"; + public static final String X_ATTRIBUTE = "x"; + public static final String Y_ATTRIBUTE = "y"; + /** + * Logger + */ + protected static final Log log = LogFactory.getLog(DefaultComponentHandler.class); + /** + * container delegate (if any) + */ + private String containerDelegate; + + public DefaultComponentHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Component.class); + } + + @Override + protected void init() throws IntrospectionException { + if (jaxxBeanInfo == null) { + super.init(); + + containerDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE); + if (containerDelegate == null && ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass().getSuperclass())) { + containerDelegate = ((DefaultComponentHandler) TagManager.getTagHandler(getBeanClass().getSuperclass())).getContainerDelegate(); + } + } + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("hasFocus", FocusListener.class); + addProxyEventInfo("isVisible", ComponentListener.class); + addProxyEventInfo("getBounds", ComponentListener.class); + addProxyEventInfo("getLocation", ComponentListener.class); + addProxyEventInfo("getLocationOnScreen", ComponentListener.class); + addProxyEventInfo("getSize", ComponentListener.class); + addProxyEventInfo("getX", ComponentListener.class); + addProxyEventInfo("getY", ComponentListener.class); + addProxyEventInfo("getWidth", ComponentListener.class); + addProxyEventInfo("getHeight", ComponentListener.class); + if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass())) { + addProxyEventInfo("getComponentCount", ContainerListener.class); + } + } + + @Override + protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + super.setDefaults(object, tag, compiler); + setAttribute(object, NAME_ATTRIBUTE, object.getId(), false, compiler); + openComponent(object, tag, compiler); + } + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + super.compileFirstPass(tag, compiler); + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + super.compileSecondPass(tag, compiler); + closeComponent(compiler.getOpenComponent(), tag, compiler); + } + + protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + String constraints = tag.getAttribute(CONSTRAINTS_ATTRIBUTE); + if (constraints != null && constraints.length() > 0) { + compiler.openComponent(object, constraints); + } else { + compiler.openComponent(object); + } + } + + protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + compiler.closeComponent(object); + } + + @Override + public boolean isPropertyInherited(String property) throws UnsupportedAttributeException { + return property.equals("font") || property.startsWith("font-") || property.equals("foreground") || property.equals("enabled"); + } + + @Override + public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException { + if (propertyName.equals(X_ATTRIBUTE) || + propertyName.equals(Y_ATTRIBUTE) || + propertyName.equals(WIDTH_ATTRIBUTE) || + propertyName.equals(HEIGHT_ATTRIBUTE) || + FONT_SIZE_ATTRIBUTE.equals(propertyName)) { + return ClassDescriptorLoader.getClassDescriptor(Integer.class); + } + if (propertyName.equals(FONT_FACE_ATTRIBUTE) || + propertyName.equals(FONT_STYLE_ATTRIBUTE) || + propertyName.equals(FONT_WEIGHT_ATTRIBUTE)) { + return ClassDescriptorLoader.getClassDescriptor(String.class); + } + return super.getPropertyType(object, propertyName, compiler); + } + + @Override + public String getGetPropertyCode(String id, String name, JAXXCompiler compiler) throws CompilerException { + if (name.equals(FONT_FACE_ATTRIBUTE)) { + return id + ".getFont().getFontName()"; + } + if (name.equals(FONT_SIZE_ATTRIBUTE)) { + return id + ".getFont().getSize()"; + } + if (name.equals(FONT_WEIGHT_ATTRIBUTE)) { + return "(" + id + ".getFont().getStyle() & Font.BOLD) != 0 ? \"bold\" : \"normal\""; + } + if (name.equals(FONT_STYLE_ATTRIBUTE)) { + return "(" + id + ".getFont().getStyle() & Font.ITALIC) != 0 ? \"italic\" : \"normal\""; + } + return super.getGetPropertyCode(id, name, compiler); + } + + @Override + public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException { + if (name.equals(X_ATTRIBUTE)) { + return id + ".setLocation(" + valueCode + ", " + id + ".getY());"; + } + if (name.equals(Y_ATTRIBUTE)) { + return id + ".setLocation(" + id + ".getX(), " + valueCode + ");"; + } + if (name.equals(WIDTH_ATTRIBUTE)) { + // need to optimize case when both width and height are being assigned + return Util.class.getName() + ".setComponentWidth(" + id + "," + valueCode + ");"; + } + if (name.equals(HEIGHT_ATTRIBUTE)) { + return Util.class.getName() + ".setComponentHeight(" + id + "," + valueCode + ");"; + } + if (name.equals(FONT_FACE_ATTRIBUTE)) { + return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(new Font(" + valueCode + ", " + id + ".getFont().getStyle(), " + id + ".getFont().getSize()));\n}"; + } + if (name.equals(FONT_SIZE_ATTRIBUTE)) { + return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont((float) " + valueCode + "));\n}"; + } + if (name.equals(FONT_WEIGHT_ATTRIBUTE)) { + if (valueCode.equals("\"bold\"")) { + return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n}"; + } + if (valueCode.equals("\"normal\"")) { + return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n}"; + } + if (!valueCode.startsWith("\"")) { + return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"bold\")) {\n " + + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOLD));\n } else {\n " + + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BOLD));\n }\n}"; + } + compiler.reportError("font-weight must be either \"normal\" or \"bold\", found " + valueCode); + return ""; + } + if (name.equals(FONT_STYLE_ATTRIBUTE)) { + if (valueCode.equals("\"italic\"")) { + return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n}"; + } + if (valueCode.equals("\"normal\"")) { + return "if (" + id + ".getFont() != null) {\n " + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n}"; + } + if (!valueCode.startsWith("\"")) { + return "if (" + id + ".getFont() != null) {\n if ((" + valueCode + ").equals(\"italic\")) {\n " + + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITALIC));\n } else {\n " + + id + ".setFont(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.ITALIC));\n }\n}"; + } + compiler.reportError("font-style must be either \"normal\" or \"italic\", found " + valueCode); + return ""; + } + if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass()) && name.equals(LAYOUT_ATTRIBUTE)) { + // handle containerDelegate (e.g. contentPane on JFrame) + String cDelegate = (String) getJAXXBeanInfo().getJAXXBeanDescriptor().getValue(CONTAINER_DELEGATE_ATTRIBUTE); + if (cDelegate != null) { + return id + '.' + cDelegate + "().setLayout(" + valueCode + ");"; + } + } + // ajout du support i18n + if (I18nHelper.isI18nableAttribute(name, compiler)) { + valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler); + } + + return super.getSetPropertyCode(id, name, valueCode, compiler); + } + + @Override + public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) { + + if (propertyName.startsWith("_")) { + // client property + if (stringValue.startsWith("{")) { + stringValue = stringValue.substring(1, stringValue.length() - 1); + } + object.addClientProperty(propertyName.substring(1), stringValue); + //TC-20090327 rather not generating code here + //object.appendAdditionCode(object.getJavaCode() + ".putClientProperty(\"" + propertyName.substring(1) + "\", " + stringValue + ");"); + return; + } + if (ICON_ATTRIBUTE.equals(propertyName)) { + if (!(stringValue.startsWith("{") || stringValue.endsWith("}"))) { + // this is a customized icon, add the icon creation code + if (compiler.getConfiguration().isUseUIManagerForIcon()) { + stringValue = "{" + Util.class.getName() + ".getUIManagerIcon(\"" + stringValue + "\")}"; + } else { + stringValue = "{" + Util.class.getName() + ".createImageIcon(\"" + stringValue + "\")}"; + } + } + } else if (ACTION_ICON_ATTRIBUTE.equals(propertyName)) { + // customized actionIcon property + if (stringValue.startsWith("{") && stringValue.endsWith("}")) { + // there is a script to define the action icon, this is forbidden + compiler.reportError("the actionIcon does not support script, remove braces..., fix the file " + compiler.getOutputClassName()); + return; + } + propertyName = ICON_ATTRIBUTE; + if (compiler.getConfiguration().isUseUIManagerForIcon()) { + stringValue = "{" + Util.class.getName() + ".getUIManagerActionIcon(\"" + stringValue + "\")}"; + } else { + stringValue = "{" + Util.class.getName() + ".createActionIcon(\"" + stringValue + "\")}"; + } + } + super.setAttribute(object, propertyName, stringValue, inline, compiler); + } + + @Override + protected void scanAttributesForDependencies(Element tag, JAXXCompiler compiler) { + super.scanAttributesForDependencies(tag, compiler); + // check for clientProperty attributes + //FIXME make this works,... it seems jaxx compiler does not come here ? + //FIXME see the the firstPassHandler in JAXXCompiler ? + NamedNodeMap children = tag.getAttributes(); + for (int i = 0, max = children.getLength(); i < max; i++) { + Attr attr = (Attr) children.item(i); + String name = attr.getName(); + if (!name.startsWith("_")) { + continue; + } + String value = attr.getValue(); + if (value.startsWith("{")) { + compiler.reportWarning(tag, "an clientProperty attribute " + name.substring(1) + " does not required curly value but was : " + value, 0); + } + } + + } + + /** + * Maps string values onto integers, so that int-valued enumeration properties can be specified by strings. For + * example, when passed a key of 'alignment', this method should normally map the values 'left', 'center', and + * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingConstants.RIGHT respectively. + * <p/> + * You do not normally need to call this method yourself; it is invoked by {@link #convertFromString} when an + * int-valued property has a value which is not a valid number. By default, this method looks at the + * <code>enumerationValues</code> value of the <code>JAXXPropertyDescriptor</code>. + * + * @param key the name of the int-typed property + * @param value the non-numeric value that was specified for the property + * @throws IllegalArgumentException if the property is an enumeration, but the value is not valid + * @throws NumberFormatException if the property is not an enumeration + */ + @Override + protected int constantValue(String key, String value) { + if ((key.equals(MNEMONIC_ATTRIBUTE) || key.equals(DISPLAYED_MNEMONIC_ATTRIBUTE))) { + if (value.length() == 1) { + return value.charAt(0); + } + try { + Field vk = java.awt.event.KeyEvent.class.getField(value); + return (Integer) vk.get(null); + } catch (NoSuchFieldException e) { + throw new IllegalArgumentException("mnemonics must be either a single character or the name of a field in KeyEvent (found: '" + value + "')"); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + return super.constantValue(key, value); + } + + /** + * Returns <code>true</code> if this component can contain other components. For children to be + * allowed, the component must be a subclass of <code>Container</code> and its <code>JAXXBeanInfo</code> + * must not have the value <code>false</code> for its <code>isContainer</code> value. + * + * @return <code>true</code> if children are allowed + */ + public boolean isContainer() { + boolean container = ClassDescriptorLoader.getClassDescriptor(Container.class).isAssignableFrom(getBeanClass()); + if (container) { + try { + init(); + if (Boolean.FALSE.equals(getJAXXBeanInfo().getJAXXBeanDescriptor().getValue("isContainer"))) { + container = false; + } + } catch (IntrospectionException e) { + throw new RuntimeException(e); + } + } + return container; + } + + public String getContainerDelegate() { + try { + init(); + return containerDelegate; + } catch (IntrospectionException e) { + throw new RuntimeException(e); + } + + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.compiler.tags; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/ScriptHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,85 +1,101 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.UnsupportedAttributeException; -import jaxx.compiler.JAXXCompiler; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringWriter; - -/** - * Handles the <code><script></code> tag. - * - * @author Ethan Nicholas - */ -public class ScriptHandler implements TagHandler { - - public static final String SOURCE_ATTRIBUTE = "source"; - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - File scriptFile = null; - NamedNodeMap attributes = tag.getAttributes(); - for (int i = 0; i < attributes.getLength(); i++) { - Attr attribute = (Attr) attributes.item(i); - String name = attribute.getName(); - String attrValue = attribute.getValue(); - if (name.equals(SOURCE_ATTRIBUTE)) { - scriptFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar)); - StringWriter scriptBuffer = new StringWriter(); - try { - FileReader in = new FileReader(scriptFile); - char[] readBuffer = new char[2048]; - int c; - while ((c = in.read(readBuffer)) > 0) { - scriptBuffer.write(readBuffer, 0, c); - } - } catch (FileNotFoundException e) { - compiler.reportError("script file not found: " + scriptFile); - } - compiler.registerScript(scriptBuffer.toString(), scriptFile); - } else if (!name.startsWith(XMLNS_ATTRIBUTE) && - !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { - throw new UnsupportedAttributeException(name); - } - } - - StringBuffer script = new StringBuffer(); - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - switch (child.getNodeType()) { - case Node.ELEMENT_NODE: - compiler.reportError("<script> tag may not contain child elements: " + tag); - case Node.TEXT_NODE: // fall through - case Node.CDATA_SECTION_NODE: - script.append(((Text) child).getData()); - } - } - - String scriptString = script.toString().trim(); - if (scriptString.length() > 0) { - if (scriptFile != null) { - compiler.reportError("<script> tag has both a source attribute and an inline script"); - } - compiler.registerScript(script.toString()); - } - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.UnsupportedAttributeException; +import jaxx.compiler.JAXXCompiler; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringWriter; + +/** + * Handles the <code><script></code> tag. + * + * @author Ethan Nicholas + */ +public class ScriptHandler implements TagHandler { + + public static final String SOURCE_ATTRIBUTE = "source"; + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + File scriptFile = null; + NamedNodeMap attributes = tag.getAttributes(); + for (int i = 0; i < attributes.getLength(); i++) { + Attr attribute = (Attr) attributes.item(i); + String name = attribute.getName(); + String attrValue = attribute.getValue(); + if (name.equals(SOURCE_ATTRIBUTE)) { + scriptFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar)); + StringWriter scriptBuffer = new StringWriter(); + try { + FileReader in = new FileReader(scriptFile); + char[] readBuffer = new char[2048]; + int c; + while ((c = in.read(readBuffer)) > 0) { + scriptBuffer.write(readBuffer, 0, c); + } + } catch (FileNotFoundException e) { + compiler.reportError("script file not found: " + scriptFile); + } + compiler.registerScript(scriptBuffer.toString(), scriptFile); + } else if (!name.startsWith(XMLNS_ATTRIBUTE) && + !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { + throw new UnsupportedAttributeException(name); + } + } + + StringBuffer script = new StringBuffer(); + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + switch (child.getNodeType()) { + case Node.ELEMENT_NODE: + compiler.reportError("<script> tag may not contain child elements: " + tag); + case Node.TEXT_NODE: // fall through + case Node.CDATA_SECTION_NODE: + script.append(((Text) child).getData()); + } + } + + String scriptString = script.toString().trim(); + if (scriptString.length() > 0) { + if (scriptFile != null) { + compiler.reportError("<script> tag has both a source attribute and an inline script"); + } + compiler.registerScript(script.toString()); + } + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/StyleHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,184 +1,200 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.UnsupportedAttributeException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.css.parser.CSSParser; -import jaxx.compiler.css.parser.CSSParserConstants; -import jaxx.compiler.css.parser.CSSParserTreeConstants; -import jaxx.compiler.css.parser.SimpleNode; -import jaxx.runtime.css.Rule; -import jaxx.runtime.css.Selector; -import jaxx.runtime.css.Stylesheet; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Handles the <code><style></code> tag. - * - * @author Ethan Nicholas - */ -public class StyleHandler implements TagHandler { - public static final String SOURCE_ATTRIBUTE = "source"; - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - boolean source = false; - NamedNodeMap attributes = tag.getAttributes(); - for (int i = 0; i < attributes.getLength(); i++) { - Attr attribute = (Attr) attributes.item(i); - String name = attribute.getName(); - String attrValue = attribute.getValue(); - if (name.equals(SOURCE_ATTRIBUTE)) { - source = true; - File styleFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar)); - StringWriter styleBuffer = new StringWriter(); - try { - FileReader in = new FileReader(styleFile); - char[] readBuffer = new char[2048]; - int c; - while ((c = in.read(readBuffer)) > 0) { - styleBuffer.write(readBuffer, 0, c); - } - } catch (FileNotFoundException e) { - compiler.reportError("stylesheet file not found: " + styleFile); - } - compiler.getSourceFiles().push(styleFile); - compiler.registerStylesheet(processStylesheet(styleBuffer.toString())); - compiler.getSourceFiles().pop(); - } else if (!name.startsWith(XMLNS_ATTRIBUTE) && - !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { - throw new UnsupportedAttributeException(name); - } - } - - StringBuffer style = new StringBuffer(); - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - switch (child.getNodeType()) { - case Node.ELEMENT_NODE: - compiler.reportError("<style> tag may not contain child elements: " + tag); - case Node.TEXT_NODE: // fall through - case Node.CDATA_SECTION_NODE: - style.append(((Text) child).getData()); - } - } - - String styleString = style.toString().trim(); - if (styleString.length() > 0) { - if (source) { - compiler.reportError("<style> tag has both a source attribute and an inline stylesheet"); - } - compiler.registerStylesheet(processStylesheet(style.toString())); - } - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - } - - protected Selector processSelector(SimpleNode selector) { - if (selector.getId() != CSSParserTreeConstants.JJTSELECTOR) { - throw new IllegalArgumentException("argument node is not a Selector"); - } - String javaClassName = null; - String styleClass = null; - String pseudoClass = null; - String id = null; - - for (int i = 0; i < selector.jjtGetNumChildren(); i++) { - SimpleNode child = selector.getChild(i); - switch (child.getId()) { - case CSSParserTreeConstants.JJTJAVACLASS: - if (!child.getText().trim().equals("*")) { - javaClassName = child.getText(); - } - break; - case CSSParserTreeConstants.JJTCLASS: - styleClass = child.getText().substring(1); - break; - case CSSParserTreeConstants.JJTPSEUDOCLASS: - pseudoClass = child.getText().substring(1); - break; - case CSSParserTreeConstants.JJTID: - id = child.getText().substring(1); - break; - - default: - throw new IllegalStateException("unexpected child of Selector node, type=" + child.getId()); - } - } - - return new Selector(javaClassName, styleClass, pseudoClass, id); - } - - protected Rule processRule(SimpleNode ruleNode) { - if (ruleNode.getId() != CSSParserTreeConstants.JJTRULE) { - throw new IllegalArgumentException("argument node is not a Rule"); - } - SimpleNode selectorsNode = ruleNode.getChild(0); - assert selectorsNode.getId() == CSSParserTreeConstants.JJTSELECTORS : "expected node to be of type Selectors"; - - List<Selector> selectors = new ArrayList<Selector>(); - for (int i = 0; i < selectorsNode.jjtGetNumChildren(); i++) { - SimpleNode selectorNode = selectorsNode.getChild(i); - selectors.add(processSelector(selectorNode)); - } - - Map<String, String> properties = new HashMap<String, String>(); - for (int i = 1; i < ruleNode.jjtGetNumChildren(); i++) { - SimpleNode declarationNode = ruleNode.getChild(i); - if (declarationNode.getId() == CSSParserTreeConstants.JJTDECLARATION) { - String key = declarationNode.getChild(0).getText(); - SimpleNode valueNode = declarationNode.getChild(1); - String value = valueNode.getText(); - if (valueNode.firstToken.kind == CSSParserConstants.STRING) { - value = value.substring(1, value.length() - 1); - } - properties.put(key, value); - } - } - Rule rule; - rule = new Rule(selectors.toArray(new Selector[selectors.size()]), properties); - return rule; - } - - protected Stylesheet processStylesheet(String stylesheetText) throws CompilerException { - CSSParser p = new CSSParser(new StringReader(stylesheetText)); - SimpleNode node; - try { - node = p.Stylesheet(); - } catch (Error e) { - throw new CompilerException(e); - } - List<Rule> rules = new ArrayList<Rule>(); - for (int i = 0; i < node.jjtGetNumChildren(); i++) { - SimpleNode ruleNode = node.getChild(i); - Rule rule = processRule(ruleNode); - rules.add(rule); - } - Stylesheet stylesheet; - stylesheet = new Stylesheet(rules.toArray(new Rule[rules.size()])); - return stylesheet; - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.UnsupportedAttributeException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.css.parser.CSSParser; +import jaxx.compiler.css.parser.CSSParserConstants; +import jaxx.compiler.css.parser.CSSParserTreeConstants; +import jaxx.compiler.css.parser.SimpleNode; +import jaxx.runtime.css.Rule; +import jaxx.runtime.css.Selector; +import jaxx.runtime.css.Stylesheet; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Handles the <code><style></code> tag. + * + * @author Ethan Nicholas + */ +public class StyleHandler implements TagHandler { + public static final String SOURCE_ATTRIBUTE = "source"; + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + boolean source = false; + NamedNodeMap attributes = tag.getAttributes(); + for (int i = 0; i < attributes.getLength(); i++) { + Attr attribute = (Attr) attributes.item(i); + String name = attribute.getName(); + String attrValue = attribute.getValue(); + if (name.equals(SOURCE_ATTRIBUTE)) { + source = true; + File styleFile = new File(compiler.getBaseDir(), attrValue.replace('/', File.separatorChar)); + StringWriter styleBuffer = new StringWriter(); + try { + FileReader in = new FileReader(styleFile); + char[] readBuffer = new char[2048]; + int c; + while ((c = in.read(readBuffer)) > 0) { + styleBuffer.write(readBuffer, 0, c); + } + } catch (FileNotFoundException e) { + compiler.reportError("stylesheet file not found: " + styleFile); + } + compiler.getSourceFiles().push(styleFile); + compiler.registerStylesheet(processStylesheet(styleBuffer.toString())); + compiler.getSourceFiles().pop(); + } else if (!name.startsWith(XMLNS_ATTRIBUTE) && + !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { + throw new UnsupportedAttributeException(name); + } + } + + StringBuffer style = new StringBuffer(); + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + switch (child.getNodeType()) { + case Node.ELEMENT_NODE: + compiler.reportError("<style> tag may not contain child elements: " + tag); + case Node.TEXT_NODE: // fall through + case Node.CDATA_SECTION_NODE: + style.append(((Text) child).getData()); + } + } + + String styleString = style.toString().trim(); + if (styleString.length() > 0) { + if (source) { + compiler.reportError("<style> tag has both a source attribute and an inline stylesheet"); + } + compiler.registerStylesheet(processStylesheet(style.toString())); + } + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + } + + protected Selector processSelector(SimpleNode selector) { + if (selector.getId() != CSSParserTreeConstants.JJTSELECTOR) { + throw new IllegalArgumentException("argument node is not a Selector"); + } + String javaClassName = null; + String styleClass = null; + String pseudoClass = null; + String id = null; + + for (int i = 0; i < selector.jjtGetNumChildren(); i++) { + SimpleNode child = selector.getChild(i); + switch (child.getId()) { + case CSSParserTreeConstants.JJTJAVACLASS: + if (!child.getText().trim().equals("*")) { + javaClassName = child.getText(); + } + break; + case CSSParserTreeConstants.JJTCLASS: + styleClass = child.getText().substring(1); + break; + case CSSParserTreeConstants.JJTPSEUDOCLASS: + pseudoClass = child.getText().substring(1); + break; + case CSSParserTreeConstants.JJTID: + id = child.getText().substring(1); + break; + + default: + throw new IllegalStateException("unexpected child of Selector node, type=" + child.getId()); + } + } + + return new Selector(javaClassName, styleClass, pseudoClass, id); + } + + protected Rule processRule(SimpleNode ruleNode) { + if (ruleNode.getId() != CSSParserTreeConstants.JJTRULE) { + throw new IllegalArgumentException("argument node is not a Rule"); + } + SimpleNode selectorsNode = ruleNode.getChild(0); + assert selectorsNode.getId() == CSSParserTreeConstants.JJTSELECTORS : "expected node to be of type Selectors"; + + List<Selector> selectors = new ArrayList<Selector>(); + for (int i = 0; i < selectorsNode.jjtGetNumChildren(); i++) { + SimpleNode selectorNode = selectorsNode.getChild(i); + selectors.add(processSelector(selectorNode)); + } + + Map<String, String> properties = new HashMap<String, String>(); + for (int i = 1; i < ruleNode.jjtGetNumChildren(); i++) { + SimpleNode declarationNode = ruleNode.getChild(i); + if (declarationNode.getId() == CSSParserTreeConstants.JJTDECLARATION) { + String key = declarationNode.getChild(0).getText(); + SimpleNode valueNode = declarationNode.getChild(1); + String value = valueNode.getText(); + if (valueNode.firstToken.kind == CSSParserConstants.STRING) { + value = value.substring(1, value.length() - 1); + } + properties.put(key, value); + } + } + Rule rule; + rule = new Rule(selectors.toArray(new Selector[selectors.size()]), properties); + return rule; + } + + protected Stylesheet processStylesheet(String stylesheetText) throws CompilerException { + CSSParser p = new CSSParser(new StringReader(stylesheetText)); + SimpleNode node; + try { + node = p.Stylesheet(); + } catch (Error e) { + throw new CompilerException(e); + } + List<Rule> rules = new ArrayList<Rule>(); + for (int i = 0; i < node.jjtGetNumChildren(); i++) { + SimpleNode ruleNode = node.getChild(i); + Rule rule = processRule(ruleNode); + rules.add(rule); + } + Stylesheet stylesheet; + stylesheet = new Stylesheet(rules.toArray(new Rule[rules.size()])); + return stylesheet; + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,48 +1,64 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.JAXXCompiler; -import org.w3c.dom.Element; - -import java.io.IOException; - -/** - * Implementations of <code>TagHandler</code> produce Java source code from XML tags. - * <code>TagHandlers</code> are mapped to particular XML tags (such as <JFrame>) in {@link JAXXCompiler}. - * There is only one <code>TagHandler</code> for any given XML tag, and therefore implementations must be - * stateless. - * - * @author Ethan Nicholas - */ -public interface TagHandler { - - String XMLNS_ATTRIBUTE = "xmlns"; - - /** - * Performs the first pass of compilation on an XML tag from a JAXX source file. - * <code>TagHandler</code> implementations affect the generated <code>.java</code> - * file by calling methods in the <code>JAXXCompiler</code>. - * - * @param tag the XML tag to compile - * @param compiler the active JAXXCompiler - * @throws CompilerException if a compilation error occurs - * @throws IOException if an I/O error occurs - */ - void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException; - - /** - * Performs the second pass of compilation on an XML tag from a JAXX source file. - * <code>TagHandler</code> implementations affect the generated <code>.java</code> - * file by calling methods in the <code>JAXXCompiler</code>. - * - * @param tag the XML tag to compile - * @param compiler the active JAXXCompiler - * @throws CompilerException if a compilation error occurs - * @throws IOException if an I/O error occurs - */ - void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException; -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import org.w3c.dom.Element; + +import java.io.IOException; + +/** + * Implementations of <code>TagHandler</code> produce Java source code from XML tags. + * <code>TagHandlers</code> are mapped to particular XML tags (such as <JFrame>) in {@link JAXXCompiler}. + * There is only one <code>TagHandler</code> for any given XML tag, and therefore implementations must be + * stateless. + * + * @author Ethan Nicholas + */ +public interface TagHandler { + + String XMLNS_ATTRIBUTE = "xmlns"; + + /** + * Performs the first pass of compilation on an XML tag from a JAXX source file. + * <code>TagHandler</code> implementations affect the generated <code>.java</code> + * file by calling methods in the <code>JAXXCompiler</code>. + * + * @param tag the XML tag to compile + * @param compiler the active JAXXCompiler + * @throws CompilerException if a compilation error occurs + * @throws IOException if an I/O error occurs + */ + void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException; + + /** + * Performs the second pass of compilation on an XML tag from a JAXX source file. + * <code>TagHandler</code> implementations affect the generated <code>.java</code> + * file by calling methods in the <code>JAXXCompiler</code>. + * + * @param tag the XML tag to compile + * @param compiler the active JAXXCompiler + * @throws CompilerException if a compilation error occurs + * @throws IOException if an I/O error occurs + */ + void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException; +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/TagManager.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.compiler.tags; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ApplicationHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,39 +1,55 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.runtime.swing.Application; -import jaxx.compiler.types.TypeManager; -import org.w3c.dom.Element; - -import javax.swing.WindowConstants; - -public class ApplicationHandler extends JWindowHandler { - - public ApplicationHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Application.class); - } - - @Override - public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException { - if (propertyName.equals("lookAndFeel") && stringValue != null && !stringValue.trim().startsWith("{")) { - compiler.appendBodyCode("{ " + object.getJavaCode() + ".setLookAndFeel(" + compiler.getJavaCode(stringValue) + "); }" + JAXXCompiler.getLineSeparator()); - } else { - super.setAttribute(object, propertyName, stringValue, inline, compiler); - } - } - - @Override - protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - super.setDefaults(object, tag, compiler); - setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.EXIT_ON_CLOSE), false, compiler); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.runtime.swing.Application; +import jaxx.compiler.types.TypeManager; +import org.w3c.dom.Element; + +import javax.swing.WindowConstants; + +public class ApplicationHandler extends JWindowHandler { + + public ApplicationHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Application.class); + } + + @Override + public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException { + if (propertyName.equals("lookAndFeel") && stringValue != null && !stringValue.trim().startsWith("{")) { + compiler.appendBodyCode("{ " + object.getJavaCode() + ".setLookAndFeel(" + compiler.getJavaCode(stringValue) + "); }" + JAXXCompiler.getLineSeparator()); + } else { + super.setAttribute(object, propertyName, stringValue, inline, compiler); + } + } + + @Override + protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + super.setDefaults(object, tag, compiler); + setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.EXIT_ON_CLOSE), false, compiler); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CellHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,150 +1,166 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.UnsupportedAttributeException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.tags.TagHandler; -import jaxx.compiler.types.TypeManager; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -import java.awt.GridBagConstraints; -import java.awt.Insets; -import java.io.IOException; - -public class CellHandler implements TagHandler { - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compileChildrenFirstPass(tag, compiler); - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - Node parent = tag.getParentNode(); - if (parent.getNodeType() != Node.ELEMENT_NODE || !parent.getLocalName().equals("row")) { - compiler.reportError("cell tag may only appear within row tag"); - return; - } - - TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent(); - table.newCell(); - GridBagConstraints c = table.getCellConstraints(); - setAttributes(c, tag); - compileChildrenSecondPass(tag, compiler); - } - - public static void setAttribute(GridBagConstraints c, String name, String value) throws CompilerException { - value = value.trim(); - if (name.equals("insets")) { - c.insets = (Insets) TypeManager.convertFromString(value, Insets.class); - } else if (name.equals("weightx")) { - c.weightx = Double.parseDouble(value); - } else if (name.equals("weighty")) { - c.weighty = Double.parseDouble(value); - } else if (name.equals("columns")) { - c.gridwidth = Integer.parseInt(value); - } else if (name.equals("rows")) { - c.gridheight = Integer.parseInt(value); - } else if (name.equals("fill")) { - if (value.equals("none")) { - c.fill = GridBagConstraints.NONE; - } else if (value.equals("horizontal")) { - c.fill = GridBagConstraints.HORIZONTAL; - } else if (value.equals("vertical")) { - c.fill = GridBagConstraints.VERTICAL; - } else if (value.equals("both")) { - c.fill = GridBagConstraints.BOTH; - } else { - throw new IllegalArgumentException("invalid value for fill attribute: '" + value + "'"); - } - } else if (name.equals("anchor")) { - //todo use a converter - if (value.equals("north")) { - c.anchor = GridBagConstraints.NORTH; - } else if (value.equals("northeast")) { - c.anchor = GridBagConstraints.NORTHEAST; - } else if (value.equals("east")) { - c.anchor = GridBagConstraints.EAST; - } else if (value.equals("southeast")) { - c.anchor = GridBagConstraints.SOUTHEAST; - } else if (value.equals("south")) { - c.anchor = GridBagConstraints.SOUTH; - } else if (value.equals("southwest")) { - c.anchor = GridBagConstraints.SOUTHWEST; - } else if (value.equals("west")) { - c.anchor = GridBagConstraints.WEST; - } else if (value.equals("northwest")) { - c.anchor = GridBagConstraints.NORTHWEST; - } else if (value.equals("center")) { - c.anchor = GridBagConstraints.CENTER; - } else { - throw new IllegalArgumentException("invalid value for anchor attribute: '" + value + "'"); - } - } else { - throw new UnsupportedAttributeException(name); - } - } - - public static void setAttributes(GridBagConstraints c, Element tag) throws CompilerException { - NamedNodeMap children = tag.getAttributes(); - for (int i = 0; i < children.getLength(); i++) { - Attr attribute = (Attr) children.item(i); - String name = attribute.getName(); - String value = attribute.getValue(); - if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { - setAttribute(c, name, value); - } - } - } - - protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - compileChildTagFirstPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - compileChildTagSecondPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileFirstPass(tag); - } - - protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileSecondPass(tag); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.UnsupportedAttributeException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.tags.TagHandler; +import jaxx.compiler.types.TypeManager; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.io.IOException; + +public class CellHandler implements TagHandler { + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compileChildrenFirstPass(tag, compiler); + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + Node parent = tag.getParentNode(); + if (parent.getNodeType() != Node.ELEMENT_NODE || !parent.getLocalName().equals("row")) { + compiler.reportError("cell tag may only appear within row tag"); + return; + } + + TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent(); + table.newCell(); + GridBagConstraints c = table.getCellConstraints(); + setAttributes(c, tag); + compileChildrenSecondPass(tag, compiler); + } + + public static void setAttribute(GridBagConstraints c, String name, String value) throws CompilerException { + value = value.trim(); + if (name.equals("insets")) { + c.insets = (Insets) TypeManager.convertFromString(value, Insets.class); + } else if (name.equals("weightx")) { + c.weightx = Double.parseDouble(value); + } else if (name.equals("weighty")) { + c.weighty = Double.parseDouble(value); + } else if (name.equals("columns")) { + c.gridwidth = Integer.parseInt(value); + } else if (name.equals("rows")) { + c.gridheight = Integer.parseInt(value); + } else if (name.equals("fill")) { + if (value.equals("none")) { + c.fill = GridBagConstraints.NONE; + } else if (value.equals("horizontal")) { + c.fill = GridBagConstraints.HORIZONTAL; + } else if (value.equals("vertical")) { + c.fill = GridBagConstraints.VERTICAL; + } else if (value.equals("both")) { + c.fill = GridBagConstraints.BOTH; + } else { + throw new IllegalArgumentException("invalid value for fill attribute: '" + value + "'"); + } + } else if (name.equals("anchor")) { + //todo use a converter + if (value.equals("north")) { + c.anchor = GridBagConstraints.NORTH; + } else if (value.equals("northeast")) { + c.anchor = GridBagConstraints.NORTHEAST; + } else if (value.equals("east")) { + c.anchor = GridBagConstraints.EAST; + } else if (value.equals("southeast")) { + c.anchor = GridBagConstraints.SOUTHEAST; + } else if (value.equals("south")) { + c.anchor = GridBagConstraints.SOUTH; + } else if (value.equals("southwest")) { + c.anchor = GridBagConstraints.SOUTHWEST; + } else if (value.equals("west")) { + c.anchor = GridBagConstraints.WEST; + } else if (value.equals("northwest")) { + c.anchor = GridBagConstraints.NORTHWEST; + } else if (value.equals("center")) { + c.anchor = GridBagConstraints.CENTER; + } else { + throw new IllegalArgumentException("invalid value for anchor attribute: '" + value + "'"); + } + } else { + throw new UnsupportedAttributeException(name); + } + } + + public static void setAttributes(GridBagConstraints c, Element tag) throws CompilerException { + NamedNodeMap children = tag.getAttributes(); + for (int i = 0; i < children.getLength(); i++) { + Attr attribute = (Attr) children.item(i); + String name = attribute.getName(); + String value = attribute.getValue(); + if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { + setAttribute(c, name, value); + } + } + } + + protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + compileChildTagFirstPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + compileChildTagSecondPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileFirstPass(tag); + } + + protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileSecondPass(tag); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/CompiledItemContainer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,50 +1,66 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.runtime.swing.Item; - -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; - -/** Compiled representation of a class that contains Items arranged in a list or tree structure (JComboBox, JList, JTree). */ -class CompiledItemContainer extends CompiledObject { - - private List<Item> items = new ArrayList<Item>(); - private Stack<Item> openNodes = new Stack<Item>(); - - public CompiledItemContainer(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { - super(id, objectClass, compiler); - } - - public void openItem(Item item) { - if (openNodes.isEmpty()) { - items.add(item); - } else { - Item openNode = openNodes.peek(); - openNode.addChild(item); - } - openNodes.add(item); - } - - public void closeItem(Item item) { - if (openNodes.pop() != item) { - throw new IllegalArgumentException(item + " was not at the top of the item stack"); - } - } - - public List<Item> getItems() { - return items; - } - - public void setItems(List<Item> items) { - this.items = items; - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.runtime.swing.Item; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +/** Compiled representation of a class that contains Items arranged in a list or tree structure (JComboBox, JList, JTree). */ +class CompiledItemContainer extends CompiledObject { + + private List<Item> items = new ArrayList<Item>(); + private Stack<Item> openNodes = new Stack<Item>(); + + public CompiledItemContainer(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { + super(id, objectClass, compiler); + } + + public void openItem(Item item) { + if (openNodes.isEmpty()) { + items.add(item); + } else { + Item openNode = openNodes.peek(); + openNode.addChild(item); + } + openNodes.add(item); + } + + public void closeItem(Item item) { + if (openNodes.pop() != item) { + throw new IllegalArgumentException(item + " was not at the top of the item stack"); + } + } + + public List<Item> getItems() { + return items; + } + + public void setItems(List<Item> items) { + this.items = items; + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/ItemHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,147 +1,163 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.UnsupportedAttributeException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.TagHandler; -import jaxx.compiler.types.TypeManager; -import jaxx.runtime.swing.Item; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -import java.io.IOException; -import java.util.List; - -public class ItemHandler implements TagHandler { - - private String DATA_BINDING = "<data binding has not been processed yet>"; - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compileChildrenFirstPass(tag, compiler); - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - String id = tag.getAttribute("id"); - if (id == null || id.length() == 0) { - id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(Item.class)); - } - String label = null; - String value = null; - boolean selected = false; - NamedNodeMap children = tag.getAttributes(); - - for (int i = 0; i < children.getLength(); i++) { - Attr attribute = (Attr) children.item(i); - String name = attribute.getName(); - String attrValue = attribute.getValue(); - if (name.equals("id")) { - // already handled - continue; - } - if (name.equals(Item.LABEL_PROPERTY)) { - String labelBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(String.class)); - if (labelBinding != null) { - compiler.registerDataBinding(labelBinding, id + ".label", id + ".setLabel(" + labelBinding + ");"); - } else { - label = attrValue; - } - continue; - } - if (name.equals(Item.VALUE_PROPERTY)) { - String valueBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Object.class)); - if (valueBinding != null) { - value = DATA_BINDING; - compiler.registerDataBinding(valueBinding, id + ".value", id + ".setValue(" + valueBinding + ");"); - } else { - value = attrValue; - } - continue; - } - if (name.equals(Item.SELECTED_PROPERTY)) { - String selectedBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Boolean.class)); - if (selectedBinding != null) { - compiler.registerDataBinding(selectedBinding, id + ".selected", id + ".setSelected(" + selectedBinding + ");"); - } else { - selected = (Boolean) TypeManager.convertFromString(attrValue, Boolean.class); - } - continue; - } - - if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { - throw new UnsupportedAttributeException(name); - } - } - - Item item = new Item(id, label, value, selected); - CompiledItemContainer list = (CompiledItemContainer) compiler.getOpenComponent(); - if (value == null) { - compiler.reportError("<item> tag is missing required 'value' attribute"); - } else { - if (!value.equals(DATA_BINDING)) { - List<Item> items = list.getItems(); - for (Item item1 : items) { - if (item1.getValue().equals(value)) { - compiler.reportError("This container already has an <item> tag with the value '" + value + "'"); - break; - } - } - } - list.openItem(item); - compileChildrenSecondPass(tag, compiler); - list.closeItem(item); - } - } - - protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - compileChildTagFirstPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - compileChildTagSecondPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileFirstPass(tag); - } - - protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileSecondPass(tag); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.UnsupportedAttributeException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.TagHandler; +import jaxx.compiler.types.TypeManager; +import jaxx.runtime.swing.Item; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +import java.io.IOException; +import java.util.List; + +public class ItemHandler implements TagHandler { + + private String DATA_BINDING = "<data binding has not been processed yet>"; + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compileChildrenFirstPass(tag, compiler); + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + String id = tag.getAttribute("id"); + if (id == null || id.length() == 0) { + id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(Item.class)); + } + String label = null; + String value = null; + boolean selected = false; + NamedNodeMap children = tag.getAttributes(); + + for (int i = 0; i < children.getLength(); i++) { + Attr attribute = (Attr) children.item(i); + String name = attribute.getName(); + String attrValue = attribute.getValue(); + if (name.equals("id")) { + // already handled + continue; + } + if (name.equals(Item.LABEL_PROPERTY)) { + String labelBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(String.class)); + if (labelBinding != null) { + compiler.registerDataBinding(labelBinding, id + ".label", id + ".setLabel(" + labelBinding + ");"); + } else { + label = attrValue; + } + continue; + } + if (name.equals(Item.VALUE_PROPERTY)) { + String valueBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Object.class)); + if (valueBinding != null) { + value = DATA_BINDING; + compiler.registerDataBinding(valueBinding, id + ".value", id + ".setValue(" + valueBinding + ");"); + } else { + value = attrValue; + } + continue; + } + if (name.equals(Item.SELECTED_PROPERTY)) { + String selectedBinding = compiler.processDataBindings(attrValue, ClassDescriptorLoader.getClassDescriptor(Boolean.class)); + if (selectedBinding != null) { + compiler.registerDataBinding(selectedBinding, id + ".selected", id + ".setSelected(" + selectedBinding + ");"); + } else { + selected = (Boolean) TypeManager.convertFromString(attrValue, Boolean.class); + } + continue; + } + + if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { + throw new UnsupportedAttributeException(name); + } + } + + Item item = new Item(id, label, value, selected); + CompiledItemContainer list = (CompiledItemContainer) compiler.getOpenComponent(); + if (value == null) { + compiler.reportError("<item> tag is missing required 'value' attribute"); + } else { + if (!value.equals(DATA_BINDING)) { + List<Item> items = list.getItems(); + for (Item item1 : items) { + if (item1.getValue().equals(value)) { + compiler.reportError("This container already has an <item> tag with the value '" + value + "'"); + break; + } + } + } + list.openItem(item); + compileChildrenSecondPass(tag, compiler); + list.closeItem(item); + } + } + + protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + compileChildTagFirstPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + compileChildTagSecondPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileFirstPass(tag); + } + + protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileSecondPass(tag); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXComboBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.compiler.tags.swing; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXListHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.compiler.tags.swing; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTabHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tags.swing; import jaxx.compiler.reflect.ClassDescriptor; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JAXXTreeHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.compiler.tags.swing; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JCheckBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,26 +1,42 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; - -import javax.swing.AbstractButton; -import javax.swing.event.ChangeListener; - -public class JCheckBoxHandler extends DefaultComponentHandler { - - public JCheckBoxHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("isSelected", ChangeListener.class, "model"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; + +import javax.swing.AbstractButton; +import javax.swing.event.ChangeListener; + +public class JCheckBoxHandler extends DefaultComponentHandler { + + public JCheckBoxHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("isSelected", ChangeListener.class, "model"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JComboBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,44 +1,60 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import java.io.IOException; -import java.awt.event.ItemListener; -import javax.swing.JComboBox; - -public class JComboBoxHandler extends DefaultComponentHandler { - - public JComboBoxHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JComboBox.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getSelectedIndex", ItemListener.class); - addProxyEventInfo("getSelectedItem", ItemListener.class); - } - - @Override - public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - if (children.getLength() > 0) { - compiler.reportError("JComboBox does not accept childs"); - throw new CompilerException("JComboBox does not accept childs"); - } - } -} - - - +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import java.io.IOException; +import java.awt.event.ItemListener; +import javax.swing.JComboBox; + +public class JComboBoxHandler extends DefaultComponentHandler { + + public JComboBoxHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JComboBox.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getSelectedIndex", ItemListener.class); + addProxyEventInfo("getSelectedItem", ItemListener.class); + } + + @Override + public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + if (children.getLength() > 0) { + compiler.reportError("JComboBox does not accept childs"); + throw new CompilerException("JComboBox does not accept childs"); + } + } +} + + + Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JInternalFrameHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,54 +1,70 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; - -import javax.swing.JInternalFrame; -import javax.swing.JMenuBar; -import javax.swing.WindowConstants; - -public class JInternalFrameHandler extends DefaultComponentHandler { - - public JInternalFrameHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JInternalFrame.class); - } - - @Override - public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { - return new CompiledObject(id, getBeanClass(), compiler) { - - @Override - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) { - appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");"); - } else { - super.addChild(child, constraints, compiler); - } - } - }; - } - - @Override - protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - super.setDefaults(object, tag, compiler); - setAttribute(object, "visible", "true", false, compiler); - setAttribute(object, "closable", "true", false, compiler); - setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.DISPOSE_ON_CLOSE), false, compiler); - } - - @Override - public void setAttributes(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - super.setAttributes(object, tag, compiler); - compiler.appendInitializerCode(object.getId() + ".pack();\n"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; + +import javax.swing.JInternalFrame; +import javax.swing.JMenuBar; +import javax.swing.WindowConstants; + +public class JInternalFrameHandler extends DefaultComponentHandler { + + public JInternalFrameHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JInternalFrame.class); + } + + @Override + public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { + return new CompiledObject(id, getBeanClass(), compiler) { + + @Override + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) { + appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");"); + } else { + super.addChild(child, constraints, compiler); + } + } + }; + } + + @Override + protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + super.setDefaults(object, tag, compiler); + setAttribute(object, "visible", "true", false, compiler); + setAttribute(object, "closable", "true", false, compiler); + setAttribute(object, "defaultCloseOperation", String.valueOf(WindowConstants.DISPOSE_ON_CLOSE), false, compiler); + } + + @Override + public void setAttributes(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + super.setAttributes(object, tag, compiler); + compiler.appendInitializerCode(object.getId() + ".pack();\n"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JListHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tags.swing; import jaxx.compiler.CompilerException; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JMenuHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,26 +1,42 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; - -import javax.swing.JMenu; -import javax.swing.event.MenuListener; - -public class JMenuHandler extends DefaultComponentHandler { - - public JMenuHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JMenu.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("isSelected", MenuListener.class); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; + +import javax.swing.JMenu; +import javax.swing.event.MenuListener; + +public class JMenuHandler extends DefaultComponentHandler { + + public JMenuHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JMenu.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("isSelected", MenuListener.class); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPasswordFieldHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,25 +1,41 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; - -import javax.swing.JPasswordField; -import javax.swing.event.DocumentListener; - -public class JPasswordFieldHandler extends JTextComponentHandler { - - public JPasswordFieldHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPasswordField.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getPassword", DocumentListener.class, "document"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; + +import javax.swing.JPasswordField; +import javax.swing.event.DocumentListener; + +public class JPasswordFieldHandler extends JTextComponentHandler { + + public JPasswordFieldHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPasswordField.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getPassword", DocumentListener.class, "document"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JPopupMenuHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,32 +1,48 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; - -import javax.swing.JPopupMenu; - -public class JPopupMenuHandler extends DefaultComponentHandler { - - public JPopupMenuHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPopupMenu.class); - } - - @Override - public boolean isContainer() { - return true; - } - - @Override - protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) { - compiler.openInvisibleComponent(object); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; + +import javax.swing.JPopupMenu; + +public class JPopupMenuHandler extends DefaultComponentHandler { + + public JPopupMenuHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JPopupMenu.class); + } + + @Override + public boolean isContainer() { + return true; + } + + @Override + protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) { + compiler.openInvisibleComponent(object); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JProgressBarHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,26 +1,42 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; - -import javax.swing.JProgressBar; -import javax.swing.event.ChangeListener; - -public class JProgressBarHandler extends DefaultComponentHandler { - - public JProgressBarHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JProgressBar.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getValue", ChangeListener.class, "change"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; + +import javax.swing.JProgressBar; +import javax.swing.event.ChangeListener; + +public class JProgressBarHandler extends DefaultComponentHandler { + + public JProgressBarHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JProgressBar.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getValue", ChangeListener.class, "change"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JRadioButtonHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,80 +1,96 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.UnsupportedAttributeException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import jaxx.runtime.swing.JAXXButtonGroup; - -import javax.swing.AbstractButton; -import javax.swing.event.ChangeListener; - -public class JRadioButtonHandler extends DefaultComponentHandler { - - private static final String VALUE_PROPERTY = JAXXButtonGroup.VALUE_CLIENT_PROPERTY.substring(1); - private static final String BUTTON_GROUP_PROPERTY = JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY.substring(1); - - public JRadioButtonHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("isSelected", ChangeListener.class, "model"); - } - - @Override - public ClassDescriptor getPropertyType(CompiledObject object, String name, JAXXCompiler compiler) throws CompilerException { - if (name.equals(BUTTON_GROUP_PROPERTY)) { - return null; // accepts either a String or a ButtonGroup - } else if (name.equals(VALUE_PROPERTY)) { - return ClassDescriptorLoader.getClassDescriptor(Object.class); - } else { - return super.getPropertyType(object, name, compiler); - } - } - - @Override - public boolean isMemberBound(String name) throws UnsupportedAttributeException { - return !(name.equals(BUTTON_GROUP_PROPERTY) || name.equals(VALUE_PROPERTY)) && super.isMemberBound(name); - } - - // handle buttonGroup assignment in addition block rather than initialization block - @Override - public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) { - if (name.equals(BUTTON_GROUP_PROPERTY)) { - object.appendAdditionCode(getSetPropertyCode(object.getJavaCode(), name, compiler.getJavaCode(value), compiler)); - } else { - super.setProperty(object, name, value, compiler); - } - } - - @Override - public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException { - if (name.equals(BUTTON_GROUP_PROPERTY)) { - if (valueCode.startsWith("\"") && valueCode.endsWith("\"")) { - valueCode = valueCode.substring(1, valueCode.length() - 1); - CompiledObject buttonGroup = compiler.getCompiledObject(valueCode); - if (buttonGroup == null) { - buttonGroup = new CompiledObject(valueCode, ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class), compiler); - compiler.registerCompiledObject(buttonGroup); - } - } - return "{ javax.swing.ButtonGroup $buttonGroup = " + valueCode + "; " + id + ".putClientProperty(\"$buttonGroup\", $buttonGroup); $buttonGroup.add(" + id + "); }\n"; - } else if (name.equals(VALUE_PROPERTY)) { - return "{ " + id + ".putClientProperty(\"" + JAXXButtonGroup.VALUE_CLIENT_PROPERTY + "\", " + valueCode + "); Object $buttonGroup = " + id + ".getClientProperty(\"" + JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY + "\");" + - " if ($buttonGroup instanceof jaxx.runtime.swing.JAXXButtonGroup) { ((jaxx.runtime.swing.JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }\n"; - } else { - return super.getSetPropertyCode(id, name, valueCode, compiler); - } - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.UnsupportedAttributeException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import jaxx.runtime.swing.JAXXButtonGroup; + +import javax.swing.AbstractButton; +import javax.swing.event.ChangeListener; + +public class JRadioButtonHandler extends DefaultComponentHandler { + + private static final String VALUE_PROPERTY = JAXXButtonGroup.VALUE_CLIENT_PROPERTY.substring(1); + private static final String BUTTON_GROUP_PROPERTY = JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY.substring(1); + + public JRadioButtonHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, AbstractButton.class); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("isSelected", ChangeListener.class, "model"); + } + + @Override + public ClassDescriptor getPropertyType(CompiledObject object, String name, JAXXCompiler compiler) throws CompilerException { + if (name.equals(BUTTON_GROUP_PROPERTY)) { + return null; // accepts either a String or a ButtonGroup + } else if (name.equals(VALUE_PROPERTY)) { + return ClassDescriptorLoader.getClassDescriptor(Object.class); + } else { + return super.getPropertyType(object, name, compiler); + } + } + + @Override + public boolean isMemberBound(String name) throws UnsupportedAttributeException { + return !(name.equals(BUTTON_GROUP_PROPERTY) || name.equals(VALUE_PROPERTY)) && super.isMemberBound(name); + } + + // handle buttonGroup assignment in addition block rather than initialization block + @Override + public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) { + if (name.equals(BUTTON_GROUP_PROPERTY)) { + object.appendAdditionCode(getSetPropertyCode(object.getJavaCode(), name, compiler.getJavaCode(value), compiler)); + } else { + super.setProperty(object, name, value, compiler); + } + } + + @Override + public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException { + if (name.equals(BUTTON_GROUP_PROPERTY)) { + if (valueCode.startsWith("\"") && valueCode.endsWith("\"")) { + valueCode = valueCode.substring(1, valueCode.length() - 1); + CompiledObject buttonGroup = compiler.getCompiledObject(valueCode); + if (buttonGroup == null) { + buttonGroup = new CompiledObject(valueCode, ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class), compiler); + compiler.registerCompiledObject(buttonGroup); + } + } + return "{ javax.swing.ButtonGroup $buttonGroup = " + valueCode + "; " + id + ".putClientProperty(\"$buttonGroup\", $buttonGroup); $buttonGroup.add(" + id + "); }\n"; + } else if (name.equals(VALUE_PROPERTY)) { + return "{ " + id + ".putClientProperty(\"" + JAXXButtonGroup.VALUE_CLIENT_PROPERTY + "\", " + valueCode + "); Object $buttonGroup = " + id + ".getClientProperty(\"" + JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY + "\");" + + " if ($buttonGroup instanceof jaxx.runtime.swing.JAXXButtonGroup) { ((jaxx.runtime.swing.JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }\n"; + } else { + return super.getSetPropertyCode(id, name, valueCode, compiler); + } + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JScrollPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,42 +1,58 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; - -import javax.swing.JScrollPane; - -public class JScrollPaneHandler extends DefaultComponentHandler { - - public JScrollPaneHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JScrollPane.class); - } - - @Override - public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { - return new CompiledObject(id, getBeanClass(), compiler) { - - boolean hasChild; - - @Override - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - if (constraints != null) { - compiler.reportError("JScrollPane does not accept constraints"); - } - if (hasChild) { - compiler.reportError("JScrollPane may only have one child"); - } - super.addChild(child, constraints, compiler); - hasChild = true; - } - }; - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; + +import javax.swing.JScrollPane; + +public class JScrollPaneHandler extends DefaultComponentHandler { + + public JScrollPaneHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JScrollPane.class); + } + + @Override + public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { + return new CompiledObject(id, getBeanClass(), compiler) { + + boolean hasChild; + + @Override + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + if (constraints != null) { + compiler.reportError("JScrollPane does not accept constraints"); + } + if (hasChild) { + compiler.reportError("JScrollPane may only have one child"); + } + super.addChild(child, constraints, compiler); + hasChild = true; + } + }; + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSliderHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,48 +1,64 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; - -import javax.swing.JSlider; -import javax.swing.event.ChangeListener; - -public class JSliderHandler extends DefaultComponentHandler { - - public JSliderHandler(ClassDescriptor beanClass) { - super(beanClass); - if (!ClassDescriptorLoader.getClassDescriptor(JSlider.class).isAssignableFrom(beanClass)) { - throw new IllegalArgumentException(getClass().getName() + " does not support the class " + beanClass.getName()); - } - } - - @Override - protected int getAttributeOrdering(Attr attr) { - if (attr.getName().equals("value")) { - return 1; - } else { - return super.getAttributeOrdering(attr); - } - } - - @Override - protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - super.setDefaults(object, tag, compiler); - setAttribute(object, "value", "0", false, compiler); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getValue", ChangeListener.class, "model"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +import javax.swing.JSlider; +import javax.swing.event.ChangeListener; + +public class JSliderHandler extends DefaultComponentHandler { + + public JSliderHandler(ClassDescriptor beanClass) { + super(beanClass); + if (!ClassDescriptorLoader.getClassDescriptor(JSlider.class).isAssignableFrom(beanClass)) { + throw new IllegalArgumentException(getClass().getName() + " does not support the class " + beanClass.getName()); + } + } + + @Override + protected int getAttributeOrdering(Attr attr) { + if (attr.getName().equals("value")) { + return 1; + } else { + return super.getAttributeOrdering(attr); + } + } + + @Override + protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + super.setDefaults(object, tag, compiler); + setAttribute(object, "value", "0", false, compiler); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getValue", ChangeListener.class, "model"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSpinnerHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,94 +1,110 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; - -import javax.swing.JSpinner; -import javax.swing.event.ChangeListener; - -public class JSpinnerHandler extends DefaultComponentHandler { - - public static String MINIMUM_PROPERTY = "minimum"; - public static String MAXIMUM_PROPERTY = "maximum"; - public static String VALUE_PROPERTY = "value"; - - public JSpinnerHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSpinner.class); - } - - public static class CompiledSpinner extends CompiledObject { - - Integer minimum = null; - Integer maximum = null; - Integer value = null; - - public CompiledSpinner(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { - super(id, objectClass, compiler); - } - } - - @Override - public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { - return new CompiledSpinner(id, getBeanClass(), compiler); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getValue", ChangeListener.class, "model"); - } - - @Override - public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException { - if (propertyName.equals(MINIMUM_PROPERTY) || propertyName.equals(MAXIMUM_PROPERTY) || - propertyName.equals(VALUE_PROPERTY)) { - return ClassDescriptorLoader.getClassDescriptor(Integer.class); - } - return super.getPropertyType(object, propertyName, compiler); - } - - @Override - public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) throws CompilerException { - if (name.equals(MINIMUM_PROPERTY)) { - ((CompiledSpinner) object).minimum = (Integer) value; - } else if (name.equals(MAXIMUM_PROPERTY)) { - ((CompiledSpinner) object).maximum = (Integer) value; - } else if (name.equals(VALUE_PROPERTY)) { - ((CompiledSpinner) object).value = (Integer) value; - } else { - super.setProperty(object, name, value, compiler); - } - } - - @Override - protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - CompiledSpinner spinner = (CompiledSpinner) object; - if (spinner.minimum != null || spinner.maximum != null || spinner.value != null) { - if (spinner.getConstructorParams() != null) { - compiler.reportError("constructorParams and minimum/maximum may not both be specified for the same JSpinner"); - } - if (spinner.minimum == null) { - spinner.minimum = Math.min(0, spinner.maximum != null ? spinner.maximum.intValue() : 0); - } - if (spinner.maximum == null) { - spinner.maximum = Math.max(100, spinner.minimum.intValue()); - } - if (spinner.value == null) { - spinner.value = spinner.minimum; - } - spinner.setConstructorParams("new SpinnerNumberModel(" + spinner.value + ", " + spinner.minimum + ", " + spinner.maximum + ", 1)"); - } - - super.closeComponent(object, tag, compiler); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; + +import javax.swing.JSpinner; +import javax.swing.event.ChangeListener; + +public class JSpinnerHandler extends DefaultComponentHandler { + + public static String MINIMUM_PROPERTY = "minimum"; + public static String MAXIMUM_PROPERTY = "maximum"; + public static String VALUE_PROPERTY = "value"; + + public JSpinnerHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSpinner.class); + } + + public static class CompiledSpinner extends CompiledObject { + + Integer minimum = null; + Integer maximum = null; + Integer value = null; + + public CompiledSpinner(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { + super(id, objectClass, compiler); + } + } + + @Override + public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { + return new CompiledSpinner(id, getBeanClass(), compiler); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getValue", ChangeListener.class, "model"); + } + + @Override + public ClassDescriptor getPropertyType(CompiledObject object, String propertyName, JAXXCompiler compiler) throws CompilerException { + if (propertyName.equals(MINIMUM_PROPERTY) || propertyName.equals(MAXIMUM_PROPERTY) || + propertyName.equals(VALUE_PROPERTY)) { + return ClassDescriptorLoader.getClassDescriptor(Integer.class); + } + return super.getPropertyType(object, propertyName, compiler); + } + + @Override + public void setProperty(CompiledObject object, String name, Object value, JAXXCompiler compiler) throws CompilerException { + if (name.equals(MINIMUM_PROPERTY)) { + ((CompiledSpinner) object).minimum = (Integer) value; + } else if (name.equals(MAXIMUM_PROPERTY)) { + ((CompiledSpinner) object).maximum = (Integer) value; + } else if (name.equals(VALUE_PROPERTY)) { + ((CompiledSpinner) object).value = (Integer) value; + } else { + super.setProperty(object, name, value, compiler); + } + } + + @Override + protected void closeComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + CompiledSpinner spinner = (CompiledSpinner) object; + if (spinner.minimum != null || spinner.maximum != null || spinner.value != null) { + if (spinner.getConstructorParams() != null) { + compiler.reportError("constructorParams and minimum/maximum may not both be specified for the same JSpinner"); + } + if (spinner.minimum == null) { + spinner.minimum = Math.min(0, spinner.maximum != null ? spinner.maximum.intValue() : 0); + } + if (spinner.maximum == null) { + spinner.maximum = Math.max(100, spinner.minimum.intValue()); + } + if (spinner.value == null) { + spinner.value = spinner.minimum; + } + spinner.setConstructorParams("new SpinnerNumberModel(" + spinner.value + ", " + spinner.minimum + ", " + spinner.maximum + ", 1)"); + } + + super.closeComponent(object, tag, compiler); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JSplitPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,71 +1,87 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; - -import javax.swing.JSplitPane; -import java.awt.Component; - -public class JSplitPaneHandler extends DefaultComponentHandler { - - public JSplitPaneHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSplitPane.class); - } - - protected Component createRawComponent(Element tag) { - return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); - } - - /** - * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. The - * values required by the JAXXBeanInfo are the unwieldy <code>vertical_split</code> and <code>horizontal_split</code> - * (which are also recognized). - */ - @Override - protected int constantValue(String key, String value) { - if (key.equals("orientation")) { - value = value.trim().toLowerCase(); - if (value.equals("horizontal") || value.equals("horizontal_split")) { - return JSplitPane.HORIZONTAL_SPLIT; - } - if (value.equals("vertical") || value.equals("vertical_split")) { - return JSplitPane.VERTICAL_SPLIT; - } - throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'"); - } - return super.constantValue(key, value); - } - - @Override - public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { - return new CompiledObject(id, getBeanClass(), compiler) { - - private int count; - - @Override - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - if (constraints != null) { - compiler.reportError("JSplitPane does not accept constraints"); - } - if (count == 0) { - super.addChild(child, "JSplitPane.LEFT", compiler); - } else if (count == 1) { - super.addChild(child, "JSplitPane.RIGHT", compiler); - } else { - compiler.reportError("JSplitPane is limited to two children"); - } - count++; - } - }; - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; + +import javax.swing.JSplitPane; +import java.awt.Component; + +public class JSplitPaneHandler extends DefaultComponentHandler { + + public JSplitPaneHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JSplitPane.class); + } + + protected Component createRawComponent(Element tag) { + return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + } + + /** + * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. The + * values required by the JAXXBeanInfo are the unwieldy <code>vertical_split</code> and <code>horizontal_split</code> + * (which are also recognized). + */ + @Override + protected int constantValue(String key, String value) { + if (key.equals("orientation")) { + value = value.trim().toLowerCase(); + if (value.equals("horizontal") || value.equals("horizontal_split")) { + return JSplitPane.HORIZONTAL_SPLIT; + } + if (value.equals("vertical") || value.equals("vertical_split")) { + return JSplitPane.VERTICAL_SPLIT; + } + throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'"); + } + return super.constantValue(key, value); + } + + @Override + public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { + return new CompiledObject(id, getBeanClass(), compiler) { + + private int count; + + @Override + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + if (constraints != null) { + compiler.reportError("JSplitPane does not accept constraints"); + } + if (count == 0) { + super.addChild(child, "JSplitPane.LEFT", compiler); + } else if (count == 1) { + super.addChild(child, "JSplitPane.RIGHT", compiler); + } else { + compiler.reportError("JSplitPane is limited to two children"); + } + count++; + } + }; + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,135 +1,151 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.I18nHelper; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import jaxx.runtime.swing.TabInfo; - -import javax.swing.Icon; -import javax.swing.JTabbedPane; -import javax.swing.event.ChangeListener; -import java.awt.Color; -import java.awt.event.ContainerListener; - -public class JTabbedPaneHandler extends DefaultComponentHandler { - - public JTabbedPaneHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTabbedPane.class); - } - - public static class CompiledTabbedPane extends CompiledObject { - - private static final TabInfo USED = new TabInfo("ALREADY USED"); - int tabCount; - TabInfo tabInfo; - - public CompiledTabbedPane(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { - super(id, objectClass, compiler); - } - - @Override - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - if (constraints != null) { - compiler.reportError("JTabbedPane tabs may not have constraints"); - } - - super.addChild(child, constraints, compiler); - - if (tabInfo == null) { - compiler.reportError("JTabbedPaneHandler may only have 'tab' tags as children (found " + child.getObjectClass() + ")"); - return; - } else if (tabInfo == USED) { - compiler.reportError("<tab> tags may only have one child component"); - return; - } - - int tabIndex = ++tabCount - 1; - appendAdditionCode(tabInfo.getId() + ".addPropertyChangeListener(new jaxx.runtime.swing.TabInfoPropertyChangeListener(" + getId() + ", " + tabIndex + "));"); - - String title = tabInfo.getTitle(); - if (title != null) { - if (I18nHelper.isI18nAttribute("title")) { - if (!title.startsWith("_(\"")) { - // we did not have the invocation code, add it - title = I18nHelper.addI18nInvocation(getId(), "title", compiler.getJavaCode(title), compiler); - } - } else { - title = compiler.getJavaCode(title); - } - appendAdditionCode(getId() + ".setTitleAt(" + tabIndex + ", " + title + ");"); - } - - String toolTipText = tabInfo.getToolTipText(); - if (toolTipText != null) { - if (I18nHelper.isI18nAttribute("toolTipText")) { - if (!toolTipText.startsWith("_(\"")) { - // we did not have the invocation code, add it - toolTipText = I18nHelper.addI18nInvocation(getId(), "toolTipText", compiler.getJavaCode(toolTipText), compiler); - } - } else { - toolTipText = compiler.getJavaCode(toolTipText); - } - appendAdditionCode(getId() + ".setToolTipTextAt(" + tabIndex + ", " + toolTipText + ");"); - } - - boolean enabled = tabInfo.isEnabled(); - if (!enabled) { - appendAdditionCode(getId() + ".setEnabledAt(" + tabIndex + ", false);"); - } - - Color foreground = tabInfo.getForeground(); - if (foreground != null) { - appendAdditionCode(getId() + ".setForegroundAt(" + tabIndex + ", " + compiler.getJavaCode(foreground) + ");"); - } - - Color background = tabInfo.getBackground(); - if (background != null) { - appendAdditionCode(getId() + ".setBackgroundAt(" + tabIndex + ", " + compiler.getJavaCode(background) + ");"); - } - - int mnemonic = tabInfo.getMnemonic(); - if (mnemonic != -1) { - appendAdditionCode(getId() + ".setMnemonicAt(" + tabIndex + ", " + mnemonic + ");"); - } - - int displayedMnemonicIndex = tabInfo.getDisplayedMnemonicIndex(); - if (displayedMnemonicIndex != -1) { - appendAdditionCode(getId() + ".setDisplayedMnemonicIndexAt(" + tabIndex + ", " + displayedMnemonicIndex + ");"); - } - - Icon icon = tabInfo.getIcon(); - if (icon != null) { - appendAdditionCode(getId() + ".setIconAt(" + tabIndex + ", " + icon + ");"); - } - - Icon disabledIcon = tabInfo.getDisabledIcon(); - if (disabledIcon != null) { - appendAdditionCode(getId() + ".setDisabledIconAt(" + tabIndex + ", " + disabledIcon + ");"); - } - - tabInfo = USED; - } - } - - @Override - public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { - return new CompiledTabbedPane(id, getBeanClass(), compiler); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getSelectedIndex", ChangeListener.class); - addProxyEventInfo("getSelectedComponent", ChangeListener.class); - addProxyEventInfo("getTabCount", ContainerListener.class); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.I18nHelper; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import jaxx.runtime.swing.TabInfo; + +import javax.swing.Icon; +import javax.swing.JTabbedPane; +import javax.swing.event.ChangeListener; +import java.awt.Color; +import java.awt.event.ContainerListener; + +public class JTabbedPaneHandler extends DefaultComponentHandler { + + public JTabbedPaneHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTabbedPane.class); + } + + public static class CompiledTabbedPane extends CompiledObject { + + private static final TabInfo USED = new TabInfo("ALREADY USED"); + int tabCount; + TabInfo tabInfo; + + public CompiledTabbedPane(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { + super(id, objectClass, compiler); + } + + @Override + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + if (constraints != null) { + compiler.reportError("JTabbedPane tabs may not have constraints"); + } + + super.addChild(child, constraints, compiler); + + if (tabInfo == null) { + compiler.reportError("JTabbedPaneHandler may only have 'tab' tags as children (found " + child.getObjectClass() + ")"); + return; + } else if (tabInfo == USED) { + compiler.reportError("<tab> tags may only have one child component"); + return; + } + + int tabIndex = ++tabCount - 1; + appendAdditionCode(tabInfo.getId() + ".addPropertyChangeListener(new jaxx.runtime.swing.TabInfoPropertyChangeListener(" + getId() + ", " + tabIndex + "));"); + + String title = tabInfo.getTitle(); + if (title != null) { + if (I18nHelper.isI18nAttribute("title")) { + if (!title.startsWith("_(\"")) { + // we did not have the invocation code, add it + title = I18nHelper.addI18nInvocation(getId(), "title", compiler.getJavaCode(title), compiler); + } + } else { + title = compiler.getJavaCode(title); + } + appendAdditionCode(getId() + ".setTitleAt(" + tabIndex + ", " + title + ");"); + } + + String toolTipText = tabInfo.getToolTipText(); + if (toolTipText != null) { + if (I18nHelper.isI18nAttribute("toolTipText")) { + if (!toolTipText.startsWith("_(\"")) { + // we did not have the invocation code, add it + toolTipText = I18nHelper.addI18nInvocation(getId(), "toolTipText", compiler.getJavaCode(toolTipText), compiler); + } + } else { + toolTipText = compiler.getJavaCode(toolTipText); + } + appendAdditionCode(getId() + ".setToolTipTextAt(" + tabIndex + ", " + toolTipText + ");"); + } + + boolean enabled = tabInfo.isEnabled(); + if (!enabled) { + appendAdditionCode(getId() + ".setEnabledAt(" + tabIndex + ", false);"); + } + + Color foreground = tabInfo.getForeground(); + if (foreground != null) { + appendAdditionCode(getId() + ".setForegroundAt(" + tabIndex + ", " + compiler.getJavaCode(foreground) + ");"); + } + + Color background = tabInfo.getBackground(); + if (background != null) { + appendAdditionCode(getId() + ".setBackgroundAt(" + tabIndex + ", " + compiler.getJavaCode(background) + ");"); + } + + int mnemonic = tabInfo.getMnemonic(); + if (mnemonic != -1) { + appendAdditionCode(getId() + ".setMnemonicAt(" + tabIndex + ", " + mnemonic + ");"); + } + + int displayedMnemonicIndex = tabInfo.getDisplayedMnemonicIndex(); + if (displayedMnemonicIndex != -1) { + appendAdditionCode(getId() + ".setDisplayedMnemonicIndexAt(" + tabIndex + ", " + displayedMnemonicIndex + ");"); + } + + Icon icon = tabInfo.getIcon(); + if (icon != null) { + appendAdditionCode(getId() + ".setIconAt(" + tabIndex + ", " + icon + ");"); + } + + Icon disabledIcon = tabInfo.getDisabledIcon(); + if (disabledIcon != null) { + appendAdditionCode(getId() + ".setDisabledIconAt(" + tabIndex + ", " + disabledIcon + ");"); + } + + tabInfo = USED; + } + } + + @Override + public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { + return new CompiledTabbedPane(id, getBeanClass(), compiler); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getSelectedIndex", ChangeListener.class); + addProxyEventInfo("getSelectedComponent", ChangeListener.class); + addProxyEventInfo("getTabCount", ContainerListener.class); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTextComponentHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,70 +1,86 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import jaxx.runtime.SwingUtil; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; - -import javax.swing.JTextArea; -import javax.swing.event.DocumentListener; -import javax.swing.text.JTextComponent; - -public class JTextComponentHandler extends DefaultComponentHandler { - - private static final int DEFAULT_COLUMNS = 15; - - public JTextComponentHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTextComponent.class); - } - - @Override - protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - super.setDefaults(object, tag, compiler); - try { - object.getObjectClass().getMethodDescriptor("setColumns", ClassDescriptorLoader.getClassDescriptor(int.class)); - setAttribute(object, "columns", String.valueOf(DEFAULT_COLUMNS), false, compiler); - } catch (NoSuchMethodException e) { - // ignore ? - } - - if (ClassDescriptorLoader.getClassDescriptor(JTextArea.class).isAssignableFrom(object.getObjectClass())) { - setAttribute(object, "lineWrap", "true", false, compiler); - setAttribute(object, "wrapStyleWord", "true", false, compiler); - } - } - - @Override - public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException { - if (name.equals("text")) { - return SwingUtil.class.getName() + ".setText(" + id + ", " + valueCode + ");\n"; - //return "jaxx.runtime.swing.Utils.setText(" + id + ", " + valueCode + ");\n"; - } - return super.getSetPropertyCode(id, name, valueCode, compiler); - } - - @Override - protected int getAttributeOrdering(Attr attr) { - // delay text in case other attributes affect how it's processed, as is the case - // with JEditorPane's contentType - if (attr.getName().equals("text")) { - return 1; - } - return super.getAttributeOrdering(attr); - } - - @Override - protected void configureProxyEventInfo() { - super.configureProxyEventInfo(); - addProxyEventInfo("getText", DocumentListener.class, "document"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import jaxx.runtime.SwingUtil; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +import javax.swing.JTextArea; +import javax.swing.event.DocumentListener; +import javax.swing.text.JTextComponent; + +public class JTextComponentHandler extends DefaultComponentHandler { + + private static final int DEFAULT_COLUMNS = 15; + + public JTextComponentHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JTextComponent.class); + } + + @Override + protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + super.setDefaults(object, tag, compiler); + try { + object.getObjectClass().getMethodDescriptor("setColumns", ClassDescriptorLoader.getClassDescriptor(int.class)); + setAttribute(object, "columns", String.valueOf(DEFAULT_COLUMNS), false, compiler); + } catch (NoSuchMethodException e) { + // ignore ? + } + + if (ClassDescriptorLoader.getClassDescriptor(JTextArea.class).isAssignableFrom(object.getObjectClass())) { + setAttribute(object, "lineWrap", "true", false, compiler); + setAttribute(object, "wrapStyleWord", "true", false, compiler); + } + } + + @Override + public String getSetPropertyCode(String id, String name, String valueCode, JAXXCompiler compiler) throws CompilerException { + if (name.equals("text")) { + return SwingUtil.class.getName() + ".setText(" + id + ", " + valueCode + ");\n"; + //return "jaxx.runtime.swing.Utils.setText(" + id + ", " + valueCode + ");\n"; + } + return super.getSetPropertyCode(id, name, valueCode, compiler); + } + + @Override + protected int getAttributeOrdering(Attr attr) { + // delay text in case other attributes affect how it's processed, as is the case + // with JEditorPane's contentType + if (attr.getName().equals("text")) { + return 1; + } + return super.getAttributeOrdering(attr); + } + + @Override + protected void configureProxyEventInfo() { + super.configureProxyEventInfo(); + addProxyEventInfo("getText", DocumentListener.class, "document"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JToolBarHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,39 +1,55 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; - -import javax.swing.JToolBar; - -public class JToolBarHandler extends DefaultComponentHandler { - - public JToolBarHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JToolBar.class); - } - - /** - * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. These values should - * have been supported without any special effort on my part, but JToolBar's BeanInfo doesn't contain the enum attribute - * for the orientation property. - */ - @Override - protected int constantValue(String key, String value) { - if (key.equals("orientation")) { - value = value.trim().toLowerCase(); - if (value.equals("horizontal")) { - return JToolBar.HORIZONTAL; - } - if (value.equals("vertical")) { - return JToolBar.VERTICAL; - } - throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'"); - } - return super.constantValue(key, value); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; + +import javax.swing.JToolBar; + +public class JToolBarHandler extends DefaultComponentHandler { + + public JToolBarHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JToolBar.class); + } + + /** + * Add support for <code>orientation="vertical"</code> and <code>orientation="horizontal"</code>. These values should + * have been supported without any special effort on my part, but JToolBar's BeanInfo doesn't contain the enum attribute + * for the orientation property. + */ + @Override + protected int constantValue(String key, String value) { + if (key.equals("orientation")) { + value = value.trim().toLowerCase(); + if (value.equals("horizontal")) { + return JToolBar.HORIZONTAL; + } + if (value.equals("vertical")) { + return JToolBar.VERTICAL; + } + throw new IllegalArgumentException("orientation must be 'horizontal' or 'vertical', found '" + value + "'"); + } + return super.constantValue(key, value); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTreeHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tags.swing; import jaxx.compiler.CompilerException; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JWindowHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,62 +1,78 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import org.w3c.dom.Element; - -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JMenuBar; -import javax.swing.JWindow; -import java.io.IOException; -import java.util.Map; - -public class JWindowHandler extends DefaultComponentHandler { - - public JWindowHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JWindow.class, JFrame.class, JDialog.class); - } - - @Override - public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { - return new CompiledObject(id, getBeanClass(), compiler) { - - @Override - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) { - appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");"); - } else { - super.addChild(child, constraints, compiler); - } - } - }; - } - - @Override - protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { - if (compiler.getOpenComponent() != null) { - compiler.openInvisibleComponent(object); - } else { - super.openComponent(object, tag, compiler); - } - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - super.compileSecondPass(tag, compiler); - CompiledObject object = objectMap.get(tag); - Map<?, ?> properties = object.getProperties(); - if (!properties.containsKey("width") && !properties.containsKey("height")) { - compiler.appendLateInitializer(object.getId() + ".pack();\n"); - } - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import org.w3c.dom.Element; + +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JMenuBar; +import javax.swing.JWindow; +import java.io.IOException; +import java.util.Map; + +public class JWindowHandler extends DefaultComponentHandler { + + public JWindowHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JWindow.class, JFrame.class, JDialog.class); + } + + @Override + public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { + return new CompiledObject(id, getBeanClass(), compiler) { + + @Override + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class).isAssignableFrom(child.getObjectClass())) { + appendAdditionCode(getId() + ".setJMenuBar(" + child.getId() + ");"); + } else { + super.addChild(child, constraints, compiler); + } + } + }; + } + + @Override + protected void openComponent(CompiledObject object, Element tag, JAXXCompiler compiler) throws CompilerException { + if (compiler.getOpenComponent() != null) { + compiler.openInvisibleComponent(object); + } else { + super.openComponent(object, tag, compiler); + } + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + super.compileSecondPass(tag, compiler); + CompiledObject object = objectMap.get(tag); + Map<?, ?> properties = object.getProperties(); + if (!properties.containsKey("width") && !properties.containsKey("height")) { + compiler.appendLateInitializer(object.getId() + ".pack();\n"); + } + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/RowHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,88 +1,104 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.TagHandler; -import jaxx.runtime.swing.Table; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -import java.awt.GridBagConstraints; -import java.io.IOException; - -public class RowHandler implements TagHandler { - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compileChildrenFirstPass(tag, compiler); - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - if (!ClassDescriptorLoader.getClassDescriptor(Table.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { - compiler.reportError("row tag may only appear within Table tag"); - return; - } - - TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent(); - table.newRow(); - GridBagConstraints c = table.getRowConstraints(); - CellHandler.setAttributes(c, tag); - compileChildrenSecondPass(tag, compiler); - } - - public void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - if (!child.getLocalName().equals("cell")) { - compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children"); - } - compileChildTagFirstPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - if (!child.getLocalName().equals("cell")) { - compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children"); - } - compileChildTagSecondPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileFirstPass(tag); - } - - protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileSecondPass(tag); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.TagHandler; +import jaxx.runtime.swing.Table; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +import java.awt.GridBagConstraints; +import java.io.IOException; + +public class RowHandler implements TagHandler { + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compileChildrenFirstPass(tag, compiler); + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + if (!ClassDescriptorLoader.getClassDescriptor(Table.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { + compiler.reportError("row tag may only appear within Table tag"); + return; + } + + TableHandler.CompiledTable table = (TableHandler.CompiledTable) compiler.getOpenComponent(); + table.newRow(); + GridBagConstraints c = table.getRowConstraints(); + CellHandler.setAttributes(c, tag); + compileChildrenSecondPass(tag, compiler); + } + + public void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + if (!child.getLocalName().equals("cell")) { + compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children"); + } + compileChildTagFirstPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + public void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + if (!child.getLocalName().equals("cell")) { + compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children"); + } + compileChildTagSecondPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileFirstPass(tag); + } + + protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileSecondPass(tag); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TabHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,169 +1,185 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.I18nHelper; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.TagHandler; -import jaxx.runtime.swing.TabInfo; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -import javax.swing.Icon; -import javax.swing.JTabbedPane; -import java.awt.Color; -import java.io.IOException; - -public class TabHandler implements TagHandler { - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compileChildrenFirstPass(tag, compiler); - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - if (!ClassDescriptorLoader.getClassDescriptor(JTabbedPane.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { - compiler.reportError("tab tag may only appear within JTabbedPane tag"); - return; - } - - JTabbedPaneHandler.CompiledTabbedPane tabs = (JTabbedPaneHandler.CompiledTabbedPane) compiler.getOpenComponent(); - - String id = tag.getAttribute("id"); - if (id == null || id.length() == 0) { - id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(TabInfo.class)); - } - TabInfo tabInfo = new TabInfo(id); - CompiledObject compiledTabInfo = new CompiledObject(id, ClassDescriptorLoader.getClassDescriptor(TabInfo.class), compiler); - compiler.registerCompiledObject(compiledTabInfo); - //id = tabInfo.getId(); - tabs.tabInfo = tabInfo; - setAttributes(compiledTabInfo, tabs, tag, compiler); - compileChildrenSecondPass(tag, compiler); - tabs.tabInfo = null; - } - - public static void setAttribute(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, String name, String value, JAXXCompiler compiler) throws CompilerException { - value = value.trim(); - TabInfo tabInfo = tabs.tabInfo; - String id = tabInfo.getId(); - String binding = compiler.processDataBindings(value, ClassDescriptorLoader.getClassDescriptor(Object.class)); - if (binding != null) { - compiler.registerDataBinding(binding, id + "." + name, id + ".set" + org.apache.commons.lang.StringUtils.capitalize(name) + "(" + binding + ");"); - return; - } - - String valueCode = compiler.getJavaCode(value); - - // add i18n support - if (I18nHelper.isI18nableAttribute(name, compiler)) { - value = valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler); - } - - if (name.equals("title")) { - tabInfo.setTitle(value); - compiledTabInfo.appendInitializationCode(id + ".setTitle(" + valueCode + ");"); - //compiledTabInfo.appendInitializationCode(id + ".setTitle(" + TypeManager.getJavaCode(value) + ");"); - } else if (name.equals("toolTipText")) { - tabInfo.setToolTipText(value); - compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + valueCode + ");"); - //compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + TypeManager.getJavaCode(value) + ");"); - } else if (name.equals("icon")) { - Icon icon = (Icon) compiler.convertFromString(value, Icon.class); - tabInfo.setIcon(icon); - compiledTabInfo.appendInitializationCode(id + ".setIcon(" + compiler.getJavaCode(icon) + ");"); - } else if (name.equals("enabled")) { - boolean enabled = (Boolean) compiler.convertFromString(value, Boolean.class); - tabInfo.setEnabled(enabled); - compiledTabInfo.appendInitializationCode(id + ".setEnabled(" + enabled + ");"); - } else if (name.equals("disabledIcon")) { - Icon disabledIcon = (Icon) compiler.convertFromString(value, Icon.class); - tabInfo.setDisabledIcon(disabledIcon); - compiledTabInfo.appendInitializationCode(id + ".setDisabledIcon(" + compiler.getJavaCode(disabledIcon) + ");"); - } else if (name.equals("mnemonic")) { - int mnemonic = (Character) compiler.convertFromString(value, char.class); - tabInfo.setMnemonic(mnemonic); - compiledTabInfo.appendInitializationCode(id + ".setMnemonic(" + mnemonic + ");"); - } else if (name.equals("displayedMnemonicIndex")) { - int displayedMnemonicIndex = (Integer) compiler.convertFromString(value, int.class); - tabInfo.setDisplayedMnemonicIndex(displayedMnemonicIndex); - compiledTabInfo.appendInitializationCode(id + ".setDisplayedMnemonicIndex(" + displayedMnemonicIndex + ");"); - } else if (name.equals("foreground")) { - Color foreground = (Color) compiler.convertFromString(value, Color.class); - tabInfo.setForeground(foreground); - compiledTabInfo.appendInitializationCode(id + ".setForeground(" + compiler.getJavaCode(foreground) + ");"); - } else if (name.equals("background")) { - Color background = (Color) compiler.convertFromString(value, Color.class); - tabInfo.setBackground(background); - compiledTabInfo.appendInitializationCode(id + ".setBackground(" + compiler.getJavaCode(background) + ");"); - } else if (name.equals("id")) { - // ignore, already handled - } else { - compiler.reportError("The <tab> tag does not support the attribute '" + name + "'"); - } - } - - public void setAttributes(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, Element tag, JAXXCompiler compiler) throws CompilerException { - NamedNodeMap children = tag.getAttributes(); - for (int i = 0; i < children.getLength(); i++) { - Attr attribute = (Attr) children.item(i); - String name = attribute.getName(); - String value = attribute.getValue(); - if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { - setAttribute(compiledTabInfo, tabs, name, value, compiler); - } - } - } - - protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - compileChildTagFirstPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileFirstPass(tag); - } - - protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - NodeList children = tag.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - int nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - Element child = (Element) node; - compileChildTagSecondPass(child, compiler); - } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { - String text = ((Text) node).getData().trim(); - if (text.length() > 0) { - compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); - } - } - } - } - - protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - compiler.compileSecondPass(tag); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.I18nHelper; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.TagHandler; +import jaxx.runtime.swing.TabInfo; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +import javax.swing.Icon; +import javax.swing.JTabbedPane; +import java.awt.Color; +import java.io.IOException; + +public class TabHandler implements TagHandler { + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compileChildrenFirstPass(tag, compiler); + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + if (!ClassDescriptorLoader.getClassDescriptor(JTabbedPane.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { + compiler.reportError("tab tag may only appear within JTabbedPane tag"); + return; + } + + JTabbedPaneHandler.CompiledTabbedPane tabs = (JTabbedPaneHandler.CompiledTabbedPane) compiler.getOpenComponent(); + + String id = tag.getAttribute("id"); + if (id == null || id.length() == 0) { + id = compiler.getAutoId(ClassDescriptorLoader.getClassDescriptor(TabInfo.class)); + } + TabInfo tabInfo = new TabInfo(id); + CompiledObject compiledTabInfo = new CompiledObject(id, ClassDescriptorLoader.getClassDescriptor(TabInfo.class), compiler); + compiler.registerCompiledObject(compiledTabInfo); + //id = tabInfo.getId(); + tabs.tabInfo = tabInfo; + setAttributes(compiledTabInfo, tabs, tag, compiler); + compileChildrenSecondPass(tag, compiler); + tabs.tabInfo = null; + } + + public static void setAttribute(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, String name, String value, JAXXCompiler compiler) throws CompilerException { + value = value.trim(); + TabInfo tabInfo = tabs.tabInfo; + String id = tabInfo.getId(); + String binding = compiler.processDataBindings(value, ClassDescriptorLoader.getClassDescriptor(Object.class)); + if (binding != null) { + compiler.registerDataBinding(binding, id + "." + name, id + ".set" + org.apache.commons.lang.StringUtils.capitalize(name) + "(" + binding + ");"); + return; + } + + String valueCode = compiler.getJavaCode(value); + + // add i18n support + if (I18nHelper.isI18nableAttribute(name, compiler)) { + value = valueCode = I18nHelper.addI18nInvocation(id, name, valueCode, compiler); + } + + if (name.equals("title")) { + tabInfo.setTitle(value); + compiledTabInfo.appendInitializationCode(id + ".setTitle(" + valueCode + ");"); + //compiledTabInfo.appendInitializationCode(id + ".setTitle(" + TypeManager.getJavaCode(value) + ");"); + } else if (name.equals("toolTipText")) { + tabInfo.setToolTipText(value); + compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + valueCode + ");"); + //compiledTabInfo.appendInitializationCode(id + ".setToolTipText(" + TypeManager.getJavaCode(value) + ");"); + } else if (name.equals("icon")) { + Icon icon = (Icon) compiler.convertFromString(value, Icon.class); + tabInfo.setIcon(icon); + compiledTabInfo.appendInitializationCode(id + ".setIcon(" + compiler.getJavaCode(icon) + ");"); + } else if (name.equals("enabled")) { + boolean enabled = (Boolean) compiler.convertFromString(value, Boolean.class); + tabInfo.setEnabled(enabled); + compiledTabInfo.appendInitializationCode(id + ".setEnabled(" + enabled + ");"); + } else if (name.equals("disabledIcon")) { + Icon disabledIcon = (Icon) compiler.convertFromString(value, Icon.class); + tabInfo.setDisabledIcon(disabledIcon); + compiledTabInfo.appendInitializationCode(id + ".setDisabledIcon(" + compiler.getJavaCode(disabledIcon) + ");"); + } else if (name.equals("mnemonic")) { + int mnemonic = (Character) compiler.convertFromString(value, char.class); + tabInfo.setMnemonic(mnemonic); + compiledTabInfo.appendInitializationCode(id + ".setMnemonic(" + mnemonic + ");"); + } else if (name.equals("displayedMnemonicIndex")) { + int displayedMnemonicIndex = (Integer) compiler.convertFromString(value, int.class); + tabInfo.setDisplayedMnemonicIndex(displayedMnemonicIndex); + compiledTabInfo.appendInitializationCode(id + ".setDisplayedMnemonicIndex(" + displayedMnemonicIndex + ");"); + } else if (name.equals("foreground")) { + Color foreground = (Color) compiler.convertFromString(value, Color.class); + tabInfo.setForeground(foreground); + compiledTabInfo.appendInitializationCode(id + ".setForeground(" + compiler.getJavaCode(foreground) + ");"); + } else if (name.equals("background")) { + Color background = (Color) compiler.convertFromString(value, Color.class); + tabInfo.setBackground(background); + compiledTabInfo.appendInitializationCode(id + ".setBackground(" + compiler.getJavaCode(background) + ");"); + } else if (name.equals("id")) { + // ignore, already handled + } else { + compiler.reportError("The <tab> tag does not support the attribute '" + name + "'"); + } + } + + public void setAttributes(CompiledObject compiledTabInfo, JTabbedPaneHandler.CompiledTabbedPane tabs, Element tag, JAXXCompiler compiler) throws CompilerException { + NamedNodeMap children = tag.getAttributes(); + for (int i = 0; i < children.getLength(); i++) { + Attr attribute = (Attr) children.item(i); + String name = attribute.getName(); + String value = attribute.getValue(); + if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) { + setAttribute(compiledTabInfo, tabs, name, value, compiler); + } + } + } + + protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + compileChildTagFirstPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileFirstPass(tag); + } + + protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + NodeList children = tag.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node node = children.item(i); + int nodeType = node.getNodeType(); + if (nodeType == Node.ELEMENT_NODE) { + Element child = (Element) node; + compileChildTagSecondPass(child, compiler); + } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { + String text = ((Text) node).getData().trim(); + if (text.length() > 0) { + compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } + } + } + } + + protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + compiler.compileSecondPass(tag); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/TableHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,123 +1,139 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.swing; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.UnsupportedAttributeException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultComponentHandler; -import jaxx.runtime.swing.Table; - -import java.awt.GridBagConstraints; -import java.awt.Insets; -import java.util.ArrayList; -import java.util.List; - -public class TableHandler extends DefaultComponentHandler { - - public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3); - - public TableHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Table.class); - } - - @Override - public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException { - try { - if (object instanceof CompiledTable) { - CellHandler.setAttribute(((CompiledTable) object).getTableConstraints(), propertyName, stringValue); - } else { - super.setAttribute(object, propertyName, stringValue, inline, compiler); - } - } catch (UnsupportedAttributeException e) { - super.setAttribute(object, propertyName, stringValue, inline, compiler); - } - } - - class CompiledTable extends CompiledObject { - - private List<Integer> rowSpans = new ArrayList<Integer>(); - private GridBagConstraints tableConstraints; - private GridBagConstraints rowConstraints = null; - private GridBagConstraints cellConstraints = null; - private boolean emptyCell; - - public CompiledTable(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { - super(id, objectClass, compiler); - tableConstraints = new GridBagConstraints(); - tableConstraints.gridx = -1; - tableConstraints.gridy = -1; - tableConstraints.insets = DEFAULT_INSETS; - } - - @Override - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - if (constraints != null) { - compiler.reportError("Table does not accept constraints"); - } - GridBagConstraints c = getCellConstraints(); - if (c == null) { - compiler.reportError("Table tag may only contain row tags"); - return; - } - if (!emptyCell) { - compiler.reportError("Table cells may only have one child component"); - } - while (rowSpans.size() < c.gridx + c.gridwidth) { - rowSpans.add(null); - } - for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) { - rowSpans.set(x, c.gridheight); - } - - super.addChild(child, compiler.getJavaCode(c), compiler); - - emptyCell = false; - } - - public GridBagConstraints getTableConstraints() { - return tableConstraints; - } - - public GridBagConstraints getRowConstraints() { - return rowConstraints; - } - - public GridBagConstraints getCellConstraints() { - return cellConstraints; - } - - public void newRow() { - tableConstraints.gridy++; - tableConstraints.gridx = -1; - rowConstraints = (GridBagConstraints) tableConstraints.clone(); - - for (int x = 0; x < rowSpans.size(); x++) { - int rowSpan = rowSpans.get(x); - if (rowSpan > 0) { - rowSpans.set(x, rowSpan - 1); - } - } - } - - public void newCell() { - emptyCell = true; - rowConstraints.gridx++; - while (rowConstraints.gridx < rowSpans.size() && rowSpans.get(rowConstraints.gridx) > 0) { - rowConstraints.gridx++; - } - cellConstraints = (GridBagConstraints) rowConstraints.clone(); - } - } - - @Override - public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { - return new CompiledTable(id, getBeanClass(), compiler); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.swing; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.UnsupportedAttributeException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultComponentHandler; +import jaxx.runtime.swing.Table; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.util.ArrayList; +import java.util.List; + +public class TableHandler extends DefaultComponentHandler { + + public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3); + + public TableHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Table.class); + } + + @Override + public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException { + try { + if (object instanceof CompiledTable) { + CellHandler.setAttribute(((CompiledTable) object).getTableConstraints(), propertyName, stringValue); + } else { + super.setAttribute(object, propertyName, stringValue, inline, compiler); + } + } catch (UnsupportedAttributeException e) { + super.setAttribute(object, propertyName, stringValue, inline, compiler); + } + } + + class CompiledTable extends CompiledObject { + + private List<Integer> rowSpans = new ArrayList<Integer>(); + private GridBagConstraints tableConstraints; + private GridBagConstraints rowConstraints = null; + private GridBagConstraints cellConstraints = null; + private boolean emptyCell; + + public CompiledTable(String id, ClassDescriptor objectClass, JAXXCompiler compiler) throws CompilerException { + super(id, objectClass, compiler); + tableConstraints = new GridBagConstraints(); + tableConstraints.gridx = -1; + tableConstraints.gridy = -1; + tableConstraints.insets = DEFAULT_INSETS; + } + + @Override + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + if (constraints != null) { + compiler.reportError("Table does not accept constraints"); + } + GridBagConstraints c = getCellConstraints(); + if (c == null) { + compiler.reportError("Table tag may only contain row tags"); + return; + } + if (!emptyCell) { + compiler.reportError("Table cells may only have one child component"); + } + while (rowSpans.size() < c.gridx + c.gridwidth) { + rowSpans.add(null); + } + for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) { + rowSpans.set(x, c.gridheight); + } + + super.addChild(child, compiler.getJavaCode(c), compiler); + + emptyCell = false; + } + + public GridBagConstraints getTableConstraints() { + return tableConstraints; + } + + public GridBagConstraints getRowConstraints() { + return rowConstraints; + } + + public GridBagConstraints getCellConstraints() { + return cellConstraints; + } + + public void newRow() { + tableConstraints.gridy++; + tableConstraints.gridx = -1; + rowConstraints = (GridBagConstraints) tableConstraints.clone(); + + for (int x = 0; x < rowSpans.size(); x++) { + int rowSpan = rowSpans.get(x); + if (rowSpan > 0) { + rowSpans.set(x, rowSpan - 1); + } + } + } + + public void newCell() { + emptyCell = true; + rowConstraints.gridx++; + while (rowConstraints.gridx < rowSpans.size() && rowSpans.get(rowConstraints.gridx) > 0) { + rowConstraints.gridx++; + } + cellConstraints = (GridBagConstraints) rowConstraints.clone(); + } + } + + @Override + public CompiledObject createCompiledObject(String id, JAXXCompiler compiler) throws CompilerException { + return new CompiledTable(id, getBeanClass(), compiler); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/BeanValidatorHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,715 +1,731 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.validator; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.CompiledObject; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.beans.JAXXBeanInfo; -import jaxx.compiler.beans.JAXXPropertyDescriptor; -import jaxx.compiler.reflect.ClassDescriptor; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.DefaultObjectHandler; -import jaxx.compiler.types.TypeManager; -import jaxx.runtime.validator.swing.SwingValidatorUtil; -import jaxx.runtime.validator.swing.SwingValidator; -import jaxx.runtime.validator.swing.ui.AbstractBeanValidatorUI; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Element; - -import java.beans.IntrospectionException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TreeMap; - -public class BeanValidatorHandler extends DefaultObjectHandler { - - public static final String TAG = "BeanValidator"; - public static final String BEAN_ATTRIBUTE = "bean"; - public static final String BEAN_CLASS_ATTRIBUTE = "beanClass"; - public static final String BEAN_INITIALIZER_ATTRIBUTE = "beanInitializer"; - public static final String ERROR_LIST_MODEL_ATTRIBUTE = "errorListModel"; - public static final String ERROR_TABLE_MODEL_ATTRIBUTE = "errorTableModel"; - public static final String ERROR_LIST_ATTRIBUTE = "errorList"; - public static final String ERROR_TABLE_ATTRIBUTE = "errorTable"; - //TODO-TC20091024 should change this default value to errorListModel - public static final String ERROR_LIST_MODEL_DEFAULT = "errors"; - //TODO-TC20091024 should change this default value to errorTableModel - public static final String ERROR_TABLE_MODEL_DEFAULT = "errors2"; - public static final String ERROR_LIST_DEFAULT = "errorList"; - public static final String ERROR_TABLE_DEFAULT = "errorTable"; - public static final String AUTOFIELD_ATTRIBUTE = "autoField"; - public static final String UI_CLASS_ATTRIBUTE = "uiClass"; - public static final String STRICT_MODE_ATTRIBUTE = "strictMode"; - public static final String CONTEXT_NAME_ATTRIBUTE = "contextName"; - //public static final String SCOPE_ATTRIBUTE = "scope"; - public static final String PARENT_VALIDATOR_ATTRIBUTE = "parentValidator"; - /** to use log facility, just put in your code: log.info(\"...\"); */ - static Log log = LogFactory.getLog(BeanValidatorHandler.class); - protected static Map<JAXXCompiler, List<CompiledBeanValidator>> validators = new HashMap<JAXXCompiler, List<CompiledBeanValidator>>(); - protected static Map<JAXXCompiler, List<String>> validatedComponents = new HashMap<JAXXCompiler, List<String>>(); - - public BeanValidatorHandler(ClassDescriptor beanClass) { - super(beanClass); - ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, SwingValidator.class); - } - - @Override - protected CompiledObject createCompiledObject(String id, JAXXCompiler compiler) { - return new CompiledBeanValidator(id, getBeanClass(), compiler); - } - - @Override - protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - if (log.isDebugEnabled()) { - log.debug(tag); - } - if (!tag.getLocalName().equals(FieldValidatorHandler.TAG)) { - compiler.reportError("tag '" + tag.getParentNode().getLocalName() + "' may only contain " + FieldValidatorHandler.TAG + " as children, but found : " + tag.getLocalName()); - } else { - compiler.compileFirstPass(tag); - } - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - - super.compileSecondPass(tag, compiler); - - CompiledBeanValidator info = (CompiledBeanValidator) objectMap.get(tag); - - boolean error = info.addErrorListModel(tag, this, compiler); - - if (!error) { - error = info.addErrorList(tag, compiler); - } - - if (!error) { - error = info.addErrorTableModel(tag, this, compiler); - } - - if (!error) { - error = info.addErrorTable(tag, compiler); - } - - if (!error) { - error = info.addUiClass(this, compiler); - } - - if (!error) { - error = info.addBean(tag, this, compiler); - } - - /*if (!error) { - error = info.addContextName(this, compiler); - }*/ - - /*if (!error) { - error = info.addScope(this, compiler); - }*/ - - if (!error) { - error = info.addParentValidator(tag, this, compiler); - } - - if (error) { - log.warn("error were detected in second compile pass of CompiledObject [" + info + "]"); - } - - // close the compiled object - compiler.closeComponent(info); - } - - @Override - protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) { - // open the compiled object - compiler.openInvisibleComponent(object); - } - - @Override - public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) { - if (log.isDebugEnabled()) { - log.debug(propertyName + " : " + stringValue + " for " + object); - } - // delegate to the compiled object with is statefull (but not the tag handler) - object.addProperty(propertyName, stringValue); - } - - /** - * The compiled objet representing a BeanValidator to be generated in JAXXObject - * - * @author chemit - */ - public static class CompiledBeanValidator extends CompiledObject { - - protected Map<String, String> fields; - protected Map<String, String> excludeFields; - protected String bean; - protected String beanClass; - protected String contextName; - protected String uiClass; - protected String errorListModel; - protected String errorList; - protected Boolean autoField; - protected Boolean strictMode; - protected JAXXBeanInfo beanDescriptor; - protected String errorTableModel; - protected String errorTable; - protected String parentValidator; - - public CompiledBeanValidator(String id, ClassDescriptor objectClass, JAXXCompiler compiler) { - //TC-20090524 Use the real class descriptor, not the one by default, - //TC-20090524 otherwise can not override the validator class while generation - //super(id, objectClass, compiler); - super(id, getDescriptor(objectClass, compiler), compiler); - fields = new TreeMap<String, String>(); - excludeFields = new TreeMap<String, String>(); - if (log.isDebugEnabled()) { - log.debug("validator objectClass " + super.getObjectClass()); - } - } - - protected static ClassDescriptor getDescriptor(ClassDescriptor objectClass, JAXXCompiler compiler) { - ClassDescriptor result = objectClass; - Class<?> validatorClass = compiler.getConfiguration().getValidatorClass(); - result = ClassDescriptorLoader.getClassDescriptor(validatorClass); - return result; - } - - public Map<String, String> getFields() { - return fields; - } - - public Map<String, String> getExcludeFields() { - return excludeFields; - } - - public void setFields(Map<String, String> fields) { - this.fields = fields; - } - - public void setExcludeFields(Map<String, String> excludeFields) { - this.excludeFields = excludeFields; - } - - @Override - public void addProperty(String property, String value) { - - if (BEAN_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - bean = value.trim(); - } - return; - } - - if (CONTEXT_NAME_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - contextName = value.trim(); - } - return; - } - - if (BEAN_CLASS_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - beanClass = value.trim(); - } - return; - } - - if (ERROR_LIST_MODEL_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - errorListModel = value.trim(); - } - return; - } - - if (ERROR_LIST_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - errorList = value.trim(); - } - return; - } - - if (ERROR_TABLE_MODEL_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - errorTableModel = value.trim(); - } - return; - } - - if (ERROR_TABLE_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - errorTable = value.trim(); - } - return; - } - - if (UI_CLASS_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - uiClass = value.trim(); - } - return; - } - - if (AUTOFIELD_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - autoField = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class); - } - return; - } - - if (STRICT_MODE_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - strictMode = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class); - } - return; - } - - if (PARENT_VALIDATOR_ATTRIBUTE.equals(property)) { - if (value != null && !value.trim().isEmpty()) { - parentValidator = value.trim(); - } - return; - } - - throw new CompilerException("property " + property + " is not allowed on object " + this); - } - - public String getBean() { - return bean; - } - - public String getErrorListModel() { - return errorListModel; - } - - public boolean getAutoField() { - return autoField != null && autoField; - } - - public boolean getStrictMode() { - return strictMode != null && strictMode; - } - - public String getUiClass() { - return uiClass; - } - - public String getBeanClass() { - return beanClass; - } - - public String getContextName() { - return contextName; - } - - public String getParentValidator() { - return parentValidator; - } - - public JAXXBeanInfo getBeanDescriptor(JAXXCompiler compiler) { - if (beanDescriptor == null && foundBean()) { - - String beanClassName = null; - try { - //TC-20090111 beanClass is mandatory - // get the real bean class name (from bean or beanClass) - /*if (beanClass != null) { - beanClassName = beanClass; - } else { - beanClassName = compiler.getSymbolTable().getClassTagIds().get(bean); - if (beanClassName == null) { - compiler.reportError("could not find class of the bean '" + bean + "'"); - return null; - } - }*/ - ClassDescriptor beanClassDescriptor = ClassDescriptorLoader.getClassDescriptor(beanClass); - beanDescriptor = DefaultObjectHandler.getJAXXBeanInfo(beanClassDescriptor); - } catch (ClassNotFoundException e) { - compiler.reportError("could not load class " + beanClassName); - } catch (IntrospectionException e) { - compiler.reportError("could not load class " + beanClassName); - } - } - return beanDescriptor; - } - - @Override - public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - // do nothing - compiler.reportError("can not add CompiledObject in the tag '" + TAG + " (only field tags)"); - } - - public boolean foundBean() { - return !(beanClass == null || beanClass.isEmpty()); - } - - protected boolean addUiClass(BeanValidatorHandler handler, JAXXCompiler compiler) { - boolean withError = false; - if (uiClass == null && compiler.getConfiguration().getDefaultErrorUI() != null) { - uiClass = compiler.getConfiguration().getDefaultErrorUI().getName(); - } - if (uiClass != null) { - try { - ClassDescriptor uiClazz = ClassDescriptorLoader.getClassDescriptor(uiClass); - if (!ClassDescriptorLoader.getClassDescriptor(AbstractBeanValidatorUI.class).isAssignableFrom(uiClazz)) { - compiler.reportError("attribute 'ui' :'" + uiClass + "' is not assignable from class " + AbstractBeanValidatorUI.class); - withError = true; - } else { - String code = handler.getSetPropertyCode(getJavaCode(), UI_CLASS_ATTRIBUTE, uiClazz.getName() + ".class", compiler); - appendAdditionCode(code); - } - } catch (ClassNotFoundException e) { - compiler.reportError("class not found '" + uiClass + "'"); - withError = true; - } - } - - return withError; - } - - protected boolean addErrorListModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { - if (errorListModel == null) { - // try with the default "errors" - if (!compiler.checkReference(tag, ERROR_LIST_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) { - return false; - } - errorListModel = ERROR_LIST_MODEL_DEFAULT; - } else { - if (errorListModel.startsWith("{") && errorListModel.endsWith("}")) { - // this is a script, no check here - errorListModel = errorListModel.substring(1, errorListModel.length() - 1).trim(); - } else if (!compiler.checkReference(tag, errorListModel, true, ERROR_LIST_MODEL_ATTRIBUTE)) { - // errorListModel is not defined - return true; - } - } - - String code = handler.getSetPropertyCode(getJavaCode(), ERROR_LIST_MODEL_ATTRIBUTE, errorListModel, compiler); - appendAdditionCode(code); - - return false; - } - - protected boolean addErrorTableModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { - if (errorTableModel == null) { - // try with the default "errors" - if (!compiler.checkReference(tag, ERROR_TABLE_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) { - return false; - } - errorTableModel = ERROR_TABLE_MODEL_DEFAULT; - } else { - if (errorTableModel.startsWith("{") && errorTableModel.endsWith("}")) { - // this is a script, no check here - errorTableModel = errorTableModel.substring(1, errorTableModel.length() - 1).trim(); - } else if (!compiler.checkReference(tag, errorTableModel, true, ERROR_TABLE_MODEL_ATTRIBUTE)) { - // errorListModel is not defined - return true; - } - } - - String code = handler.getSetPropertyCode(getJavaCode(), ERROR_TABLE_MODEL_ATTRIBUTE, errorTableModel, compiler); - appendAdditionCode(code); - - return false; - - } - - protected boolean addParentValidator(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { - if (parentValidator != null) { - String initializer; - if (parentValidator.startsWith("{") && parentValidator.endsWith("}")) { - - // todo : should be able to bind - initializer = parentValidator.substring(1, parentValidator.length() - 1); - - } else { - // the attribute referes an existing widget - if (!compiler.checkReference(tag, parentValidator, true, PARENT_VALIDATOR_ATTRIBUTE)) { - // parentValidator is not defined - return true; - } - initializer = parentValidator; - } - String code = handler.getSetPropertyCode(getJavaCode(), PARENT_VALIDATOR_ATTRIBUTE, initializer, compiler); - appendAdditionCode(code); - } - return false; - } - - protected boolean addErrorList(Element tag, JAXXCompiler compiler) { - - if (errorList == null) { - // try with the default "errorList" - if (!compiler.checkReference(tag, ERROR_LIST_DEFAULT, false, ERROR_LIST_ATTRIBUTE)) { - return false; - } - errorList = ERROR_LIST_DEFAULT; - } else { - if (!compiler.checkReference(tag, errorList, true, ERROR_LIST_ATTRIBUTE)) { - return true; - } - } - - String code = SwingValidatorUtil.class.getName() + ".registerErrorListMouseListener(" + errorList + ");"; - appendAdditionCode(code); - - return false; - } - - protected boolean addErrorTable(Element tag, JAXXCompiler compiler) { - - if (errorTable == null) { - // try with the default "errorList" - if (!compiler.checkReference(tag, ERROR_TABLE_DEFAULT, false, ERROR_TABLE_ATTRIBUTE)) { - return false; - } - errorTable = ERROR_TABLE_DEFAULT; - } else { - if (!compiler.checkReference(tag, errorTable, true, ERROR_TABLE_ATTRIBUTE)) { - return true; - } - } - - String code = SwingValidatorUtil.class.getName() + ".registerErrorTableMouseListener(" + errorTable + ");"; - appendAdditionCode(code); - - return false; - } - - protected boolean addBean(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { - - if (beanClass == null || beanClass.isEmpty()) { - // try to guest beanClass from bean attribute - if (bean != null && !bean.isEmpty()) { - beanClass = compiler.getSymbolTable().getClassTagIds().get(bean); - if (beanClass == null) { - compiler.reportError("could not find class of the bean '" + bean + "', and no beanClass was setted"); - return true; - } - } - } - if (beanClass == null) { - compiler.reportError("tag '" + tag + "' requires a 'beanClass' attribute, and could not guest it from 'bean' attribute (no bean attribute setted...)"); - return true; - } - - JAXXBeanInfo beanInfo = getBeanDescriptor(compiler); - if (beanInfo == null) { - compiler.reportError(tag, "could not find descriptor of class " + beanClass); - return true; - } - - String beanInitializer = null; - if (bean != null) { - - if (bean.startsWith("{") && bean.endsWith("}")) { - - // just has an intializer - beanInitializer = bean.substring(1, bean.length() - 1); - // this is not a real bean, so delete it - bean = null; - } else { - - if (!compiler.checkReference(tag, bean, true, BEAN_ATTRIBUTE)) { - // could not find bean in compiled object - return true; - } - - if (isBeanUsedByValidator(compiler, bean)) { - compiler.reportError("the bean '" + bean + "' is already used in another the validator, can not used it in '" + tag + "'"); - return true; - } - - /*if (beanInitializer != null) { - compiler.reportWarning("tag '" + tag + "' found a 'bean' and a 'beanInitializer' attributes, 'beanInitializer' is skipped"); - }*/ - beanInitializer = bean; - } - } - - if (beanInitializer != null) { - String code = handler.getSetPropertyCode(getJavaCode(), BEAN_ATTRIBUTE, compiler.checkJavaCode(beanInitializer), compiler); - appendAdditionCode(code); - } - - String beanClassName = beanInfo.getJAXXBeanDescriptor().getClassDescriptor().getName(); - // contextName must be in constructor to able to init validator with his correct contextName - setConstructorParams(beanClassName + ".class, " + compiler.getJavaCode(contextName)); - // add generic type to validator - setGenericTypes(new String[]{beanClassName}); - - if (getAutoField()) { - registerAutoFieldBean(tag, compiler, beanInfo); - } - - if (getBeanDescriptor(compiler) != null) { - - // add fieldrepresentation invocations - addFieldRepresentations(tag, compiler); - - // register the validator in compiler - registerValidator(compiler, this); - - } - - return false; - } - - private void registerValidator(JAXXCompiler compiler, CompiledBeanValidator compiledBeanValidator) { - List<CompiledBeanValidator> vals = validators.get(compiler); - if (vals == null) { - vals = new ArrayList<CompiledBeanValidator>(); - validators.put(compiler, vals); - } - vals.add(compiledBeanValidator); - List<String> ids = validatedComponents.get(compiler); - if (ids == null) { - ids = new ArrayList<String>(); - validatedComponents.put(compiler, ids); - } - ids.addAll(compiledBeanValidator.getFields().values()); - } - - protected void addFieldRepresentations(Element tag, JAXXCompiler compiler) { - for (Entry<String, String> entry : fields.entrySet()) { - String propertyName = entry.getKey(); - String component = entry.getValue(); - if (!checkBeanProperty(compiler, propertyName)) { - // property not find on bean - continue; - } - if (!compiler.checkReference(tag, component, true, null)) { - // editor component not find on ui - continue; - } - String keyCode = compiler.getJavaCode(propertyName); - appendAdditionCode(getJavaCode() + ".setFieldRepresentation(" + keyCode + ", " + component + ");"); - } - } - - protected void registerAutoFieldBean(Element tag, JAXXCompiler compiler, JAXXBeanInfo beanInfo) { - for (JAXXPropertyDescriptor beanProperty : beanInfo.getJAXXPropertyDescriptors()) { - String descriptionName = beanProperty.getName(); - if (log.isDebugEnabled()) { - log.debug("try to bind on bean " + beanInfo.getJAXXBeanDescriptor().getName() + " property " + descriptionName); - } - if (beanProperty.getWriteMethodDescriptor() == null) { - // read-only property - continue; - } - if (fields.containsKey(descriptionName)) { - // already defined in field - continue; - } - if (excludeFields.containsKey(descriptionName)) { - // exclude field - continue; - } - if (!compiler.checkReference(tag, descriptionName, getStrictMode(), null)) { - // no editor component found - continue; - } - // ok add the field mapping - registerField(descriptionName, descriptionName, compiler); - } - - for (Entry<String, String> entry : excludeFields.entrySet()) { - String key = entry.getKey(); - if (fields.containsKey(key)) { - compiler.reportWarning("field '" + key + "' can not be used and excluded at same time ! (field is skipped) for validator " + this); - fields.remove(key); - } - } - } - - public void registerField(String id, String component, JAXXCompiler compiler) { - if (fields.containsKey(id)) { - compiler.reportError("duplicate field '" + id + "' for validator " + this); - } else { - if (log.isDebugEnabled()) { - log.debug("add field <" + id + ":" + component + ">"); - } - fields.put(id, component); - } - } - - public void registerExcludeField(String id, String component, JAXXCompiler compiler) { - if (excludeFields.containsKey(id)) { - compiler.reportError("duplicate field '" + id + "' for validator " + this); - } else { - if (log.isDebugEnabled()) { - log.debug("add excludeField <" + id + ":" + component + ">"); - } - excludeFields.put(id, component); - } - } - - protected boolean checkBeanProperty(JAXXCompiler compiler, String propertyName) { - - for (JAXXPropertyDescriptor beanProperty : getBeanDescriptor(compiler).getJAXXPropertyDescriptors()) { - if (beanProperty.getName().equals(propertyName)) { - if (beanProperty.getWriteMethodDescriptor() == null) { - // read-onlyproperty - compiler.reportError("could not bind the readonly property '" + propertyName + "' on bean [" + getBean() + "] "); - return false; - } - return true; - } - } - compiler.reportError("could not find the property '" + propertyName + "' on bean [" + getBean() + "] "); - return false; - } - } - - /** - * Test if a given bean is attached to a validator. - * - * @param compiler current compiler to use - * @param beanId the bean to test - * @return <code>true</code> if the given bean is attached to a validator, <code>false</code> otherwise - */ - public static boolean isBeanUsedByValidator(JAXXCompiler compiler, String beanId) { - List<CompiledBeanValidator> beanValidatorList = validators.get(compiler); - if (beanValidatorList != null) { - for (CompiledBeanValidator validator : beanValidatorList) { - if (beanId.equals(validator.getBean())) { - return true; - } - } - } - return false; - } - - /** - * @param compiler compiler to use - * @return <code>true</code> if some validators were detected, <code>false</code> otherwise - */ - public static boolean hasValidator(JAXXCompiler compiler) { - List<CompiledBeanValidator> beanValidatorList = validators.get(compiler); - return beanValidatorList != null && !beanValidatorList.isEmpty(); - } - - /** - * Test if a given CompiledObject is attached to a validator. - * - * @param compiler compiler to use - * @param componentId the compiled object to test - * @return <code>true</code> if the given compiled object is attached to a validator, <code>false</code> otherwise - */ - public static boolean isComponentUsedByValidator(JAXXCompiler compiler, String componentId) { - List<String> ids = validatedComponents.get(compiler); - return ids != null && ids.contains(componentId); - } - - public static List<CompiledBeanValidator> getValidators(JAXXCompiler compiler) { - return validators.get(compiler); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.validator; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.CompiledObject; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.beans.JAXXBeanInfo; +import jaxx.compiler.beans.JAXXPropertyDescriptor; +import jaxx.compiler.reflect.ClassDescriptor; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.DefaultObjectHandler; +import jaxx.compiler.types.TypeManager; +import jaxx.runtime.validator.swing.SwingValidatorUtil; +import jaxx.runtime.validator.swing.SwingValidator; +import jaxx.runtime.validator.swing.ui.AbstractBeanValidatorUI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Element; + +import java.beans.IntrospectionException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; + +public class BeanValidatorHandler extends DefaultObjectHandler { + + public static final String TAG = "BeanValidator"; + public static final String BEAN_ATTRIBUTE = "bean"; + public static final String BEAN_CLASS_ATTRIBUTE = "beanClass"; + public static final String BEAN_INITIALIZER_ATTRIBUTE = "beanInitializer"; + public static final String ERROR_LIST_MODEL_ATTRIBUTE = "errorListModel"; + public static final String ERROR_TABLE_MODEL_ATTRIBUTE = "errorTableModel"; + public static final String ERROR_LIST_ATTRIBUTE = "errorList"; + public static final String ERROR_TABLE_ATTRIBUTE = "errorTable"; + //TODO-TC20091024 should change this default value to errorListModel + public static final String ERROR_LIST_MODEL_DEFAULT = "errors"; + //TODO-TC20091024 should change this default value to errorTableModel + public static final String ERROR_TABLE_MODEL_DEFAULT = "errors2"; + public static final String ERROR_LIST_DEFAULT = "errorList"; + public static final String ERROR_TABLE_DEFAULT = "errorTable"; + public static final String AUTOFIELD_ATTRIBUTE = "autoField"; + public static final String UI_CLASS_ATTRIBUTE = "uiClass"; + public static final String STRICT_MODE_ATTRIBUTE = "strictMode"; + public static final String CONTEXT_NAME_ATTRIBUTE = "contextName"; + //public static final String SCOPE_ATTRIBUTE = "scope"; + public static final String PARENT_VALIDATOR_ATTRIBUTE = "parentValidator"; + /** to use log facility, just put in your code: log.info(\"...\"); */ + static Log log = LogFactory.getLog(BeanValidatorHandler.class); + protected static Map<JAXXCompiler, List<CompiledBeanValidator>> validators = new HashMap<JAXXCompiler, List<CompiledBeanValidator>>(); + protected static Map<JAXXCompiler, List<String>> validatedComponents = new HashMap<JAXXCompiler, List<String>>(); + + public BeanValidatorHandler(ClassDescriptor beanClass) { + super(beanClass); + ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, SwingValidator.class); + } + + @Override + protected CompiledObject createCompiledObject(String id, JAXXCompiler compiler) { + return new CompiledBeanValidator(id, getBeanClass(), compiler); + } + + @Override + protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + if (log.isDebugEnabled()) { + log.debug(tag); + } + if (!tag.getLocalName().equals(FieldValidatorHandler.TAG)) { + compiler.reportError("tag '" + tag.getParentNode().getLocalName() + "' may only contain " + FieldValidatorHandler.TAG + " as children, but found : " + tag.getLocalName()); + } else { + compiler.compileFirstPass(tag); + } + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + + super.compileSecondPass(tag, compiler); + + CompiledBeanValidator info = (CompiledBeanValidator) objectMap.get(tag); + + boolean error = info.addErrorListModel(tag, this, compiler); + + if (!error) { + error = info.addErrorList(tag, compiler); + } + + if (!error) { + error = info.addErrorTableModel(tag, this, compiler); + } + + if (!error) { + error = info.addErrorTable(tag, compiler); + } + + if (!error) { + error = info.addUiClass(this, compiler); + } + + if (!error) { + error = info.addBean(tag, this, compiler); + } + + /*if (!error) { + error = info.addContextName(this, compiler); + }*/ + + /*if (!error) { + error = info.addScope(this, compiler); + }*/ + + if (!error) { + error = info.addParentValidator(tag, this, compiler); + } + + if (error) { + log.warn("error were detected in second compile pass of CompiledObject [" + info + "]"); + } + + // close the compiled object + compiler.closeComponent(info); + } + + @Override + protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler) { + // open the compiled object + compiler.openInvisibleComponent(object); + } + + @Override + public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) { + if (log.isDebugEnabled()) { + log.debug(propertyName + " : " + stringValue + " for " + object); + } + // delegate to the compiled object with is statefull (but not the tag handler) + object.addProperty(propertyName, stringValue); + } + + /** + * The compiled objet representing a BeanValidator to be generated in JAXXObject + * + * @author chemit + */ + public static class CompiledBeanValidator extends CompiledObject { + + protected Map<String, String> fields; + protected Map<String, String> excludeFields; + protected String bean; + protected String beanClass; + protected String contextName; + protected String uiClass; + protected String errorListModel; + protected String errorList; + protected Boolean autoField; + protected Boolean strictMode; + protected JAXXBeanInfo beanDescriptor; + protected String errorTableModel; + protected String errorTable; + protected String parentValidator; + + public CompiledBeanValidator(String id, ClassDescriptor objectClass, JAXXCompiler compiler) { + //TC-20090524 Use the real class descriptor, not the one by default, + //TC-20090524 otherwise can not override the validator class while generation + //super(id, objectClass, compiler); + super(id, getDescriptor(objectClass, compiler), compiler); + fields = new TreeMap<String, String>(); + excludeFields = new TreeMap<String, String>(); + if (log.isDebugEnabled()) { + log.debug("validator objectClass " + super.getObjectClass()); + } + } + + protected static ClassDescriptor getDescriptor(ClassDescriptor objectClass, JAXXCompiler compiler) { + ClassDescriptor result = objectClass; + Class<?> validatorClass = compiler.getConfiguration().getValidatorClass(); + result = ClassDescriptorLoader.getClassDescriptor(validatorClass); + return result; + } + + public Map<String, String> getFields() { + return fields; + } + + public Map<String, String> getExcludeFields() { + return excludeFields; + } + + public void setFields(Map<String, String> fields) { + this.fields = fields; + } + + public void setExcludeFields(Map<String, String> excludeFields) { + this.excludeFields = excludeFields; + } + + @Override + public void addProperty(String property, String value) { + + if (BEAN_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + bean = value.trim(); + } + return; + } + + if (CONTEXT_NAME_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + contextName = value.trim(); + } + return; + } + + if (BEAN_CLASS_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + beanClass = value.trim(); + } + return; + } + + if (ERROR_LIST_MODEL_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + errorListModel = value.trim(); + } + return; + } + + if (ERROR_LIST_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + errorList = value.trim(); + } + return; + } + + if (ERROR_TABLE_MODEL_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + errorTableModel = value.trim(); + } + return; + } + + if (ERROR_TABLE_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + errorTable = value.trim(); + } + return; + } + + if (UI_CLASS_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + uiClass = value.trim(); + } + return; + } + + if (AUTOFIELD_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + autoField = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class); + } + return; + } + + if (STRICT_MODE_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + strictMode = (Boolean) TypeManager.convertFromString(value.trim(), Boolean.class); + } + return; + } + + if (PARENT_VALIDATOR_ATTRIBUTE.equals(property)) { + if (value != null && !value.trim().isEmpty()) { + parentValidator = value.trim(); + } + return; + } + + throw new CompilerException("property " + property + " is not allowed on object " + this); + } + + public String getBean() { + return bean; + } + + public String getErrorListModel() { + return errorListModel; + } + + public boolean getAutoField() { + return autoField != null && autoField; + } + + public boolean getStrictMode() { + return strictMode != null && strictMode; + } + + public String getUiClass() { + return uiClass; + } + + public String getBeanClass() { + return beanClass; + } + + public String getContextName() { + return contextName; + } + + public String getParentValidator() { + return parentValidator; + } + + public JAXXBeanInfo getBeanDescriptor(JAXXCompiler compiler) { + if (beanDescriptor == null && foundBean()) { + + String beanClassName = null; + try { + //TC-20090111 beanClass is mandatory + // get the real bean class name (from bean or beanClass) + /*if (beanClass != null) { + beanClassName = beanClass; + } else { + beanClassName = compiler.getSymbolTable().getClassTagIds().get(bean); + if (beanClassName == null) { + compiler.reportError("could not find class of the bean '" + bean + "'"); + return null; + } + }*/ + ClassDescriptor beanClassDescriptor = ClassDescriptorLoader.getClassDescriptor(beanClass); + beanDescriptor = DefaultObjectHandler.getJAXXBeanInfo(beanClassDescriptor); + } catch (ClassNotFoundException e) { + compiler.reportError("could not load class " + beanClassName); + } catch (IntrospectionException e) { + compiler.reportError("could not load class " + beanClassName); + } + } + return beanDescriptor; + } + + @Override + public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { + // do nothing + compiler.reportError("can not add CompiledObject in the tag '" + TAG + " (only field tags)"); + } + + public boolean foundBean() { + return !(beanClass == null || beanClass.isEmpty()); + } + + protected boolean addUiClass(BeanValidatorHandler handler, JAXXCompiler compiler) { + boolean withError = false; + if (uiClass == null && compiler.getConfiguration().getDefaultErrorUI() != null) { + uiClass = compiler.getConfiguration().getDefaultErrorUI().getName(); + } + if (uiClass != null) { + try { + ClassDescriptor uiClazz = ClassDescriptorLoader.getClassDescriptor(uiClass); + if (!ClassDescriptorLoader.getClassDescriptor(AbstractBeanValidatorUI.class).isAssignableFrom(uiClazz)) { + compiler.reportError("attribute 'ui' :'" + uiClass + "' is not assignable from class " + AbstractBeanValidatorUI.class); + withError = true; + } else { + String code = handler.getSetPropertyCode(getJavaCode(), UI_CLASS_ATTRIBUTE, uiClazz.getName() + ".class", compiler); + appendAdditionCode(code); + } + } catch (ClassNotFoundException e) { + compiler.reportError("class not found '" + uiClass + "'"); + withError = true; + } + } + + return withError; + } + + protected boolean addErrorListModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { + if (errorListModel == null) { + // try with the default "errors" + if (!compiler.checkReference(tag, ERROR_LIST_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) { + return false; + } + errorListModel = ERROR_LIST_MODEL_DEFAULT; + } else { + if (errorListModel.startsWith("{") && errorListModel.endsWith("}")) { + // this is a script, no check here + errorListModel = errorListModel.substring(1, errorListModel.length() - 1).trim(); + } else if (!compiler.checkReference(tag, errorListModel, true, ERROR_LIST_MODEL_ATTRIBUTE)) { + // errorListModel is not defined + return true; + } + } + + String code = handler.getSetPropertyCode(getJavaCode(), ERROR_LIST_MODEL_ATTRIBUTE, errorListModel, compiler); + appendAdditionCode(code); + + return false; + } + + protected boolean addErrorTableModel(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { + if (errorTableModel == null) { + // try with the default "errors" + if (!compiler.checkReference(tag, ERROR_TABLE_MODEL_DEFAULT, false, ERROR_LIST_MODEL_ATTRIBUTE)) { + return false; + } + errorTableModel = ERROR_TABLE_MODEL_DEFAULT; + } else { + if (errorTableModel.startsWith("{") && errorTableModel.endsWith("}")) { + // this is a script, no check here + errorTableModel = errorTableModel.substring(1, errorTableModel.length() - 1).trim(); + } else if (!compiler.checkReference(tag, errorTableModel, true, ERROR_TABLE_MODEL_ATTRIBUTE)) { + // errorListModel is not defined + return true; + } + } + + String code = handler.getSetPropertyCode(getJavaCode(), ERROR_TABLE_MODEL_ATTRIBUTE, errorTableModel, compiler); + appendAdditionCode(code); + + return false; + + } + + protected boolean addParentValidator(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { + if (parentValidator != null) { + String initializer; + if (parentValidator.startsWith("{") && parentValidator.endsWith("}")) { + + // todo : should be able to bind + initializer = parentValidator.substring(1, parentValidator.length() - 1); + + } else { + // the attribute referes an existing widget + if (!compiler.checkReference(tag, parentValidator, true, PARENT_VALIDATOR_ATTRIBUTE)) { + // parentValidator is not defined + return true; + } + initializer = parentValidator; + } + String code = handler.getSetPropertyCode(getJavaCode(), PARENT_VALIDATOR_ATTRIBUTE, initializer, compiler); + appendAdditionCode(code); + } + return false; + } + + protected boolean addErrorList(Element tag, JAXXCompiler compiler) { + + if (errorList == null) { + // try with the default "errorList" + if (!compiler.checkReference(tag, ERROR_LIST_DEFAULT, false, ERROR_LIST_ATTRIBUTE)) { + return false; + } + errorList = ERROR_LIST_DEFAULT; + } else { + if (!compiler.checkReference(tag, errorList, true, ERROR_LIST_ATTRIBUTE)) { + return true; + } + } + + String code = SwingValidatorUtil.class.getName() + ".registerErrorListMouseListener(" + errorList + ");"; + appendAdditionCode(code); + + return false; + } + + protected boolean addErrorTable(Element tag, JAXXCompiler compiler) { + + if (errorTable == null) { + // try with the default "errorList" + if (!compiler.checkReference(tag, ERROR_TABLE_DEFAULT, false, ERROR_TABLE_ATTRIBUTE)) { + return false; + } + errorTable = ERROR_TABLE_DEFAULT; + } else { + if (!compiler.checkReference(tag, errorTable, true, ERROR_TABLE_ATTRIBUTE)) { + return true; + } + } + + String code = SwingValidatorUtil.class.getName() + ".registerErrorTableMouseListener(" + errorTable + ");"; + appendAdditionCode(code); + + return false; + } + + protected boolean addBean(Element tag, BeanValidatorHandler handler, JAXXCompiler compiler) { + + if (beanClass == null || beanClass.isEmpty()) { + // try to guest beanClass from bean attribute + if (bean != null && !bean.isEmpty()) { + beanClass = compiler.getSymbolTable().getClassTagIds().get(bean); + if (beanClass == null) { + compiler.reportError("could not find class of the bean '" + bean + "', and no beanClass was setted"); + return true; + } + } + } + if (beanClass == null) { + compiler.reportError("tag '" + tag + "' requires a 'beanClass' attribute, and could not guest it from 'bean' attribute (no bean attribute setted...)"); + return true; + } + + JAXXBeanInfo beanInfo = getBeanDescriptor(compiler); + if (beanInfo == null) { + compiler.reportError(tag, "could not find descriptor of class " + beanClass); + return true; + } + + String beanInitializer = null; + if (bean != null) { + + if (bean.startsWith("{") && bean.endsWith("}")) { + + // just has an intializer + beanInitializer = bean.substring(1, bean.length() - 1); + // this is not a real bean, so delete it + bean = null; + } else { + + if (!compiler.checkReference(tag, bean, true, BEAN_ATTRIBUTE)) { + // could not find bean in compiled object + return true; + } + + if (isBeanUsedByValidator(compiler, bean)) { + compiler.reportError("the bean '" + bean + "' is already used in another the validator, can not used it in '" + tag + "'"); + return true; + } + + /*if (beanInitializer != null) { + compiler.reportWarning("tag '" + tag + "' found a 'bean' and a 'beanInitializer' attributes, 'beanInitializer' is skipped"); + }*/ + beanInitializer = bean; + } + } + + if (beanInitializer != null) { + String code = handler.getSetPropertyCode(getJavaCode(), BEAN_ATTRIBUTE, compiler.checkJavaCode(beanInitializer), compiler); + appendAdditionCode(code); + } + + String beanClassName = beanInfo.getJAXXBeanDescriptor().getClassDescriptor().getName(); + // contextName must be in constructor to able to init validator with his correct contextName + setConstructorParams(beanClassName + ".class, " + compiler.getJavaCode(contextName)); + // add generic type to validator + setGenericTypes(new String[]{beanClassName}); + + if (getAutoField()) { + registerAutoFieldBean(tag, compiler, beanInfo); + } + + if (getBeanDescriptor(compiler) != null) { + + // add fieldrepresentation invocations + addFieldRepresentations(tag, compiler); + + // register the validator in compiler + registerValidator(compiler, this); + + } + + return false; + } + + private void registerValidator(JAXXCompiler compiler, CompiledBeanValidator compiledBeanValidator) { + List<CompiledBeanValidator> vals = validators.get(compiler); + if (vals == null) { + vals = new ArrayList<CompiledBeanValidator>(); + validators.put(compiler, vals); + } + vals.add(compiledBeanValidator); + List<String> ids = validatedComponents.get(compiler); + if (ids == null) { + ids = new ArrayList<String>(); + validatedComponents.put(compiler, ids); + } + ids.addAll(compiledBeanValidator.getFields().values()); + } + + protected void addFieldRepresentations(Element tag, JAXXCompiler compiler) { + for (Entry<String, String> entry : fields.entrySet()) { + String propertyName = entry.getKey(); + String component = entry.getValue(); + if (!checkBeanProperty(compiler, propertyName)) { + // property not find on bean + continue; + } + if (!compiler.checkReference(tag, component, true, null)) { + // editor component not find on ui + continue; + } + String keyCode = compiler.getJavaCode(propertyName); + appendAdditionCode(getJavaCode() + ".setFieldRepresentation(" + keyCode + ", " + component + ");"); + } + } + + protected void registerAutoFieldBean(Element tag, JAXXCompiler compiler, JAXXBeanInfo beanInfo) { + for (JAXXPropertyDescriptor beanProperty : beanInfo.getJAXXPropertyDescriptors()) { + String descriptionName = beanProperty.getName(); + if (log.isDebugEnabled()) { + log.debug("try to bind on bean " + beanInfo.getJAXXBeanDescriptor().getName() + " property " + descriptionName); + } + if (beanProperty.getWriteMethodDescriptor() == null) { + // read-only property + continue; + } + if (fields.containsKey(descriptionName)) { + // already defined in field + continue; + } + if (excludeFields.containsKey(descriptionName)) { + // exclude field + continue; + } + if (!compiler.checkReference(tag, descriptionName, getStrictMode(), null)) { + // no editor component found + continue; + } + // ok add the field mapping + registerField(descriptionName, descriptionName, compiler); + } + + for (Entry<String, String> entry : excludeFields.entrySet()) { + String key = entry.getKey(); + if (fields.containsKey(key)) { + compiler.reportWarning("field '" + key + "' can not be used and excluded at same time ! (field is skipped) for validator " + this); + fields.remove(key); + } + } + } + + public void registerField(String id, String component, JAXXCompiler compiler) { + if (fields.containsKey(id)) { + compiler.reportError("duplicate field '" + id + "' for validator " + this); + } else { + if (log.isDebugEnabled()) { + log.debug("add field <" + id + ":" + component + ">"); + } + fields.put(id, component); + } + } + + public void registerExcludeField(String id, String component, JAXXCompiler compiler) { + if (excludeFields.containsKey(id)) { + compiler.reportError("duplicate field '" + id + "' for validator " + this); + } else { + if (log.isDebugEnabled()) { + log.debug("add excludeField <" + id + ":" + component + ">"); + } + excludeFields.put(id, component); + } + } + + protected boolean checkBeanProperty(JAXXCompiler compiler, String propertyName) { + + for (JAXXPropertyDescriptor beanProperty : getBeanDescriptor(compiler).getJAXXPropertyDescriptors()) { + if (beanProperty.getName().equals(propertyName)) { + if (beanProperty.getWriteMethodDescriptor() == null) { + // read-onlyproperty + compiler.reportError("could not bind the readonly property '" + propertyName + "' on bean [" + getBean() + "] "); + return false; + } + return true; + } + } + compiler.reportError("could not find the property '" + propertyName + "' on bean [" + getBean() + "] "); + return false; + } + } + + /** + * Test if a given bean is attached to a validator. + * + * @param compiler current compiler to use + * @param beanId the bean to test + * @return <code>true</code> if the given bean is attached to a validator, <code>false</code> otherwise + */ + public static boolean isBeanUsedByValidator(JAXXCompiler compiler, String beanId) { + List<CompiledBeanValidator> beanValidatorList = validators.get(compiler); + if (beanValidatorList != null) { + for (CompiledBeanValidator validator : beanValidatorList) { + if (beanId.equals(validator.getBean())) { + return true; + } + } + } + return false; + } + + /** + * @param compiler compiler to use + * @return <code>true</code> if some validators were detected, <code>false</code> otherwise + */ + public static boolean hasValidator(JAXXCompiler compiler) { + List<CompiledBeanValidator> beanValidatorList = validators.get(compiler); + return beanValidatorList != null && !beanValidatorList.isEmpty(); + } + + /** + * Test if a given CompiledObject is attached to a validator. + * + * @param compiler compiler to use + * @param componentId the compiled object to test + * @return <code>true</code> if the given compiled object is attached to a validator, <code>false</code> otherwise + */ + public static boolean isComponentUsedByValidator(JAXXCompiler compiler, String componentId) { + List<String> ids = validatedComponents.get(compiler); + return ids != null && ids.contains(componentId); + } + + public static List<CompiledBeanValidator> getValidators(JAXXCompiler compiler) { + return validators.get(compiler); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/ExcludeFieldValidatorHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,85 +1,101 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.validator; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.TagHandler; -import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator; -import jaxx.runtime.validator.swing.SwingValidator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Element; - -import java.io.IOException; - -public class ExcludeFieldValidatorHandler implements TagHandler { - - public static final String TAG = "excludeField"; - public static final String NAME_ATTRIBUTE = "name"; - public static final String COMPONENT_ATTRIBUTE = "component"; - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(ExcludeFieldValidatorHandler.class); - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - if (compiler.getConfiguration().isVerbose()) { - log.info(tag); - } - //todo check there is no child - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - if (compiler.getConfiguration().isVerbose()) { - log.debug(tag); - } - - if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { - compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag); - return; - } - - CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent(); - if (!info.getAutoField()) { - compiler.reportError(TAG + " tag can not be used without an 'autoField' validator : " + tag); - return; - } - String name = tag.getAttribute(NAME_ATTRIBUTE); - String component = tag.getAttribute(COMPONENT_ATTRIBUTE); - if (name == null || name.trim().isEmpty()) { - compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute"); - return; - } - name = name.trim(); - if (component == null || component.trim().isEmpty()) { - // try to use the name as component - if (!compiler.checkReference(tag, name, false, name)) { - compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found"); - return; - } - component = name; - } - component = component.trim(); - - // check component is not already used by this compiled object - if (info.getFields().containsValue(component)) { - compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator"); - return; - } - if (info.getExcludeFields().containsValue(component)) { - compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator"); - return; - } - // check component exist (again perharps, but let the error knows exactly which tag failed...) - if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) { - // add a field - info.registerField(name, component, compiler); - } - - - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.validator; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.TagHandler; +import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator; +import jaxx.runtime.validator.swing.SwingValidator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Element; + +import java.io.IOException; + +public class ExcludeFieldValidatorHandler implements TagHandler { + + public static final String TAG = "excludeField"; + public static final String NAME_ATTRIBUTE = "name"; + public static final String COMPONENT_ATTRIBUTE = "component"; + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(ExcludeFieldValidatorHandler.class); + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + if (compiler.getConfiguration().isVerbose()) { + log.info(tag); + } + //todo check there is no child + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + if (compiler.getConfiguration().isVerbose()) { + log.debug(tag); + } + + if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { + compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag); + return; + } + + CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent(); + if (!info.getAutoField()) { + compiler.reportError(TAG + " tag can not be used without an 'autoField' validator : " + tag); + return; + } + String name = tag.getAttribute(NAME_ATTRIBUTE); + String component = tag.getAttribute(COMPONENT_ATTRIBUTE); + if (name == null || name.trim().isEmpty()) { + compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute"); + return; + } + name = name.trim(); + if (component == null || component.trim().isEmpty()) { + // try to use the name as component + if (!compiler.checkReference(tag, name, false, name)) { + compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found"); + return; + } + component = name; + } + component = component.trim(); + + // check component is not already used by this compiled object + if (info.getFields().containsValue(component)) { + compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator"); + return; + } + if (info.getExcludeFields().containsValue(component)) { + compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator"); + return; + } + // check component exist (again perharps, but let the error knows exactly which tag failed...) + if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) { + // add a field + info.registerField(name, component, compiler); + } + + + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tags/validator/FieldValidatorHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,78 +1,94 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.tags.validator; - -import jaxx.compiler.CompilerException; -import jaxx.compiler.JAXXCompiler; -import jaxx.compiler.reflect.ClassDescriptorLoader; -import jaxx.compiler.tags.TagHandler; -import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator; -import jaxx.runtime.validator.swing.SwingValidator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Element; - -import java.io.IOException; - -public class FieldValidatorHandler implements TagHandler { - - public static final String TAG = "field"; - public static final String NAME_ATTRIBUTE = "name"; - public static final String COMPONENT_ATTRIBUTE = "component"; - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(FieldValidatorHandler.class); - - @Override - public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - if (compiler.getConfiguration().isVerbose()) { - log.debug(tag); - } - //todo check there is no child - } - - @Override - public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { - if (compiler.getConfiguration().isVerbose()) { - log.debug(tag); - } - - if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { - compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag); - return; - } - - CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent(); - - String name = tag.getAttribute(NAME_ATTRIBUTE); - String component = tag.getAttribute(COMPONENT_ATTRIBUTE); - if (name == null || name.trim().isEmpty()) { - compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute"); - return; - } - name = name.trim(); - if (component == null || component.trim().isEmpty()) { - // try to use the name as component - if (!compiler.checkReference(tag, name, false, name)) { - compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found"); - return; - } - component = name; - } - component = component.trim(); - - // check component is not already used by this compiled object - if (info.getFields().containsValue(component)) { - compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator"); - return; - } - // check component exist (again perharps, but let the error knows exactly which tag failed...) - if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) { - // add a field - info.registerField(name, component, compiler); - } - - - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.tags.validator; + +import jaxx.compiler.CompilerException; +import jaxx.compiler.JAXXCompiler; +import jaxx.compiler.reflect.ClassDescriptorLoader; +import jaxx.compiler.tags.TagHandler; +import jaxx.compiler.tags.validator.BeanValidatorHandler.CompiledBeanValidator; +import jaxx.runtime.validator.swing.SwingValidator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Element; + +import java.io.IOException; + +public class FieldValidatorHandler implements TagHandler { + + public static final String TAG = "field"; + public static final String NAME_ATTRIBUTE = "name"; + public static final String COMPONENT_ATTRIBUTE = "component"; + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(FieldValidatorHandler.class); + + @Override + public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + if (compiler.getConfiguration().isVerbose()) { + log.debug(tag); + } + //todo check there is no child + } + + @Override + public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException { + if (compiler.getConfiguration().isVerbose()) { + log.debug(tag); + } + + if (!ClassDescriptorLoader.getClassDescriptor(SwingValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) { + compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag); + return; + } + + CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent(); + + String name = tag.getAttribute(NAME_ATTRIBUTE); + String component = tag.getAttribute(COMPONENT_ATTRIBUTE); + if (name == null || name.trim().isEmpty()) { + compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute"); + return; + } + name = name.trim(); + if (component == null || component.trim().isEmpty()) { + // try to use the name as component + if (!compiler.checkReference(tag, name, false, name)) { + compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute [" + name + "] for the component, but no such component found"); + return; + } + component = name; + } + component = component.trim(); + + // check component is not already used by this compiled object + if (info.getFields().containsValue(component)) { + compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " [" + component + "] already used in this validator"); + return; + } + // check component exist (again perharps, but let the error knows exactly which tag failed...) + if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) { + // add a field + info.registerField(name, component, compiler); + } + + + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/PrintTagInfo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools; import jaxx.compiler.tags.*; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/AbstractContextNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; import java.util.ArrayList; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/CapturedObject.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; import jaxx.compiler.JAXXCompiler; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ContextNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; public interface ContextNode { Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/JAXXCapture.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; import jaxx.compiler.ClassMap; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/LiteralNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; public class LiteralNode extends AbstractContextNode { Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/MethodNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; public class MethodNode extends AbstractContextNode { Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/PropertyNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; public class PropertyNode extends AbstractContextNode { Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/ValueNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture; public class ValueNode extends AbstractContextNode { Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/JTabbedPaneHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture.handlers; import jaxx.compiler.tools.jaxxcapture.ContextNode; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/ObjectHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture.handlers; import jaxx.compiler.JAXXCompiler; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/tools/jaxxcapture/handlers/TableHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tools.jaxxcapture.handlers; import jaxx.compiler.tools.jaxxcapture.CapturedObject; Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/ColorConverter.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,42 +1,58 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.types; - -import java.awt.Color; -import java.lang.reflect.Field; - -public class ColorConverter implements TypeConverter { - - @Override - public Class<?>[] getSupportedTypes() { - return new Class<?>[]{ - Color.class - }; - } - - @Override - public String getJavaCode(Object object) { - Color color = (Color) object; - return "new Color(" + color.getRed() + ", " + color.getGreen() + ", " + color.getBlue() + ")"; - } - - @Override - public Object convertFromString(String string, Class<?> type) { - if (type != Color.class) { - throw new IllegalArgumentException("unsupported type: " + type); - } - if (string.length() == 7 && string.charAt(0) == '#') { - return new Color(Integer.parseInt(string.substring(1), 16)); - } - try { - Field color = Color.class.getField(string); - return color.get(null); - } catch (NoSuchFieldException e) { - throw new IllegalArgumentException("colors must be of the form #xxxxxx ('#' followed by six hexadecimal digits), or the name of a constant field in java.awt.Color (found: '" + string + "')"); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.types; + +import java.awt.Color; +import java.lang.reflect.Field; + +public class ColorConverter implements TypeConverter { + + @Override + public Class<?>[] getSupportedTypes() { + return new Class<?>[]{ + Color.class + }; + } + + @Override + public String getJavaCode(Object object) { + Color color = (Color) object; + return "new Color(" + color.getRed() + ", " + color.getGreen() + ", " + color.getBlue() + ")"; + } + + @Override + public Object convertFromString(String string, Class<?> type) { + if (type != Color.class) { + throw new IllegalArgumentException("unsupported type: " + type); + } + if (string.length() == 7 && string.charAt(0) == '#') { + return new Color(Integer.parseInt(string.substring(1), 16)); + } + try { + Field color = Color.class.getField(string); + return color.get(null); + } catch (NoSuchFieldException e) { + throw new IllegalArgumentException("colors must be of the form #xxxxxx ('#' followed by six hexadecimal digits), or the name of a constant field in java.awt.Color (found: '" + string + "')"); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/GridBagConstraintsConverter.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,30 +1,46 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.types; - -import java.awt.GridBagConstraints; - -public class GridBagConstraintsConverter implements TypeConverter { - - @Override - public Class<?>[] getSupportedTypes() { - return new Class<?>[] { - GridBagConstraints.class - }; - } - - @Override - public String getJavaCode(Object object) { - GridBagConstraints g = (GridBagConstraints) object; - return "new GridBagConstraints(" + g.gridx + ", " + g.gridy + ", " + g.gridwidth + ", " + g.gridheight + ", " + - g.weightx + ", " + g.weighty + ", " + g.anchor + ", " + g.fill + ", " + - TypeManager.getJavaCode(g.insets) + ", " + g.ipadx + ", " + g.ipady + ")"; - } - - @Override - public Object convertFromString(String string, Class<?> type) { - throw new UnsupportedOperationException("GridBagConstraints must be represented using Java code"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.types; + +import java.awt.GridBagConstraints; + +public class GridBagConstraintsConverter implements TypeConverter { + + @Override + public Class<?>[] getSupportedTypes() { + return new Class<?>[] { + GridBagConstraints.class + }; + } + + @Override + public String getJavaCode(Object object) { + GridBagConstraints g = (GridBagConstraints) object; + return "new GridBagConstraints(" + g.gridx + ", " + g.gridy + ", " + g.gridwidth + ", " + g.gridheight + ", " + + g.weightx + ", " + g.weighty + ", " + g.anchor + ", " + g.fill + ", " + + TypeManager.getJavaCode(g.insets) + ", " + g.ipadx + ", " + g.ipady + ")"; + } + + @Override + public Object convertFromString(String string, Class<?> type) { + throw new UnsupportedOperationException("GridBagConstraints must be represented using Java code"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/InsetsConverter.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,43 +1,59 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.types; - -import java.awt.Insets; -import java.util.StringTokenizer; - -public class InsetsConverter implements TypeConverter { - - @Override - public Class<?>[] getSupportedTypes() { - return new Class<?>[]{Insets.class}; - } - - @Override - public String getJavaCode(Object object) { - Insets insets = (Insets) object; - return "new Insets(" + insets.top + ", " + insets.left + ", " + insets.bottom + ", " + insets.right + ")"; - } - - @Override - public Object convertFromString(String string, Class<?> type) { - if (type != Insets.class) { - throw new IllegalArgumentException("unsupported type: " + type); - } - StringTokenizer tokenizer = new StringTokenizer(string, ","); - int count = tokenizer.countTokens(); - if (count == 1) { - int i = Integer.parseInt(tokenizer.nextToken().trim()); - return new Insets(i, i, i, i); - } - if (count == 4) { - int[] insets = new int[count]; - for (int i = 0; tokenizer.hasMoreTokens(); i++) { - insets[i] = Integer.parseInt(tokenizer.nextToken().trim()); - } - return new Insets(insets[0], insets[1], insets[2], insets[3]); - } - throw new IllegalArgumentException("unable to convert string '" + string + "' to Insets"); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.types; + +import java.awt.Insets; +import java.util.StringTokenizer; + +public class InsetsConverter implements TypeConverter { + + @Override + public Class<?>[] getSupportedTypes() { + return new Class<?>[]{Insets.class}; + } + + @Override + public String getJavaCode(Object object) { + Insets insets = (Insets) object; + return "new Insets(" + insets.top + ", " + insets.left + ", " + insets.bottom + ", " + insets.right + ")"; + } + + @Override + public Object convertFromString(String string, Class<?> type) { + if (type != Insets.class) { + throw new IllegalArgumentException("unsupported type: " + type); + } + StringTokenizer tokenizer = new StringTokenizer(string, ","); + int count = tokenizer.countTokens(); + if (count == 1) { + int i = Integer.parseInt(tokenizer.nextToken().trim()); + return new Insets(i, i, i, i); + } + if (count == 4) { + int[] insets = new int[count]; + for (int i = 0; tokenizer.hasMoreTokens(); i++) { + insets[i] = Integer.parseInt(tokenizer.nextToken().trim()); + } + return new Insets(insets[0], insets[1], insets[2], insets[3]); + } + throw new IllegalArgumentException("unable to convert string '" + string + "' to Insets"); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/KeyStrokeConverter.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,28 +1,44 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.types; - -import javax.swing.KeyStroke; - -public class KeyStrokeConverter implements TypeConverter { - - @Override - public Class<?>[] getSupportedTypes() { - return new Class<?>[]{KeyStroke.class}; - } - - @Override - public String getJavaCode(Object object) { - return "KeyStroke.getKeyStroke(\"" + object.toString() + "\")"; - } - - @Override - public Object convertFromString(String string, Class<?> type) { - if (type != KeyStroke.class) { - throw new IllegalArgumentException("unsupported type: " + type); - } - return KeyStroke.getKeyStroke(string); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.types; + +import javax.swing.KeyStroke; + +public class KeyStrokeConverter implements TypeConverter { + + @Override + public Class<?>[] getSupportedTypes() { + return new Class<?>[]{KeyStroke.class}; + } + + @Override + public String getJavaCode(Object object) { + return "KeyStroke.getKeyStroke(\"" + object.toString() + "\")"; + } + + @Override + public Object convertFromString(String string, Class<?> type) { + if (type != KeyStroke.class) { + throw new IllegalArgumentException("unsupported type: " + type); + } + return KeyStroke.getKeyStroke(string); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/PrimitiveConverter.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,104 +1,120 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.types; - -import jaxx.compiler.JAXXCompiler; - -public class PrimitiveConverter implements TypeConverter { - - @Override - public Class<?>[] getSupportedTypes() { - - return new Class<?>[]{ - boolean.class, - Boolean.class, - byte.class, - Byte.class, - short.class, - Short.class, - int.class, - Integer.class, - long.class, - Long.class, - float.class, - Float.class, - double.class, - Double.class, - char.class, - Character.class, - String.class - }; - } - - @Override - public String getJavaCode(Object object) { - if (object instanceof Boolean) { - return String.valueOf(((Boolean) object).booleanValue()); - } - if (object instanceof Byte) { - return String.valueOf(((Byte) object).byteValue()); - } - if (object instanceof Short) { - return String.valueOf(((Short) object).shortValue()); - } - if (object instanceof Integer) { - return String.valueOf(((Integer) object).intValue()); - } - if (object instanceof Long) { - return String.valueOf(((Long) object).longValue()) + "L"; - } - if (object instanceof Float) { - return String.valueOf(((Float) object).floatValue()) + "F"; - } - if (object instanceof Double) { - return String.valueOf(((Double) object).doubleValue()); - } - if (object instanceof String) { - return '"' + JAXXCompiler.escapeJavaString((String) object) + '"'; - } - throw new IllegalArgumentException("unsupported object: " + object); - } - - @Override - public Object convertFromString(String string, Class<?> type) { - if (type == String.class || type == Object.class || type == null) { - return string; - } - if (type == int.class || type == Integer.class) { - return Integer.valueOf(string); - } - if (type == boolean.class || type == Boolean.class) { - if (string.toLowerCase().equals("true")) { - return Boolean.TRUE; - } - if (string.toLowerCase().equals("false")) { - return Boolean.FALSE; - } - throw new IllegalArgumentException("expected 'true' or 'false', found '" + string + "'"); - } - if (type == byte.class || type == Byte.class) { - return Byte.valueOf(string); - } - if (type == short.class || type == Short.class) { - return Short.valueOf(string); - } - if (type == long.class || type == Long.class) { - return Long.valueOf(string); - } - if (type == float.class || type == Float.class) { - return Float.valueOf(string); - } - if (type == double.class || type == Double.class) { - return Double.valueOf(string); - } - if (type == char.class || type == Character.class) { - if (string.length() == 1) { - return string.charAt(0); - } - throw new IllegalArgumentException("expected a single character, found '" + string + "'"); - } - throw new IllegalArgumentException("unsupported type: " + type); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.types; + +import jaxx.compiler.JAXXCompiler; + +public class PrimitiveConverter implements TypeConverter { + + @Override + public Class<?>[] getSupportedTypes() { + + return new Class<?>[]{ + boolean.class, + Boolean.class, + byte.class, + Byte.class, + short.class, + Short.class, + int.class, + Integer.class, + long.class, + Long.class, + float.class, + Float.class, + double.class, + Double.class, + char.class, + Character.class, + String.class + }; + } + + @Override + public String getJavaCode(Object object) { + if (object instanceof Boolean) { + return String.valueOf(((Boolean) object).booleanValue()); + } + if (object instanceof Byte) { + return String.valueOf(((Byte) object).byteValue()); + } + if (object instanceof Short) { + return String.valueOf(((Short) object).shortValue()); + } + if (object instanceof Integer) { + return String.valueOf(((Integer) object).intValue()); + } + if (object instanceof Long) { + return String.valueOf(((Long) object).longValue()) + "L"; + } + if (object instanceof Float) { + return String.valueOf(((Float) object).floatValue()) + "F"; + } + if (object instanceof Double) { + return String.valueOf(((Double) object).doubleValue()); + } + if (object instanceof String) { + return '"' + JAXXCompiler.escapeJavaString((String) object) + '"'; + } + throw new IllegalArgumentException("unsupported object: " + object); + } + + @Override + public Object convertFromString(String string, Class<?> type) { + if (type == String.class || type == Object.class || type == null) { + return string; + } + if (type == int.class || type == Integer.class) { + return Integer.valueOf(string); + } + if (type == boolean.class || type == Boolean.class) { + if (string.toLowerCase().equals("true")) { + return Boolean.TRUE; + } + if (string.toLowerCase().equals("false")) { + return Boolean.FALSE; + } + throw new IllegalArgumentException("expected 'true' or 'false', found '" + string + "'"); + } + if (type == byte.class || type == Byte.class) { + return Byte.valueOf(string); + } + if (type == short.class || type == Short.class) { + return Short.valueOf(string); + } + if (type == long.class || type == Long.class) { + return Long.valueOf(string); + } + if (type == float.class || type == Float.class) { + return Float.valueOf(string); + } + if (type == double.class || type == Double.class) { + return Double.valueOf(string); + } + if (type == char.class || type == Character.class) { + if (string.length() == 1) { + return string.charAt(0); + } + throw new IllegalArgumentException("expected a single character, found '" + string + "'"); + } + throw new IllegalArgumentException("unsupported type: " + type); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeConverter.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,14 +1,30 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.types; - -public interface TypeConverter { - - Class<?>[] getSupportedTypes(); - - String getJavaCode(Object object); - - Object convertFromString(String string, Class<?> type); -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.types; + +public interface TypeConverter { + + Class<?>[] getSupportedTypes(); + + String getJavaCode(Object object); + + Object convertFromString(String string, Class<?> type); +} Modified: branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/main/java/jaxx/compiler/types/TypeManager.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,54 +1,70 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.compiler.types; - -import java.util.HashMap; -import java.util.Map; -import java.util.ServiceLoader; - -public class TypeManager { - - private static Map<Class<?>, TypeConverter> converters; - - public static Map<Class<?>, TypeConverter> getConverters() { - if (converters == null) { - converters = new HashMap<Class<?>, TypeConverter>(); - // load converters - ServiceLoader<TypeConverter> loader = ServiceLoader.load(TypeConverter.class); - for (TypeConverter c : loader) { - // for each supported type, register the converter - for (Class<?> type : c.getSupportedTypes()) { - converters.put(type, c); - } - } - } - return converters; - } - - private TypeManager() { /* not instantiable */ } - - public static TypeConverter getTypeConverter(Class<?> type) { - return getConverters().get(type); - } - - public static String getJavaCode(Object object) { - if (object == null) { - return "null"; - } - TypeConverter converter = getTypeConverter(object.getClass()); - if (converter == null) { - throw new IllegalArgumentException("unsupported type: " + object.getClass()); - } - return converter.getJavaCode(object); - } - - public static Object convertFromString(String string, Class<?> type) { - TypeConverter converter = getTypeConverter(type); - if (converter == null) { - throw new IllegalArgumentException("unsupported type: " + type); - } - return converter.convertFromString(string, type); - } -} +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.compiler.types; + +import java.util.HashMap; +import java.util.Map; +import java.util.ServiceLoader; + +public class TypeManager { + + private static Map<Class<?>, TypeConverter> converters; + + public static Map<Class<?>, TypeConverter> getConverters() { + if (converters == null) { + converters = new HashMap<Class<?>, TypeConverter>(); + // load converters + ServiceLoader<TypeConverter> loader = ServiceLoader.load(TypeConverter.class); + for (TypeConverter c : loader) { + // for each supported type, register the converter + for (Class<?> type : c.getSupportedTypes()) { + converters.put(type, c); + } + } + } + return converters; + } + + private TypeManager() { /* not instantiable */ } + + public static TypeConverter getTypeConverter(Class<?> type) { + return getConverters().get(type); + } + + public static String getJavaCode(Object object) { + if (object == null) { + return "null"; + } + TypeConverter converter = getTypeConverter(object.getClass()); + if (converter == null) { + throw new IllegalArgumentException("unsupported type: " + object.getClass()); + } + return converter.getJavaCode(object); + } + + public static Object convertFromString(String string, Class<?> type) { + TypeConverter converter = getTypeConverter(type); + if (converter == null) { + throw new IllegalArgumentException("unsupported type: " + type); + } + return converter.convertFromString(string, type); + } +} Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaFileParserTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import jaxx.compiler.CompilerException; Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/JavaMethodTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler; import jaxx.compiler.java.JavaMethod; Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/beans/BeanIntoUtilTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.beans; import org.junit.Assert; Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/reflect/ClassDescriptorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.reflect; import static org.junit.Assert.assertEquals; Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/tags/TagManagerTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.tags; import jaxx.compiler.JAXXCompiler; Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/ColorConverterTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.types; import jaxx.compiler.types.ColorConverter; Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/InsetsConverterTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.types; import jaxx.compiler.types.InsetsConverter; Modified: branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java =================================================================== --- branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-compiler/src/test/java/jaxx/compiler/types/PrimitiveConverterTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Compiler + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.compiler.types; import jaxx.compiler.types.PrimitiveConverter; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Base64Coder.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime; import java.io.ByteArrayInputStream; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/ComponentDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,49 +1,65 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime; - -import java.io.Serializable; - -public class ComponentDescriptor implements Serializable { - String id; - String javaClassName; - String styleClass; - ComponentDescriptor parent; - private static final long serialVersionUID = 1L; - - - public ComponentDescriptor(String id, String javaClassName, String styleClass, ComponentDescriptor parent) { - this.id = id; - this.javaClassName = javaClassName; - this.styleClass = styleClass; - this.parent = parent; - } - - - public String getId() { - return id; - } - - - public String getJavaClassName() { - return javaClassName; - } - - - public String getStyleClass() { - return styleClass; - } - - - public ComponentDescriptor getParent() { - return parent; - } - - - @Override - public String toString() { - return "ComponentDescriptor[" + id + ", " + javaClassName + ", " + styleClass + "]"; - } +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime; + +import java.io.Serializable; + +public class ComponentDescriptor implements Serializable { + String id; + String javaClassName; + String styleClass; + ComponentDescriptor parent; + private static final long serialVersionUID = 1L; + + + public ComponentDescriptor(String id, String javaClassName, String styleClass, ComponentDescriptor parent) { + this.id = id; + this.javaClassName = javaClassName; + this.styleClass = styleClass; + this.parent = parent; + } + + + public String getId() { + return id; + } + + + public String getJavaClassName() { + return javaClassName; + } + + + public String getStyleClass() { + return styleClass; + } + + + public ComponentDescriptor getParent() { + return parent; + } + + + @Override + public String toString() { + return "ComponentDescriptor[" + id + ", " + javaClassName + ", " + styleClass + "]"; + } } \ No newline at end of file Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingListener.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,47 +1,63 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - - -/** - * A <code>PropertyChangeListener</code> which processes a data binding when it receives a - * <code>PropertyChangeEvent</code>. - */ -public class DataBindingListener implements PropertyChangeListener { - private JAXXObject object; - private String dest; - - /** - * Creates a new <code>DataBindingListener</code> which will run the given data binding - * when it receives a <code>PropertyChangeEvent</code>. - * - * @param object the object in which the data binding exists - * @param dest the name of the data binding to run - */ - public DataBindingListener(JAXXObject object, String dest) { - this.object = object; - this.dest = dest; - } - - - /** - * Processes the data binding in response to a <code>PropertyChangeEvent</code>. - * - * @param e the event which triggered the binding - */ - @Override - public void propertyChange(PropertyChangeEvent e) { - object.processDataBinding(dest); - - // for now, handle dependency changes by always removing & reapplying - // the binding. We should be more efficient and only do this when it's - // actually necessary - object.removeDataBinding(dest); - object.applyDataBinding(dest); - } +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + + +/** + * A <code>PropertyChangeListener</code> which processes a data binding when it receives a + * <code>PropertyChangeEvent</code>. + */ +public class DataBindingListener implements PropertyChangeListener { + private JAXXObject object; + private String dest; + + /** + * Creates a new <code>DataBindingListener</code> which will run the given data binding + * when it receives a <code>PropertyChangeEvent</code>. + * + * @param object the object in which the data binding exists + * @param dest the name of the data binding to run + */ + public DataBindingListener(JAXXObject object, String dest) { + this.object = object; + this.dest = dest; + } + + + /** + * Processes the data binding in response to a <code>PropertyChangeEvent</code>. + * + * @param e the event which triggered the binding + */ + @Override + public void propertyChange(PropertyChangeEvent e) { + object.processDataBinding(dest); + + // for now, handle dependency changes by always removing & reapplying + // the binding. We should be more efficient and only do this when it's + // actually necessary + object.removeDataBinding(dest); + object.applyDataBinding(dest); + } } \ No newline at end of file Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/DataBindingUpdateListener.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,47 +1,63 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - - -/** - * A <code>PropertyChangeListener</code> which removes and re-applies a data binding - * when it receives a <code>PropertyChangeEvent</code>. - */ -public class DataBindingUpdateListener implements PropertyChangeListener { - private JAXXObject object; - private String dest; - - /** - * Creates a new <code>DataBindingUpdateListener</code> which will remove and re-apply a - * data binding when it receives a <code>PropertyChangeEvent</code>. - * - * @param object the object in which the data binding exists - * @param dest the name of the data binding to reapply - */ - public DataBindingUpdateListener(JAXXObject object, String dest) { - this.object = object; - this.dest = dest; - } - - - public String getBindingName() { - return dest; - } - - - /** - * Updates the data binding in response to a <code>PropertyChangeEvent</code>. - * - * @param e the event which triggered the binding - */ - @Override - public void propertyChange(PropertyChangeEvent e) { - object.removeDataBinding(dest); - object.applyDataBinding(dest); - } +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + + +/** + * A <code>PropertyChangeListener</code> which removes and re-applies a data binding + * when it receives a <code>PropertyChangeEvent</code>. + */ +public class DataBindingUpdateListener implements PropertyChangeListener { + private JAXXObject object; + private String dest; + + /** + * Creates a new <code>DataBindingUpdateListener</code> which will remove and re-apply a + * data binding when it receives a <code>PropertyChangeEvent</code>. + * + * @param object the object in which the data binding exists + * @param dest the name of the data binding to reapply + */ + public DataBindingUpdateListener(JAXXObject object, String dest) { + this.object = object; + this.dest = dest; + } + + + public String getBindingName() { + return dest; + } + + + /** + * Updates the data binding in response to a <code>PropertyChangeEvent</code>. + * + * @param e the event which triggered the binding + */ + @Override + public void propertyChange(PropertyChangeEvent e) { + object.removeDataBinding(dest); + object.applyDataBinding(dest); + } } \ No newline at end of file Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime; import jaxx.runtime.context.JAXXInitialContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXContext.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime; import java.awt.Container; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObject.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,70 +1,86 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime; - -import java.io.Serializable; -import java.util.Map; - -/** - * The <code>JAXXObject</code> interface is implemented by all classes - * produced by the JAXX compiler. - */ -public interface JAXXObject extends JAXXContext, Serializable { - - /** - * Retrieves an object defined in an XML tag by its ID. - * - * @param id the id of the component to retrieve - * @return the object - */ - Object getObjectById(String id); - - /** - * Pretrieves the dictonary of knwon objects indexed by their ids. - * - * @return the dictonary of objects. - */ - Map<String, Object> get$objectMap(); - - /** - * - * @return the {@link JAXXContext} attached to the object - */ - JAXXContext getDelegateContext(); - - /** - * Apply the data bind by name and then process it. - * @param id the id of the databinding - */ - void applyDataBinding(String id); - - /** - * Processes a data binding by name. Data binding names are comprised of an object ID and a property name: - * for example, the data binding in the tag <code><JLabel id='label' text='{foo.getText()}'/></code> is - * named <code>"label.text"</code>. Processing a data binding causes it to reevaluate its expression, in this - * case <code>foo.getText()</code>. - * - * @param dest the name of the data binding to run - */ - void processDataBinding(String dest); - - /** - * Remove a databinding by name. - * - * @param id the name of databinding to remove - */ - void removeDataBinding(String id); - - /** - * All <code>JAXXObject</code> implements are capable of broadcasting <code>PropertyChangeEvent</code>, and - * furthermore (for technical reasons) must allow code in outside packages, specifically the JAXX runtime, - * to trigger these events. - * - * @param name the name of the property which changed - * @param oldValue the old value of the property - * @param newValue the new value of the property - */ - void firePropertyChange(String name, Object oldValue, Object newValue); -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime; + +import java.io.Serializable; +import java.util.Map; + +/** + * The <code>JAXXObject</code> interface is implemented by all classes + * produced by the JAXX compiler. + */ +public interface JAXXObject extends JAXXContext, Serializable { + + /** + * Retrieves an object defined in an XML tag by its ID. + * + * @param id the id of the component to retrieve + * @return the object + */ + Object getObjectById(String id); + + /** + * Pretrieves the dictonary of knwon objects indexed by their ids. + * + * @return the dictonary of objects. + */ + Map<String, Object> get$objectMap(); + + /** + * + * @return the {@link JAXXContext} attached to the object + */ + JAXXContext getDelegateContext(); + + /** + * Apply the data bind by name and then process it. + * @param id the id of the databinding + */ + void applyDataBinding(String id); + + /** + * Processes a data binding by name. Data binding names are comprised of an object ID and a property name: + * for example, the data binding in the tag <code><JLabel id='label' text='{foo.getText()}'/></code> is + * named <code>"label.text"</code>. Processing a data binding causes it to reevaluate its expression, in this + * case <code>foo.getText()</code>. + * + * @param dest the name of the data binding to run + */ + void processDataBinding(String dest); + + /** + * Remove a databinding by name. + * + * @param id the name of databinding to remove + */ + void removeDataBinding(String id); + + /** + * All <code>JAXXObject</code> implements are capable of broadcasting <code>PropertyChangeEvent</code>, and + * furthermore (for technical reasons) must allow code in outside packages, specifically the JAXX runtime, + * to trigger these events. + * + * @param name the name of the property which changed + * @param oldValue the old value of the property + * @param newValue the new value of the property + */ + void firePropertyChange(String name, Object oldValue, Object newValue); +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,42 +1,58 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime; - -import jaxx.runtime.css.Stylesheet; - -import java.io.Serializable; - -public class JAXXObjectDescriptor implements Serializable { - private ComponentDescriptor[] descriptors; - private Stylesheet stylesheet; - private static final long serialVersionUID = 1L; - - - public JAXXObjectDescriptor(ComponentDescriptor[] descriptors, - Stylesheet stylesheet) { - this.descriptors = descriptors; - this.stylesheet = stylesheet; - } - - - public ComponentDescriptor[] getComponentDescriptors() { - return descriptors; - } - - - public Stylesheet getStylesheet() { - return stylesheet; - } - - @Override - public String toString() { - StringBuilder buffer = new StringBuilder(); - for (ComponentDescriptor descriptor : descriptors) { - buffer.append("\n").append(descriptor); - } - buffer.append("\n").append(stylesheet); - return buffer.toString(); - } +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime; + +import jaxx.runtime.css.Stylesheet; + +import java.io.Serializable; + +public class JAXXObjectDescriptor implements Serializable { + private ComponentDescriptor[] descriptors; + private Stylesheet stylesheet; + private static final long serialVersionUID = 1L; + + + public JAXXObjectDescriptor(ComponentDescriptor[] descriptors, + Stylesheet stylesheet) { + this.descriptors = descriptors; + this.stylesheet = stylesheet; + } + + + public ComponentDescriptor[] getComponentDescriptors() { + return descriptors; + } + + + public Stylesheet getStylesheet() { + return stylesheet; + } + + @Override + public String toString() { + StringBuilder buffer = new StringBuilder(); + for (ComponentDescriptor descriptor : descriptors) { + buffer.append("\n").append(descriptor); + } + buffer.append("\n").append(stylesheet); + return buffer.toString(); + } } \ No newline at end of file Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/JAXXValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime; import java.awt.Color; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/Util.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime; import jaxx.runtime.context.JAXXContextEntryDef; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DataContext.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.context; import jaxx.runtime.JAXXContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultApplicationContext.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.context; import jaxx.runtime.*; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/DefaultJAXXContext.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.context; import jaxx.runtime.*; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXContextEntryDef.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.context; import java.util.List; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/context/JAXXInitialContext.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.context; import jaxx.runtime.JAXXContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/DataBinding.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,32 +1,48 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.css; - -/** - * Represents a data binding bound to an attribute at runtime. Used by {@link Pseudoclasses} to keep - * track of which data bindings are in effect. - */ -public class DataBinding { - - private String id; - - public DataBinding(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - @Override - public boolean equals(Object o) { - return o instanceof DataBinding && ((DataBinding) o).getId().equals(getId()); - } - - @Override - public int hashCode() { - return id.hashCode(); - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.css; + +/** + * Represents a data binding bound to an attribute at runtime. Used by {@link Pseudoclasses} to keep + * track of which data bindings are in effect. + */ +public class DataBinding { + + private String id; + + public DataBinding(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + @Override + public boolean equals(Object o) { + return o instanceof DataBinding && ((DataBinding) o).getId().equals(getId()); + } + + @Override + public int hashCode() { + return id.hashCode(); + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Pseudoclasses.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.css; import jaxx.runtime.JAXXObject; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Rule.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,52 +1,68 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.css; - -import java.util.Map; - -public class Rule implements java.io.Serializable, Comparable<Rule> { - - public static final String INLINE_ATTRIBUTE = "<inline attribute>"; - public static final String DATA_BINDING = "<data binding>"; - private Selector[] selectors; - private Map<String, String> properties; - private static final long serialVersionUID = 1L; - - public Rule(Selector[] selectors, Map<String, String> properties) { - this.selectors = selectors; - java.util.Arrays.sort(selectors); - this.properties = properties; - } - - public Rule(Selector[] selectors, String[] keys, String[] values) { - this.selectors = selectors; - java.util.Arrays.sort(selectors); - this.properties = new java.util.HashMap<String, String>(); - if (keys.length != values.length) { - throw new IllegalArgumentException("keys and values must have the same number of entries"); - } - for (int i = 0; i < keys.length; i++) { - properties.put(keys[i], values[i]); - } - } - - public Selector[] getSelectors() { - return selectors; - } - - public Map<String, String> getProperties() { - return properties; - } - - @Override - public int compareTo(Rule o) { - return selectors[0].compareTo(o.selectors[0]); // they are already sorted so we only need to compare the highest-ranked from each one - } - - @Override - public String toString() { - return "Rule[" + java.util.Arrays.asList(selectors) + ", " + properties + "]"; - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.css; + +import java.util.Map; + +public class Rule implements java.io.Serializable, Comparable<Rule> { + + public static final String INLINE_ATTRIBUTE = "<inline attribute>"; + public static final String DATA_BINDING = "<data binding>"; + private Selector[] selectors; + private Map<String, String> properties; + private static final long serialVersionUID = 1L; + + public Rule(Selector[] selectors, Map<String, String> properties) { + this.selectors = selectors; + java.util.Arrays.sort(selectors); + this.properties = properties; + } + + public Rule(Selector[] selectors, String[] keys, String[] values) { + this.selectors = selectors; + java.util.Arrays.sort(selectors); + this.properties = new java.util.HashMap<String, String>(); + if (keys.length != values.length) { + throw new IllegalArgumentException("keys and values must have the same number of entries"); + } + for (int i = 0; i < keys.length; i++) { + properties.put(keys[i], values[i]); + } + } + + public Selector[] getSelectors() { + return selectors; + } + + public Map<String, String> getProperties() { + return properties; + } + + @Override + public int compareTo(Rule o) { + return selectors[0].compareTo(o.selectors[0]); // they are already sorted so we only need to compare the highest-ranked from each one + } + + @Override + public String toString() { + return "Rule[" + java.util.Arrays.asList(selectors) + ", " + properties + "]"; + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Selector.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,92 +1,108 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.css; - -public class Selector implements java.io.Serializable, Comparable<Selector> { - - public static final int NEVER_APPLIES = 0; - public static final int PSEUDOCLASS_APPLIES_INHERIT_ONLY = 1; - public static final int PSEUDOCLASS_APPLIES = 2; - public static final int ALWAYS_APPLIES_INHERIT_ONLY = 3; - public static final int ALWAYS_APPLIES = 4; - private String javaClassName; - private String styleClass; - private String pseudoClass; - private String id; - private boolean inline; - private static final long serialVersionUID = 1L; - - public Selector(String javaClassName, String styleClass, String pseudoClass, String id) { - this(javaClassName, styleClass, pseudoClass, id, false); - } - - public Selector(String javaClassName, String styleClass, String pseudoClass, String id, boolean inline) { - this.javaClassName = javaClassName; - this.styleClass = styleClass; - this.pseudoClass = pseudoClass; - this.id = id; - this.inline = inline; - } - - public String getJavaClassName() { - return javaClassName; - } - - public String getStyleClass() { - return styleClass; - } - - public String getPseudoClass() { - return pseudoClass; - } - - public String getId() { - return id; - } - - public boolean isInline() { - return inline; - } - - @Override - public int compareTo(Selector selector) { - if (inline && !selector.inline) { - return 1; - } - if (!inline && selector.inline) { - return -1; - } - if (pseudoClass != null && selector.pseudoClass == null) { - return 1; - } - if (pseudoClass == null && selector.pseudoClass != null) { - return -1; - } - if (id != null && selector.id == null) { - return 1; - } - if (id == null && selector.id != null) { - return -1; - } - if (styleClass != null && selector.styleClass == null) { - return 1; - } - if (styleClass == null && selector.styleClass != null) { - return -1; - } - if (javaClassName != null && selector.javaClassName == null) { - return 1; - } - if (javaClassName == null && selector.javaClassName != null) { - return -1; - } - return 0; - } - - @Override - public String toString() { - return "Selector[" + javaClassName + ", " + styleClass + ", " + pseudoClass + ", " + id + "]"; - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.css; + +public class Selector implements java.io.Serializable, Comparable<Selector> { + + public static final int NEVER_APPLIES = 0; + public static final int PSEUDOCLASS_APPLIES_INHERIT_ONLY = 1; + public static final int PSEUDOCLASS_APPLIES = 2; + public static final int ALWAYS_APPLIES_INHERIT_ONLY = 3; + public static final int ALWAYS_APPLIES = 4; + private String javaClassName; + private String styleClass; + private String pseudoClass; + private String id; + private boolean inline; + private static final long serialVersionUID = 1L; + + public Selector(String javaClassName, String styleClass, String pseudoClass, String id) { + this(javaClassName, styleClass, pseudoClass, id, false); + } + + public Selector(String javaClassName, String styleClass, String pseudoClass, String id, boolean inline) { + this.javaClassName = javaClassName; + this.styleClass = styleClass; + this.pseudoClass = pseudoClass; + this.id = id; + this.inline = inline; + } + + public String getJavaClassName() { + return javaClassName; + } + + public String getStyleClass() { + return styleClass; + } + + public String getPseudoClass() { + return pseudoClass; + } + + public String getId() { + return id; + } + + public boolean isInline() { + return inline; + } + + @Override + public int compareTo(Selector selector) { + if (inline && !selector.inline) { + return 1; + } + if (!inline && selector.inline) { + return -1; + } + if (pseudoClass != null && selector.pseudoClass == null) { + return 1; + } + if (pseudoClass == null && selector.pseudoClass != null) { + return -1; + } + if (id != null && selector.id == null) { + return 1; + } + if (id == null && selector.id != null) { + return -1; + } + if (styleClass != null && selector.styleClass == null) { + return 1; + } + if (styleClass == null && selector.styleClass != null) { + return -1; + } + if (javaClassName != null && selector.javaClassName == null) { + return 1; + } + if (javaClassName == null && selector.javaClassName != null) { + return -1; + } + return 0; + } + + @Override + public String toString() { + return "Selector[" + javaClassName + ", " + styleClass + ", " + pseudoClass + ", " + id + "]"; + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/css/Stylesheet.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,45 +1,61 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.css; - -public class Stylesheet implements java.io.Serializable { - - private Rule[] rules; - private static final long serialVersionUID = 1L; - - public Stylesheet() { - rules = new Rule[0]; - } - - public Stylesheet(Rule[] rules) { - this.rules = rules; - java.util.Arrays.sort(rules); - } - - public Rule[] getRules() { - return rules; - } - - public void add(Rule newRule) { - Rule[] oldRules = rules; - rules = new Rule[oldRules.length + 1]; - System.arraycopy(oldRules, 0, rules, 0, oldRules.length); - rules[rules.length - 1] = newRule; - java.util.Arrays.sort(rules); - } - - public void add(Rule[] newRules) { - Rule[] oldRules = rules; - rules = new Rule[oldRules.length + newRules.length]; - System.arraycopy(oldRules, 0, rules, 0, oldRules.length); - System.arraycopy(newRules, 0, rules, oldRules.length, newRules.length); - java.util.Arrays.sort(rules); - } - - @Override - public String toString() { - return "Stylesheet" + java.util.Arrays.asList(rules); - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.css; + +public class Stylesheet implements java.io.Serializable { + + private Rule[] rules; + private static final long serialVersionUID = 1L; + + public Stylesheet() { + rules = new Rule[0]; + } + + public Stylesheet(Rule[] rules) { + this.rules = rules; + java.util.Arrays.sort(rules); + } + + public Rule[] getRules() { + return rules; + } + + public void add(Rule newRule) { + Rule[] oldRules = rules; + rules = new Rule[oldRules.length + 1]; + System.arraycopy(oldRules, 0, rules, 0, oldRules.length); + rules[rules.length - 1] = newRule; + java.util.Arrays.sort(rules); + } + + public void add(Rule[] newRules) { + Rule[] oldRules = rules; + rules = new Rule[oldRules.length + newRules.length]; + System.arraycopy(oldRules, 0, rules, 0, oldRules.length); + System.arraycopy(newRules, 0, rules, oldRules.length, newRules.length); + java.util.Arrays.sort(rules); + } + + @Override + public String toString() { + return "Stylesheet" + java.util.Arrays.asList(rules); + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/Decorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/DecoratorUtils.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; import java.util.ArrayList; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/JXPathDecorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; import org.apache.commons.jxpath.JXPathContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/MultiJXPathDecorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; import org.apache.commons.logging.Log; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/PropertyDecorator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; import org.apache.commons.beanutils.PropertyUtils; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorListCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator.swing; import jaxx.runtime.decorator.*; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/decorator/swing/DecoratorTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator.swing; import jaxx.runtime.decorator.*; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Application.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,56 +1,71 @@ -package jaxx.runtime.swing; - -import javax.swing.JFrame; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import java.awt.GraphicsConfiguration; - -public class Application extends JFrame { - // Special: jaxxc will automatically add a main() method to any components which - // extend <Application> - - - public Application() { - } - - - public Application(GraphicsConfiguration gc) { - super(gc); - } - - - public Application(String title) { - super(title); - } - - - public Application(String title, GraphicsConfiguration gc) { - super(title, gc); - } - - - public void setLookAndFeel(String lookAndFeel) { - if (lookAndFeel.equals("system")) - lookAndFeel = UIManager.getSystemLookAndFeelClassName(); - else if (lookAndFeel.equals("cross_platform")) - lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName(); - try { - UIManager.setLookAndFeel(lookAndFeel); - if (isDisplayable()) - SwingUtilities.updateComponentTreeUI(this); - } - catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - catch (InstantiationException e) { - throw new RuntimeException(e); - } - catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - catch (UnsupportedLookAndFeelException e) { - throw new RuntimeException(e); - } - } -} \ No newline at end of file +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.JFrame; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import java.awt.GraphicsConfiguration; + +public class Application extends JFrame { + + private static final long serialVersionUID = 1L; + // Special: jaxxc will automatically add a main() method to any components which + // extend <Application> + + public Application() { + } + + public Application(GraphicsConfiguration gc) { + super(gc); + } + + public Application(String title) { + super(title); + } + + public Application(String title, GraphicsConfiguration gc) { + super(title, gc); + } + + public void setLookAndFeel(String lookAndFeel) { + if (lookAndFeel.equals("system")) { + lookAndFeel = UIManager.getSystemLookAndFeelClassName(); + } else if (lookAndFeel.equals("cross_platform")) { + lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName(); + } + try { + UIManager.setLookAndFeel(lookAndFeel); + if (isDisplayable()) { + SwingUtilities.updateComponentTreeUI(this); + } + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (UnsupportedLookAndFeelException e) { + throw new RuntimeException(e); + } + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing; import java.awt.AlphaComposite; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/BlockingLayerUI2.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing; import java.awt.AlphaComposite; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing; import org.apache.commons.logging.Log; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/CardLayout2Ext.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing; import java.awt.Container; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/GBC.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,7 @@ /** - * *##% Lutin I18n Editor - * Copyright (C) 2008 CodeLutin + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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 @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ /* GBC - A convenience class to tame the GridBagLayout Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBox.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,94 +1,110 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.JPanel; -import java.awt.Insets; - -/** - * Panel which uses an {@link HBoxLayout} by default. - * - * @author Ethan Nicholas - */ -public class HBox extends JPanel { - - private static final long serialVersionUID = 1L; - public static final String SPACING_PROPERTY = "spacing"; - public static final String MARGIN_PROPERTY = "margin"; - public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment"; - public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment"; - private Insets margin; - - public HBox() { - super(new HBoxLayout()); - } - - /** - * Returns the spacing between components, in pixels. Spacing is applied between components only, - * not to the top or bottom of the container. - * - * @return spacing between components - */ - public int getSpacing() { - return ((HBoxLayout) getLayout()).getSpacing(); - } - - /** - * Sets the spacing between components. Spacing is applied between components only, - * not to the top or bottom of the container. - * - * @param spacing new spacing value - */ - public void setSpacing(int spacing) { - int oldValue = getSpacing(); - ((HBoxLayout) getLayout()).setSpacing(spacing); - firePropertyChange(SPACING_PROPERTY, oldValue, spacing); - revalidate(); - } - - public int getHorizontalAlignment() { - return ((HBoxLayout) getLayout()).getHorizontalAlignment(); - } - - public void setHorizontalAlignment(int horizontalAlignment) { - int oldValue = getHorizontalAlignment(); - ((HBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment); - firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment); - revalidate(); - } - - public int getVerticalAlignment() { - return ((HBoxLayout) getLayout()).getVerticalAlignment(); - } - - public void setVerticalAlignment(int verticalAlignment) { - int oldValue = getVerticalAlignment(); - ((HBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment); - firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment); - revalidate(); - } - - public Insets getMargin() { - return margin; - } - - public void setMargin(Insets margin) { - Insets oldValue = this.margin; - this.margin = (Insets) margin.clone(); - firePropertyChange(MARGIN_PROPERTY, oldValue, margin); - } - - @Override - public Insets getInsets() { - Insets result = super.getInsets(); - if (margin != null) { - result.top += margin.top; - result.left += margin.left; - result.right += margin.right; - result.bottom += margin.bottom; - } - return result; - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.JPanel; +import java.awt.Insets; + +/** + * Panel which uses an {@link HBoxLayout} by default. + * + * @author Ethan Nicholas + */ +public class HBox extends JPanel { + + private static final long serialVersionUID = 1L; + public static final String SPACING_PROPERTY = "spacing"; + public static final String MARGIN_PROPERTY = "margin"; + public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment"; + public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment"; + private Insets margin; + + public HBox() { + super(new HBoxLayout()); + } + + /** + * Returns the spacing between components, in pixels. Spacing is applied between components only, + * not to the top or bottom of the container. + * + * @return spacing between components + */ + public int getSpacing() { + return ((HBoxLayout) getLayout()).getSpacing(); + } + + /** + * Sets the spacing between components. Spacing is applied between components only, + * not to the top or bottom of the container. + * + * @param spacing new spacing value + */ + public void setSpacing(int spacing) { + int oldValue = getSpacing(); + ((HBoxLayout) getLayout()).setSpacing(spacing); + firePropertyChange(SPACING_PROPERTY, oldValue, spacing); + revalidate(); + } + + public int getHorizontalAlignment() { + return ((HBoxLayout) getLayout()).getHorizontalAlignment(); + } + + public void setHorizontalAlignment(int horizontalAlignment) { + int oldValue = getHorizontalAlignment(); + ((HBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment); + firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment); + revalidate(); + } + + public int getVerticalAlignment() { + return ((HBoxLayout) getLayout()).getVerticalAlignment(); + } + + public void setVerticalAlignment(int verticalAlignment) { + int oldValue = getVerticalAlignment(); + ((HBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment); + firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment); + revalidate(); + } + + public Insets getMargin() { + return margin; + } + + public void setMargin(Insets margin) { + Insets oldValue = this.margin; + this.margin = (Insets) margin.clone(); + firePropertyChange(MARGIN_PROPERTY, oldValue, margin); + } + + @Override + public Insets getInsets() { + Insets result = super.getInsets(); + if (margin != null) { + result.top += margin.top; + result.left += margin.left; + result.right += margin.right; + result.bottom += margin.bottom; + } + return result; + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxBeanInfo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.runtime.swing; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/HBoxLayout.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,127 +1,143 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.SwingConstants; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.LayoutManager; - -/** - * Horizontal box layout. The layout rules followed by this class are quite different than the core BoxLayout class, - * and in general represent a more useful algorithm. - * - * @author Ethan Nicholas - */ -public class HBoxLayout implements LayoutManager { - - private int spacing = 6; - private int horizontalAlignment = SwingConstants.LEFT; - private int verticalAlignment = SwingConstants.TOP; - - public int getSpacing() { - return spacing; - } - - public void setSpacing(int spacing) { - this.spacing = spacing; - } - - public int getHorizontalAlignment() { - return horizontalAlignment; - } - - public void setHorizontalAlignment(int horizontalAlignment) { - this.horizontalAlignment = horizontalAlignment; - } - - public int getVerticalAlignment() { - return verticalAlignment; - } - - public void setVerticalAlignment(int verticalAlignment) { - this.verticalAlignment = verticalAlignment; - } - - @Override - public void addLayoutComponent(String name, Component comp) { - } - - @Override - public void layoutContainer(Container parent) { - Insets insets = parent.getInsets(); - int parentHeight = parent.getSize().height - insets.top - insets.bottom; - int count = parent.getComponentCount(); - Dimension preferredSize = parent.getPreferredSize(); - int x; - switch (horizontalAlignment) { - case SwingConstants.LEFT: - x = insets.left; - break; - case SwingConstants.CENTER: - x = insets.left + (parent.getWidth() - preferredSize.width) / 2; - break; - case SwingConstants.RIGHT: - x = insets.left + (parent.getWidth() - preferredSize.width); - break; - default: - throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment); - } - - for (int i = 0; i < count; i++) { - Component component = parent.getComponent(i); - Dimension childPreferredSize = component.getPreferredSize(); - int height = Math.min(childPreferredSize.height, parentHeight); - int y; - switch (verticalAlignment) { - case SwingConstants.TOP: - y = insets.top; - break; - case SwingConstants.CENTER: - y = insets.top + (parentHeight - childPreferredSize.height) / 2; - break; - case SwingConstants.BOTTOM: - y = insets.top + (parentHeight - childPreferredSize.height); - break; - default: - throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment); - } - component.setBounds(x, y, childPreferredSize.width, height); - x += childPreferredSize.width + spacing; - } - } - - @Override - public Dimension minimumLayoutSize(Container parent) { - int width = (parent.getComponentCount() - 1) * spacing; - int height = 0; - for (int i = parent.getComponentCount() - 1; i >= 0; i--) { - Dimension minimumSize = parent.getComponent(i).getMinimumSize(); - width += minimumSize.width; - height = Math.max(height, minimumSize.height); - } - Insets insets = parent.getInsets(); - return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); - } - - @Override - public Dimension preferredLayoutSize(Container parent) { - int width = (parent.getComponentCount() - 1) * spacing; - int height = 0; - for (int i = parent.getComponentCount() - 1; i >= 0; i--) { - Dimension preferredSize = parent.getComponent(i).getPreferredSize(); - width += preferredSize.width; - height = Math.max(height, preferredSize.height); - } - Insets insets = parent.getInsets(); - return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); - } - - @Override - public void removeLayoutComponent(Component comp) { - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.SwingConstants; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.LayoutManager; + +/** + * Horizontal box layout. The layout rules followed by this class are quite different than the core BoxLayout class, + * and in general represent a more useful algorithm. + * + * @author Ethan Nicholas + */ +public class HBoxLayout implements LayoutManager { + + private int spacing = 6; + private int horizontalAlignment = SwingConstants.LEFT; + private int verticalAlignment = SwingConstants.TOP; + + public int getSpacing() { + return spacing; + } + + public void setSpacing(int spacing) { + this.spacing = spacing; + } + + public int getHorizontalAlignment() { + return horizontalAlignment; + } + + public void setHorizontalAlignment(int horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + } + + public int getVerticalAlignment() { + return verticalAlignment; + } + + public void setVerticalAlignment(int verticalAlignment) { + this.verticalAlignment = verticalAlignment; + } + + @Override + public void addLayoutComponent(String name, Component comp) { + } + + @Override + public void layoutContainer(Container parent) { + Insets insets = parent.getInsets(); + int parentHeight = parent.getSize().height - insets.top - insets.bottom; + int count = parent.getComponentCount(); + Dimension preferredSize = parent.getPreferredSize(); + int x; + switch (horizontalAlignment) { + case SwingConstants.LEFT: + x = insets.left; + break; + case SwingConstants.CENTER: + x = insets.left + (parent.getWidth() - preferredSize.width) / 2; + break; + case SwingConstants.RIGHT: + x = insets.left + (parent.getWidth() - preferredSize.width); + break; + default: + throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment); + } + + for (int i = 0; i < count; i++) { + Component component = parent.getComponent(i); + Dimension childPreferredSize = component.getPreferredSize(); + int height = Math.min(childPreferredSize.height, parentHeight); + int y; + switch (verticalAlignment) { + case SwingConstants.TOP: + y = insets.top; + break; + case SwingConstants.CENTER: + y = insets.top + (parentHeight - childPreferredSize.height) / 2; + break; + case SwingConstants.BOTTOM: + y = insets.top + (parentHeight - childPreferredSize.height); + break; + default: + throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment); + } + component.setBounds(x, y, childPreferredSize.width, height); + x += childPreferredSize.width + spacing; + } + } + + @Override + public Dimension minimumLayoutSize(Container parent) { + int width = (parent.getComponentCount() - 1) * spacing; + int height = 0; + for (int i = parent.getComponentCount() - 1; i >= 0; i--) { + Dimension minimumSize = parent.getComponent(i).getMinimumSize(); + width += minimumSize.width; + height = Math.max(height, minimumSize.height); + } + Insets insets = parent.getInsets(); + return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); + } + + @Override + public Dimension preferredLayoutSize(Container parent) { + int width = (parent.getComponentCount() - 1) * spacing; + int height = 0; + for (int i = parent.getComponentCount() - 1; i >= 0; i--) { + Dimension preferredSize = parent.getComponent(i).getPreferredSize(); + width += preferredSize.width; + height = Math.max(height, preferredSize.height); + } + Insets insets = parent.getInsets(); + return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); + } + + @Override + public void removeLayoutComponent(Component comp) { + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Item.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,223 +1,239 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.event.SwingPropertyChangeSupport; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.ArrayList; -import java.util.List; - -// This needs to be split into two classes, Item and TreeItem -/** - * An item in a component such as <code>JComboBox</code> or <code>JTree</code>. The <code>Item</code> - * class corresponds to the <code><item></code> tag in JAXX source files. - */ -public class Item { - - public static final String LABEL_PROPERTY = "label"; - public static final String VALUE_PROPERTY = "value"; - public static final String SELECTED_PROPERTY = "selected"; - private String id; - private String label; - private Object value; - private boolean selected; - private List<Item> children; - private Item parent; - private PropertyChangeSupport propertyChangeSupport; - - /** - * Creates a new Item. This should only be called from compiled JAXX files. - * - * @param id the item's ID - * @param label the string that should be used to represent the item visually - * @param value the item's actual value - * @param selected <code>true</code> if the item should be selected by default - */ - public Item(String id, String label, Object value, boolean selected) { - this.id = id; - this.label = label; - this.value = value; - this.selected = selected; - } - - /** - * Returns this item's ID. - * - * @return the JAXX ID attribute - */ - public String getId() { - return id; - } - - /** - * Returns the string that should be used to represent the item at display time. If <code>null</code>, - * <code>String.valueOf(getValue())</code> will be used instead. - * - * @return this item's display string - * @see #setLabel - */ - public String getLabel() { - return label; - } - - /** - * Sets the item's display string. If <code>null, String.valueOf(getValue())</code> will be used instead. - * - * @param label the new display string - * @see #getLabel - */ - public void setLabel(String label) { - String oldLabel = this.label; - this.label = label; - firePropertyChange(LABEL_PROPERTY, oldLabel, label); - } - - /** - * Returns the item's actual value as it appears in the component's model. The <code>Item</code> itself is not - * visible from the model, only the value. - * - * @return the item's value - * @see #setValue - */ - public Object getValue() { - return value; - } - - /** - * Sets the item's value as it appears in the component's model. The <code>Item</code> itself is not - * visible from the model, only the value. - * - * @param value the new value - * @see #getValue - */ - public void setValue(Object value) { - Object oldValue = this.value; - this.value = value; - firePropertyChange(VALUE_PROPERTY, oldValue, value); - } - - /** - * Returns <code>true</code> if this item is currently selected. This is a bound property. - * - * @return <code>true</code> if item is selected - * @see #setSelected - */ - public boolean isSelected() { - return selected; - } - - /** - * Sets the item's selection state. This is a bound property. - * - * @param selected the new selection state - * @see #isSelected - */ - public void setSelected(boolean selected) { - boolean oldSelected = this.selected; - this.selected = selected; - firePropertyChange(SELECTED_PROPERTY, oldSelected, selected); - } - - /** - * Adds a new child node (Items can be nested in trees). - * - * @param item the new child item - */ - public void addChild(Item item) { - if (children == null) { - children = new ArrayList<Item>(); - } - children.add(item); - item.parent = this; - } - - /** - * Remove child node a new child node - * - * @param item to remove - */ - public void removeChild(Item item) { - if (children != null) { - children.remove(item); - } - } - - /** - * Remove all childs nodes - * - * @param items list of items to remove - */ - public void removeChilds(List<Item> items) { - if (children != null) { - children.removeAll(items); - } - } - - /** - * Returns a list of this item's children. - * - * @return a list of all nested child nodes - */ - public List<Item> getChildren() { - if (children == null) { - children = new ArrayList<Item>(); - } - return children; - } - - /** - * Returns the <code>Item</code> containing this <code>Item</code>, or <code>null</code> for a top-level - * <code>Item</code>. - * - * @return the item parent (or null) - */ - public Item getParent() { - return parent; - } - - /** - * Set the parent of this item - * - * @param parent the item parent (or null) - */ - public void setParent(Item parent) { - this.parent = parent; - } - - private PropertyChangeSupport getPropertyChangeSupport() { - if (propertyChangeSupport == null) { - propertyChangeSupport = new SwingPropertyChangeSupport(this); - } - return propertyChangeSupport; - } - - public void addPropertyChangeListener(PropertyChangeListener listener) { - getPropertyChangeSupport().addPropertyChangeListener(listener); - } - - public void addPropertyChangeListener(String property, PropertyChangeListener listener) { - getPropertyChangeSupport().addPropertyChangeListener(property, listener); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - getPropertyChangeSupport().removePropertyChangeListener(listener); - } - - public void removePropertyChangeListener(String property, PropertyChangeListener listener) { - getPropertyChangeSupport().removePropertyChangeListener(property, listener); - } - - protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { - if (propertyChangeSupport != null) { - getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue); - } - } - - @Override - public String toString() { - return getClass().getName() + "[" + value + "]"; - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.event.SwingPropertyChangeSupport; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.ArrayList; +import java.util.List; + +// This needs to be split into two classes, Item and TreeItem +/** + * An item in a component such as <code>JComboBox</code> or <code>JTree</code>. The <code>Item</code> + * class corresponds to the <code><item></code> tag in JAXX source files. + */ +public class Item { + + public static final String LABEL_PROPERTY = "label"; + public static final String VALUE_PROPERTY = "value"; + public static final String SELECTED_PROPERTY = "selected"; + private String id; + private String label; + private Object value; + private boolean selected; + private List<Item> children; + private Item parent; + private PropertyChangeSupport propertyChangeSupport; + + /** + * Creates a new Item. This should only be called from compiled JAXX files. + * + * @param id the item's ID + * @param label the string that should be used to represent the item visually + * @param value the item's actual value + * @param selected <code>true</code> if the item should be selected by default + */ + public Item(String id, String label, Object value, boolean selected) { + this.id = id; + this.label = label; + this.value = value; + this.selected = selected; + } + + /** + * Returns this item's ID. + * + * @return the JAXX ID attribute + */ + public String getId() { + return id; + } + + /** + * Returns the string that should be used to represent the item at display time. If <code>null</code>, + * <code>String.valueOf(getValue())</code> will be used instead. + * + * @return this item's display string + * @see #setLabel + */ + public String getLabel() { + return label; + } + + /** + * Sets the item's display string. If <code>null, String.valueOf(getValue())</code> will be used instead. + * + * @param label the new display string + * @see #getLabel + */ + public void setLabel(String label) { + String oldLabel = this.label; + this.label = label; + firePropertyChange(LABEL_PROPERTY, oldLabel, label); + } + + /** + * Returns the item's actual value as it appears in the component's model. The <code>Item</code> itself is not + * visible from the model, only the value. + * + * @return the item's value + * @see #setValue + */ + public Object getValue() { + return value; + } + + /** + * Sets the item's value as it appears in the component's model. The <code>Item</code> itself is not + * visible from the model, only the value. + * + * @param value the new value + * @see #getValue + */ + public void setValue(Object value) { + Object oldValue = this.value; + this.value = value; + firePropertyChange(VALUE_PROPERTY, oldValue, value); + } + + /** + * Returns <code>true</code> if this item is currently selected. This is a bound property. + * + * @return <code>true</code> if item is selected + * @see #setSelected + */ + public boolean isSelected() { + return selected; + } + + /** + * Sets the item's selection state. This is a bound property. + * + * @param selected the new selection state + * @see #isSelected + */ + public void setSelected(boolean selected) { + boolean oldSelected = this.selected; + this.selected = selected; + firePropertyChange(SELECTED_PROPERTY, oldSelected, selected); + } + + /** + * Adds a new child node (Items can be nested in trees). + * + * @param item the new child item + */ + public void addChild(Item item) { + if (children == null) { + children = new ArrayList<Item>(); + } + children.add(item); + item.parent = this; + } + + /** + * Remove child node a new child node + * + * @param item to remove + */ + public void removeChild(Item item) { + if (children != null) { + children.remove(item); + } + } + + /** + * Remove all childs nodes + * + * @param items list of items to remove + */ + public void removeChilds(List<Item> items) { + if (children != null) { + children.removeAll(items); + } + } + + /** + * Returns a list of this item's children. + * + * @return a list of all nested child nodes + */ + public List<Item> getChildren() { + if (children == null) { + children = new ArrayList<Item>(); + } + return children; + } + + /** + * Returns the <code>Item</code> containing this <code>Item</code>, or <code>null</code> for a top-level + * <code>Item</code>. + * + * @return the item parent (or null) + */ + public Item getParent() { + return parent; + } + + /** + * Set the parent of this item + * + * @param parent the item parent (or null) + */ + public void setParent(Item parent) { + this.parent = parent; + } + + private PropertyChangeSupport getPropertyChangeSupport() { + if (propertyChangeSupport == null) { + propertyChangeSupport = new SwingPropertyChangeSupport(this); + } + return propertyChangeSupport; + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + getPropertyChangeSupport().addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String property, PropertyChangeListener listener) { + getPropertyChangeSupport().addPropertyChangeListener(property, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + getPropertyChangeSupport().removePropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String property, PropertyChangeListener listener) { + getPropertyChangeSupport().removePropertyChangeListener(property, listener); + } + + protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { + if (propertyChangeSupport != null) { + getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue); + } + } + + @Override + public String toString() { + return getClass().getName() + "[" + value + "]"; + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.runtime.swing; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXComboBox.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,292 +1,308 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.AbstractListModel; -import javax.swing.ComboBoxModel; -import javax.swing.DefaultListCellRenderer; -import javax.swing.JComboBox; -import javax.swing.JList; -import javax.swing.ListModel; -import java.awt.Component; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class JAXXComboBox extends JComboBox { - - private static final long serialVersionUID = 1L; - - public class JAXXComboBoxModel extends AbstractListModel implements ComboBoxModel { - - private List<Item> items; - private Object selectedItem; - private static final long serialVersionUID = -8940733376638766414L; - - public JAXXComboBoxModel(List<Item> items) { - this.items = items; - - PropertyChangeListener listener = new PropertyChangeListener() { - - @Override - public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) { - Item item = (Item) e.getSource(); - int itemIndex = JAXXComboBoxModel.this.items.indexOf(item); - // TODO: fix cut-and-pasting badness - int[] oldSelection = new int[]{getSelectedIndex()}; - int[] newSelection; - int index = -1; - for (int i = 0; i < oldSelection.length; i++) { - if (oldSelection[i] == itemIndex) { - index = i; - break; - } - } - if (item.isSelected()) { - if (index != -1) // it was already selected - { - return; - } - newSelection = new int[oldSelection.length + 1]; - System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length); - newSelection[newSelection.length - 1] = itemIndex; - } else { - if (index == -1) // it already wasn't selected - { - return; - } - newSelection = new int[oldSelection.length - 1]; - System.arraycopy(oldSelection, 0, newSelection, 0, index); - System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index); - } - if (newSelection.length > 0) { - setSelectedIndex(newSelection[0]); - } - } else { - // TODO: more cut-and-pasting badness - for (int i = 0; i < getSize(); i++) { - if (getElementAt(i) == ((Item) e.getSource()).getValue()) { - fireContentsChanged(JAXXComboBoxModel.this, i, i); - if (getSelectedIndex() == i) { - fireItemStateChanged(new ItemEvent(JAXXComboBox.this, ItemEvent.ITEM_STATE_CHANGED, getElementAt(i), ItemEvent.DESELECTED)); - } - return; - } - } - } - } - }; - for (Item item : items) { - item.addPropertyChangeListener(listener); - } - } - - public List<Item> getItems() { - return items; - } - - @Override - public Object getElementAt(int i) { - return items.get(i).getValue(); - } - - @Override - public int getSize() { - return items.size(); - } - - @Override - public Object getSelectedItem() { - return selectedItem; - } - - @Override - public void setSelectedItem(Object selectedItem) { - if ((this.selectedItem != null && !this.selectedItem.equals(selectedItem)) || - this.selectedItem == null && selectedItem != null) { - this.selectedItem = selectedItem; - fireContentsChanged(this, -1, -1); - } - } - } - - public JAXXComboBox() { - setRenderer(new DefaultListCellRenderer() { - - private static final long serialVersionUID = 1L; - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - ListModel model = list.getModel(); - if (model instanceof JAXXComboBoxModel) { - List/*<Item>*/ items = ((JAXXComboBoxModel) model).items; - Item item = null; - if (index == -1) { - for (Object item1 : items) { - Item testItem = (Item) item1; - if (testItem.getValue() == value) { - item = testItem; - break; - } - } - } else { - item = (Item) items.get(index); - } - - if (item != null) { - String label = item.getLabel(); - if (label != null) { - value = label; - } - } - } - return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - } - }); - - addItemListener(new ItemListener() { - - @Override - public void itemStateChanged(ItemEvent e) { - ListModel model = getModel(); - if (model instanceof JAXXComboBoxModel) { - List<Item> items = ((JAXXComboBoxModel) model).items; - for (int i = items.size() - 1; i >= 0; i--) { - boolean selected = getSelectedIndex() == i; - Item item = items.get(i); - if (selected != item.isSelected()) { - item.setSelected(selected); - } - } - } - } - }); - } - - /** - * Fill a combo box model with some datas, and select after all the given object - * - * @param data data ot inject in combo - * @param select the object to select in combo after reflling his model - * @param methodName method to invoke to display data's name - */ - public void fillComboBox(Collection<?> data, Object select, String methodName) { - // prepare method to use - Method m; - try { - m = select.getClass().getMethod(methodName); - m.setAccessible(true); - } catch (NoSuchMethodException e) { - throw new IllegalArgumentException("could not find method " + methodName + " on " + select.getClass()); - } - - List<Item> items = new ArrayList<Item>(); - for (Object o : data) { - boolean selected = o.equals(select); - try { - items.add(new Item(o.toString(), (String) m.invoke(o), o, selected)); - } catch (IllegalAccessException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } - } - setItems(items); - } - - // this way we can keep it marked protected and still allow code in this file to call it - @Override - protected void fireItemStateChanged(ItemEvent e) { - super.fireItemStateChanged(e); - } - - public void setItems(List<Item> items) { - setModel(new JAXXComboBoxModel(items)); - List<Integer> selectedIndexList = new ArrayList<Integer>(); - for (int i = 0; i < items.size(); i++) { - if (items.get(i).isSelected()) { - selectedIndexList.add(i); - } - } - int[] selectedIndices = new int[selectedIndexList.size()]; - for (int i = 0; i < selectedIndexList.size(); i++) { - selectedIndices[i] = selectedIndexList.get(i); - } - if (selectedIndices.length > 0) { - setSelectedIndex(selectedIndices[0]); - } - } - - public List<Item> getItems() { - if (getModel() instanceof JAXXComboBoxModel) { - return ((JAXXComboBoxModel) getModel()).getItems(); - } - return null; - } - - public void setSelectedItem(Item item) { - //TC-20092004 Anomalie #73 fix npe when want to call with a null - // value - super.setSelectedItem(item == null ? null : item.getValue()); - } - - public Item getSelectedJaxxItem() { - Object selected = super.getSelectedItem(); - return findItem(selected); - } - - public Item findItem(Object value) { - List<Item> items = getItems(); - if (items != null) { - for (Item i : items) { - if (i.getValue().equals(value)) { - return i; - } - } - } - return null; - } - - public void addItem(Item item) { - List<Item> items = getItems(); - if (items != null) { - items.add(item); - setItems(items); - } - } - - public void addAllItems(Collection<Item> itemsToAdd) { - List<Item> items = getItems(); - if (items != null) { - items.addAll(itemsToAdd); - setItems(items); - } - } - - public void removeItem(Item item) { - List<Item> items = getItems(); - if (items != null) { - items.remove(item); - setItems(items); - } - } - - public void removeAllItems(Collection<Item> itemsToRemove) { - List<Item> items = getItems(); - if (items != null) { - items.removeAll(itemsToRemove); - setItems(items); - } - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.AbstractListModel; +import javax.swing.ComboBoxModel; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JComboBox; +import javax.swing.JList; +import javax.swing.ListModel; +import java.awt.Component; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class JAXXComboBox extends JComboBox { + + private static final long serialVersionUID = 1L; + + public class JAXXComboBoxModel extends AbstractListModel implements ComboBoxModel { + + private List<Item> items; + private Object selectedItem; + private static final long serialVersionUID = -8940733376638766414L; + + public JAXXComboBoxModel(List<Item> items) { + this.items = items; + + PropertyChangeListener listener = new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent e) { + if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) { + Item item = (Item) e.getSource(); + int itemIndex = JAXXComboBoxModel.this.items.indexOf(item); + // TODO: fix cut-and-pasting badness + int[] oldSelection = new int[]{getSelectedIndex()}; + int[] newSelection; + int index = -1; + for (int i = 0; i < oldSelection.length; i++) { + if (oldSelection[i] == itemIndex) { + index = i; + break; + } + } + if (item.isSelected()) { + if (index != -1) // it was already selected + { + return; + } + newSelection = new int[oldSelection.length + 1]; + System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length); + newSelection[newSelection.length - 1] = itemIndex; + } else { + if (index == -1) // it already wasn't selected + { + return; + } + newSelection = new int[oldSelection.length - 1]; + System.arraycopy(oldSelection, 0, newSelection, 0, index); + System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index); + } + if (newSelection.length > 0) { + setSelectedIndex(newSelection[0]); + } + } else { + // TODO: more cut-and-pasting badness + for (int i = 0; i < getSize(); i++) { + if (getElementAt(i) == ((Item) e.getSource()).getValue()) { + fireContentsChanged(JAXXComboBoxModel.this, i, i); + if (getSelectedIndex() == i) { + fireItemStateChanged(new ItemEvent(JAXXComboBox.this, ItemEvent.ITEM_STATE_CHANGED, getElementAt(i), ItemEvent.DESELECTED)); + } + return; + } + } + } + } + }; + for (Item item : items) { + item.addPropertyChangeListener(listener); + } + } + + public List<Item> getItems() { + return items; + } + + @Override + public Object getElementAt(int i) { + return items.get(i).getValue(); + } + + @Override + public int getSize() { + return items.size(); + } + + @Override + public Object getSelectedItem() { + return selectedItem; + } + + @Override + public void setSelectedItem(Object selectedItem) { + if ((this.selectedItem != null && !this.selectedItem.equals(selectedItem)) || + this.selectedItem == null && selectedItem != null) { + this.selectedItem = selectedItem; + fireContentsChanged(this, -1, -1); + } + } + } + + public JAXXComboBox() { + setRenderer(new DefaultListCellRenderer() { + + private static final long serialVersionUID = 1L; + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + ListModel model = list.getModel(); + if (model instanceof JAXXComboBoxModel) { + List/*<Item>*/ items = ((JAXXComboBoxModel) model).items; + Item item = null; + if (index == -1) { + for (Object item1 : items) { + Item testItem = (Item) item1; + if (testItem.getValue() == value) { + item = testItem; + break; + } + } + } else { + item = (Item) items.get(index); + } + + if (item != null) { + String label = item.getLabel(); + if (label != null) { + value = label; + } + } + } + return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + } + }); + + addItemListener(new ItemListener() { + + @Override + public void itemStateChanged(ItemEvent e) { + ListModel model = getModel(); + if (model instanceof JAXXComboBoxModel) { + List<Item> items = ((JAXXComboBoxModel) model).items; + for (int i = items.size() - 1; i >= 0; i--) { + boolean selected = getSelectedIndex() == i; + Item item = items.get(i); + if (selected != item.isSelected()) { + item.setSelected(selected); + } + } + } + } + }); + } + + /** + * Fill a combo box model with some datas, and select after all the given object + * + * @param data data ot inject in combo + * @param select the object to select in combo after reflling his model + * @param methodName method to invoke to display data's name + */ + public void fillComboBox(Collection<?> data, Object select, String methodName) { + // prepare method to use + Method m; + try { + m = select.getClass().getMethod(methodName); + m.setAccessible(true); + } catch (NoSuchMethodException e) { + throw new IllegalArgumentException("could not find method " + methodName + " on " + select.getClass()); + } + + List<Item> items = new ArrayList<Item>(); + for (Object o : data) { + boolean selected = o.equals(select); + try { + items.add(new Item(o.toString(), (String) m.invoke(o), o, selected)); + } catch (IllegalAccessException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } + } + setItems(items); + } + + // this way we can keep it marked protected and still allow code in this file to call it + @Override + protected void fireItemStateChanged(ItemEvent e) { + super.fireItemStateChanged(e); + } + + public void setItems(List<Item> items) { + setModel(new JAXXComboBoxModel(items)); + List<Integer> selectedIndexList = new ArrayList<Integer>(); + for (int i = 0; i < items.size(); i++) { + if (items.get(i).isSelected()) { + selectedIndexList.add(i); + } + } + int[] selectedIndices = new int[selectedIndexList.size()]; + for (int i = 0; i < selectedIndexList.size(); i++) { + selectedIndices[i] = selectedIndexList.get(i); + } + if (selectedIndices.length > 0) { + setSelectedIndex(selectedIndices[0]); + } + } + + public List<Item> getItems() { + if (getModel() instanceof JAXXComboBoxModel) { + return ((JAXXComboBoxModel) getModel()).getItems(); + } + return null; + } + + public void setSelectedItem(Item item) { + //TC-20092004 Anomalie #73 fix npe when want to call with a null + // value + super.setSelectedItem(item == null ? null : item.getValue()); + } + + public Item getSelectedJaxxItem() { + Object selected = super.getSelectedItem(); + return findItem(selected); + } + + public Item findItem(Object value) { + List<Item> items = getItems(); + if (items != null) { + for (Item i : items) { + if (i.getValue().equals(value)) { + return i; + } + } + } + return null; + } + + public void addItem(Item item) { + List<Item> items = getItems(); + if (items != null) { + items.add(item); + setItems(items); + } + } + + public void addAllItems(Collection<Item> itemsToAdd) { + List<Item> items = getItems(); + if (items != null) { + items.addAll(itemsToAdd); + setItems(items); + } + } + + public void removeItem(Item item) { + List<Item> items = getItems(); + if (items != null) { + items.remove(item); + setItems(items); + } + } + + public void removeAllItems(Collection<Item> itemsToRemove) { + List<Item> items = getItems(); + if (items != null) { + items.removeAll(itemsToRemove); + setItems(items); + } + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXList.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,396 +1,412 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.AbstractListModel; -import javax.swing.DefaultListCellRenderer; -import javax.swing.JList; -import javax.swing.ListModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import java.awt.Component; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class JAXXList extends JList { - - private static final long serialVersionUID = 1L; - - public class JAXXListModel extends AbstractListModel { - - private List<Item> items; - private static final long serialVersionUID = -1598924187490122036L; - - public JAXXListModel(List<Item> items) { - this.items = items; - - PropertyChangeListener listener = new PropertyChangeListener() { - - @Override - public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) { - Item item = (Item) e.getSource(); - int itemIndex = JAXXListModel.this.items.indexOf(item); - int[] oldSelection = getSelectedIndices(); - int[] newSelection; - int index = -1; - for (int i = 0; i < oldSelection.length; i++) { - if (oldSelection[i] == itemIndex) { - index = i; - break; - } - } - if (item.isSelected()) { - if (index != -1) // it was already selected - { - return; - } - newSelection = new int[oldSelection.length + 1]; - System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length); - newSelection[newSelection.length - 1] = itemIndex; - } else { - if (index == -1) // it already wasn't selected - { - return; - } - newSelection = new int[oldSelection.length - 1]; - System.arraycopy(oldSelection, 0, newSelection, 0, index); - System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index); - } - setSelectedIndices(newSelection); - } else { - for (int i = 0; i < getSize(); i++) { - if (getElementAt(i) == ((Item) e.getSource()).getValue()) { - fireContentsChanged(JAXXListModel.this, i, i); - if (isSelectedIndex(i)) { - fireSelectionValueChanged(i, i, false); - } - return; - } - } - } - } - }; - for (Item item : items) { - item.addPropertyChangeListener(listener); - } - } - - public List<Item> getItems(){ - return items; - } - - @Override - public Object getElementAt(int i) { - return items.get(i).getValue(); - } - - @Override - public int getSize() { - return items.size(); - } - } - - public JAXXList() { - setCellRenderer(new DefaultListCellRenderer() { - - private static final long serialVersionUID = 1L; - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - ListModel model = list.getModel(); - if (model instanceof JAXXListModel) { - Item item = ((JAXXListModel) model).items.get(index); - String label = item.getLabel(); - if (label != null) { - value = label; - } - } - return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - } - }); - - addListSelectionListener(new ListSelectionListener() { - - @Override - public void valueChanged(ListSelectionEvent e) { - ListModel model = getModel(); - if (model instanceof JAXXListModel) { - List<Item> items = ((JAXXListModel) model).items; - for (int i = items.size() - 1; i >= 0; i--) { - boolean selected = isSelectedIndex(i); - Item item = items.get(i); - if (selected != item.isSelected()) { - item.setSelected(selected); - } - } - } - } - }); - } - - // this way we can keep it marked protected and still allow code in this file to call it - @Override - protected void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting) { - super.fireSelectionValueChanged(firstIndex, lastIndex, isAdjusting); - } - - public void setItems(List<Item> items) { - setModel(new JAXXListModel(items)); - List<Integer> selectedIndexList = new ArrayList<Integer>(); - for (int i = 0; i < items.size(); i++) { - if (items.get(i).isSelected()) { - selectedIndexList.add(i); - } - } - int[] selectedIndices = new int[selectedIndexList.size()]; - for (int i = 0; i < selectedIndexList.size(); i++) { - selectedIndices[i] = selectedIndexList.get(i); - } - setSelectedIndices(selectedIndices); - } - - public List<Item> getItems(){ - if (getModel() instanceof JAXXListModel){ - return ((JAXXListModel)getModel()).getItems(); - } - return null; - } - - public void setSelectedValue(Object value) { - super.setSelectedValue(value, true); - } - - /** - * Set the selected Objects - * - * @param values Objects must be selected in the list - */ - public void setSelectedValues(Object[] values) { - if (values != null){ - List<Integer> selectedIndices = new ArrayList<Integer>(); - ListModel model = getModel(); - for (int i = 0; i < model.getSize(); i++) { - Object o = model.getElementAt(i); - for (Object value : values) { - if (o.equals(value)) { - selectedIndices.add(i); - break; - } - } - } - int[] ints = new int[selectedIndices.size()]; - for (int i = 0; i < ints.length; i++) { - ints[i] = selectedIndices.get(i).intValue(); - } - setSelectedIndices(ints); - } - else{ - // No selection if values is null - setSelectedIndex(-1); - } - } - - public void setSelectedItem(Item item) { - super.setSelectedValue(item.getValue(), true); - } - - public void setSelectedItems(List<Item> itemsToSelect) { - if (itemsToSelect != null){ - List<Item> items = getItems(); - int[] indices = new int[itemsToSelect.size()]; - int i = 0; - for (Item item : itemsToSelect){ - indices[i] = items.indexOf(item); - i++; - } - super.setSelectedIndices(indices); - } - } - - public Item getSelectedItem(){ - Object selected = super.getSelectedValue(); - return findItem(selected); - } - - public List<Item> getSelectedItems(){ - Object[] selected = super.getSelectedValues(); - java.util.List<Item> itemsSelected = new ArrayList<Item>(); - for (Object s : selected){ - itemsSelected.add(findItem(s)); - } - return itemsSelected; - } - - public Item findItem(Object value){ - List<Item> items = getItems(); - if (items != null){ - for (Item i : items){ - if (i.getValue().equals(value)){ - return i; - } - } - } - return null; - } - - public void addItem(Item item){ - List<Item> items = getItems(); - if (items != null){ - items.add(item); - setItems(items); - } - } - - public void addAllItems(Collection<Item> itemsToAdd){ - List<Item> items = getItems(); - if (items != null){ - items.addAll(itemsToAdd); - setItems(items); - } - } - - public void removeItem(Item item){ - List<Item> items = getItems(); - if (items != null){ - items.remove(item); - setItems(items); - } - } - - public void removeAllItems(Collection<Item> itemsToRemove){ - List<Item> items = getItems(); - if (items != null){ - items.removeAll(itemsToRemove); - setItems(items); - } - } - - /** - * Fill a list model with some datas, and select after all the given object - * - * @param data data ot inject in combo - * @param selects the objects to select in list after reflling his model - */ - public void fillList(Collection<?> data, Collection<?> selects) { - if (selects == null) { - selects = java.util.Collections.EMPTY_LIST; - } - List<Item> items = new ArrayList<Item>(); - for (Object o : data) { - boolean selected = false; - for (Object select : selects) { - if (selected = o.equals(select)) { - break; - } - } - items.add(new Item(o.toString(), o.toString(), o, selected)); - } - setItems(items); - } - - /** - * Fill a list model with some datas, and select after all the given object - * - * @param data data ot inject in combo - * @param select object to select in list after reflling his model - */ - public void fillList(Collection<?> data, Object select) { - List<Item> items = new ArrayList<Item>(); - for (Object o : data) { - boolean selected = o.equals(select); - items.add(new Item(o.toString(), o.toString(), o, selected)); - } - setItems(items); - } - - /** - * Fill a list model with some datas, and select after all the given object - * - * @param data data ot inject in combo - * @param select object to select in list after reflling his model - * @param methodName method to invoke to display data's name - */ - public void fillList(Collection<?> data, Object select, String methodName) { - // prepare method to use - Method m = null; - - List<Item> items = new ArrayList<Item>(); - for (Object o : data) { - boolean selected = o.equals(select); - if (m == null) { - try { - m = o.getClass().getMethod(methodName); - m.setAccessible(true); - } catch (NoSuchMethodException e) { - throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass()); - } - } - try { - items.add(new Item(o.toString(), (String) m.invoke(o), o, selected)); - } catch (SecurityException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } catch (IllegalArgumentException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } - } - setItems(items); - } - - /** - * Fill a list model with some datas, and select after all the given object - * - * @param data data ot inject in combo - * @param selects the objects to select in list after reflling his model - * @param methodName method to invoke to display data's name - */ - public void fillList(Collection<?> data, Collection<?> selects, String methodName) { - // prepare method to use - Method m = null; - - List<Item> items = new ArrayList<Item>(); - for (Object o : data) { - boolean selected = selects.contains(o); - if (m == null) { - try { - m = o.getClass().getMethod(methodName); - m.setAccessible(true); - } catch (NoSuchMethodException e) { - throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass()); - } - } - try { - items.add(new Item(o.toString(), (String) m.invoke(o), o, selected)); - } catch (SecurityException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } catch (IllegalArgumentException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - // shoudl never happen ? - throw new RuntimeException(e); - } - } - setItems(items); - } - -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.AbstractListModel; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JList; +import javax.swing.ListModel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.Component; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class JAXXList extends JList { + + private static final long serialVersionUID = 1L; + + public class JAXXListModel extends AbstractListModel { + + private List<Item> items; + private static final long serialVersionUID = -1598924187490122036L; + + public JAXXListModel(List<Item> items) { + this.items = items; + + PropertyChangeListener listener = new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent e) { + if (e.getPropertyName().equals(Item.SELECTED_PROPERTY)) { + Item item = (Item) e.getSource(); + int itemIndex = JAXXListModel.this.items.indexOf(item); + int[] oldSelection = getSelectedIndices(); + int[] newSelection; + int index = -1; + for (int i = 0; i < oldSelection.length; i++) { + if (oldSelection[i] == itemIndex) { + index = i; + break; + } + } + if (item.isSelected()) { + if (index != -1) // it was already selected + { + return; + } + newSelection = new int[oldSelection.length + 1]; + System.arraycopy(oldSelection, 0, newSelection, 0, oldSelection.length); + newSelection[newSelection.length - 1] = itemIndex; + } else { + if (index == -1) // it already wasn't selected + { + return; + } + newSelection = new int[oldSelection.length - 1]; + System.arraycopy(oldSelection, 0, newSelection, 0, index); + System.arraycopy(oldSelection, index + 1, newSelection, index, oldSelection.length - 1 - index); + } + setSelectedIndices(newSelection); + } else { + for (int i = 0; i < getSize(); i++) { + if (getElementAt(i) == ((Item) e.getSource()).getValue()) { + fireContentsChanged(JAXXListModel.this, i, i); + if (isSelectedIndex(i)) { + fireSelectionValueChanged(i, i, false); + } + return; + } + } + } + } + }; + for (Item item : items) { + item.addPropertyChangeListener(listener); + } + } + + public List<Item> getItems(){ + return items; + } + + @Override + public Object getElementAt(int i) { + return items.get(i).getValue(); + } + + @Override + public int getSize() { + return items.size(); + } + } + + public JAXXList() { + setCellRenderer(new DefaultListCellRenderer() { + + private static final long serialVersionUID = 1L; + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + ListModel model = list.getModel(); + if (model instanceof JAXXListModel) { + Item item = ((JAXXListModel) model).items.get(index); + String label = item.getLabel(); + if (label != null) { + value = label; + } + } + return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + } + }); + + addListSelectionListener(new ListSelectionListener() { + + @Override + public void valueChanged(ListSelectionEvent e) { + ListModel model = getModel(); + if (model instanceof JAXXListModel) { + List<Item> items = ((JAXXListModel) model).items; + for (int i = items.size() - 1; i >= 0; i--) { + boolean selected = isSelectedIndex(i); + Item item = items.get(i); + if (selected != item.isSelected()) { + item.setSelected(selected); + } + } + } + } + }); + } + + // this way we can keep it marked protected and still allow code in this file to call it + @Override + protected void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting) { + super.fireSelectionValueChanged(firstIndex, lastIndex, isAdjusting); + } + + public void setItems(List<Item> items) { + setModel(new JAXXListModel(items)); + List<Integer> selectedIndexList = new ArrayList<Integer>(); + for (int i = 0; i < items.size(); i++) { + if (items.get(i).isSelected()) { + selectedIndexList.add(i); + } + } + int[] selectedIndices = new int[selectedIndexList.size()]; + for (int i = 0; i < selectedIndexList.size(); i++) { + selectedIndices[i] = selectedIndexList.get(i); + } + setSelectedIndices(selectedIndices); + } + + public List<Item> getItems(){ + if (getModel() instanceof JAXXListModel){ + return ((JAXXListModel)getModel()).getItems(); + } + return null; + } + + public void setSelectedValue(Object value) { + super.setSelectedValue(value, true); + } + + /** + * Set the selected Objects + * + * @param values Objects must be selected in the list + */ + public void setSelectedValues(Object[] values) { + if (values != null){ + List<Integer> selectedIndices = new ArrayList<Integer>(); + ListModel model = getModel(); + for (int i = 0; i < model.getSize(); i++) { + Object o = model.getElementAt(i); + for (Object value : values) { + if (o.equals(value)) { + selectedIndices.add(i); + break; + } + } + } + int[] ints = new int[selectedIndices.size()]; + for (int i = 0; i < ints.length; i++) { + ints[i] = selectedIndices.get(i).intValue(); + } + setSelectedIndices(ints); + } + else{ + // No selection if values is null + setSelectedIndex(-1); + } + } + + public void setSelectedItem(Item item) { + super.setSelectedValue(item.getValue(), true); + } + + public void setSelectedItems(List<Item> itemsToSelect) { + if (itemsToSelect != null){ + List<Item> items = getItems(); + int[] indices = new int[itemsToSelect.size()]; + int i = 0; + for (Item item : itemsToSelect){ + indices[i] = items.indexOf(item); + i++; + } + super.setSelectedIndices(indices); + } + } + + public Item getSelectedItem(){ + Object selected = super.getSelectedValue(); + return findItem(selected); + } + + public List<Item> getSelectedItems(){ + Object[] selected = super.getSelectedValues(); + java.util.List<Item> itemsSelected = new ArrayList<Item>(); + for (Object s : selected){ + itemsSelected.add(findItem(s)); + } + return itemsSelected; + } + + public Item findItem(Object value){ + List<Item> items = getItems(); + if (items != null){ + for (Item i : items){ + if (i.getValue().equals(value)){ + return i; + } + } + } + return null; + } + + public void addItem(Item item){ + List<Item> items = getItems(); + if (items != null){ + items.add(item); + setItems(items); + } + } + + public void addAllItems(Collection<Item> itemsToAdd){ + List<Item> items = getItems(); + if (items != null){ + items.addAll(itemsToAdd); + setItems(items); + } + } + + public void removeItem(Item item){ + List<Item> items = getItems(); + if (items != null){ + items.remove(item); + setItems(items); + } + } + + public void removeAllItems(Collection<Item> itemsToRemove){ + List<Item> items = getItems(); + if (items != null){ + items.removeAll(itemsToRemove); + setItems(items); + } + } + + /** + * Fill a list model with some datas, and select after all the given object + * + * @param data data ot inject in combo + * @param selects the objects to select in list after reflling his model + */ + public void fillList(Collection<?> data, Collection<?> selects) { + if (selects == null) { + selects = java.util.Collections.EMPTY_LIST; + } + List<Item> items = new ArrayList<Item>(); + for (Object o : data) { + boolean selected = false; + for (Object select : selects) { + if (selected = o.equals(select)) { + break; + } + } + items.add(new Item(o.toString(), o.toString(), o, selected)); + } + setItems(items); + } + + /** + * Fill a list model with some datas, and select after all the given object + * + * @param data data ot inject in combo + * @param select object to select in list after reflling his model + */ + public void fillList(Collection<?> data, Object select) { + List<Item> items = new ArrayList<Item>(); + for (Object o : data) { + boolean selected = o.equals(select); + items.add(new Item(o.toString(), o.toString(), o, selected)); + } + setItems(items); + } + + /** + * Fill a list model with some datas, and select after all the given object + * + * @param data data ot inject in combo + * @param select object to select in list after reflling his model + * @param methodName method to invoke to display data's name + */ + public void fillList(Collection<?> data, Object select, String methodName) { + // prepare method to use + Method m = null; + + List<Item> items = new ArrayList<Item>(); + for (Object o : data) { + boolean selected = o.equals(select); + if (m == null) { + try { + m = o.getClass().getMethod(methodName); + m.setAccessible(true); + } catch (NoSuchMethodException e) { + throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass()); + } + } + try { + items.add(new Item(o.toString(), (String) m.invoke(o), o, selected)); + } catch (SecurityException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } catch (IllegalArgumentException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } + } + setItems(items); + } + + /** + * Fill a list model with some datas, and select after all the given object + * + * @param data data ot inject in combo + * @param selects the objects to select in list after reflling his model + * @param methodName method to invoke to display data's name + */ + public void fillList(Collection<?> data, Collection<?> selects, String methodName) { + // prepare method to use + Method m = null; + + List<Item> items = new ArrayList<Item>(); + for (Object o : data) { + boolean selected = selects.contains(o); + if (m == null) { + try { + m = o.getClass().getMethod(methodName); + m.setAccessible(true); + } catch (NoSuchMethodException e) { + throw new IllegalArgumentException("could not find method " + methodName + " on " + o.getClass()); + } + } + try { + items.add(new Item(o.toString(), (String) m.invoke(o), o, selected)); + } catch (SecurityException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } catch (IllegalArgumentException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + // shoudl never happen ? + throw new RuntimeException(e); + } + } + setItems(items); + } + +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTab.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,21 +1,23 @@ -/* - * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, - * Tony Chemit +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 CodeLutin * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ##% */ + * 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>. + * ##%* + */ package jaxx.runtime.swing; /** @author chemit */ Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXToggleButton.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing; public class JAXXToggleButton extends javax.swing.JToggleButton { Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/JAXXTree.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.runtime.swing; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/OneClicListSelectionModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing; import org.apache.commons.logging.Log; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Spacer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,12 +1,28 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.JComponent; - -public class Spacer extends JComponent { - - private static final long serialVersionUID = 1L; -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.JComponent; + +public class Spacer extends JComponent { + + private static final long serialVersionUID = 1L; +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,165 +1,181 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.Icon; -import javax.swing.event.SwingPropertyChangeSupport; -import java.awt.Color; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; - -public class TabInfo { - - public static String BACKGROUND_PROPERTY = "background"; - public static String DISABLED_ICON_PROPERTY = "disabledIcon"; - public static String DISPLAYED_MNEMONIC_INDEX_PROPERTY = "displayedMnemonicIndex"; - public static String ENABLED_PROPERTY = "enabled"; - public static String FOREGROUND_PROPERTY = "foreground"; - public static String ICON_PROPERTY = "icon"; - public static String MNEMONIC_PROPERTY = "mnemonic"; - public static String TITLE_PROPERTY = "title"; - public static String TOOL_TIP_TEXT_PROPERTY = "toolTipText"; - private String id; - private Color background; - private Icon disabledIcon; - private int displayedMnemonicIndex = -1; - private boolean enabled = true; - private Color foreground; - private Icon icon; - private int mnemonic = -1; - private String title; - private String toolTipText; - private PropertyChangeSupport propertyChangeSupport; - - public TabInfo() { - } - - public TabInfo(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - public Color getBackground() { - return background; - } - - public void setBackground(Color background) { - Color oldValue = this.background; - this.background = background; - firePropertyChange(BACKGROUND_PROPERTY, oldValue, background); - } - - public Icon getDisabledIcon() { - return disabledIcon; - } - - public void setDisabledIcon(Icon disabledIcon) { - Icon oldValue = this.disabledIcon; - this.disabledIcon = disabledIcon; - firePropertyChange(DISABLED_ICON_PROPERTY, oldValue, disabledIcon); - } - - public int getDisplayedMnemonicIndex() { - return displayedMnemonicIndex; - } - - public void setDisplayedMnemonicIndex(int displayedMnemonicIndex) { - int oldValue = this.displayedMnemonicIndex; - this.displayedMnemonicIndex = displayedMnemonicIndex; - firePropertyChange(DISPLAYED_MNEMONIC_INDEX_PROPERTY, oldValue, displayedMnemonicIndex); - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - boolean oldValue = this.enabled; - this.enabled = enabled; - firePropertyChange(ENABLED_PROPERTY, oldValue, enabled); - } - - public Color getForeground() { - return foreground; - } - - public void setForeground(Color foreground) { - Color oldValue = this.foreground; - this.foreground = foreground; - firePropertyChange(FOREGROUND_PROPERTY, oldValue, foreground); - } - - public Icon getIcon() { - return icon; - } - - public void setIcon(Icon icon) { - Icon oldValue = this.icon; - this.icon = icon; - firePropertyChange(ICON_PROPERTY, oldValue, icon); - } - - public int getMnemonic() { - return mnemonic; - } - - public void setMnemonic(int mnemonic) { - int oldValue = this.mnemonic; - this.mnemonic = mnemonic; - firePropertyChange(MNEMONIC_PROPERTY, oldValue, mnemonic); - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - String oldValue = this.title; - this.title = title; - firePropertyChange(TITLE_PROPERTY, oldValue, title); - } - - public String getToolTipText() { - return toolTipText; - } - - public void setToolTipText(String toolTipText) { - String oldValue = this.toolTipText; - this.toolTipText = toolTipText; - firePropertyChange(TOOL_TIP_TEXT_PROPERTY, oldValue, toolTipText); - } - - private PropertyChangeSupport getPropertyChangeSupport() { - if (propertyChangeSupport == null) { - propertyChangeSupport = new SwingPropertyChangeSupport(this); - } - return propertyChangeSupport; - } - - public void addPropertyChangeListener(PropertyChangeListener listener) { - getPropertyChangeSupport().addPropertyChangeListener(listener); - } - - public void addPropertyChangeListener(String property, PropertyChangeListener listener) { - getPropertyChangeSupport().addPropertyChangeListener(property, listener); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - getPropertyChangeSupport().removePropertyChangeListener(listener); - } - - public void removePropertyChangeListener(String property, PropertyChangeListener listener) { - getPropertyChangeSupport().removePropertyChangeListener(property, listener); - } - - protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { - if (propertyChangeSupport != null) { - getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue); - } - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.Icon; +import javax.swing.event.SwingPropertyChangeSupport; +import java.awt.Color; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; + +public class TabInfo { + + public static String BACKGROUND_PROPERTY = "background"; + public static String DISABLED_ICON_PROPERTY = "disabledIcon"; + public static String DISPLAYED_MNEMONIC_INDEX_PROPERTY = "displayedMnemonicIndex"; + public static String ENABLED_PROPERTY = "enabled"; + public static String FOREGROUND_PROPERTY = "foreground"; + public static String ICON_PROPERTY = "icon"; + public static String MNEMONIC_PROPERTY = "mnemonic"; + public static String TITLE_PROPERTY = "title"; + public static String TOOL_TIP_TEXT_PROPERTY = "toolTipText"; + private String id; + private Color background; + private Icon disabledIcon; + private int displayedMnemonicIndex = -1; + private boolean enabled = true; + private Color foreground; + private Icon icon; + private int mnemonic = -1; + private String title; + private String toolTipText; + private PropertyChangeSupport propertyChangeSupport; + + public TabInfo() { + } + + public TabInfo(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public Color getBackground() { + return background; + } + + public void setBackground(Color background) { + Color oldValue = this.background; + this.background = background; + firePropertyChange(BACKGROUND_PROPERTY, oldValue, background); + } + + public Icon getDisabledIcon() { + return disabledIcon; + } + + public void setDisabledIcon(Icon disabledIcon) { + Icon oldValue = this.disabledIcon; + this.disabledIcon = disabledIcon; + firePropertyChange(DISABLED_ICON_PROPERTY, oldValue, disabledIcon); + } + + public int getDisplayedMnemonicIndex() { + return displayedMnemonicIndex; + } + + public void setDisplayedMnemonicIndex(int displayedMnemonicIndex) { + int oldValue = this.displayedMnemonicIndex; + this.displayedMnemonicIndex = displayedMnemonicIndex; + firePropertyChange(DISPLAYED_MNEMONIC_INDEX_PROPERTY, oldValue, displayedMnemonicIndex); + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + boolean oldValue = this.enabled; + this.enabled = enabled; + firePropertyChange(ENABLED_PROPERTY, oldValue, enabled); + } + + public Color getForeground() { + return foreground; + } + + public void setForeground(Color foreground) { + Color oldValue = this.foreground; + this.foreground = foreground; + firePropertyChange(FOREGROUND_PROPERTY, oldValue, foreground); + } + + public Icon getIcon() { + return icon; + } + + public void setIcon(Icon icon) { + Icon oldValue = this.icon; + this.icon = icon; + firePropertyChange(ICON_PROPERTY, oldValue, icon); + } + + public int getMnemonic() { + return mnemonic; + } + + public void setMnemonic(int mnemonic) { + int oldValue = this.mnemonic; + this.mnemonic = mnemonic; + firePropertyChange(MNEMONIC_PROPERTY, oldValue, mnemonic); + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + String oldValue = this.title; + this.title = title; + firePropertyChange(TITLE_PROPERTY, oldValue, title); + } + + public String getToolTipText() { + return toolTipText; + } + + public void setToolTipText(String toolTipText) { + String oldValue = this.toolTipText; + this.toolTipText = toolTipText; + firePropertyChange(TOOL_TIP_TEXT_PROPERTY, oldValue, toolTipText); + } + + private PropertyChangeSupport getPropertyChangeSupport() { + if (propertyChangeSupport == null) { + propertyChangeSupport = new SwingPropertyChangeSupport(this); + } + return propertyChangeSupport; + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + getPropertyChangeSupport().addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String property, PropertyChangeListener listener) { + getPropertyChangeSupport().addPropertyChangeListener(property, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + getPropertyChangeSupport().removePropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String property, PropertyChangeListener listener) { + getPropertyChangeSupport().removePropertyChangeListener(property, listener); + } + + protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { + if (propertyChangeSupport != null) { + getPropertyChangeSupport().firePropertyChange(propertyName, oldValue, newValue); + } + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/TabInfoPropertyChangeListener.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,44 +1,60 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.Icon; -import javax.swing.JTabbedPane; -import java.awt.Color; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - -public class TabInfoPropertyChangeListener implements PropertyChangeListener { - - private JTabbedPane tabs; - private int tabIndex; - - public TabInfoPropertyChangeListener(JTabbedPane tabs, int tabIndex) { - this.tabs = tabs; - this.tabIndex = tabIndex; - } - - @Override - public void propertyChange(PropertyChangeEvent e) { - String name = e.getPropertyName(); - if (name.equals(TabInfo.TITLE_PROPERTY)) { - tabs.setTitleAt(tabIndex, (String) e.getNewValue()); - } else if (name.equals(TabInfo.TOOL_TIP_TEXT_PROPERTY)) { - tabs.setToolTipTextAt(tabIndex, (String) e.getNewValue()); - } else if (name.equals(TabInfo.FOREGROUND_PROPERTY)) { - tabs.setForegroundAt(tabIndex, (Color) e.getNewValue()); - } else if (name.equals(TabInfo.BACKGROUND_PROPERTY)) { - tabs.setBackgroundAt(tabIndex, (Color) e.getNewValue()); - } else if (name.equals(TabInfo.MNEMONIC_PROPERTY)) { - tabs.setMnemonicAt(tabIndex, (Integer) e.getNewValue()); - } else if (name.equals(TabInfo.DISPLAYED_MNEMONIC_INDEX_PROPERTY)) { - tabs.setDisplayedMnemonicIndexAt(tabIndex, (Integer) e.getNewValue()); - } else if (name.equals(TabInfo.ICON_PROPERTY)) { - tabs.setIconAt(tabIndex, (Icon) e.getNewValue()); - } else if (name.equals(TabInfo.DISABLED_ICON_PROPERTY)) { - tabs.setDisabledIconAt(tabIndex, (Icon) e.getNewValue()); - } - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.Icon; +import javax.swing.JTabbedPane; +import java.awt.Color; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +public class TabInfoPropertyChangeListener implements PropertyChangeListener { + + private JTabbedPane tabs; + private int tabIndex; + + public TabInfoPropertyChangeListener(JTabbedPane tabs, int tabIndex) { + this.tabs = tabs; + this.tabIndex = tabIndex; + } + + @Override + public void propertyChange(PropertyChangeEvent e) { + String name = e.getPropertyName(); + if (name.equals(TabInfo.TITLE_PROPERTY)) { + tabs.setTitleAt(tabIndex, (String) e.getNewValue()); + } else if (name.equals(TabInfo.TOOL_TIP_TEXT_PROPERTY)) { + tabs.setToolTipTextAt(tabIndex, (String) e.getNewValue()); + } else if (name.equals(TabInfo.FOREGROUND_PROPERTY)) { + tabs.setForegroundAt(tabIndex, (Color) e.getNewValue()); + } else if (name.equals(TabInfo.BACKGROUND_PROPERTY)) { + tabs.setBackgroundAt(tabIndex, (Color) e.getNewValue()); + } else if (name.equals(TabInfo.MNEMONIC_PROPERTY)) { + tabs.setMnemonicAt(tabIndex, (Integer) e.getNewValue()); + } else if (name.equals(TabInfo.DISPLAYED_MNEMONIC_INDEX_PROPERTY)) { + tabs.setDisplayedMnemonicIndexAt(tabIndex, (Integer) e.getNewValue()); + } else if (name.equals(TabInfo.ICON_PROPERTY)) { + tabs.setIconAt(tabIndex, (Icon) e.getNewValue()); + } else if (name.equals(TabInfo.DISABLED_ICON_PROPERTY)) { + tabs.setDisabledIconAt(tabIndex, (Icon) e.getNewValue()); + } + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/Table.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,58 +1,74 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.JPanel; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.LayoutManager; - -/** - * Panel which uses a {@link GridBagLayout} by default. - * - * @author Ethan Nicholas - */ -public class Table extends JPanel { - - private static final long serialVersionUID = 1L; - public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3); - private GridBagConstraints tableConstraints = new GridBagConstraints(); - private GridBagConstraints rowConstraints = null; - private GridBagConstraints cellConstraints = null; - - public Table() { - super.setLayout(new GridBagLayout()); - - tableConstraints.insets = DEFAULT_INSETS; - } - - @Override - public void setLayout(LayoutManager layout) { - // do nothing - } - - public GridBagConstraints getTableConstraints() { - return tableConstraints; - } - - public GridBagConstraints getRowConstraints() { - return rowConstraints; - } - - public GridBagConstraints getCellConstraints() { - return cellConstraints; - } - - public void newRow() { - tableConstraints.gridy++; - rowConstraints = (GridBagConstraints) tableConstraints.clone(); - } - - public void newCell() { - rowConstraints.gridx++; - cellConstraints = (GridBagConstraints) rowConstraints.clone(); - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.JPanel; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.LayoutManager; + +/** + * Panel which uses a {@link GridBagLayout} by default. + * + * @author Ethan Nicholas + */ +public class Table extends JPanel { + + private static final long serialVersionUID = 1L; + public static final Insets DEFAULT_INSETS = new Insets(3, 3, 3, 3); + private GridBagConstraints tableConstraints = new GridBagConstraints(); + private GridBagConstraints rowConstraints = null; + private GridBagConstraints cellConstraints = null; + + public Table() { + super.setLayout(new GridBagLayout()); + + tableConstraints.insets = DEFAULT_INSETS; + } + + @Override + public void setLayout(LayoutManager layout) { + // do nothing + } + + public GridBagConstraints getTableConstraints() { + return tableConstraints; + } + + public GridBagConstraints getRowConstraints() { + return rowConstraints; + } + + public GridBagConstraints getCellConstraints() { + return cellConstraints; + } + + public void newRow() { + tableConstraints.gridy++; + rowConstraints = (GridBagConstraints) tableConstraints.clone(); + } + + public void newCell() { + rowConstraints.gridx++; + cellConstraints = (GridBagConstraints) rowConstraints.clone(); + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBox.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,94 +1,110 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.JPanel; -import java.awt.Insets; - -/** - * Panel which uses a {@link VBoxLayout} by default. - * - * @author Ethan Nicholas - */ -public class VBox extends JPanel { - - private static final long serialVersionUID = 1L; - public static final String SPACING_PROPERTY = "spacing"; - public static final String MARGIN_PROPERTY = "margin"; - public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment"; - public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment"; - private Insets margin; - - public VBox() { - super(new VBoxLayout()); - } - - /** - * Returns the spacing between components, in pixels. Spacing is applied between components only, - * not to the top or bottom of the container. - * - * @return spacing between components - */ - public int getSpacing() { - return ((VBoxLayout) getLayout()).getSpacing(); - } - - /** - * Sets the spacing between components. Spacing is applied between components only, - * not to the top or bottom of the container. - * - * @param spacing new spacing value - */ - public void setSpacing(int spacing) { - int oldValue = getSpacing(); - ((VBoxLayout) getLayout()).setSpacing(spacing); - firePropertyChange(SPACING_PROPERTY, oldValue, spacing); - revalidate(); - } - - public int getHorizontalAlignment() { - return ((VBoxLayout) getLayout()).getHorizontalAlignment(); - } - - public void setHorizontalAlignment(int horizontalAlignment) { - int oldValue = getHorizontalAlignment(); - ((VBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment); - firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment); - revalidate(); - } - - public int getVerticalAlignment() { - return ((VBoxLayout) getLayout()).getVerticalAlignment(); - } - - public void setVerticalAlignment(int verticalAlignment) { - int oldValue = getVerticalAlignment(); - ((VBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment); - firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment); - revalidate(); - } - - public Insets getMargin() { - return margin; - } - - public void setMargin(Insets margin) { - Insets oldValue = this.margin; - this.margin = (Insets) margin.clone(); - firePropertyChange(MARGIN_PROPERTY, oldValue, margin); - } - - @Override - public Insets getInsets() { - Insets result = super.getInsets(); - if (margin != null) { - result.top += margin.top; - result.left += margin.left; - result.right += margin.right; - result.bottom += margin.bottom; - } - return result; - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.JPanel; +import java.awt.Insets; + +/** + * Panel which uses a {@link VBoxLayout} by default. + * + * @author Ethan Nicholas + */ +public class VBox extends JPanel { + + private static final long serialVersionUID = 1L; + public static final String SPACING_PROPERTY = "spacing"; + public static final String MARGIN_PROPERTY = "margin"; + public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment"; + public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment"; + private Insets margin; + + public VBox() { + super(new VBoxLayout()); + } + + /** + * Returns the spacing between components, in pixels. Spacing is applied between components only, + * not to the top or bottom of the container. + * + * @return spacing between components + */ + public int getSpacing() { + return ((VBoxLayout) getLayout()).getSpacing(); + } + + /** + * Sets the spacing between components. Spacing is applied between components only, + * not to the top or bottom of the container. + * + * @param spacing new spacing value + */ + public void setSpacing(int spacing) { + int oldValue = getSpacing(); + ((VBoxLayout) getLayout()).setSpacing(spacing); + firePropertyChange(SPACING_PROPERTY, oldValue, spacing); + revalidate(); + } + + public int getHorizontalAlignment() { + return ((VBoxLayout) getLayout()).getHorizontalAlignment(); + } + + public void setHorizontalAlignment(int horizontalAlignment) { + int oldValue = getHorizontalAlignment(); + ((VBoxLayout) getLayout()).setHorizontalAlignment(horizontalAlignment); + firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue, horizontalAlignment); + revalidate(); + } + + public int getVerticalAlignment() { + return ((VBoxLayout) getLayout()).getVerticalAlignment(); + } + + public void setVerticalAlignment(int verticalAlignment) { + int oldValue = getVerticalAlignment(); + ((VBoxLayout) getLayout()).setVerticalAlignment(verticalAlignment); + firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue, verticalAlignment); + revalidate(); + } + + public Insets getMargin() { + return margin; + } + + public void setMargin(Insets margin) { + Insets oldValue = this.margin; + this.margin = (Insets) margin.clone(); + firePropertyChange(MARGIN_PROPERTY, oldValue, margin); + } + + @Override + public Insets getInsets() { + Insets result = super.getInsets(); + if (margin != null) { + result.top += margin.top; + result.left += margin.left; + result.right += margin.right; + result.bottom += margin.bottom; + } + return result; + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxBeanInfo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.runtime.swing; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/VBoxLayout.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,127 +1,143 @@ -/* - * Copyright 2006 Ethan Nicholas. All rights reserved. - * Use is subject to license terms. - */ -package jaxx.runtime.swing; - -import javax.swing.SwingConstants; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.LayoutManager; - -/** - * Vertical box layout. The layout rules followed by this class are quite different than the core BoxLayout class, - * and in general represent a more useful algorithm. - * - * @author Ethan Nicholas - */ -public class VBoxLayout implements LayoutManager { - - private int spacing = 6; - private int horizontalAlignment = SwingConstants.LEFT; - private int verticalAlignment = SwingConstants.TOP; - - public int getSpacing() { - return spacing; - } - - public void setSpacing(int spacing) { - this.spacing = spacing; - } - - public int getHorizontalAlignment() { - return horizontalAlignment; - } - - public void setHorizontalAlignment(int horizontalAlignment) { - this.horizontalAlignment = horizontalAlignment; - } - - public int getVerticalAlignment() { - return verticalAlignment; - } - - public void setVerticalAlignment(int verticalAlignment) { - this.verticalAlignment = verticalAlignment; - } - - @Override - public void addLayoutComponent(String name, Component comp) { - } - - @Override - public void layoutContainer(Container parent) { - Insets insets = parent.getInsets(); - int parentWidth = parent.getSize().width - insets.left - insets.right; - int count = parent.getComponentCount(); - Dimension preferredSize = parent.getPreferredSize(); - int y; - switch (verticalAlignment) { - case SwingConstants.TOP: - y = insets.top; - break; - case SwingConstants.CENTER: - y = insets.top + (parent.getHeight() - preferredSize.height) / 2; - break; - case SwingConstants.BOTTOM: - y = insets.top + (parent.getHeight() - preferredSize.height); - break; - default: - throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment); - } - - for (int i = 0; i < count; i++) { - Component component = parent.getComponent(i); - Dimension childPreferredSize = component.getPreferredSize(); - int width = Math.min(childPreferredSize.width, parentWidth); - int x; - switch (horizontalAlignment) { - case SwingConstants.LEFT: - x = insets.left; - break; - case SwingConstants.CENTER: - x = insets.left + (parentWidth - childPreferredSize.width) / 2; - break; - case SwingConstants.RIGHT: - x = insets.left + (parentWidth - childPreferredSize.width); - break; - default: - throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment); - } - component.setBounds(x, y, width, childPreferredSize.height); - y += childPreferredSize.height + spacing; - } - } - - @Override - public Dimension minimumLayoutSize(Container parent) { - int width = 0; - int height = (parent.getComponentCount() - 1) * spacing; - for (int i = parent.getComponentCount() - 1; i >= 0; i--) { - Dimension minimumSize = parent.getComponent(i).getMinimumSize(); - width = Math.max(width, minimumSize.width); - height += minimumSize.height; - } - Insets insets = parent.getInsets(); - return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); - } - - @Override - public Dimension preferredLayoutSize(Container parent) { - int width = 0; - int height = (parent.getComponentCount() - 1) * spacing; - for (int i = parent.getComponentCount() - 1; i >= 0; i--) { - Dimension preferredSize = parent.getComponent(i).getPreferredSize(); - width = Math.max(width, preferredSize.width); - height += preferredSize.height; - } - Insets insets = parent.getInsets(); - return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); - } - - @Override - public void removeLayoutComponent(Component comp) { - } -} +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ +package jaxx.runtime.swing; + +import javax.swing.SwingConstants; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.LayoutManager; + +/** + * Vertical box layout. The layout rules followed by this class are quite different than the core BoxLayout class, + * and in general represent a more useful algorithm. + * + * @author Ethan Nicholas + */ +public class VBoxLayout implements LayoutManager { + + private int spacing = 6; + private int horizontalAlignment = SwingConstants.LEFT; + private int verticalAlignment = SwingConstants.TOP; + + public int getSpacing() { + return spacing; + } + + public void setSpacing(int spacing) { + this.spacing = spacing; + } + + public int getHorizontalAlignment() { + return horizontalAlignment; + } + + public void setHorizontalAlignment(int horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + } + + public int getVerticalAlignment() { + return verticalAlignment; + } + + public void setVerticalAlignment(int verticalAlignment) { + this.verticalAlignment = verticalAlignment; + } + + @Override + public void addLayoutComponent(String name, Component comp) { + } + + @Override + public void layoutContainer(Container parent) { + Insets insets = parent.getInsets(); + int parentWidth = parent.getSize().width - insets.left - insets.right; + int count = parent.getComponentCount(); + Dimension preferredSize = parent.getPreferredSize(); + int y; + switch (verticalAlignment) { + case SwingConstants.TOP: + y = insets.top; + break; + case SwingConstants.CENTER: + y = insets.top + (parent.getHeight() - preferredSize.height) / 2; + break; + case SwingConstants.BOTTOM: + y = insets.top + (parent.getHeight() - preferredSize.height); + break; + default: + throw new IllegalArgumentException("invalid vertical alignment: " + verticalAlignment); + } + + for (int i = 0; i < count; i++) { + Component component = parent.getComponent(i); + Dimension childPreferredSize = component.getPreferredSize(); + int width = Math.min(childPreferredSize.width, parentWidth); + int x; + switch (horizontalAlignment) { + case SwingConstants.LEFT: + x = insets.left; + break; + case SwingConstants.CENTER: + x = insets.left + (parentWidth - childPreferredSize.width) / 2; + break; + case SwingConstants.RIGHT: + x = insets.left + (parentWidth - childPreferredSize.width); + break; + default: + throw new IllegalArgumentException("invalid horizontal alignment: " + horizontalAlignment); + } + component.setBounds(x, y, width, childPreferredSize.height); + y += childPreferredSize.height + spacing; + } + } + + @Override + public Dimension minimumLayoutSize(Container parent) { + int width = 0; + int height = (parent.getComponentCount() - 1) * spacing; + for (int i = parent.getComponentCount() - 1; i >= 0; i--) { + Dimension minimumSize = parent.getComponent(i).getMinimumSize(); + width = Math.max(width, minimumSize.width); + height += minimumSize.height; + } + Insets insets = parent.getInsets(); + return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); + } + + @Override + public Dimension preferredLayoutSize(Container parent) { + int width = 0; + int height = (parent.getComponentCount() - 1) * spacing; + for (int i = parent.getComponentCount() - 1; i >= 0; i--) { + Dimension preferredSize = parent.getComponent(i).getPreferredSize(); + width = Math.max(width, preferredSize.width); + height += preferredSize.height; + } + Insets insets = parent.getInsets(); + return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom); + } + + @Override + public void removeLayoutComponent(Component comp) { + } +} Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/ClassCellEditor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,7 @@ /* -* *##% ui - * Copyright (C) 2008 CodeLutin +* *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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 @@ -14,7 +15,8 @@ * * 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>. ##%* */ + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor; import org.apache.commons.beanutils.Converter; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/EnumEditor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,7 @@ /* - * *##% Lutin utilities library - * Copyright (C) 2004 - 2008 CodeLutin + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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 @@ -14,7 +15,8 @@ * * 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>. ##%* */ + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor; import javax.swing.JComboBox; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/LocaleEditor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,7 @@ /* -* *##% Lutin utilities library - * Copyright (C) 2004 - 2008 CodeLutin +* *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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 @@ -14,7 +15,8 @@ * * 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>. ##%* */ + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor; import javax.swing.JComboBox; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/editor/MyDefaultCellEditor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.editor; import javax.swing.DefaultCellEditor; @@ -8,7 +28,6 @@ import javax.swing.JTextField; import javax.swing.table.TableCellEditor; import java.awt.Component; -import jaxx.runtime.swing.editor.EnumEditor; /** * @author chemit Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpBroker.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.help; import java.applet.Applet; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.help; import java.awt.Component; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/help/JAXXHelpUIHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.help; import jaxx.runtime.JAXXContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationCardPanel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import java.awt.CardLayout; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemNavigationPanel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,6 +1,22 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* */ package jaxx.runtime.swing.navigation; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/ItemTreeNavigationAdapter.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import javax.swing.event.TreeSelectionEvent; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationContentUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeContextHelper.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import javax.swing.JTree; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import java.awt.Component; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHandlerWithCardLayout.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import jaxx.runtime.JAXXContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeHelper.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import java.lang.reflect.InvocationTargetException; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import jaxx.runtime.JAXXContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModelBuilder.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import java.util.Enumeration; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNode.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import java.util.Enumeration; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import javax.swing.tree.TreeCellRenderer; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererDecoratorImpl.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import jaxx.runtime.decorator.Decorator; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeNodeRendererI18nImpl.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import static org.nuiton.i18n.I18n._; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/BooleanCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.renderer; import javax.swing.Icon; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EmptyNumberTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.renderer; import javax.swing.JTable; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/EnumTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.renderer; import javax.swing.JTable; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.renderer; import static org.nuiton.i18n.I18n._; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/LocaleListCellRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.renderer; import java.awt.Component; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import java.beans.PropertyChangeListener; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import javax.swing.SwingWorker; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationActionThread.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import java.beans.PropertyChangeEvent; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import java.util.Arrays; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationState.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardOperationStep.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStep.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import java.io.Serializable; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardStepUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import javax.swing.JTabbedPane; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUILancher.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import java.awt.Window; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.wizard; import java.awt.Component; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import java.beans.EventSetDescriptor; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorDetector.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorEvent.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorField.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import static org.nuiton.i18n.I18n._; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorListener.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorMessage.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorScope.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import static org.nuiton.i18n.I18n.n_; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/BeanValidatorUtil.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import jaxx.runtime.*; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/XWorkBeanValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import com.opensymphony.xwork2.ActionContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.util.ValueStack; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.validator.ValidationException; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.validator.ValidationException; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/ExistingFileFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.validator.ValidationException; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.util.ValueStack; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.validator.ValidationException; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/NotExistingFileFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.validator.ValidationException; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/field/RequiredFileFieldValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import com.opensymphony.xwork2.validator.ValidationException; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidator.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import jaxx.runtime.validator.swing.ui.AbstractBeanValidatorUI; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessage.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import javax.swing.JComponent; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import jaxx.runtime.validator.BeanValidatorEvent; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListMouseListener.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import org.apache.commons.logging.Log; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import javax.swing.ImageIcon; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import jaxx.runtime.validator.BeanValidatorEvent; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableMouseListener.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import org.apache.commons.logging.Log; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import javax.swing.ImageIcon; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,7 +1,26 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing; import jaxx.runtime.*; -import jaxx.runtime.validator.BeanValidatorUtil; import jaxx.runtime.validator.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -13,10 +32,6 @@ import javax.swing.JComponent; import javax.swing.RowSorter; import javax.swing.SortOrder; -import jaxx.runtime.validator.swing.SwingValidatorMessageTableMouseListener; -import jaxx.runtime.validator.swing.SwingValidatorMessageListMouseListener; -import jaxx.runtime.validator.swing.SwingValidatorMessage; -import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer; import static org.nuiton.i18n.I18n.n_; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/AbstractBeanValidatorUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing.ui; import jaxx.runtime.validator.BeanValidatorEvent; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/IconValidationUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing.ui; import org.jdesktop.jxlayer.JXLayer; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/ImageValidationUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing.ui; import org.jdesktop.jxlayer.JXLayer; Modified: branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/main/java/jaxx/runtime/validator/swing/ui/TranslucentValidationUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.swing.ui; import jaxx.runtime.validator.BeanValidatorScope; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/UtilTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime; import org.junit.Assert; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultApplicationContextTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.context; import jaxx.runtime.context.DefaultApplicationContext.AutoLoad; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/context/DefaultJAXXContextTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.context; import jaxx.runtime.JAXXContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/Data.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; import java.util.ArrayList; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/JXPathDecoratorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; import jaxx.runtime.decorator.JXPathDecorator.Context; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/decorator/MultiJXPathDecoratorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.decorator; import org.junit.After; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/swing/navigation/NavigationTreeModelTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.swing.navigation; import jaxx.runtime.context.DefaultJAXXContext; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/AbstractBeanValidatorDetectorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorDetectorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/BeanValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import java.util.List; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/SimpleBean.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import java.beans.PropertyChangeListener; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/XWorkBeanValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator; import java.util.List; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/AbstractValidatorBeanFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; /** Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionFieldExpressionValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import jaxx.runtime.validator.field.ValidatorBean.ValidatorBeanEntry; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/CollectionUniqueKeyValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import jaxx.runtime.validator.field.ValidatorBean.ValidatorBeanEntry; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingDirectoryFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ExistingFileFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionBean.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.beans.PropertyChangeListener; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/FieldExpressionWithParamsValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; /** @author chemit */ Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingDirectoryFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/NotExistingFileFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/RequiredFileFieldValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.io.File; Modified: branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java =================================================================== --- branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-runtime/src/test/java/jaxx/runtime/validator/field/ValidatorBean.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Runtime + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package jaxx.runtime.validator.field; import java.beans.PropertyChangeListener; Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/AbstractActionConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionAnnotationProcessing.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfig.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit, Gabriel Landais Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactory.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionFactoryFromProvider.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * ##% Copyright (C) 2007, 2008 Code Lutin, Tony Chemit * Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionNameProvider.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProvider.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderAnnotation.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ActionProviderFromProperties.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/MyAbstractAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfig.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit, Gabriel Landais Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/SelectActionConfigConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfig.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit, Gabriel Landais Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/action/ToggleActionConfigConfigurationResolver.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabContentConfig.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit, Gabriel Landais Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabFactory.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/tab/TabModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/AbstractUIAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIDef.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/DialogUIModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FactoryWindowListener.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/FormElement.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/ShowUIAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIFactory.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIHelper.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /* * ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/UIProvider.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/CancelAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUI.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/DialogConfigUIModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/ResetAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java =================================================================== --- branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-swing-action/src/main/java/org/nuiton/jaxx/util/config/SaveAction.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Action + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ /** * ##% Copyright (C) 2008 Code Lutin, Tony Chemit * This program is free software; you Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/EntityComboBoxHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/StatusMessagePanelHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/NumberEditorHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor; @@ -465,4 +467,4 @@ } return acceptNull; } -} \ No newline at end of file +} Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/TimeEditorHandler.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor; @@ -219,4 +221,4 @@ } return mutator; } -} \ No newline at end of file +} Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableEditor.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /* -* *##% jaxx-runtime-swing-widget +* *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* */ + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor.config; import jaxx.runtime.swing.editor.config.model.ConfigTableModel; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigTableRenderer.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /* - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* */ + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor.config; import static org.nuiton.i18n.I18n._; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/ConfigUIBuilder.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor.config; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/CategoryModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor.config.model; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigTableModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor.config.model; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/ConfigUIModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor.config.model; Modified: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/config/model/OptionModel.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,5 +1,6 @@ /** - * *##% jaxx-runtime-swing-widget + * *##% + * JAXX Widgets * Copyright (C) 2008 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify @@ -14,7 +15,8 @@ * * 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>. ##%* + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* */ package jaxx.runtime.swing.editor.config.model; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,21 +1,21 @@ -/* *##% - * Copyright (C) 2007 - * JaxxPlugin, Code Lutin +/* *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 CodeLutin * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ + * 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>. + * ##%*/ package org.nuiton.jaxx.plugin; import org.apache.maven.project.MavenProject; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,21 +1,21 @@ -/* *##% - * Copyright (C) 2007 - * JaxxPlugin, Code Lutin +/* *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 CodeLutin * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ + * 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>. + * ##%*/ package org.nuiton.jaxx.plugin; import com.sun.java.help.search.Indexer; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,21 +1,21 @@ -/* *##% - * Copyright (C) 2007 - * JaxxPlugin, Code Lutin +/* *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 CodeLutin * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ + * 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>. + * ##%*/ package org.nuiton.jaxx.plugin; import java.util.List; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import java.util.ArrayList; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/XmlHelper.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import java.io.File; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1722Test.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import org.junit.Test; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1750Test.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import jaxx.runtime.Base64Coder; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import org.junit.Test; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import jaxx.runtime.context.DefaultJAXXContext; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import org.apache.maven.plugin.MojoExecutionException; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/DecoratorTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import org.junit.Test; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Evolution74Test.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import org.apache.maven.plugin.MojoExecutionException; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import org.junit.Test; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/JaxxBaseTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import jaxx.runtime.context.DefaultJAXXContext; Modified: branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java =================================================================== --- branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java 2009-10-26 19:11:57 UTC (rev 1601) +++ branches/jaxx-2.X/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/NodeItemTest.java 2009-10-26 19:13:36 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * *##% + * JAXX Maven plugin + * Copyright (C) 2008 - 2009 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>. + * ##%* + */ package org.nuiton.jaxx.plugin; import org.junit.Assert;