KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > piagetproject > PiagetLogicalView


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * PovrayLogicalView.java
21  *
22  * Created on February 16, 2005, 5:57 PM
23  */

24
25 package org.netbeans.modules.piagetproject;
26
27 import java.awt.Image JavaDoc;
28 import java.beans.PropertyChangeEvent JavaDoc;
29 import java.beans.PropertyChangeListener JavaDoc;
30 import javax.swing.AbstractAction JavaDoc;
31 import javax.swing.Action JavaDoc;
32 import org.netbeans.modules.piagetproject.treestructure.NodeRetriever;
33 import org.netbeans.spi.project.ui.LogicalViewProvider;
34 import org.openide.ErrorManager;
35 import org.openide.filesystems.FileAttributeEvent;
36 import org.openide.filesystems.FileChangeListener;
37 import org.openide.filesystems.FileEvent;
38 import org.openide.filesystems.FileObject;
39 import org.openide.loaders.DataObject;
40 import org.openide.loaders.DataObjectNotFoundException;
41 import org.openide.nodes.AbstractNode;
42 import org.openide.nodes.Children;
43 import org.openide.nodes.FilterNode;
44 import org.openide.nodes.Node;
45 import org.openide.util.Lookup;
46 import org.openide.util.Utilities;
47 import org.openide.util.lookup.Lookups;
48 import org.openide.util.lookup.ProxyLookup;
49
50 /**
51  * Logical view of a Povray project for the project tab in Explorer.
52  * Provides a FilterNode wraps the default DataNode
53  * for the project, replacing the icon.
54  *
55  * @author Timothy Boudreau
56  */

57 public class PiagetLogicalView implements LogicalViewProvider {
58     
59     private PiagetProject project;
60     private static Node piagetNode, originalNode;
61     
62     /** Creates a new instance of PovrayLogicalView */
63     public PiagetLogicalView(PiagetProject project) {
64         this.project = project;
65     }
66     
67     public org.openide.nodes.Node createLogicalView() {
68         try {
69             FileObject dir = project.getProjectDirectory();
70             DataObject dirDataObject = DataObject.find(dir);
71             Node dirNode = dirDataObject.getNodeDelegate();
72             piagetNode = new PiagetNode(dirNode, project);
73             return piagetNode;
74         } catch (DataObjectNotFoundException donfe) {
75             ErrorManager.getDefault().notify(donfe);
76             return new AbstractNode(Children.LEAF);
77         }
78     }
79     
80     public org.openide.nodes.Node findPath(org.openide.nodes.Node root, Object JavaDoc target) {
81         if (target instanceof DataObject) {
82             return null; //XXX not implemented yet
83
} else {
84             return null;
85         }
86     }
87 }
Popular Tags