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.model.api.Variable;
23: import org.netbeans.modules.xslt.tmap.model.api.VariableReference;
24: import org.netbeans.modules.xslt.tmap.util.Util;
25: import org.openide.util.NbBundle;
26:
27: /**
28: *
29: * @author Vitaly Bychkov
30: * @version 1.0
31: */
32: public class DecoratedTransform extends
33: DecoratedTMapComponentAbstract<Transform> {
34:
35: public DecoratedTransform(Transform orig) {
36: super (orig);
37: }
38:
39: @Override
40: public String getHtmlDisplayName() {
41: Transform ref = getOriginal();
42: String file = ref == null ? null : ref.getFile();
43:
44: String addon = null;
45: if (file != null) {
46: addon = TMapComponentNode.WHITE_SPACE + file; // NOI18N
47: }
48:
49: return Util.getGrayString(super .getHtmlDisplayName(), addon);
50: }
51:
52: @Override
53: public String getTooltip() {
54: Transform ref = getOriginal();
55: StringBuffer attributesTooltip = new StringBuffer();
56: if (ref != null) {
57: attributesTooltip.append(Util.getLocalizedAttribute(ref
58: .getFile(), Transform.FILE));
59:
60: attributesTooltip.append(Util.getLocalizedAttribute(ref
61: .getSource(), Transform.SOURCE));
62:
63: attributesTooltip.append(Util.getLocalizedAttribute(ref
64: .getResult(), Transform.RESULT));
65: }
66:
67: return NbBundle.getMessage(TMapComponentNode.class,
68: "LBL_LONG_TOOLTIP_HTML_TEMPLATE", super.getName(),
69: attributesTooltip.toString());
70: }
71:
72: }
|