Source Code Cross Referenced for ServiceNode.java in  » IDE-Netbeans » xml » org » netbeans » modules » xslt » tmap » nodes » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » xml » org.netbeans.modules.xslt.tmap.nodes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the terms of the Common Development
003:         * and Distribution License (the License). You may not use this file except in
004:         * compliance with the License.
005:         * 
006:         * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007:         * or http://www.netbeans.org/cddl.txt.
008:         * 
009:         * When distributing Covered Code, include this CDDL Header Notice in each file
010:         * and include the License file at http://www.netbeans.org/cddl.txt.
011:         * If applicable, add the following below the CDDL Header, with the fields
012:         * enclosed by brackets [] replaced by your own identifying information:
013:         * "Portions Copyrighted [year] [name of copyright owner]"
014:         * 
015:         * The Original Software is NetBeans. The Initial Developer of the Original
016:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017:         * Microsystems, Inc. All Rights Reserved.
018:         */
019:
020:        package org.netbeans.modules.xslt.tmap.nodes;
021:
022:        import java.awt.datatransfer.DataFlavor;
023:        import java.awt.datatransfer.Transferable;
024:        import java.awt.datatransfer.UnsupportedFlavorException;
025:        import java.io.IOException;
026:        import java.util.ArrayList;
027:        import java.util.List;
028:        import org.netbeans.modules.xml.xam.ui.ComponentPasteType;
029:        import org.netbeans.modules.xslt.tmap.model.api.Operation;
030:        import org.netbeans.modules.xslt.tmap.model.api.Service;
031:        import org.netbeans.modules.xslt.tmap.model.api.TMapComponent;
032:        import org.netbeans.modules.xslt.tmap.model.api.TMapModel;
033:        import org.netbeans.modules.xslt.tmap.nodes.properties.PropertyType;
034:        import org.netbeans.modules.xslt.tmap.nodes.properties.PropertyUtils;
035:        import org.openide.nodes.Children;
036:        import org.openide.nodes.Node;
037:        import org.openide.nodes.Sheet;
038:        import org.openide.util.Exceptions;
039:        import org.openide.util.Lookup;
040:        import org.openide.util.NbBundle;
041:        import org.openide.util.datatransfer.NewType;
042:        import org.openide.util.datatransfer.PasteType;
043:
044:        /**
045:         *
046:         * @author Vitaly Bychkov
047:         * @version 1.0
048:         */
049:        public class ServiceNode extends TMapComponentNode<DecoratedService> {
050:
051:            public ServiceNode(Service ref, Lookup lookup) {
052:                this (ref, Children.LEAF, lookup);
053:            }
054:
055:            public ServiceNode(Service ref, Children children, Lookup lookup) {
056:                super (new DecoratedService(ref), children, lookup);
057:            }
058:
059:            //    @Override
060:            //    protected void createPasteTypes(Transferable t, List<PasteType> s) {
061:            ////        super.createPasteTypes(t, s);
062:            //        System.out.println("getted transferable: "+t);
063:            //        DataFlavor[] dataFlavors = t.getTransferDataFlavors();
064:            //        int i =0;
065:            //        for (DataFlavor dataFlavor : dataFlavors) {
066:            //            try {
067:            //                i++;
068:            //                System.out.println(i + ") currentDataFlavor: " 
069:            //                        + dataFlavor + "; transferedData: " 
070:            //                        + t.getTransferData(dataFlavor));
071:            //            } catch (UnsupportedFlavorException ex) {
072:            //                System.out.println("unsupproted dataFlavor");
073:            //            } catch (IOException ex) {
074:            //                System.out.println("ioexception when try to get transfered data");
075:            //            }
076:            //        }
077:            //        
078:            //
079:            //        
080:            //        
081:            //    }
082:
083:            protected Sheet createSheet() {
084:                Sheet sheet = super .createSheet();
085:                if (getReference() == null) {
086:                    // The related object has been removed!
087:                    return sheet;
088:                }
089:                //
090:                Sheet.Set mainPropertySet = getPropertySet(sheet);
091:                //
092:                Node.Property prop;
093:                prop = PropertyUtils.registerProperty(this , mainPropertySet,
094:                        PropertyType.PARTNER_LINK_TYPE, "getPartnerLinkType",
095:                        "setPartnerLinkType"); // NOI18N
096:                prop.setValue("canEditAsText", Boolean.FALSE); // NOI18N
097:                //
098:                prop = PropertyUtils.registerProperty(this , mainPropertySet,
099:                        PropertyType.ROLE, "getRole", "setRole"); // NOI18N
100:                prop.setValue("canEditAsText", Boolean.FALSE); // NOI18N
101:                //
102:                //
103:                return sheet;
104:            }
105:
106:            //    
107:            //    @Override
108:            //    protected void createPasteTypes(Transferable transferable, List<PasteType> list) {
109:            //        System.out.println("getted transferable: "+transferable);
110:            //        DataFlavor[] dataFlavors = transferable.getTransferDataFlavors();
111:            //        int i =0;
112:            //        for (DataFlavor dataFlavor : dataFlavors) {
113:            //            try {
114:            //                i++;
115:            //                System.out.println(i + ") currentDataFlavor: " 
116:            //                        + dataFlavor + "; transferedData: " 
117:            //                        + transferable.getTransferData(dataFlavor));
118:            //            } catch (UnsupportedFlavorException ex) {
119:            //                System.out.println("unsupproted dataFlavor");
120:            //            } catch (IOException ex) {
121:            //                System.out.println("ioexception when try to get transfered data");
122:            //            }
123:            //        }
124:            //
125:            //        // Make sure this node is still valid.
126:            //        TMapComponent component = getComponentRef();
127:            //        
128:            //        if (component != null && component.getModel() != null && isEditable()) {
129:            //            PasteType type = ComponentPasteType.getPasteType(
130:            //                    component, transferable, null);
131:            //            System.out.println("pasteType::: "+type);
132:            //            if (type != null) {
133:            //                list.add(type);
134:            //            }
135:            //        }
136:            //    }
137:            //
138:            //    @Override
139:            //    public PasteType getDropType(Transferable transferable, int action, int index) {
140:            //        // Make sure this node is still valid.
141:            //        TMapComponent component = getComponentRef();
142:            //        
143:            //        if (component != null && component.getModel() != null && isEditable()) {
144:            //            PasteType type = ComponentPasteType.getDropType(
145:            //                    component, transferable, null, action, index);
146:            //            System.out.println("drop type: "+type);
147:            //            if (type != null) {
148:            //                return type;
149:            //            }
150:            //        }
151:            //        return null;
152:            //    }
153:            //    
154:            //    
155:            //    
156:            //    private class OperationPasteType extends PasteType {
157:            //
158:            //        @Override
159:            //        public Transferable paste() throws IOException {
160:            //            System.out.println("try to perform paste operation");
161:            //            
162:            //            return null;
163:            //        }
164:            //    }
165:
166:            @Override
167:            public NewType[] getNewTypes() {
168:                if (isEditable()) {
169:                    return getNewTypes(getComponentRef());
170:                }
171:                return new NewType[] {};
172:            }
173:
174:            public NewType[] getNewTypes(TMapComponent newComponent) {
175:
176:                List<NewType> list = new ArrayList<NewType>();
177:
178:                if (newComponent instanceof  Service) {
179:                    list.add(new OperationNewType((Service) newComponent));
180:                }
181:
182:                return list.toArray(new NewType[] {});
183:            }
184:
185:            public static class OperationNewType extends NewType {
186:
187:                private Service myService;
188:
189:                OperationNewType(Service service) {
190:                    myService = service;
191:                }
192:
193:                @Override
194:                public String getName() {
195:                    return NbBundle.getMessage(TMapComponentNode.class,
196:                            "LBL_NewOperationAction"); // NOI18N
197:                }
198:
199:                @Override
200:                public void create() throws IOException {
201:                    TMapModel model = myService.getModel();
202:                    model.startTransaction();
203:                    //        String operationOutputName = NameGenerator.getInstance().generateUniqueOperationOutputName(mOperation);
204:                    Operation operation = model.getFactory().createOperation();
205:                    //        output.setName(operationOutputName);
206:                    //        mOperation.setOutput(output);
207:                    myService.addOperation(operation);
208:                    model.endTransaction();
209:                    //        ActionHelper.selectNode(operation);
210:                }
211:            }
212:
213:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.