KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > websphere6 > dd > loaders > webbnd > WSWebBndToolBarMVElement


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 package org.netbeans.modules.j2ee.websphere6.dd.loaders.webbnd;
20
21 import java.io.IOException JavaDoc;
22 import org.netbeans.modules.j2ee.websphere6.dd.beans.DDXmiConstants;
23 import org.netbeans.modules.j2ee.websphere6.dd.beans.EjbRefBindingsType;
24 import org.netbeans.modules.j2ee.websphere6.dd.beans.ResEnvRefBindingsType;
25 import org.netbeans.modules.j2ee.websphere6.dd.beans.ResRefBindingsType;
26 import org.netbeans.modules.j2ee.websphere6.dd.beans.WSWebBnd;
27 import org.netbeans.modules.j2ee.websphere6.dd.loaders.WSMultiViewDataObject;
28 import org.netbeans.modules.j2ee.websphere6.dd.loaders.ui.WSReferenceBindingsPanel;
29 import org.netbeans.modules.j2ee.websphere6.dd.loaders.SectionNodes.*;
30 import org.netbeans.modules.xml.multiview.*;
31 import org.netbeans.modules.xml.multiview.ui.*;
32 import org.openide.nodes.*;
33 import org.openide.util.RequestProcessor;
34 import org.openide.util.NbBundle;
35 import org.netbeans.modules.xml.multiview.Error;
36 /**
37  *
38  * @author dlipin
39  */

