KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > clientproject > ui > AppClientLogicalViewProvider


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 package org.netbeans.modules.j2ee.clientproject.ui;
21
22 import java.awt.Image JavaDoc;
23 import java.awt.event.ActionEvent JavaDoc;
24 import java.beans.PropertyChangeEvent JavaDoc;
25 import java.beans.PropertyChangeListener JavaDoc;
26 import java.io.CharConversionException JavaDoc;
27 import java.io.File JavaDoc;
28 import java.io.IOException JavaDoc;
29 import java.net.URI JavaDoc;
30 import java.net.URL JavaDoc;
31 import java.util.ArrayList JavaDoc;
32 import java.util.Arrays JavaDoc;
33 import java.util.Collection JavaDoc;
34 import java.util.Collections JavaDoc;
35 import java.util.HashMap JavaDoc;
36 import java.util.HashSet JavaDoc;
37 import java.util.Iterator JavaDoc;
38 import java.util.List JavaDoc;
39 import java.util.Map JavaDoc;
40 import java.util.ResourceBundle JavaDoc;
41 import java.util.Set JavaDoc;
42 import javax.swing.AbstractAction JavaDoc;
43 import javax.swing.Action JavaDoc;
44 import javax.swing.JSeparator JavaDoc;
45 import javax.swing.SwingUtilities JavaDoc;
46 import javax.swing.event.ChangeEvent JavaDoc;
47 import javax.swing.event.ChangeListener JavaDoc;
48 import org.netbeans.api.java.platform.JavaPlatform;
49 import org.netbeans.api.java.platform.JavaPlatformManager;
50 import org.netbeans.api.java.project.JavaProjectConstants;
51 import org.netbeans.api.project.FileOwnerQuery;
52 import org.netbeans.api.project.Project;
53 import org.netbeans.api.project.ProjectUtils;
54 import org.netbeans.api.project.SourceGroup;
55 import org.netbeans.api.project.Sources;
56 import org.netbeans.modules.j2ee.api.ejbjar.Car;
57 import org.netbeans.modules.j2ee.api.ejbjar.EjbProjectConstants;
58 import org.netbeans.modules.j2ee.clientproject.AppClientProject;
59 import org.netbeans.modules.j2ee.clientproject.AppClientProjectUtil;
60 import org.netbeans.modules.j2ee.clientproject.SourceRoots;
61 import org.netbeans.modules.j2ee.clientproject.UpdateHelper;
62 import org.netbeans.modules.j2ee.clientproject.classpath.ClassPathSupport;
63 import org.netbeans.modules.j2ee.clientproject.ui.customizer.AppClientProjectProperties;
64 import org.netbeans.modules.j2ee.clientproject.ui.customizer.CustomizerLibraries;
65 import org.netbeans.modules.j2ee.clientproject.ui.customizer.CustomizerProviderImpl;
66 import org.netbeans.modules.j2ee.clientproject.wsclient.AppClientProjectWebServicesClientSupport;
67 import org.netbeans.modules.j2ee.common.ui.BrokenServerSupport;
68 import org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment;
69 import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
70 import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform;
71 import org.netbeans.modules.j2ee.deployment.devmodules.spi.InstanceListener;
72 import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
73 import org.netbeans.modules.j2ee.spi.ejbjar.support.J2eeProjectView;
74 import org.netbeans.modules.websvc.api.client.WebServicesClientSupport;
75 import org.netbeans.modules.websvc.api.client.WebServicesClientView;
76 import org.netbeans.modules.websvc.api.jaxws.client.JAXWSClientSupport;
77 import org.netbeans.modules.websvc.api.jaxws.client.JAXWSClientView;
78 import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
79 import org.netbeans.spi.java.project.support.ui.BrokenReferencesSupport;
80 import org.netbeans.spi.java.project.support.ui.PackageView;
81 import org.netbeans.spi.project.ActionProvider;
82 import org.netbeans.spi.project.support.ant.AntProjectHelper;
83 import org.netbeans.spi.project.support.ant.PropertyEvaluator;
84 import org.netbeans.spi.project.support.ant.ReferenceHelper;
85 import org.netbeans.spi.project.ui.LogicalViewProvider;
86 import org.netbeans.spi.project.ui.support.CommonProjectActions;
87 import org.netbeans.spi.project.ui.support.DefaultProjectOperations;
88 import org.netbeans.spi.project.ui.support.ProjectSensitiveActions;
89 import org.openide.ErrorManager;
90 import org.openide.actions.FindAction;
91 import org.openide.actions.ToolsAction;
92 import org.openide.filesystems.FileChangeAdapter;
93 import org.openide.filesystems.FileEvent;
94 import org.openide.filesystems.FileObject;
95 import org.openide.filesystems.FileStateInvalidException;
96 import org.openide.filesystems.FileStatusEvent;
97 import org.openide.filesystems.FileStatusListener;
98 import org.openide.filesystems.FileSystem;
99 import org.openide.filesystems.FileUtil;
100 import org.openide.filesystems.Repository;
101 import org.openide.loaders.DataFolder;
102 import org.openide.loaders.DataObject;
103 import org.openide.loaders.DataObjectNotFoundException;
104 import org.openide.loaders.FolderLookup;
105 import org.openide.modules.SpecificationVersion;
106 import org.openide.nodes.AbstractNode;
107 import org.openide.nodes.Children;
108 import org.openide.nodes.FilterNode;
109 import org.openide.nodes.Node;
110 import org.openide.util.Lookup;
111 import org.openide.util.NbBundle;
112 import org.openide.util.RequestProcessor;
113 import org.openide.util.Utilities;
114 import org.openide.util.WeakListeners;
115 import org.openide.util.actions.SystemAction;
116 import org.openide.util.lookup.Lookups;
117 import org.openide.xml.XMLUtil;
118
119 /**
120  * Support for creating logical views.
121  * @author Petr Hrebejk
122  */

