Package org.jdesktop.wonderland.modules.contentrepo.common

Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentNode


        // First fetch the content collection of the user-specific X Apps items
        // and look for the file <app name>.xml.
        ContentCollection userNode = getUserXAppContentCollection();
        String nodeName = item.getAppName() + ".xml";
        ContentNode appNode = userNode.getChild(nodeName);
        if (appNode != null) {
            userNode.removeChild(nodeName);
        }
    }
View Full Code Here


    /**
     * @inheritDoc()
     */
    public Object getValueAt(int row, int column) {
        // First fetch the content node given the row, it should be there
        ContentNode node = nodeList.get(row);

        // Then return the proper type depending upon the column
        switch (column) {
            case 0:
                return (node instanceof ContentCollection) ? dirIcon : fileIcon;

            case 1:
                return node.getName();

            case 2:
                if (node instanceof ContentResource) {
                    return new Long( ((ContentResource) node).getSize() );
                }
View Full Code Here

     * Informs all table selections listeners that the selection tree node has
     * changed.
     */
    private void fireTableSelectionChanged(ListSelectionEvent selectionEvent) {
        // Find the currently selected Content Node for the given selection.
        ContentNode node = null;
        int row = getSelectedRow();
        if (row != -1) {
            node = tableModel.getContentNode(row);
        }

View Full Code Here

     * Handles when a directory is changed. Opens the selected directory (if it
     * is a directory) and informs listeners
     */
    private void changeDirectory() {
        // Find the currently selected Content Node for the given selection.
        ContentNode node = null;
        int row = getSelectedRow();
        if (row != -1) {
            node = tableModel.getContentNode(row);
        }
       
View Full Code Here

        // We ignore the selection given in the tree selection event (since it
        // seems to give events for both items now selected and items just
        // deselected. Just fetch the currently selected node from the tree
        // itself
        DefaultMutableTreeNode selectedNode = getSelectedNode();
        ContentNode contentNode = null;
        if (selectedNode != null) {
            TreeNodeHolder holder = (TreeNodeHolder) selectedNode.getUserObject();
            contentNode = holder.contentNode;
        }
       
View Full Code Here

        protected List<ContentNode> doInBackground() throws Exception {
            // From the node, find the "User Object" and then the content
            // node from the user object
            if (node.getUserObject() instanceof TreeNodeHolder) {
                TreeNodeHolder holder = (TreeNodeHolder) node.getUserObject();
                ContentNode contentNode = (ContentNode) holder.contentNode;
                if (contentNode instanceof ContentCollection) {
                    return ((ContentCollection) contentNode).getChildren();
                }
            }
           
View Full Code Here

        // First try to find the resource, if it exists, then simply upload the
        // new bits. Otherwise create the resource and upload the new bits
        try {
            userRoot = repo.getUserRoot();
            ContentNode node = (ContentNode)userRoot.getChild(fileName);
            if (node == null) {
                node = (ContentNode)userRoot.createChild(fileName, Type.RESOURCE);
            }
            ((ContentResource)node).put(file);
        } catch (ContentRepositoryException excp) {
View Full Code Here

     */
    public List<ContentNode> getChildren() throws ContentRepositoryException {
        // In this case, we find the content collection with "art/" and return
        // the children of that.
        List<ContentNode> childList = new LinkedList();
        ContentNode node = moduleCollection.getChild("/art");
        if (node == null || !(node instanceof ContentCollection)) {
            return childList;
        }

        // Now find the children of the art/ subdir and return nodes that wrap
View Full Code Here

            }
        });
    }

    private ContentNode getSelection() {
        ContentNode selected = null;

        Object selectedObj = fileList.getSelectedValue();
        if (selectedObj instanceof ParentHolder) {
            selected = ((ParentHolder) selectedObj).getParent();
        } else if (selectedObj != null) {
View Full Code Here

        return selected;
    }

    private void changeSelection() {
        ContentNode selected = getSelection();
       
        boolean enableDownload = false;
        boolean enableDelete = false;
        if (selected == null) {
            typeLabel.setText("");
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.contentrepo.common.ContentNode

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.