40 public class WSWebBndToolBarMVElement extends ToolBarMultiViewElement implements java.beans.PropertyChangeListener JavaDoc, DDXmiConstants{
41     private ToolBarDesignEditor comp;
42     private SectionView view;
43     private WSWebBndDataObject dObj;
44     private PanelFactory factory;
45     private RequestProcessor.Task repaintingTask;
46     private boolean needInit=true;
47     private javax.swing.Action JavaDoc addResRefAction, removeResRefAction;
48     private javax.swing.Action JavaDoc addEjbRefAction, removeEjbRefAction;
49     private javax.swing.Action JavaDoc addResEnvRefAction, removeResEnvRefAction;
50     private static final long serialVersionUID = 76123745399723L;
51     private static final String JavaDoc WEBBND_MV_ID = WSMultiViewDataObject.MULTIVIEW_WEBBND +
52             WSMultiViewDataObject.DD_MULTIVIEW_POSTFIX;
53     
54     public WSWebBndToolBarMVElement(WSWebBndDataObject dObj) {
55         super(dObj);
56         this.dObj=dObj;
57         comp = new ToolBarDesignEditor();
58         factory=new PanelFactory(comp,dObj);
59         addResRefAction = new AddResRefAction("Add New Resource Reference Binding.."/*NbBundle.getMessage(WSWebBndToolBarMVElement.class,"LBL_addJspPG")*/);
60         removeResRefAction = new RemoveResRefAction("Remove This Binding"/*NbBundle.getMessage(WSWebBndToolBarMVElement.class,"LBL_addJspPG")*/);
61         
62         addEjbRefAction = new AddEjbRefAction("Add New Ejb Reference Binding.."/*NbBundle.getMessage(WSWebBndToolBarMVElement.class,"LBL_addJspPG")*/);
63         removeEjbRefAction = new RemoveEjbRefAction("Remove This Binding"/*NbBundle.getMessage(WSWebBndToolBarMVElement.class,"LBL_addJspPG")*/);
64         
65         addResEnvRefAction = new AddResEnvRefAction("Add New Resource Env Reference Binding.."/*NbBundle.getMessage(WSWebBndToolBarMVElement.class,"LBL_addJspPG")*/);
66         removeResEnvRefAction = new RemoveResEnvRefAction("Remove This Binding"/*NbBundle.getMessage(WSWebBndToolBarMVElement.class,"LBL_addJspPG")*/);
67         
68         
69         setVisualEditor(comp);
70         repaintingTask = RequestProcessor.getDefault().create(new Runnable JavaDoc() {
71             public void run() {
72                 javax.swing.SwingUtilities.invokeLater(new Runnable JavaDoc() {
73                     public void run() {
74                         repaintView();
75                     }
76                 });
77             }
78         });
79         
80     }
81     private void repaintView() {
82         view =new WSWebBndView(dObj);
83         comp.setContentView(view);
84         Object JavaDoc lastActive = comp.getLastActive();
85         if (lastActive!=null) {
86             ((SectionView)view).openPanel(lastActive);
87         } else {
88             //((SectionView)view).openPanel("welcome_files"); //NOI18N
89
}
90         view.checkValidity();
91         //dObj.checkParseable();
92
}
93     
94     
95     
96     public SectionView getSectionView() {
97         return view;
98     }
99     public WSWebBndView getWebBndView() {
100         return (WSWebBndView)view;
101     }
102     
103     public void componentShowing() {
104         super.componentShowing();
105         if (needInit) {
106             repaintView();
107             needInit=false;
108         }
109         //view=new WSWebBndView(dObj);
110
comp.setContentView(view);
111         try {
112             ((SectionView)view).openPanel(dObj.getWebBnd());
113         } catch(java.io.IOException JavaDoc e) {
114             
115         }
116         
117         view.checkValidity();
118     }
119     public void componentOpened() {
120         super.componentOpened();
121         try {
122             dObj.getWebBnd().addPropertyChangeListener(this);
123         } catch(IOException JavaDoc ex) {
124             ex=null;
125         }
126     }
127     
128     public void componentClosed() {
129         super.componentClosed();
130         try {
131             dObj.getWebBnd().removePropertyChangeListener(this);
132         } catch(IOException JavaDoc ex) {
133             ex=null;
134         }
135     }
136     public void propertyChange(java.beans.PropertyChangeEvent JavaDoc evt) {
137         if (!dObj.isChangedFromUI()) {
138             String JavaDoc name = evt.getPropertyName();
139             if ( name.indexOf("WebApplicationBnd")>0 ) { //NOI18
140
// repaint view if the wiew is active and something is changed with filters
141
if (WEBBND_MV_ID.equals(dObj.getSelectedPerspective().preferredID())) {
142                     repaintingTask.schedule(100);
143                 } else {
144                     needInit=true;
145                 }
146             }
147         }
148     }
149     
150     private class AddResRefAction extends javax.swing.AbstractAction JavaDoc {
151         
152         AddResRefAction(String JavaDoc actionName) {
153             super(actionName);
154             //char mnem = NbBundle.getMessage(PagesMultiViewElement.class,"LBL_addJspPG_mnem").charAt(0);
155
//putValue(MNEMONIC_KEY,new Integer((int)mnem));
156
}
157         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
158             try{
159         dObj.setChangedFromUI(true);
160                 WSWebBnd webbnd=dObj.getWebBnd();
161                 ResRefBindingsType rr=new ResRefBindingsType(WEB_APPLICATION);
162                 rr.setDefaults();
163                 int number=webbnd.getResRefBindings().length+1;
164                 
165                 //rr.setTitle("Binding Item #"+number);
166
webbnd.addResRefBindings(rr);
167                 //////////////////////////////////
168
Node resrefNode = new ResRefNode();
169                 view.getRoot().getChildren().add(new Node[]{resrefNode});
170                 resrefNode.setDisplayName(resrefNode.getDisplayName()+number);
171                 dObj.setChangedFromUI(true);
172                 dObj.modelUpdatedFromUI();
173                 ResRefBindingsType[] resrefs = webbnd.getResRefBindings();
174                 SectionPanel sectionPanel=new SectionPanel(view,resrefNode,rr);
175                 sectionPanel.setHeaderActions(new javax.swing.Action JavaDoc[]{removeResRefAction});
176                 ((WSWebBndView)view).getResRefsContainer().addSection(sectionPanel,true);
177                 dObj.setChangedFromUI(false);
178                 
179             } catch (java.io.IOException JavaDoc ex) {
180             } catch (java.lang.IllegalArgumentException JavaDoc ex) {
181             }
182         }
183     }
184     private class RemoveResRefAction extends javax.swing.AbstractAction JavaDoc {
185         
186         RemoveResRefAction(String JavaDoc actionName) {
187             super(actionName);
188             //char mnem = NbBundle.getMessage(PagesMultiViewElement.class,"LBL_remove_mnem").charAt(0);
189
//putValue(MNEMONIC_KEY,new Integer((int)mnem));
190
}
191         
192         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
193             SectionPanel sectionPanel = ((SectionPanel.HeaderButton)evt.getSource()).getSectionPanel();
194             ResRefBindingsType resref = (ResRefBindingsType)sectionPanel.getKey();
195             // removing from data model
196

197             try {
198                 dObj.modelUpdatedFromUI();
199                 dObj.setChangedFromUI(true);
200                 dObj.getWebBnd().removeResRefBindings(resref);
201                 sectionPanel.getSectionView().removeSection(sectionPanel.getNode());
202             } catch (java.io.IOException JavaDoc ec) {
203                 
204             } finally {
205                 dObj.setChangedFromUI(false);
206             }
207             
208         }
209     }
210     
211     
212     private class AddEjbRefAction extends javax.swing.AbstractAction JavaDoc {
213         
214         AddEjbRefAction(String JavaDoc actionName) {
215             super(actionName);
216             //char mnem = NbBundle.getMessage(PagesMultiViewElement.class,"LBL_addJspPG_mnem").charAt(0);
217
//putValue(MNEMONIC_KEY,new Integer((int)mnem));
218
}
219         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
220             
221             try{
222         dObj.setChangedFromUI(true);
223                 WSWebBnd webbnd=dObj.getWebBnd();
224                 EjbRefBindingsType er=new EjbRefBindingsType(WEB_APPLICATION);
225                 er.setDefaults();
226                 int number=webbnd.getEjbRefBindings().length+1;
227                 
228                 //er.setTitle("Binding Item #"+number);
229
webbnd.addEjbRefBindings(er);
230                 //////////////////////////////////
231
Node ejbrefNode = new EjbRefNode();
232                 Node root=view.getRoot();
233                 root.getChildren().add(new Node[]{ejbrefNode});
234                 ejbrefNode.setDisplayName(ejbrefNode.getDisplayName()+number);
235                 dObj.setChangedFromUI(true);
236                 dObj.modelUpdatedFromUI();
237                 EjbRefBindingsType[] ejbrefs = webbnd.getEjbRefBindings();
238                 SectionPanel sectionPanel=new SectionPanel(view,ejbrefNode,er);
239                 sectionPanel.setHeaderActions(new javax.swing.Action JavaDoc[]{removeEjbRefAction});
240                 ((WSWebBndView)view).getEjbRefsContainer().addSection(sectionPanel,true);
241                 dObj.setChangedFromUI(false);
242                 
243             } catch (java.io.IOException JavaDoc ex) {
244             } catch (java.lang.IllegalArgumentException JavaDoc ex) {
245             }
246         }
247     }
248     private class RemoveEjbRefAction extends javax.swing.AbstractAction JavaDoc {
249         
250         RemoveEjbRefAction(String JavaDoc actionName) {
251             super(actionName);
252             //char mnem = NbBundle.getMessage(PagesMultiViewElement.class,"LBL_remove_mnem").charAt(0);
253
//putValue(MNEMONIC_KEY,new Integer((int)mnem));
254
}
255         
256         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
257             SectionPanel sectionPanel = ((SectionPanel.HeaderButton)evt.getSource()).getSectionPanel();
258             EjbRefBindingsType ejbref = (EjbRefBindingsType)sectionPanel.getKey();
259             // removing from data model
260

261             try {
262                 dObj.modelUpdatedFromUI();
263                 dObj.setChangedFromUI(true);
264                 dObj.getWebBnd().removeEjbRefBindings(ejbref);
265                 sectionPanel.getSectionView().removeSection(sectionPanel.getNode());
266             } catch (java.io.IOException JavaDoc ec) {
267                 
268             } finally {
269                 dObj.setChangedFromUI(false);
270             }
271             
272             
273         }
274     }
275     
276     
277     
278     private class AddResEnvRefAction extends javax.swing.AbstractAction JavaDoc {
279         
280         AddResEnvRefAction(String JavaDoc actionName) {
281             super(actionName);
282             //char mnem = NbBundle.getMessage(PagesMultiViewElement.class,"LBL_addJspPG_mnem").charAt(0);
283
//putValue(MNEMONIC_KEY,new Integer((int)mnem));
284
}
285         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
286             try{
287                 WSWebBnd webbnd=dObj.getWebBnd();
288                 ResEnvRefBindingsType rer=new ResEnvRefBindingsType(WEB_APPLICATION);
289                 rer.setDefaults();
290                 int number=webbnd.getResEnvRefBindings().length+1;
291                 
292                 //rr.setTitle("Binding Item #"+number);
293
webbnd.addResEnvRefBindings(rer);
294                 //////////////////////////////////
295
Node resenvrefNode = new ResEnvRefNode();
296                 view.getRoot().getChildren().add(new Node[]{resenvrefNode});
297                 resenvrefNode.setDisplayName(resenvrefNode.getDisplayName()+number);
298                 dObj.setChangedFromUI(true);
299                 dObj.modelUpdatedFromUI();
300                 ResEnvRefBindingsType[] resenvrefs = webbnd.getResEnvRefBindings();
301                 SectionPanel sectionPanel=new SectionPanel(view,resenvrefNode,rer);
302                 sectionPanel.setHeaderActions(new javax.swing.Action JavaDoc[]{removeResEnvRefAction});
303                 ((WSWebBndView)view).getResEnvRefsContainer().addSection(sectionPanel,true);
304                 dObj.setChangedFromUI(false);
305                 
306             } catch (java.io.IOException JavaDoc ex) {
307             } catch (java.lang.IllegalArgumentException JavaDoc ex) {
308             }
309         }
310     }
311     private class RemoveResEnvRefAction extends javax.swing.AbstractAction JavaDoc {
312         
313         RemoveResEnvRefAction(String JavaDoc actionName) {
314             super(actionName);
315             //char mnem = NbBundle.getMessage(PagesMultiViewElement.class,"LBL_remove_mnem").charAt(0);
316
//putValue(MNEMONIC_KEY,new Integer((int)mnem));
317
}
318         
319         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
320             SectionPanel sectionPanel = ((SectionPanel.HeaderButton)evt.getSource()).getSectionPanel();
321             ResEnvRefBindingsType resenvref = (ResEnvRefBindingsType)sectionPanel.getKey();
322             // removing from data model
323

324             try {
325                 dObj.modelUpdatedFromUI();
326                 dObj.setChangedFromUI(true);
327                 dObj.getWebBnd().removeResEnvRefBindings(resenvref);
328                 sectionPanel.getSectionView().removeSection(sectionPanel.getNode());
329             } catch (java.io.IOException JavaDoc ec) {
330                 
331             } finally {
332                 dObj.setChangedFromUI(false);
333             }
334             
335         }
336     }
337     
338     
339     private class WSWebBndView extends SectionView {
340         private SectionContainer resrefsCont;
341         private SectionContainer ejbrefsCont;
342         private SectionContainer resenvrefsCont;
343         private WSWebBnd webbnd;
344         XmlMultiViewDataSynchronizer sync;
345         WSWebBndView(WSWebBndDataObject dObj) {
346             super(factory);
347             Children rootChildren = new Children.Array();
348             Node root = new AbstractNode(rootChildren);
349             try {
350                 this.webbnd=dObj.getWebBnd();
351                 rootChildren.add(new Node[]{
352                     createWebBndAttrNode(),
353                     createResRefNode(),
354                     createEjbRefNode(),
355                     createResEnvRefNode()}
356                 );
357             } catch (java.io.IOException JavaDoc ex) {
358                 System.out.println("ex="+ex);
359                 root.setDisplayName("Invalid WebBnd");
360             } finally {
361                 setRoot(root);
362             }
363         }
364         
365         
366         private Node createWebBndAttrNode() {
367             Node webbndNode = new WSWebBndNode();
368             // add panels
369
addSection(new SectionPanel(this,webbndNode,webbnd));
370             return webbndNode;
371         }
372         
373         private Node createResRefNode() {
374             ResRefBindingsType[] resrefs = webbnd.getResRefBindings();
375             Children resch = new Children.Array();
376             Node[] resrefNode=null;
377             
378             if(resrefs!=null && resrefs.length>0) {
379                 resrefNode = new Node[resrefs.length];
380                 for (int i=0;i<resrefs.length;i++) {
381                     resrefNode[i] = new ResRefNode();
382                     resrefNode[i].setDisplayName("Binding Item #"+(i+1));
383                 }
384                 resch.add(resrefNode);
385             }
386             
387             Node resrefsNode = new SectionContainerNode(resch);
388             resrefsNode.setDisplayName("Resource Reference Bindings");
389             
390             //rootChildren.add(new Node[]{webbndNode,resrefsNode});
391
resrefsCont = new SectionContainer(this,resrefsNode,"Resource Reference Bindings");
392             resrefsCont.setHeaderActions(new javax.swing.Action JavaDoc[]{addResRefAction});
393             
394             // creatings section panels for ResRefs
395
if(resrefs!=null) {
396                 SectionPanel[] pan = new SectionPanel[resrefs.length];
397                 for (int i=0;i<resrefs.length;i++) {
398                     pan[i] = new SectionPanel(this, resrefNode[i], resrefs[i]);
399                     pan[i].setHeaderActions(new javax.swing.Action JavaDoc[]{removeResRefAction});
400                     resrefsCont.addSection(pan[i]);
401                 }
402             }
403             addSection(resrefsCont);
404             return resrefsNode;
405         }
406         
407         private Node createEjbRefNode() {
408             //adding ejbRef
409
EjbRefBindingsType[] ejbrefs = webbnd.getEjbRefBindings();
410             Children ejbch = new Children.Array();
411             Node[] ejbrefNode=null;
412             
413             if(ejbrefs!=null && ejbrefs.length>0) {
414                 ejbrefNode = new Node[ejbrefs.length];
415                 for (int i=0;i<ejbrefs.length;i++) {
416                     ejbrefNode[i] = new EjbRefNode();
417                     ejbrefNode[i].setDisplayName("Binding Item #"+(i+1));
418                 }
419                 ejbch.add(ejbrefNode);
420             }
421             
422             Node ejbrefsNode = new SectionContainerNode(ejbch);
423             ejbrefsNode.setDisplayName("Ejb Reference Bindings");
424             
425             ejbrefsCont = new SectionContainer(this,ejbrefsNode,"Ejb Reference Bindings");
426             ejbrefsCont.setHeaderActions(new javax.swing.Action JavaDoc[]{addEjbRefAction});
427             
428             // creatings section panels for EjbRefs
429
if(ejbrefs!=null) {
430                 SectionPanel[] pan = new SectionPanel[ejbrefs.length];
431                 for (int i=0;i<ejbrefs.length;i++) {
432                     pan[i] = new SectionPanel(this, ejbrefNode[i], ejbrefs[i]);
433                     pan[i].setHeaderActions(new javax.swing.Action JavaDoc[]{removeEjbRefAction});
434                     ejbrefsCont.addSection(pan[i]);
435                 }
436             }
437             addSection(ejbrefsCont);
438             return ejbrefsNode;
439         }
440         
441         private Node createResEnvRefNode() {
442             ResEnvRefBindingsType[] resenvrefs = webbnd.getResEnvRefBindings();
443             Children resenvch = new Children.Array();
444             Node[] resenvrefNode=null;
445             
446             if(resenvrefs!=null && resenvrefs.length>0) {
447                 resenvrefNode = new Node[resenvrefs.length];
448                 for (int i=0;i<resenvrefs.length;i++) {
449                     resenvrefNode[i] = new ResEnvRefNode();
450                     resenvrefNode[i].setDisplayName("Binding Item #"+(i+1));
451                 }
452                 resenvch.add(resenvrefNode);
453             }
454             
455             Node resenvrefsNode = new SectionContainerNode(resenvch);
456             resenvrefsNode.setDisplayName("Resource Env Reference Bindings");
457             
458             //rootChildren.add(new Node[]{webbndNode,resenvrefsNode});
459
resenvrefsCont = new SectionContainer(this,resenvrefsNode,"Resource Env Reference Bindings");
460             resenvrefsCont.setHeaderActions(new javax.swing.Action JavaDoc[]{addResEnvRefAction});
461             
462             // creatings section panels for ResEnvRefs
463
if(resenvrefs!=null) {
464                 SectionPanel[] pan = new SectionPanel[resenvrefs.length];
465                 for (int i=0;i<resenvrefs.length;i++) {
466                     pan[i] = new SectionPanel(this, resenvrefNode[i], resenvrefs[i]);
467                     pan[i].setHeaderActions(new javax.swing.Action JavaDoc[]{removeResEnvRefAction});
468                     resenvrefsCont.addSection(pan[i]);
469                 }
470             }
471             addSection(resenvrefsCont);
472             return resenvrefsNode;
473             
474         }
475         
476         public SectionContainer getResRefsContainer() {
477             return resrefsCont;
478         }
479         public SectionContainer getEjbRefsContainer() {
480             return ejbrefsCont;
481         }
482         public SectionContainer getResEnvRefsContainer() {
483             return resenvrefsCont;
484         }
485     }
486     
487     
488     
489     public Error JavaDoc validateView() {
490         try {
491             WSWebBnd webbnd = dObj.getWebBnd();
492             
493             ResRefBindingsType[] resrefs = webbnd.getResRefBindings();
494             if(resrefs==null) {
495                 return null;
496             }
497             for (int i=0;i<resrefs.length;i++) {
498                 String JavaDoc title = resrefs[i].getBindingReference();
499                 if (title==null || title.length()==0) {
500                     Error.ErrorLocation JavaDoc loc = new Error.ErrorLocation JavaDoc(resrefs[i],"title");
501                     return new Error JavaDoc(Error.MISSING_VALUE_MESSAGE, "Title", loc);
502                 }
503                 for (int j=0;j<resrefs.length;j++) {
504                     String JavaDoc tit = resrefs[j].getBindingReference();
505                     if (i!=j && title.equals(tit)) {
506                         Error.ErrorLocation JavaDoc loc = new Error.ErrorLocation JavaDoc(resrefs[i],"title");
507                         return new Error JavaDoc(Error.TYPE_FATAL, Error.DUPLICATE_VALUE_MESSAGE, title, loc);
508                     }
509                 }
510             }
511             
512             EjbRefBindingsType[] ejbrefs = webbnd.getEjbRefBindings();
513             if(ejbrefs==null) {
514                 return null;
515             }
516             for (int i=0;i<ejbrefs.length;i++) {
517                 String JavaDoc title = ejbrefs[i].getBindingReference();
518                 if (title==null || title.length()==0) {
519                     Error.ErrorLocation JavaDoc loc = new Error.ErrorLocation JavaDoc(ejbrefs[i],"title");
520                     return new Error JavaDoc(Error.MISSING_VALUE_MESSAGE, "Title", loc);
521                 }
522                 for (int j=0;j<ejbrefs.length;j++) {
523                     String JavaDoc tit = ejbrefs[j].getBindingReference();
524                     if (i!=j && title.equals(tit)) {
525                         Error.ErrorLocation JavaDoc loc = new Error.ErrorLocation JavaDoc(ejbrefs[i],"title");
526                         return new Error JavaDoc(Error.TYPE_FATAL, Error.DUPLICATE_VALUE_MESSAGE, title, loc);
527                     }
528                 }
529             }
530             
531             ResEnvRefBindingsType[] resenvrefs = webbnd.getResEnvRefBindings();
532             if(resenvrefs==null) {
533                 return null;
534             }
535             for (int i=0;i<resenvrefs.length;i++) {
536                 String JavaDoc title = resenvrefs[i].getBindingReference();
537                 if (title==null || title.length()==0) {
538                     Error.ErrorLocation JavaDoc loc = new Error.ErrorLocation JavaDoc(resenvrefs[i],"title");
539                     return new Error JavaDoc(Error.MISSING_VALUE_MESSAGE, "Title", loc);
540                 }
541                 for (int j=0;j<resenvrefs.length;j++) {
542                     String JavaDoc tit = resenvrefs[j].getBindingReference();
543                     if (i!=j && title.equals(tit)) {
544                         Error.ErrorLocation JavaDoc loc = new Error.ErrorLocation JavaDoc(resenvrefs[i],"title");
545                         return new Error JavaDoc(Error.TYPE_FATAL, Error.DUPLICATE_VALUE_MESSAGE, title, loc);
546                     }
547                 }
548             }
549         } catch (java.io.IOException JavaDoc ex){}
550         return null;
551     }
552     
553     
554     public static class WSWebBndNode extends org.openide.nodes.AbstractNode {
555         WSWebBndNode() {
556             super(org.openide.nodes.Children.LEAF);
557             setDisplayName("General Deployment Binding Information");
558             //setIconBaseWithExtension("org/netbeans/modules/webbndmultiview/ws6.gif"); //NOI18N
559
}
560     }
561     
562 }
563
Popular Tags