123 public class AppClientLogicalViewProvider implements LogicalViewProvider {
124     
125     private static final RequestProcessor BROKEN_LINKS_RP = new RequestProcessor("AppClientLogicalViewProvider.BROKEN_LINKS_RP"); // NOI18N
126

127     private final AppClientProject project;
128     private final UpdateHelper helper;
129     private final PropertyEvaluator evaluator;
130     private final ReferenceHelper resolver;
131     private List JavaDoc<ChangeListener JavaDoc> changeListeners;
132     
133     // Web service client
134
private static final Object JavaDoc KEY_SERVICE_REFS = "serviceRefs"; // NOI18N
135
private static final String JavaDoc KEY_SETUP_DIR = "setupDir"; //NOI18N
136
private static final String JavaDoc KEY_CONF_DIR = "confDir"; //NOI18N
137

138     public AppClientLogicalViewProvider(AppClientProject project, UpdateHelper helper, PropertyEvaluator evaluator, ReferenceHelper resolver) {
139         this.project = project;
140         assert project != null;
141         this.helper = helper;
142         assert helper != null;
143         this.evaluator = evaluator;
144         assert evaluator != null;
145         this.resolver = resolver;
146     }
147     
148     public Node createLogicalView() {
149         return new AppClientLogicalViewRootNode();
150     }
151     
152     public Node findPath(Node root, Object JavaDoc target) {
153         Project project = (Project) root.getLookup().lookup(Project.class);
154         if (project == null) {
155             return null;
156         }
157         
158         if (target instanceof FileObject) {
159             FileObject fo = (FileObject) target;
160             Project owner = FileOwnerQuery.getOwner(fo);
161             if (!project.equals(owner)) {
162                 return null; // Don't waste time if project does not own the fo
163
}
164             
165             Node[] nodes = root.getChildren().getNodes(true);
166             for (int i = 0; i < nodes.length; i++) {
167                 Node result = PackageView.findPath(nodes[i], target);
168                 if (result != null) {
169                     return result;
170                 }
171             }
172         }
173         
174         return null;
175     }
176     
177     
178     
179     public synchronized void addChangeListener(ChangeListener JavaDoc l) {
180         if (this.changeListeners == null) {
181             this.changeListeners = new ArrayList JavaDoc<ChangeListener JavaDoc>();
182         }
183         this.changeListeners.add(l);
184     }
185     
186     public synchronized void removeChangeListener(ChangeListener JavaDoc l) {
187         if (this.changeListeners == null) {
188             return;
189         }
190         this.changeListeners.remove(l);
191     }
192     
193     /**
194      * Used by AppClientProjectCustomizer to mark the project as broken when it warns user
195      * about project's broken references and advices him to use BrokenLinksAction to correct it.
196      */

197     public void testBroken() {
198         ChangeListener JavaDoc[] _listeners;
199         synchronized (this) {
200             if (this.changeListeners == null) {
201                 return;
202             }
203             _listeners = this.changeListeners.toArray(new ChangeListener JavaDoc[this.changeListeners.size()]);
204         }
205         ChangeEvent JavaDoc event = new ChangeEvent JavaDoc(this);
206         for (int i=0; i < _listeners.length; i++) {
207             _listeners[i].stateChanged(event);
208         }
209     }
210     
211     // Private innerclasses ----------------------------------------------------
212

213     private static final String JavaDoc[] BREAKABLE_PROPERTIES = new String JavaDoc[] {
214         AppClientProjectProperties.JAVAC_CLASSPATH,
215 // AppClientProjectProperties.RUN_CLASSPATH, take it from target server
216
AppClientProjectProperties.DEBUG_CLASSPATH,
217         AppClientProjectProperties.RUN_TEST_CLASSPATH,
218         AppClientProjectProperties.DEBUG_TEST_CLASSPATH,
219         AppClientProjectProperties.JAVAC_TEST_CLASSPATH,
220     };
221     
222     public boolean hasBrokenLinks() {
223         return BrokenReferencesSupport.isBroken(helper.getAntProjectHelper(), resolver, getBreakableProperties(),
224                 new String JavaDoc[] {AppClientProjectProperties.JAVA_PLATFORM});
225     }
226     
227     public boolean hasInvalidJdkVersion() {
228         String JavaDoc javaSource = this.evaluator.getProperty("javac.source"); //NOI18N
229
String JavaDoc javaTarget = this.evaluator.getProperty("javac.target"); //NOI18N
230
if (javaSource == null && javaTarget == null) {
231             //No need to check anything
232
return false;
233         }
234         
235         final String JavaDoc platformId = this.evaluator.getProperty(AppClientProjectProperties.JAVA_PLATFORM); //NOI18N
236
final JavaPlatform activePlatform = AppClientProjectUtil.getActivePlatform(platformId);
237         if (activePlatform == null) {
238             return true;
239         }
240         SpecificationVersion platformVersion = activePlatform.getSpecification().getVersion();
241         try {
242             return (javaSource != null && new SpecificationVersion(javaSource).compareTo(platformVersion)>0)
243             || (javaTarget != null && new SpecificationVersion(javaTarget).compareTo(platformVersion)>0);
244         } catch (NumberFormatException JavaDoc nfe) {
245             ErrorManager.getDefault().log("Invalid javac.source: "+javaSource+" or javac.target: "+javaTarget+" of project:"
246                     +this.project.getProjectDirectory().getPath());
247             return true;
248         }
249     }
250     
251     private String JavaDoc[] getBreakableProperties() {
252         SourceRoots roots = this.project.getSourceRoots();
253         String JavaDoc[] srcRootProps = roots.getRootProperties();
254         roots = this.project.getTestSourceRoots();
255         String JavaDoc[] testRootProps = roots.getRootProperties();
256         String JavaDoc[] result = new String JavaDoc [BREAKABLE_PROPERTIES.length + srcRootProps.length + testRootProps.length];
257         System.arraycopy(BREAKABLE_PROPERTIES, 0, result, 0, BREAKABLE_PROPERTIES.length);
258         System.arraycopy(srcRootProps, 0, result, BREAKABLE_PROPERTIES.length, srcRootProps.length);
259         System.arraycopy(testRootProps, 0, result, BREAKABLE_PROPERTIES.length + srcRootProps.length, testRootProps.length);
260         return result;
261     }
262     
263     private static Image JavaDoc brokenProjectBadge = Utilities.loadImage("org/netbeans/modules/j2ee/clientproject/ui/resources/brokenProjectBadge.gif", true);
264     
265     /** Filter node containin additional features for the J2SE physical
266      */

267     private final class AppClientLogicalViewRootNode extends AbstractNode implements Runnable JavaDoc, FileStatusListener, ChangeListener JavaDoc, PropertyChangeListener JavaDoc {
268         
269         private Action JavaDoc brokenLinksAction;
270         private BrokenServerAction brokenServerAction;
271         private boolean broken; //Represents a state where project has a broken reference repairable by broken reference support
272
private boolean illegalState; //Represents a state where project is not in legal state, eg invalid source/target level
273

274         // icon badging >>>
275
private Set JavaDoc files;
276         private Map JavaDoc<FileSystem, FileStatusListener> fileSystemListeners;
277         private RequestProcessor.Task task;
278         private final Object JavaDoc privateLock = new Object JavaDoc();
279         private boolean iconChange;
280         private boolean nameChange;
281         private ChangeListener JavaDoc sourcesListener;
282         private Map JavaDoc<SourceGroup, PropertyChangeListener JavaDoc> groupsListeners;
283         //private Project project;
284
// icon badging <<<
285

286         public AppClientLogicalViewRootNode() {
287             super(new LogicalViewChildren(project, evaluator, helper, resolver), Lookups.singleton(project));
288             setIconBaseWithExtension("org/netbeans/modules/j2ee/clientproject/ui/resources/appclient.gif"); // NOI18N
289
super.setName( ProjectUtils.getInformation( project ).getDisplayName() );
290             if (hasBrokenLinks()) {
291                 broken = true;
292             } else if (hasInvalidJdkVersion()) {
293                 illegalState = true;
294             }
295             brokenLinksAction = new BrokenLinksAction();
296             brokenServerAction = new BrokenServerAction();
297             J2eeModuleProvider moduleProvider = (J2eeModuleProvider)project.getLookup().lookup(J2eeModuleProvider.class);
298             moduleProvider.addInstanceListener((InstanceListener)WeakListeners.create(
299                         InstanceListener.class, brokenServerAction, moduleProvider));
300             setProjectFiles(project);
301         }
302         
303         
304         protected void setProjectFiles(Project project) {
305             Sources sources = ProjectUtils.getSources(project); // returns singleton
306
if (sourcesListener == null) {
307                 sourcesListener = WeakListeners.change(this, sources);
308                 sources.addChangeListener(sourcesListener);
309             }
310             setGroups(Arrays.asList(sources.getSourceGroups(Sources.TYPE_GENERIC)));
311         }
312         
313         
314         private void setGroups(Collection JavaDoc groups) {
315             if (groupsListeners != null) {
316                 Iterator JavaDoc it = groupsListeners.keySet().iterator();
317                 while (it.hasNext()) {
318                     SourceGroup group = (SourceGroup) it.next();
319                     PropertyChangeListener JavaDoc pcl = groupsListeners.get(group);
320                     group.removePropertyChangeListener(pcl);
321                 }
322             }
323             groupsListeners = new HashMap JavaDoc<SourceGroup, PropertyChangeListener JavaDoc>();
324             Set JavaDoc<FileObject> roots = new HashSet JavaDoc<FileObject>();
325             Iterator JavaDoc it = groups.iterator();
326             while (it.hasNext()) {
327                 SourceGroup group = (SourceGroup) it.next();
328                 PropertyChangeListener JavaDoc pcl = WeakListeners.propertyChange(this, group);
329                 groupsListeners.put(group, pcl);
330                 group.addPropertyChangeListener(pcl);
331                 FileObject fo = group.getRootFolder();
332                 roots.add(fo);
333             }
334             setFiles(roots);
335         }
336         
337         protected void setFiles(Set JavaDoc files) {
338             if (fileSystemListeners != null) {
339                 for (FileSystem fs : fileSystemListeners.keySet()) {
340                     FileStatusListener fsl = (FileStatusListener) fileSystemListeners.get(fs);
341                     fs.removeFileStatusListener(fsl);
342                 }
343             }
344             
345             fileSystemListeners = new HashMap JavaDoc<FileSystem, FileStatusListener>();
346             this.files = files;
347             if (files == null) {
348                 return;
349             }
350             
351             Iterator JavaDoc it = files.iterator();
352             Set JavaDoc<FileSystem> hookedFileSystems = new HashSet JavaDoc<FileSystem>();
353             while (it.hasNext()) {
354                 FileObject fo = (FileObject) it.next();
355                 try {
356                     FileSystem fs = fo.getFileSystem();
357                     if (hookedFileSystems.contains(fs)) {
358                         continue;
359                     }
360                     hookedFileSystems.add(fs);
361                     FileStatusListener fsl = FileUtil.weakFileStatusListener(this, fs);
362                     fs.addFileStatusListener(fsl);
363                     fileSystemListeners.put(fs, fsl);
364                 } catch (FileStateInvalidException e) {
365                     ErrorManager err = ErrorManager.getDefault();
366                     err.annotate(e, ErrorManager.UNKNOWN, "Cannot get " + fo + " filesystem, ignoring...", null, null, null); // NOI18N
367
err.notify(ErrorManager.INFORMATIONAL, e);
368                 }
369             }
370         }
371         
372         public String JavaDoc getHtmlDisplayName() {
373             String JavaDoc dispName = super.getDisplayName();
374             try {
375                 dispName = XMLUtil.toElementContent(dispName);
376             } catch (CharConversionException JavaDoc ex) {
377                 return dispName;
378             }
379             // XXX text colors should be taken from UIManager, not hard-coded!
380
return broken || illegalState || brokenServerAction.isEnabled() ? "<font color=\"#A40000\">" + dispName + "</font>" : null; //NOI18N
381
}
382         
383         public Image JavaDoc getIcon(int type) {
384             Image JavaDoc img = getMyIcon(type);
385             
386             if (files != null && files.iterator().hasNext()) {
387                 try {
388                     FileObject fo = (FileObject) files.iterator().next();
389                     img = fo.getFileSystem().getStatus().annotateIcon(img, type, files);
390                 } catch (FileStateInvalidException e) {
391                     ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
392                 }
393             }
394             
395             return img;
396         }
397         
398         private Image JavaDoc getMyIcon(int type) {
399             Image JavaDoc original = super.getIcon(type);
400             return broken || illegalState || brokenServerAction.isEnabled()
401                    ? Utilities.mergeImages(original, brokenProjectBadge, 8, 0)
402                    : original;
403         }
404         
405         public Image JavaDoc getOpenedIcon(int type) {
406             Image JavaDoc img = getMyOpenedIcon(type);
407             
408             if (files != null && files.iterator().hasNext()) {
409                 try {
410                     FileObject fo = (FileObject) files.iterator().next();
411                     img = fo.getFileSystem().getStatus().annotateIcon(img, type, files);
412                 } catch (FileStateInvalidException e) {
413                     ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
414                 }
415             }
416             
417             return img;
418         }
419         
420         private Image JavaDoc getMyOpenedIcon(int type) {
421             Image JavaDoc original = super.getOpenedIcon(type);
422             return broken || illegalState || brokenServerAction.isEnabled()
423                    ? Utilities.mergeImages(original, brokenProjectBadge, 8, 0)
424                    : original;
425         }
426         
427         public void run() {
428             boolean fireIcon;
429             boolean fireName;
430             synchronized (privateLock) {
431                 fireIcon = iconChange;
432                 fireName = nameChange;
433                 iconChange = false;
434                 nameChange = false;
435             }
436             if (fireIcon) {
437                 fireIconChange();
438                 fireOpenedIconChange();
439             }
440             if (fireName) {
441                 fireDisplayNameChange(null, null);
442             }
443         }
444         
445         public void annotationChanged(FileStatusEvent event) {
446             if (task == null) {
447                 task = RequestProcessor.getDefault().create(this);
448             }
449             
450             synchronized (privateLock) {
451                 if ((iconChange == false && event.isIconChange()) || (nameChange == false && event.isNameChange())) {
452                     Iterator JavaDoc it = files.iterator();
453                     while (it.hasNext()) {
454                         FileObject fo = (FileObject) it.next();
455                         if (event.hasChanged(fo)) {
456                             iconChange |= event.isIconChange();
457                             nameChange |= event.isNameChange();
458                         }
459                     }
460                 }
461             }
462             
463             task.schedule(50); // batch by 50 ms
464
}
465         
466         // sources change
467
public void stateChanged(ChangeEvent JavaDoc e) {
468             setProjectFiles(project);
469         }
470         
471         // group change
472
public void propertyChange(PropertyChangeEvent JavaDoc evt) {
473             setProjectFiles(project);
474         }
475         
476         public Action JavaDoc[] getActions( boolean context ) {
477             return getAdditionalActions();
478         }
479         
480         public boolean canRename() {
481             return true;
482         }
483         
484         public void setName(String JavaDoc s) {
485             DefaultProjectOperations.performDefaultRenameOperation(project, s);
486         }
487         
488         /*
489         public boolean canDestroy() {
490             return true;
491         }
492          
493         public void destroy() throws IOException {
494             System.out.println("Destroy " + project.getProjectDirectory());
495             LogicalViews.closeProjectAction().actionPerformed(new ActionEvent(this, 0, ""));
496             project.getProjectDirectory().delete();
497         }
498          */

499         
500         // Private methods -------------------------------------------------
501

502         private Action JavaDoc[] getAdditionalActions() {
503             
504             ResourceBundle JavaDoc bundle = NbBundle.getBundle(AppClientLogicalViewProvider.class);
505             
506             List JavaDoc<Action JavaDoc> actions = new ArrayList JavaDoc<Action JavaDoc>(30);
507             
508             J2eeModuleProvider provider = (J2eeModuleProvider) project.getLookup().lookup(J2eeModuleProvider.class);
509             actions.add(CommonProjectActions.newFileAction());
510             actions.add(null);
511             actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_BUILD, bundle.getString("LBL_BuildAction_Name"), null)); // NOI18N
512
actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_REBUILD, bundle.getString("LBL_RebuildAction_Name"), null)); // NOI18N
513
actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, bundle.getString("LBL_CleanAction_Name"), null)); // NOI18N
514
if (provider != null && provider.hasVerifierSupport()) {
515                 actions.add(ProjectSensitiveActions.projectCommandAction( "verify", bundle.getString( "LBL_VerifyAction_Name" ), null )); // NOI18N
516
}
517             actions.add(ProjectSensitiveActions.projectCommandAction(JavaProjectConstants.COMMAND_JAVADOC, bundle.getString("LBL_JavadocAction_Name"), null)); // NOI18N
518
actions.add(null);
519             actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_RUN, bundle.getString("LBL_RunAction_Name"), null)); // NOI18N
520
actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, bundle.getString("LBL_DebugAction_Name"), null)); // NOI18N
521
actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST, bundle.getString("LBL_TestAction_Name"), null)); // NOI18N
522
actions.add(ProjectSensitiveActions.projectCommandAction(EjbProjectConstants.COMMAND_REDEPLOY, bundle.getString( "LBL_RedeployAction_Name" ), null )); // NOI18N
523
actions.add(null);
524             actions.add(CommonProjectActions.setAsMainProjectAction());
525             actions.add(CommonProjectActions.openSubprojectsAction());
526             actions.add(CommonProjectActions.closeProjectAction());
527             actions.add(null);
528             actions.add(CommonProjectActions.renameProjectAction());
529             actions.add(CommonProjectActions.moveProjectAction());
530             actions.add(CommonProjectActions.copyProjectAction());
531             actions.add(CommonProjectActions.deleteProjectAction());
532             actions.add(null);
533             actions.add(SystemAction.get(FindAction.class));
534             
535             // honor 57874 contact
536

