Package org.itsnat.comp

Examples of org.itsnat.comp.ItsNatComponentManager


        {
            ItsNatDocument itsNatDoc = listMult.getItsNatDocument();

            if (!itsNatDoc.getItsNatDocumentTemplate().isAutoBuildComponents())
            {
                ItsNatComponentManager compMgr = listMult.getItsNatComponentManager();
                compMgr.buildItsNatComponents(cellContentElem);
            }

            final ItsNatHTMLInputText firstNameComp = getInputText("firstNameId",cellContentElem,listMult);
            final ItsNatHTMLInputText lastNameComp = getInputText("lastNameId",cellContentElem,listMult);
View Full Code Here


    public void unrenderListCell(ItsNatList list,int index,Element cellContentElem)
    {
        ItsNatDocument itsNatDoc = list.getItsNatDocument();
        if (!itsNatDoc.getItsNatDocumentTemplate().isAutoBuildComponents())
        {
            ItsNatComponentManager compMgr = list.getItsNatComponentManager();
            compMgr.removeItsNatComponents(cellContentElem,true);
        }
    }
View Full Code Here

    }

    public void startExamplePanel()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        this.inputComp = (ItsNatHTMLInputTextFormatted)compMgr.createItsNatComponentById("inputId","formattedTextField",null);

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

        ItsNatFormatter dispFormatter = inputComp.createItsNatFormatter(DateFormat.getDateInstance(DateFormat.LONG ,Locale.US));
        factory.setDisplayFormatter(dispFormatter);
View Full Code Here

    }

    public void startExamplePanel()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

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

        inputComp.addPropertyChangeListener("value",this);

        inputComp.addVetoableChangeListener(this);
View Full Code Here

    }

    public void load()
    {
        Document doc = itsNatDoc.getDocument();
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("fileUploadInputId");
        this.input = (ItsNatHTMLInputFile)componentMgr.findItsNatComponent(inputElem);
        HTMLIFrameElement iframeElem = (HTMLIFrameElement)doc.getElementById("fileUploadIFrameId");
        this.iframe = (ItsNatHTMLIFrame)componentMgr.findItsNatComponent(iframeElem);
        HTMLButtonElement buttonElem = (HTMLButtonElement)doc.getElementById("fileUploadButtonId");
        this.button = (ItsNatHTMLButton)componentMgr.findItsNatComponent(buttonElem);
        button.addEventListener("click", this);
    }
View Full Code Here

    }

    public void startExamplePanel()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        this.useSingleClickComp = (ItsNatHTMLInputCheckBox)compMgr.createItsNatComponentById("useSingleClickId");
        useSingleClickComp.getToggleButtonModel().addItemListener(this);

        NameValue[] artifacts = new NameValue[]{new NameValue("rootless","true")};
        this.treeComp = (ItsNatFreeTree)compMgr.createItsNatComponentById("compId","freeTree",artifacts);

        new FreeTreeDecorator(treeComp).bind();

        DefaultTreeModel dataModel = (DefaultTreeModel)treeComp.getTreeModel();

        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Grey's Anatomy");
        dataModel.setRoot(rootNode);

        DefaultMutableTreeNode parentNode;

            parentNode = addNode("Characters",rootNode,dataModel);

                addNode("Meredith Grey",parentNode,dataModel);
                addNode("Cristina Yang",parentNode,dataModel);
                addNode("Alex Karev",parentNode,dataModel);
                addNode("George O'Malley",parentNode,dataModel);

            parentNode = addNode("Actors",rootNode,dataModel);

                addNode("Ellen Pompeo",parentNode,dataModel);
                addNode("Sandra Oh",parentNode,dataModel);
                addNode("Justin Chambers",parentNode,dataModel);
                addNode("T.R. Knight",parentNode,dataModel);

        TreeSelectionModel selModel = treeComp.getTreeSelectionModel();
        selModel.setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);

        selModel.addSelectionPath(new TreePath(parentNode.getPath())); // Actors

        treeComp.addEventListener("click",this);
        dataModel.addTreeModelListener(this);
        selModel.addTreeSelectionListener(this);

        treeComp.addTreeWillExpandListener(this);

        this.removeButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("removeId");
        removeButton.addEventListener("click",this);

        this.itemComp = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("itemId");
        itemComp.setText(selModel.getSelectionPath().getLastPathComponent().toString());

        this.posComp = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("posId");
        posComp.setText(Integer.toString(selModel.getMinSelectionRow()));

        this.updateButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("updateId");
        updateButton.addEventListener("click",this);

        this.insertBeforeButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("insertBeforeId");
        insertBeforeButton.addEventListener("click",this);

        this.insertAfterButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("insertAfterId");
        insertAfterButton.addEventListener("click",this);

        this.insertChildButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("insertChildId");
        insertChildButton.addEventListener("click",this);

        this.joystickModeComp = (ItsNatHTMLInputCheckBox)compMgr.createItsNatComponentById("joystickModeId");
        joystickModeComp.getToggleButtonModel().addItemListener(this);
        joystickModeComp.setSelected(isJoystickModePreferred());
    }
