01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * 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-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19: package org.netbeans.modules.xslt.tmap.nodes;
20:
21: import org.netbeans.modules.xslt.tmap.model.api.Transform;
22: import org.netbeans.modules.xslt.tmap.nodes.properties.PropertyType;
23: import org.netbeans.modules.xslt.tmap.nodes.properties.PropertyUtils;
24: import org.openide.nodes.Children;
25: import org.openide.nodes.Node;
26: import org.openide.nodes.Sheet;
27: import org.openide.util.Lookup;
28:
29: /**
30: *
31: * @author Vitaly Bychkov
32: * @version 1.0
33: */
34: public class TransformNode extends
35: TMapComponentNode<DecoratedTransform> {
36:
37: public TransformNode(Transform ref, Lookup lookup) {
38: this (ref, Children.LEAF, lookup);
39: }
40:
41: public TransformNode(Transform ref, Children children, Lookup lookup) {
42: super (new DecoratedTransform(ref), children, lookup);
43: }
44:
45: protected Sheet createSheet() {
46: Sheet sheet = super .createSheet();
47: if (getReference() == null) {
48: // The related object has been removed!
49: return sheet;
50: }
51: //
52: Sheet.Set mainPropertySet = getPropertySet(sheet);
53: //
54: Node.Property prop;
55: prop = PropertyUtils.registerProperty(this , mainPropertySet,
56: PropertyType.FILE, "getFile", "setFile"); // NOI18N
57: prop.setValue("canEditAsText", Boolean.FALSE); // NOI18N
58: //
59: prop = PropertyUtils.registerProperty(this , mainPropertySet,
60: PropertyType.SOURCE, "getSource", "setSource"); // NOI18N
61: prop.setValue("canEditAsText", Boolean.FALSE); // NOI18N
62: //
63: prop = PropertyUtils.registerProperty(this , mainPropertySet,
64: PropertyType.RESULT, "getResult", "setResult"); // NOI18N
65: prop.setValue("canEditAsText", Boolean.FALSE); // NOI18N
66: //
67: return sheet;
68: }
69:
70: }
|