537             try {
538                 FileObject fo = Repository.getDefault().getDefaultFileSystem().findResource("Projects/Actions"); // NOI18N
539
if (fo != null) {
540                     DataObject dobj = DataObject.find(fo);
541                     FolderLookup actionRegistry = new FolderLookup((DataFolder)dobj);
542                     Lookup.Template query = new Lookup.Template(Object JavaDoc.class);
543                     Lookup lookup = actionRegistry.getLookup();
544                     Iterator JavaDoc it = lookup.lookup(query).allInstances().iterator();
545                     if (it.hasNext()) {
546                         actions.add(null);
547                     }
548                     while (it.hasNext()) {
549                         Object JavaDoc next = it.next();
550                         if (next instanceof Action JavaDoc) {
551                             actions.add((Action JavaDoc) next);
552                         } else if (next instanceof JSeparator JavaDoc) {
553                             actions.add(null);
554                         }
555                     }
556                 }
557             } catch (DataObjectNotFoundException ex) {
558                 // data folder for existing fileobject expected
559
ErrorManager.getDefault().notify(ex);
560             }
561             
562             actions.add(null);
563             actions.add(SystemAction.get(ToolsAction.class));
564             
565             actions.add(null);
566             if (brokenLinksAction != null && brokenLinksAction.isEnabled()) {
567                 actions.add(brokenLinksAction);
568             }
569             if (brokenServerAction.isEnabled()) {
570                 actions.add(brokenServerAction);
571             }
572             actions.add(CommonProjectActions.customizeProjectAction());
573
574             return (Action JavaDoc[])actions.toArray(new Action JavaDoc[actions.size()]);
575         }
576         
577         private boolean isBroken() {
578             return this.broken;
579         }
580         
581         private void setBroken(boolean broken) {
582             this.broken = broken;
583             brokenLinksAction.setEnabled(broken);
584             fireIconChange();
585             fireOpenedIconChange();
586             fireDisplayNameChange(null, null);
587         }
588         
589         private void setIllegalState(boolean illegalState) {
590             this.illegalState = illegalState;
591             fireIconChange();
592             fireOpenedIconChange();
593             fireDisplayNameChange(null, null);
594         }
595         
596         /** This action is created only when project has broken references.
597          * Once these are resolved the action is disabled.
598          */