View Full Code Here

    }

    public void startExamplePanel()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();

        this.listComp = (ItsNatFreeListMultSel)compMgr.createItsNatComponentById("compId","freeListMultSel",null);

        listComp.setItsNatListCellRenderer(new PersonRenderer());
        listComp.setItsNatListCellEditor(null);// disable

        DefaultListModel dataModel = (DefaultListModel)listComp.getListModel();

        dataModel.addElement(new Person("Meredith","Grey"));
        dataModel.addElement(new Person("Cristina","Yang"));
        dataModel.addElement(new Person("Izzie","Stevens"));
        dataModel.addElement(new Person("Alex","Karev"));
        dataModel.addElement(new Person("George","O'Malley"));
        dataModel.addElement(new Person("Derek","Shepherd"));

        ListSelectionModel selModel = listComp.getListSelectionModel();
        selModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        selModel.setSelectionInterval(2,3);

        listComp.addEventListener("click",this);
        selModel.addListSelectionListener(this);
        dataModel.addListDataListener(this);

        this.removeButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("removeId");
        removeButton.addEventListener("click",this);

        Person person = (Person)listComp.getListModel().getElementAt(listComp.getSelectedIndex());
        this.personFirstNameComp = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("personFirstNameId");
        personFirstNameComp.setText(person.getFirstName());

        this.personLastNameComp = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("personLastNameId");
        personLastNameComp.setText(person.getLastName());

        this.posComp = (ItsNatHTMLInputText)compMgr.createItsNatComponentById("posId");
        posComp.setText(Integer.toString(listComp.getSelectedIndex()));

        this.updateButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("updateId");
        updateButton.addEventListener("click",this);

        this.insertButton = (ItsNatHTMLInputButton)compMgr.createItsNatComponentById("insertId");
        insertButton.addEventListener("click",this);

        for(int i = 0; i < dataModel.getSize(); i++)
        {
            decorateSelection(i,selModel.isSelectedIndex(i));
        }

        this.joystickModeComp = (ItsNatHTMLInputCheckBox)compMgr.createItsNatComponentById("joystickModeId");
        joystickModeComp.getToggleButtonModel().addItemListener(this);
        joystickModeComp.setSelected(isJoystickModePreferred());

        this.globalListener = new EventListener()
        {
View Full Code Here

    public void initTree(String treeId,String addButtonId,String removeButtonId,String reloadButtonId,String joystickCheckboxId)
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement rootElem = (HTMLElement)doc.getElementById(treeId);
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.comp = (ItsNatFreeTree)componentMgr.findItsNatComponent(rootElem);

        comp.setToggleClickCount(2);

        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Root Item");
        DefaultTreeModel dataModel = new DefaultTreeModel(rootNode);
        dataModel.addTreeModelListener(this); // A�adimos antes de meter en el componente para que el listener �ltimo sea el del componente pues se procesan los �ltimos primero en eventos

        comp.setTreeModel(dataModel);

        comp.addEventListener("click",this);

        DefaultMutableTreeNode childNode;
        DefaultMutableTreeNode parentNode;

        childNode = addNode("Item 1",rootNode);

            parentNode = childNode;
            childNode = addNode("Item 1.1",parentNode);

                parentNode = childNode;
                childNode = addNode("Item 1.1.1",parentNode);

        childNode = addNode("Item 2",rootNode);

            parentNode = childNode;
            childNode = addNode("Item 2.1",parentNode);
            childNode = addNode("Item 2.2",parentNode);

        // comp.setSelectionModel(null);

        TreeSelectionModel selModel = comp.getTreeSelectionModel();
        selModel.setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);

        TreePath[] paths = selModel.getSelectionPaths();
        if (paths != null)
        {
            for(int i = 0; i < paths.length; i++)
            {
                TreePath path = paths[i];
                boolean selected = selModel.isPathSelected(path);
                decorateSelection(path,selected);
            }
        }

        selModel.addTreeSelectionListener(this);


        comp.addTreeExpansionListener(this);
        comp.addTreeWillExpandListener(this);


        this.buttonAdd = (ItsNatHTMLButton)componentMgr.findItsNatComponentById(addButtonId);
        buttonAdd.addEventListener("click",this);

        this.buttonRemove = (ItsNatHTMLButton)componentMgr.findItsNatComponentById(removeButtonId);
        buttonRemove.addEventListener("click",this);

        this.buttonReload = (ItsNatHTMLButton)componentMgr.findItsNatComponentById(reloadButtonId);
        buttonReload.addEventListener("click",this);

        this.joystickModeCheck = (ItsNatHTMLInputCheckBox)componentMgr.findItsNatComponentById(joystickCheckboxId);
        joystickModeCheck.addEventListener("click",this);
        joystickModeCheck.setSelected(itsNatDoc.isJoystickMode());
    }
View Full Code Here

    public void initButton()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("inputButtonId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputButton input = (ItsNatHTMLInputButton)componentMgr.findItsNatComponent(inputElem);
        DefaultButtonModel dataModel = new DefaultButtonModel();
        input.setButtonModel(dataModel);

        input.setLabelValue("Text Button");
        input.setEnabled(false); // Para testear la propagaci�n al DOM (getDisabled)
View Full Code Here

    public void handleEvent(Event evt)
    {
        ItsNatDOMStdEvent itsNatEvent = (ItsNatDOMStdEvent)evt;
        ItsNatHTMLDocument itsNatDoc = (ItsNatHTMLDocument)itsNatEvent.getItsNatDocument();
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLInputButton input = (ItsNatHTMLInputButton)componentMgr.findItsNatComponent((Node)evt.getCurrentTarget());
        outText("OK " + evt.getType() + " "); // Para que se vea

        input.setLabelValue("Button " + evt.getType());
    }
View Full Code Here

TOP

Related Classes of org.itsnat.comp.ItsNatComponentManager

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.