Package org.itsnat.comp.label

Examples of org.itsnat.comp.label.ItsNatHTMLLabel


    public void load() throws PropertyVetoException
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLElement elem = (HTMLElement)doc.getElementById("labelId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLLabel comp = (ItsNatHTMLLabel)componentMgr.findItsNatComponent(elem);

        comp.setValue(null); // Para probar
        String text = "Label Test";
        comp.setValue(text);
        TestUtil.checkError(comp.getElement().hasChildNodes());
        comp.setValue(null); // Para probar si se vac�a
        TestUtil.checkError(!comp.getElement().hasChildNodes());
        comp.setValue(text);

        TestUtil.checkError(comp.getForComponent() != null);
    }
View Full Code Here


        this.useSingleClickComp = (ItsNatHTMLInputCheckBox)compMgr.createItsNatComponentById("useSingleClickId");
        useSingleClickComp.addEventListener("click",this);

        try
        {
            ItsNatHTMLLabel comp;

            comp = (ItsNatHTMLLabel)compMgr.createItsNatComponentById("labelId1");
            comp.setValue("Any Text");
            ItsNatHTMLInputText textInput = compMgr.createItsNatHTMLInputText(null,null);
            shared(0,comp,textInput);

            comp = (ItsNatHTMLLabel)compMgr.createItsNatComponentById("labelId2");
            comp.setValue(Boolean.TRUE);
            ItsNatHTMLInputCheckBox checkBox = compMgr.createItsNatHTMLInputCheckBox(null,null);
            checkBox.getElement().setAttribute("style","width:20px;height:20px;");
            shared(1,comp,checkBox);

            comp = (ItsNatHTMLLabel)compMgr.createItsNatComponentById("labelId3");
            comp.setValue(new Integer(3));
            ItsNatHTMLSelectComboBox comboBox = compMgr.createItsNatHTMLSelectComboBox(null,null);
            DefaultComboBoxModel model = (DefaultComboBoxModel)comboBox.getComboBoxModel();
            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);
            shared(4,comp,textArea);
        }
        catch(PropertyVetoException ex)
        {
View Full Code Here

        return null;
    }

    public ItsNatHTMLLabel createItsNatHTMLLabel(HTMLLabelElement element,NameValue[] artifacts,boolean execCreateFilters,ItsNatStfulDocComponentManagerImpl compMgr)
    {
        ItsNatHTMLLabel comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatHTMLLabel)processBeforeCreateItsNatComponentListener(element,getCompType(),null,artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatHTMLLabelImpl(element,artifacts,compMgr);
        if (doFilters) comp = (ItsNatHTMLLabel)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here

    public static void LABELS()
    {
        ItsNatHTMLDocument itsNatDoc = null;
        ItsNatHTMLComponentManager componentMgr = itsNatDoc.getItsNatHTMLComponentManager();

        ItsNatHTMLLabel label = (ItsNatHTMLLabel)componentMgr.createItsNatComponentById("labelId");
        try { label.setValue(new Integer(3))} // Initial value
        catch(PropertyVetoException ex) { throw new RuntimeException(ex); }

        ItsNatHTMLSelectComboBox editorComp = componentMgr.createItsNatHTMLSelectComboBox(null,null);
        DefaultComboBoxModel model = (DefaultComboBoxModel)editorComp.getComboBoxModel();
        for(int i=0; i < 5; i++) model.addElement(new Integer(i));

        ItsNatLabelEditor editor = componentMgr.createDefaultItsNatLabelEditor(editorComp);
        label.setItsNatLabelEditor(editor);

        EventListener evtListener = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                System.out.println("Edition starts...");
            }
        };
        label.addEventListener("dblclick",evtListener);

        PropertyChangeListener propListener = new PropertyChangeListener()
        {
            public void propertyChange(PropertyChangeEvent evt)
            {
                System.out.println("Changed label, old: " + evt.getOldValue() + ", new: " + evt.getNewValue());
            }
        };
        label.addPropertyChangeListener("value",propListener);
    }
View Full Code Here

TOP

Related Classes of org.itsnat.comp.label.ItsNatHTMLLabel

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