599         private class BrokenLinksAction extends AbstractAction JavaDoc implements PropertyChangeListener JavaDoc, ChangeListener JavaDoc, Runnable JavaDoc {
600             
601             private RequestProcessor.Task task = null;
602             
603             private final PropertyChangeListener JavaDoc weakPCL;
604             
605             public BrokenLinksAction() {
606                 putValue(Action.NAME, NbBundle.getMessage(AppClientLogicalViewProvider.class, "LBL_Fix_Broken_Links_Action"));
607                 setEnabled(broken);
608                 evaluator.addPropertyChangeListener(this);
609                 // When evaluator fires changes that platform properties were
610
// removed the platform still exists in JavaPlatformManager.
611
// That's why I have to listen here also on JPM:
612
weakPCL = WeakListeners.propertyChange(this, JavaPlatformManager.getDefault());
613                 JavaPlatformManager.getDefault().addPropertyChangeListener(weakPCL);
614                 AppClientLogicalViewProvider.this.addChangeListener((ChangeListener JavaDoc) WeakListeners.change(this, AppClientLogicalViewProvider.this));
615             }
616             
617             public void actionPerformed(ActionEvent JavaDoc e) {
618                 try {
619                     helper.requestSave();
620                     BrokenReferencesSupport.showCustomizer(helper.getAntProjectHelper(), resolver, getBreakableProperties(), new String JavaDoc[] {AppClientProjectProperties.JAVA_PLATFORM});
621                     run();
622                 } catch (IOException JavaDoc ioe) {
623                     ErrorManager.getDefault().notify(ioe);
624                 }
625             }
626             
627             public void propertyChange(PropertyChangeEvent JavaDoc evt) {
628                 refsMayChanged();
629             }
630             
631             
632             public void stateChanged(ChangeEvent JavaDoc evt) {
633                 refsMayChanged();
634             }
635             
636             public synchronized void run() {
637                 boolean old = AppClientLogicalViewRootNode.this.broken;
638                 boolean broken = hasBrokenLinks();
639                 if (old != broken) {
640                     setBroken(broken);
641                 }
642                 
643                 old = AppClientLogicalViewRootNode.this.illegalState;
644                 broken = hasInvalidJdkVersion();
645                 if (old != broken) {
646                     setIllegalState(broken);
647                 }
648             }
649             
650             private void refsMayChanged() {
651                 // check project state whenever there was a property change
652
// or change in list of platforms.
653
// Coalesce changes since they can come quickly:
654
if (task == null) {
655                     task = BROKEN_LINKS_RP.create(this);
656                 }
657                 task.schedule(100);
658             }
659             
660         }
661         
662         private class BrokenServerAction extends AbstractAction JavaDoc implements
663                     InstanceListener, PropertyChangeListener JavaDoc {
664
665             private RequestProcessor.Task task = null;
666             private boolean brokenServer;
667             
668             public BrokenServerAction() {
669                 putValue(Action.NAME, NbBundle.getMessage(AppClientLogicalViewProvider.class, "LBL_Fix_Missing_Server_Action")); // NOI18N
670
evaluator.addPropertyChangeListener(this);
671                 checkMissingServer();
672             }
673             
674             public boolean isEnabled() {
675                 return brokenServer;
676             }
677
678             public void actionPerformed(ActionEvent JavaDoc e) {
679                 String JavaDoc j2eeSpec = AppClientProjectProperties.getProperty(
680                         AppClientProjectProperties.J2EE_PLATFORM,
681                         helper.getAntProjectHelper(),
682                         AntProjectHelper.PROJECT_PROPERTIES_PATH);
683                 String JavaDoc instance = BrokenServerSupport.selectServer(j2eeSpec, J2eeModule.CLIENT);
684                 if (instance != null) {
685                     AppClientProjectProperties.setServerInstance(
686                             project, helper.getAntProjectHelper(), instance);
687                 }
688                 checkMissingServer();
689             }
690
691             public void propertyChange(PropertyChangeEvent JavaDoc evt) {
692                 if (AppClientProjectProperties.J2EE_SERVER_INSTANCE.equals(evt.getPropertyName())) {
693                     checkMissingServer();
694                 }
695             }
696                 
697             public void changeDefaultInstance(String JavaDoc oldServerInstanceID, String JavaDoc newServerInstanceID) {
698             }
699
700             public void instanceAdded(String JavaDoc serverInstanceID) {
701                 checkMissingServer();
702             }
703
704             public void instanceRemoved(String JavaDoc serverInstanceID) {
705                 checkMissingServer();
706             }
707
708             private void checkMissingServer() {
709                 boolean old = brokenServer;
710                 String JavaDoc servInstID = AppClientProjectProperties.getProperty(AppClientProjectProperties.J2EE_SERVER_INSTANCE, helper.getAntProjectHelper(), AntProjectHelper.PRIVATE_PROPERTIES_PATH);
711                 brokenServer = BrokenServerSupport.isBroken(servInstID);
712                 if (old != brokenServer) {
713                     fireIconChange();
714                     fireOpenedIconChange();
715                     fireDisplayNameChange(null, null);
716                 }
717             }
718         }
719     }
720     
721     private static final class LogicalViewChildren extends Children.Keys/*<SourceGroup>*/ implements ChangeListener JavaDoc {
722         
723         private static final Object JavaDoc LIBRARIES = "Libs"; //NOI18N
724
private static final Object JavaDoc TEST_LIBRARIES = "TestLibs"; //NOI18N
725
private static final String JavaDoc WSDL_FOLDER=AppClientProjectWebServicesClientSupport.WSDL_FOLDER;
726         
727         private final Project project;
728         private final PropertyEvaluator evaluator;
729         private final UpdateHelper helper;
730         private final ReferenceHelper resolver;
731         private final SourceRoots testSources;
732         
733         private final WsdlCreationListener wsdlListener;
734         private final MetaInfListener metaInfListener;
735         private FileObject wsdlFolder;
736         private Car jp;
737         
738         public LogicalViewChildren(AppClientProject project, PropertyEvaluator evaluator, UpdateHelper helper, ReferenceHelper resolver) {
739             this.project = project;
740             this.evaluator = evaluator;
741             this.helper = helper;
742             this.resolver = resolver;
743             this.testSources = project.getTestSourceRoots();
744             this.metaInfListener = new MetaInfListener();
745             this.wsdlListener = new WsdlCreationListener();
746             Car jps[] = Car.getCars(project);
747             assert jps.length > 0;
748             jp = jps[0];
749         }
750         
751         protected void addNotify() {
752             super.addNotify();
753             getSources().addChangeListener(this);
754             
755             AntProjectHelper projectHelper = helper.getAntProjectHelper();
756             String JavaDoc prop = evaluator.getProperty(AppClientProjectProperties.META_INF); //NOI18N
757
if (prop!=null) {
758                 FileObject metaInf = projectHelper.resolveFileObject(prop);
759                 if (metaInf!=null) {
760                     metaInf.addFileChangeListener(metaInfListener);
761                 }
762             }
763             prop = evaluator.getProperty(AppClientProjectProperties.SRC_DIR); //NOI18N
764
if (prop!=null) {
765                 FileObject srcDir = projectHelper.resolveFileObject(prop);
766                 if (srcDir!=null) {
767                     srcDir.addFileChangeListener(metaInfListener);
768                 }
769             }
770             
771             //XXX: Not very nice, the wsdlFolder should be hold by this class because it listens on it
772
WebServicesClientSupport wsClientSupportImpl = WebServicesClientSupport.getWebServicesClientSupport(project.getProjectDirectory());
773             try {
774                 if (wsClientSupportImpl != null) {
775                     wsdlFolder = wsClientSupportImpl.getWsdlFolder(false);
776                 }
777             } catch (IOException JavaDoc ex) {
778                 ErrorManager.getDefault().notify(ex);
779             }
780             if (wsdlFolder != null) {
781                 wsdlFolder.addFileChangeListener(wsdlListener);
782             }
783             setKeys(getKeys());
784         }
785         
786         protected void removeNotify() {
787             setKeys(Collections.EMPTY_SET);
788             getSources().removeChangeListener(this);
789             
790             AntProjectHelper projectHelper = helper.getAntProjectHelper();
791             String JavaDoc prop = evaluator.getProperty(AppClientProjectProperties.META_INF); //NOI18N
792
if (prop!=null) {
793                 FileObject metaInf = projectHelper.resolveFileObject(prop);
794                 if (metaInf!=null) {
795                     metaInf.addFileChangeListener(metaInfListener);
796                 }
797             }
798             prop = evaluator.getProperty(AppClientProjectProperties.SRC_DIR); //NOI18N
799
if (prop!=null) {
800                 FileObject srcDir = projectHelper.resolveFileObject(prop);
801                 if (srcDir!=null) {
802                     srcDir.removeFileChangeListener(metaInfListener);
803                 }
804             }
805             if (wsdlFolder != null) {
806                 wsdlFolder.removeFileChangeListener(wsdlListener);
807             }
808             
809             super.removeNotify();
810         }
811         
812         protected Node[] createNodes(Object JavaDoc key) {
813             Node[] result;
814             if (key == LIBRARIES) {
815                 //Libraries Node
816
result = new Node[] {
817                     new LibrariesNode(
818                             NbBundle.getMessage(AppClientLogicalViewProvider.class,"CTL_LibrariesNode"),
819                             project,
820                             evaluator,
821                             helper,
822                             resolver,
823                             AppClientProjectProperties.RUN_CLASSPATH,
824                             new String JavaDoc[] {AppClientProjectProperties.BUILD_CLASSES_DIR},
825                             AppClientProjectProperties.JAVA_PLATFORM, // NOI18N
826
AppClientProjectProperties.J2EE_SERVER_INSTANCE,
827                             new Action JavaDoc[] {
828                         LibrariesNode.createAddProjectAction(project, AppClientProjectProperties.JAVAC_CLASSPATH,
829                                                          ClassPathSupport.ELEMENT_INCLUDED_LIBRARIES),
830                         LibrariesNode.createAddLibraryAction(project, helper.getAntProjectHelper(), AppClientProjectProperties.JAVAC_CLASSPATH,
831                                                          ClassPathSupport.ELEMENT_INCLUDED_LIBRARIES),
832                         LibrariesNode.createAddFolderAction(project, AppClientProjectProperties.JAVAC_CLASSPATH,
833                                                          ClassPathSupport.ELEMENT_INCLUDED_LIBRARIES),
834                         null,
835                         new PreselectPropertiesAction(project, "Libraries", CustomizerLibraries.COMPILE) // NOI18N
836
},
837                     ClassPathSupport.ELEMENT_INCLUDED_LIBRARIES)
838                 };
839             } else if (key == TEST_LIBRARIES) {
840                 result = new Node[] {
841                     new LibrariesNode(
842                             NbBundle.getMessage(AppClientLogicalViewProvider.class,"CTL_TestLibrariesNode"),
843                             project,
844                             evaluator,
845                             helper,
846                             resolver,
847                             AppClientProjectProperties.RUN_TEST_CLASSPATH,
848                             new String JavaDoc[] {
849                         AppClientProjectProperties.BUILD_TEST_CLASSES_DIR,
850                         AppClientProjectProperties.JAVAC_CLASSPATH,
851                         AppClientProjectProperties.BUILD_CLASSES_DIR,
852                             },
853                             null,
854                             null,
855                             new Action JavaDoc[] {
856                         LibrariesNode.createAddProjectAction(project, AppClientProjectProperties.JAVAC_TEST_CLASSPATH, null),
857                         LibrariesNode.createAddLibraryAction(project, helper.getAntProjectHelper(), AppClientProjectProperties.JAVAC_TEST_CLASSPATH, null),
858                         LibrariesNode.createAddFolderAction(project, AppClientProjectProperties.JAVAC_TEST_CLASSPATH, null),
859                         null,
860                         new PreselectPropertiesAction(project, "Libraries", CustomizerLibraries.COMPILE_TESTS), // NOI18N
861
},
862                             null
863                     ),
864                 };
865             }
866             // else if (key instanceof SourceGroup) {
867
else if (key instanceof SourceGroupKey) {
868                 //Source root
869
//result = new Node[] {new PackageViewFilterNode(((SourceGroupKey) key).group, project)};
870
result = new Node[] {PackageView.createPackageView(((SourceGroupKey) key).group)};
871             } else if (key == KEY_SETUP_DIR) {
872                 result = new Node[] {J2eeProjectView.createServerResourcesNode(project)};
873             } else if (key == KEY_CONF_DIR) {
874                 result = new Node[] {J2eeProjectView.createConfigFilesView(jp.getMetaInf())};
875             } else if (key == KEY_SERVICE_REFS) {
876                 java.util.Map JavaDoc properties = ((AppClientProject) project).getAntProjectHelper().getStandardPropertyEvaluator().getProperties();
877                 String JavaDoc serverInstance = (String JavaDoc)properties.get(AppClientProjectProperties.J2EE_SERVER_INSTANCE);
878                 J2eePlatform j2eePlatform = Deployment.getDefault().getJ2eePlatform(serverInstance);
879                 
880                 Car wm = Car.getCar(project.getProjectDirectory());
881                 result = null;
882                 if (wm!=null && (J2eeModule.JAVA_EE_5.equals(wm.getJ2eePlatformVersion()))) {
883                     JAXWSClientView view = JAXWSClientView.getJAXWSClientView();
884                     result = view == null ? new Node[0] : new Node[] {view.createJAXWSClientView(project)};
885                 } else {
886                     FileObject clientRoot = project.getProjectDirectory();
887                     WebServicesClientView clientView = WebServicesClientView.getWebServicesClientView(clientRoot);
888                     if (clientView != null) {
889                         WebServicesClientSupport wss = WebServicesClientSupport.getWebServicesClientSupport(clientRoot);
890                         if (wss!=null) {
891                             FileObject wsdlFolder = wss.getWsdlFolder();
892                             if (wsdlFolder!=null) {
893                                 FileObject[] children = wsdlFolder.getChildren();
894                                 boolean foundWsdl = false;
895                                 for (int i=0;i<children.length;i++) {
896                                     if (children[i].getExt().equalsIgnoreCase(WSDL_FOLDER)) { //NOI18N
897
foundWsdl=true;
898                                         break;
899                                     }
900                                 }
901                                 if (foundWsdl) {
902                                     result = new Node[] {clientView.createWebServiceClientView(wsdlFolder)};
903                                 }
904                             }
905                         }
906                     }
907                 }
908             } else {
909                 assert false : "Unknown key type"; //NOI18N
910
result = new Node[0];
911             }
912             return result;
913         }
914         
915         public void stateChanged(ChangeEvent JavaDoc e) {
916             // setKeys(getKeys());
917
// The caller holds ProjectManager.mutex() read lock
918
SwingUtilities.invokeLater(new Runnable JavaDoc() {
919                 public void run() {
920                     setKeys(getKeys());
921                 }
922             });
923         }
924         
925         // Private methods -----------------------------------------------------
926

927         private Collection JavaDoc getKeys() {
928             //#60800, #61584 - when the project is deleted externally do not try to create children, the source groups
929
//are not valid
930
if (this.project.getProjectDirectory() == null || !this.project.getProjectDirectory().isValid()) {
931                 return Collections.EMPTY_LIST;
932             }
933             Sources sources = getSources();
934             SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
935             
936             List JavaDoc<Object JavaDoc> result = new ArrayList JavaDoc<Object JavaDoc>(groups.length);
937             result.add(KEY_CONF_DIR);
938             result.add(KEY_SETUP_DIR);
939             for( int i = 0; i < groups.length; i++ ) {
940                 result.add(new SourceGroupKey(groups[i]));
941             }
942             result.add(LIBRARIES);
943             URL JavaDoc[] testRoots = this.testSources.getRootURLs();
944             boolean addTestSources = false;
945             for (int i = 0; i < testRoots.length; i++) {
946                 File JavaDoc f = new File JavaDoc(URI.create(testRoots[i].toExternalForm()));
947                 if (f.exists()) {
948                     addTestSources = true;
949                     break;
950                 }
951             }
952             if (addTestSources) {
953                 result.add(TEST_LIBRARIES);
954             }
955             
956             //show the ws client node iff there are some clients
957
JaxWsModel jaxWsModel = (JaxWsModel)project.getLookup().lookup(JaxWsModel.class);
958             JAXWSClientSupport jwcss = JAXWSClientSupport.getJaxWsClientSupport(project.getProjectDirectory());
959             if ((jwcss != null) && (jaxWsModel != null) && (jaxWsModel.getClients().length > 0)) {
960                 result.add(KEY_SERVICE_REFS);
961             } else {
962                 WebServicesClientSupport wscs = WebServicesClientSupport.getWebServicesClientSupport(project.getProjectDirectory());
963                 List JavaDoc wsClients = wscs.getServiceClients();
964                 if ((wsClients != null) && (!wsClients.isEmpty())) {
965                     result.add(KEY_SERVICE_REFS);
966                 }
967             }
968             
969             return result;
970         }
971         
972         private Sources getSources() {
973             return ProjectUtils.getSources(project);
974         }
975         
976         private static class SourceGroupKey {
977             
978             public final SourceGroup group;
979             public final FileObject fileObject;
980             
981             SourceGroupKey(SourceGroup group) {
982                 this.group = group;
983                 this.fileObject = group.getRootFolder();
984             }
985             
986             public int hashCode() {
987                 return fileObject.hashCode();
988             }
989             
990             public boolean equals(Object JavaDoc obj) {
991                 if (!(obj instanceof SourceGroupKey)) {
992                     return false;
993                 } else {
994                     SourceGroupKey otherKey = (SourceGroupKey) obj;
995                     String JavaDoc thisDisplayName = this.group.getDisplayName();
996                     String JavaDoc otherDisplayName = otherKey.group.getDisplayName();
997                     // XXX what is the operator binding order supposed to be here??
998
return fileObject.equals(otherKey.fileObject) &&
999                             thisDisplayName == null ? otherDisplayName == null : thisDisplayName.equals(otherDisplayName);
1000                }
1001            }
1002            
1003        }
1004        
1005        private final class WsdlCreationListener extends FileChangeAdapter {
1006            
1007            public void fileDataCreated(FileEvent fe) {
1008                if (WSDL_FOLDER.equalsIgnoreCase(fe.getFile().getExt())) {
1009                    SwingUtilities.invokeLater(new Runnable JavaDoc() {
1010                        public void run() {
1011                            refreshKey(KEY_SERVICE_REFS);
1012                        }
1013                    });
1014                }
1015            }
1016            
1017            public void fileDeleted(FileEvent fe) {
1018                if (WSDL_FOLDER.equalsIgnoreCase(fe.getFile().getExt())) {
1019                    SwingUtilities.invokeLater(new Runnable JavaDoc() {
1020                        public void run() {
1021                            refreshKey(KEY_SERVICE_REFS);
1022                        }
1023                    });
1024                } else if (fe.getFile().isFolder() && WSDL_FOLDER.equals(fe.getFile().getName())) {
1025                    SwingUtilities.invokeLater(new Runnable JavaDoc() {
1026                        public void run() {
1027                            refreshKey(KEY_SERVICE_REFS);
1028                        }
1029                    });
1030                }
1031            }
1032        }
1033        
1034        private final class MetaInfListener extends FileChangeAdapter {
1035            
1036            public void fileFolderCreated(FileEvent fe) {
1037                if (fe.getFile().isFolder() && WSDL_FOLDER.equals(fe.getFile().getName())) {
1038                    fe.getFile().addFileChangeListener(wsdlListener);
1039                } else if (fe.getFile().isFolder() && "META-INF".equals(fe.getFile().getName())) { //NOI18N
1040
fe.getFile().addFileChangeListener(metaInfListener);
1041                }
1042            }
1043            
1044            public void fileDeleted(FileEvent fe) {
1045                if (fe.getFile().isFolder() && WSDL_FOLDER.equals(fe.getFile().getName())) {
1046                    fe.getFile().removeFileChangeListener(wsdlListener);
1047                    SwingUtilities.invokeLater(new Runnable JavaDoc() {
1048                        public void run() {
1049                            refreshKey(KEY_SERVICE_REFS);
1050                        }
1051                    });
1052                } else if (fe.getFile().isFolder() && "META-INF".equals(fe.getFile().getName())) { //NOI18N
1053
fe.getFile().removeFileChangeListener(metaInfListener);
1054                }
1055            }
1056        }
1057    }
1058    
1059    /** Yet another cool filter node just to add properties action
1060     */

