Examples of ItsNatHTMLInputTextFormatted


Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

        return "formattedTextField";
    }

    public ItsNatHTMLInputTextFormatted createItsNatHTMLInputTextFormatted(HTMLInputElement element,NameValue[] artifacts,boolean execCreateFilters,ItsNatStfulDocComponentManagerImpl compMgr)
    {
        ItsNatHTMLInputTextFormatted comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatHTMLInputTextFormatted)processBeforeCreateItsNatComponentListener(element,getCompType(),null,artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatHTMLInputTextFormattedImpl(element,artifacts,compMgr);
        if (doFilters) comp = (ItsNatHTMLInputTextFormatted)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

            for(int i=0; i < 5; i++) model.addElement(new Integer(i));
            shared(2,comp,comboBox);

            comp = (ItsNatHTMLLabel)compMgr.createItsNatComponentById("labelId4");
            comp.setValue(new Date());
            ItsNatHTMLInputTextFormatted textInputFormatted = compMgr.createItsNatHTMLInputTextFormatted(null,null);
            shared(3,comp,textInputFormatted);

            comp = (ItsNatHTMLLabel)compMgr.createItsNatComponentById("labelId5");
            comp.setValue("Any \n Text");
            ItsNatHTMLTextArea textArea = compMgr.createItsNatHTMLTextArea(null,null);
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

        check(inputHidden);

        ItsNatHTMLInputFile inputFile = (ItsNatHTMLInputFile)compMgr.findItsNatComponentById("inputFileId");
        check(inputFile);

        ItsNatHTMLInputTextFormatted inputTextFormat = (ItsNatHTMLInputTextFormatted)compMgr.findItsNatComponentById("inputTextFormattedId");
        check(inputTextFormat);
        try{ inputTextFormat.setValue("Input Text Formatted"); }catch(Exception ex) { }

        // Text Area
        ItsNatHTMLTextArea textArea = (ItsNatHTMLTextArea)compMgr.findItsNatComponentById("textAreaId");
        check(textArea);
        textArea.setText("Text Area");
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

    public void initInputText() throws PropertyVetoException
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("textFormattedWithFactoryFieldId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputTextFormatted inputComp = (ItsNatHTMLInputTextFormatted)componentMgr.findItsNatComponent(inputElem);

        ItsNatFormatterFactoryDefault factory = (ItsNatFormatterFactoryDefault)inputComp.createDefaultItsNatFormatterFactory();

        ItsNatFormatter dispFormatter = inputComp.createItsNatFormatter(DateFormat.getDateInstance(DateFormat.LONG ,Locale.US));
        factory.setDisplayFormatter(dispFormatter);
        ItsNatFormatter editFormatter = inputComp.createItsNatFormatter(DateFormat.getDateInstance(DateFormat.SHORT,Locale.US));
        factory.setEditFormatter(editFormatter);

        inputComp.setItsNatFormatterFactory(factory);

        try{ inputComp.setValue(new Date()); } catch(PropertyVetoException ex) { throw new RuntimeException(ex); }

        inputComp.addPropertyChangeListener("value",this);

        inputComp.addVetoableChangeListener(this);

        inputComp.addEventListener("change",this);

        PlainDocument dataModel = (PlainDocument)inputComp.getDocument();
        dataModel.addDocumentListener(this);
    }
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

            for(int i=0; i < 5; i++) model.addElement(new Integer(i));
            shared(2,comp,comboBox);

            comp = (ItsNatFreeLabel)compMgr.createItsNatComponentById("labelId4","freeLabel",null);
            comp.setValue(new Date());
            ItsNatHTMLInputTextFormatted textInputFormatted = compMgr.createItsNatHTMLInputTextFormatted(null,null);
            shared(3,comp,textInputFormatted);

            comp = (ItsNatFreeLabel)compMgr.createItsNatComponentById("labelId5","freeLabel",null);
            comp.setValue("Any \n Text");
            ItsNatHTMLTextArea textArea = compMgr.createItsNatHTMLTextArea(null,null);
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

    public void label5(String id) throws PropertyVetoException
    {
        ItsNatLabel label = getItsNatLabel(id);
        label.setValue(new Date());
        ItsNatHTMLInputTextFormatted textInputFormatted = getComponentMgr().createItsNatHTMLInputTextFormatted(null,null);
        labelShared(5,label,textInputFormatted);
    }
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

    public void label6(String id) throws PropertyVetoException
    {
        ItsNatLabel label = getItsNatLabel(id);
        label.setValue(new Float(5.4));
        ItsNatHTMLInputTextFormatted textInputFormatted = getComponentMgr().createItsNatHTMLInputTextFormatted(null,null);
        labelShared(6,label,textInputFormatted);
    }
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

    public void initInputText() throws PropertyVetoException
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("textFormattedFieldId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputTextFormatted input = (ItsNatHTMLInputTextFormatted)componentMgr.findItsNatComponent(inputElem);

        PlainDocument dataModel = new PlainDocument();
        input.setDocument(dataModel);

        input.setValue(new Date());

        input.addEventListener("change",this);

        input.addPropertyChangeListener("value",this);

        dataModel.addDocumentListener(this);
    }
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

    public static void TEXT_BASED_COMPONENTS_FORMATTED()
    {
        ItsNatDocument itsNatDoc = null;
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();

        ItsNatHTMLInputTextFormatted inputComp = (ItsNatHTMLInputTextFormatted)componentMgr.createItsNatComponentById("inputId","formattedTextField",null);
        try{ inputComp.setValue(new Date()); } catch(PropertyVetoException ex) { throw new RuntimeException(ex); }

        PropertyChangeListener propListener = new PropertyChangeListener()
        {
            public void propertyChange(PropertyChangeEvent evt)
            {
                Date value = (Date)evt.getNewValue();
                System.out.println("Value changed to: " + value);
            }
        };
        inputComp.addPropertyChangeListener("value",propListener);

        VetoableChangeListener vetoListener = new VetoableChangeListener()
        {
            public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException
            {
                Date newDate = (Date)evt.getNewValue();
                if (newDate.compareTo(new Date()) > 0)
                    throw new PropertyVetoException("Future date is not allowed",evt);
            }
        };
        inputComp.addVetoableChangeListener(vetoListener);
    }
View Full Code Here

Examples of org.itsnat.comp.text.ItsNatHTMLInputTextFormatted

        inputComp.addVetoableChangeListener(vetoListener);
    }

    public static void TEXT_BASED_COMPONENTS_FORMATTED_2()
    {
        ItsNatHTMLInputTextFormatted inputComp = null;

        ItsNatFormatterFactoryDefault factory = (ItsNatFormatterFactoryDefault)inputComp.createDefaultItsNatFormatterFactory();

        ItsNatFormatter dispFormatter = inputComp.createItsNatFormatter(DateFormat.getDateInstance(DateFormat.LONG,Locale.US));
        factory.setDisplayFormatter(dispFormatter);
        ItsNatFormatter editFormatter = inputComp.createItsNatFormatter(DateFormat.getDateInstance(DateFormat.SHORT,Locale.US));
        factory.setEditFormatter(editFormatter);

        inputComp.setItsNatFormatterFactory(factory);

        try{ inputComp.setValue(new Date()); } catch(PropertyVetoException ex) { throw new RuntimeException(ex); }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.