1061    private static class PackageViewFilterNode extends FilterNode {
1062        
1063        private final String JavaDoc nodeName;
1064        private final Project project;
1065        
1066        Action JavaDoc[] actions;
1067        
1068        public PackageViewFilterNode(SourceGroup sourceGroup, Project project) {
1069            super(PackageView.createPackageView(sourceGroup));
1070            this.project = project;
1071            this.nodeName = "Sources"; // NOI18N
1072
}
1073        
1074        
1075        public Action JavaDoc[] getActions(boolean context) {
1076            if (!context) {
1077                if (actions == null) {
1078                    Action JavaDoc superActions[] = super.getActions(context);
1079                    actions = new Action JavaDoc[superActions.length + 2];
1080                    System.arraycopy(superActions, 0, actions, 0, superActions.length);
1081                    actions[superActions.length] = null;
1082                    actions[superActions.length + 1] = new PreselectPropertiesAction(project, nodeName);
1083                }
1084                return actions;
1085            } else {
1086                return super.getActions(context);
1087            }
1088        }
1089        
1090    }
1091    
1092    
1093    /** The special properties action
1094     */

1095    private static class PreselectPropertiesAction extends AbstractAction JavaDoc {
1096        
1097        private final Project project;
1098        private final String JavaDoc nodeName;
1099        private final String JavaDoc panelName;
1100        
1101        public PreselectPropertiesAction(Project project, String JavaDoc nodeName) {
1102            this(project, nodeName, null);
1103        }
1104        
1105        public PreselectPropertiesAction(Project project, String JavaDoc nodeName, String JavaDoc panelName) {
1106            super(NbBundle.getMessage(AppClientLogicalViewProvider.class, "LBL_Properties_Action"));
1107            this.project = project;
1108            this.nodeName = nodeName;
1109            this.panelName = panelName;
1110        }
1111        
1112        public void actionPerformed(ActionEvent JavaDoc e) {
1113            // J2SECustomizerProvider cp = (J2SECustomizerProvider) project.getLookup().lookup(J2SECustomizerProvider.class);
1114
CustomizerProviderImpl cp = (CustomizerProviderImpl) project.getLookup().lookup(CustomizerProviderImpl.class);
1115            if (cp != null) {
1116                cp.showCustomizer(nodeName, panelName);
1117            }
1118            
1119        }
1120    }
1121    
1122}
1123
Popular Tags