Lines 24-37
Link Here
|
24 |
import java.beans.PropertyChangeEvent; |
24 |
import java.beans.PropertyChangeEvent; |
25 |
import java.beans.PropertyChangeListener; |
25 |
import java.beans.PropertyChangeListener; |
26 |
import java.io.CharConversionException; |
26 |
import java.io.CharConversionException; |
27 |
import java.io.File; |
|
|
28 |
import java.io.IOException; |
27 |
import java.io.IOException; |
29 |
import java.net.URI; |
|
|
30 |
import java.net.URL; |
31 |
import java.util.ArrayList; |
28 |
import java.util.ArrayList; |
32 |
import java.util.Arrays; |
29 |
import java.util.Arrays; |
33 |
import java.util.Collection; |
30 |
import java.util.Collection; |
34 |
import java.util.Collections; |
|
|
35 |
import java.util.HashMap; |
31 |
import java.util.HashMap; |
36 |
import java.util.HashSet; |
32 |
import java.util.HashSet; |
37 |
import java.util.Iterator; |
33 |
import java.util.Iterator; |
Lines 42-48
Link Here
|
42 |
import javax.swing.AbstractAction; |
38 |
import javax.swing.AbstractAction; |
43 |
import javax.swing.Action; |
39 |
import javax.swing.Action; |
44 |
import javax.swing.JSeparator; |
40 |
import javax.swing.JSeparator; |
45 |
import javax.swing.SwingUtilities; |
|
|
46 |
import javax.swing.event.ChangeEvent; |
41 |
import javax.swing.event.ChangeEvent; |
47 |
import javax.swing.event.ChangeListener; |
42 |
import javax.swing.event.ChangeListener; |
48 |
import org.netbeans.api.java.platform.JavaPlatform; |
43 |
import org.netbeans.api.java.platform.JavaPlatform; |
Lines 54-82
Link Here
|
54 |
import org.netbeans.api.project.SourceGroup; |
49 |
import org.netbeans.api.project.SourceGroup; |
55 |
import org.netbeans.api.project.Sources; |
50 |
import org.netbeans.api.project.Sources; |
56 |
import org.netbeans.modules.java.j2seproject.J2SEProjectUtil; |
51 |
import org.netbeans.modules.java.j2seproject.J2SEProjectUtil; |
57 |
import org.netbeans.modules.java.j2seproject.ui.customizer.CustomizerLibraries; |
|
|
58 |
import org.netbeans.modules.java.j2seproject.ui.customizer.CustomizerProviderImpl; |
59 |
import org.netbeans.modules.java.j2seproject.ui.customizer.J2SEProjectProperties; |
52 |
import org.netbeans.modules.java.j2seproject.ui.customizer.J2SEProjectProperties; |
60 |
import org.netbeans.modules.java.j2seproject.J2SEProject; |
53 |
import org.netbeans.modules.java.j2seproject.J2SEProject; |
61 |
import org.netbeans.modules.java.j2seproject.SourceRoots; |
54 |
import org.netbeans.modules.java.j2seproject.SourceRoots; |
62 |
import org.netbeans.modules.java.j2seproject.UpdateHelper; |
55 |
import org.netbeans.modules.java.j2seproject.UpdateHelper; |
63 |
import org.netbeans.modules.java.j2seproject.wsclient.J2SEProjectWebServicesClientSupport; |
|
|
64 |
import org.netbeans.spi.java.project.support.ui.BrokenReferencesSupport; |
56 |
import org.netbeans.spi.java.project.support.ui.BrokenReferencesSupport; |
65 |
import org.netbeans.spi.java.project.support.ui.PackageView; |
57 |
import org.netbeans.spi.java.project.support.ui.PackageView; |
66 |
import org.netbeans.spi.project.ActionProvider; |
58 |
import org.netbeans.spi.project.ActionProvider; |
67 |
import org.netbeans.spi.project.SubprojectProvider; |
59 |
import org.netbeans.spi.project.SubprojectProvider; |
68 |
import org.netbeans.spi.project.support.ant.AntProjectHelper; |
|
|
69 |
import org.netbeans.spi.project.support.ant.PropertyEvaluator; |
60 |
import org.netbeans.spi.project.support.ant.PropertyEvaluator; |
70 |
import org.netbeans.spi.project.support.ant.ReferenceHelper; |
61 |
import org.netbeans.spi.project.support.ant.ReferenceHelper; |
71 |
import org.netbeans.spi.project.ui.LogicalViewProvider; |
62 |
import org.netbeans.spi.project.ui.LogicalViewProvider; |
72 |
import org.netbeans.spi.project.ui.support.CommonProjectActions; |
63 |
import org.netbeans.spi.project.ui.support.CommonProjectActions; |
|
|
64 |
import org.netbeans.spi.project.ui.support.NodeFactorySupport; |
73 |
import org.netbeans.spi.project.ui.support.DefaultProjectOperations; |
65 |
import org.netbeans.spi.project.ui.support.DefaultProjectOperations; |
74 |
import org.netbeans.spi.project.ui.support.ProjectSensitiveActions; |
66 |
import org.netbeans.spi.project.ui.support.ProjectSensitiveActions; |
75 |
import org.openide.ErrorManager; |
67 |
import org.openide.ErrorManager; |
76 |
import org.openide.actions.FindAction; |
68 |
import org.openide.actions.FindAction; |
77 |
import org.openide.actions.ToolsAction; |
69 |
import org.openide.actions.ToolsAction; |
78 |
import org.openide.filesystems.FileChangeAdapter; |
|
|
79 |
import org.openide.filesystems.FileEvent; |
80 |
import org.openide.filesystems.FileObject; |
70 |
import org.openide.filesystems.FileObject; |
81 |
import org.openide.filesystems.FileStateInvalidException; |
71 |
import org.openide.filesystems.FileStateInvalidException; |
82 |
import org.openide.filesystems.FileStatusEvent; |
72 |
import org.openide.filesystems.FileStatusEvent; |
Lines 90-97
Link Here
|
90 |
import org.openide.loaders.FolderLookup; |
80 |
import org.openide.loaders.FolderLookup; |
91 |
import org.openide.modules.SpecificationVersion; |
81 |
import org.openide.modules.SpecificationVersion; |
92 |
import org.openide.nodes.AbstractNode; |
82 |
import org.openide.nodes.AbstractNode; |
93 |
import org.openide.nodes.Children; |
|
|
94 |
import org.openide.nodes.FilterNode; |
95 |
import org.openide.nodes.Node; |
83 |
import org.openide.nodes.Node; |
96 |
import org.openide.util.HelpCtx; |
84 |
import org.openide.util.HelpCtx; |
97 |
import org.openide.util.Lookup; |
85 |
import org.openide.util.Lookup; |
Lines 102-109
Link Here
|
102 |
import org.openide.util.actions.SystemAction; |
90 |
import org.openide.util.actions.SystemAction; |
103 |
import org.openide.util.lookup.Lookups; |
91 |
import org.openide.util.lookup.Lookups; |
104 |
import org.openide.xml.XMLUtil; |
92 |
import org.openide.xml.XMLUtil; |
105 |
import org.netbeans.modules.websvc.api.client.WebServicesClientSupport; |
|
|
106 |
import org.netbeans.modules.websvc.api.client.WebServicesClientView; |
107 |
|
93 |
|
108 |
/** |
94 |
/** |
109 |
* Support for creating logical views. |
95 |
* Support for creating logical views. |
Lines 119-127
Link Here
|
119 |
private final SubprojectProvider spp; |
105 |
private final SubprojectProvider spp; |
120 |
private final ReferenceHelper resolver; |
106 |
private final ReferenceHelper resolver; |
121 |
private List changeListeners; |
107 |
private List changeListeners; |
122 |
|
|
|
123 |
// Web service client |
124 |
private static final Object KEY_SERVICE_REFS = "serviceRefs"; // NOI18N |
125 |
|
108 |
|
126 |
public J2SELogicalViewProvider(J2SEProject project, UpdateHelper helper, PropertyEvaluator evaluator, SubprojectProvider spp, ReferenceHelper resolver) { |
109 |
public J2SELogicalViewProvider(J2SEProject project, UpdateHelper helper, PropertyEvaluator evaluator, SubprojectProvider spp, ReferenceHelper resolver) { |
127 |
this.project = project; |
110 |
this.project = project; |
Lines 139-144
Link Here
|
139 |
return new J2SELogicalViewRootNode(); |
122 |
return new J2SELogicalViewRootNode(); |
140 |
} |
123 |
} |
141 |
|
124 |
|
|
|
125 |
public PropertyEvaluator getEvaluator() { |
126 |
return evaluator; |
127 |
} |
128 |
|
129 |
public ReferenceHelper getRefHelper() { |
130 |
return resolver; |
131 |
} |
132 |
|
133 |
public UpdateHelper getUpdateHelper() { |
134 |
return helper; |
135 |
} |
136 |
|
142 |
public Node findPath(Node root, Object target) { |
137 |
public Node findPath(Node root, Object target) { |
143 |
Project project = (Project) root.getLookup().lookup(Project.class); |
138 |
Project project = (Project) root.getLookup().lookup(Project.class); |
144 |
if (project == null) { |
139 |
if (project == null) { |
Lines 284-290
Link Here
|
284 |
// icon badging <<< |
279 |
// icon badging <<< |
285 |
|
280 |
|
286 |
public J2SELogicalViewRootNode() { |
281 |
public J2SELogicalViewRootNode() { |
287 |
super(new LogicalViewChildren(project, evaluator, helper, resolver), Lookups.singleton(project)); |
282 |
super(NodeFactorySupport.createCompositeChildren(project, "Projects/org-netbeans-modules-java-j2seproject/Nodes"), |
|
|
283 |
Lookups.singleton(project)); |
288 |
setIconBaseWithExtension("org/netbeans/modules/java/j2seproject/ui/resources/j2seProject.gif"); |
284 |
setIconBaseWithExtension("org/netbeans/modules/java/j2seproject/ui/resources/j2seProject.gif"); |
289 |
super.setName( ProjectUtils.getInformation( project ).getDisplayName() ); |
285 |
super.setName( ProjectUtils.getInformation( project ).getDisplayName() ); |
290 |
if (hasBrokenLinks()) { |
286 |
if (hasBrokenLinks()) { |
Lines 650-1001
Link Here
|
650 |
|
646 |
|
651 |
} |
647 |
} |
652 |
|
648 |
|
653 |
} |
|
|
654 |
|
655 |
private static final class LogicalViewChildren extends Children.Keys/*<SourceGroup>*/ implements ChangeListener { |
656 |
|
657 |
private static final Object LIBRARIES = "Libs"; //NOI18N |
658 |
private static final Object TEST_LIBRARIES = "TestLibs"; //NOI18N |
659 |
private static final String WSDL_FOLDER=J2SEProjectWebServicesClientSupport.WSDL_FOLDER; |
660 |
|
661 |
private final Project project; |
662 |
private final PropertyEvaluator evaluator; |
663 |
private final UpdateHelper helper; |
664 |
private final ReferenceHelper resolver; |
665 |
private final SourceRoots testSources; |
666 |
|
667 |
private final WsdlCreationListener wsdlListener; |
668 |
private final MetaInfListener metaInfListener; |
669 |
private FileObject wsdlFolder; |
670 |
|
671 |
public LogicalViewChildren(J2SEProject project, PropertyEvaluator evaluator, UpdateHelper helper, ReferenceHelper resolver) { |
672 |
this.project = project; |
673 |
this.evaluator = evaluator; |
674 |
this.helper = helper; |
675 |
this.resolver = resolver; |
676 |
this.testSources = project.getTestSourceRoots(); |
677 |
this.metaInfListener = new MetaInfListener(); |
678 |
this.wsdlListener = new WsdlCreationListener(); |
679 |
} |
680 |
|
681 |
protected void addNotify() { |
682 |
super.addNotify(); |
683 |
getSources().addChangeListener(this); |
684 |
|
685 |
AntProjectHelper projectHelper = helper.getAntProjectHelper(); |
686 |
String prop = evaluator.getProperty("meta.inf.dir"); //NOI18N |
687 |
if (prop!=null) { |
688 |
FileObject metaInf = projectHelper.resolveFileObject(prop); |
689 |
if (metaInf!=null) metaInf.addFileChangeListener(metaInfListener); |
690 |
} |
691 |
prop = evaluator.getProperty("src.dir"); //NOI18N |
692 |
if (prop!=null) { |
693 |
FileObject srcDir = projectHelper.resolveFileObject(prop); |
694 |
if (srcDir!=null) srcDir.addFileChangeListener(metaInfListener); |
695 |
} |
696 |
|
697 |
//XXX: Not very nice, the wsdlFolder should be hold by this class because it listens on it |
698 |
WebServicesClientSupport wsClientSupportImpl = WebServicesClientSupport.getWebServicesClientSupport(project.getProjectDirectory()); |
699 |
try { |
700 |
if (wsClientSupportImpl != null) { |
701 |
wsdlFolder = wsClientSupportImpl.getWsdlFolder(false); |
702 |
} |
703 |
} catch (IOException ex) { |
704 |
ErrorManager.getDefault().notify(ex); |
705 |
} |
706 |
if (wsdlFolder != null) { |
707 |
wsdlFolder.addFileChangeListener(wsdlListener); |
708 |
} |
709 |
setKeys(getKeys()); |
710 |
} |
711 |
|
712 |
protected void removeNotify() { |
713 |
setKeys(Collections.EMPTY_SET); |
714 |
getSources().removeChangeListener(this); |
715 |
|
716 |
AntProjectHelper projectHelper = helper.getAntProjectHelper(); |
717 |
String prop = evaluator.getProperty("meta.inf.dir"); //NOI18N |
718 |
if (prop!=null) { |
719 |
FileObject metaInf = projectHelper.resolveFileObject(prop); |
720 |
if (metaInf!=null) metaInf.addFileChangeListener(metaInfListener); |
721 |
} |
722 |
prop = evaluator.getProperty("src.dir"); //NOI18N |
723 |
if (prop!=null) { |
724 |
FileObject srcDir = projectHelper.resolveFileObject(prop); |
725 |
if (srcDir!=null) srcDir.removeFileChangeListener(metaInfListener); |
726 |
} |
727 |
if (wsdlFolder != null) { |
728 |
wsdlFolder.removeFileChangeListener(wsdlListener); |
729 |
} |
730 |
|
731 |
super.removeNotify(); |
732 |
} |
733 |
|
734 |
protected Node[] createNodes(Object key) { |
735 |
Node[] result; |
736 |
if (key == LIBRARIES) { |
737 |
//Libraries Node |
738 |
result = new Node[] { |
739 |
new LibrariesNode(NbBundle.getMessage(J2SELogicalViewProvider.class,"CTL_LibrariesNode"), |
740 |
project, evaluator, helper, resolver, J2SEProjectProperties.RUN_CLASSPATH, |
741 |
new String[] {J2SEProjectProperties.BUILD_CLASSES_DIR}, |
742 |
"platform.active", // NOI18N |
743 |
new Action[] { |
744 |
LibrariesNode.createAddProjectAction(project, J2SEProjectProperties.JAVAC_CLASSPATH), |
745 |
LibrariesNode.createAddLibraryAction(project, J2SEProjectProperties.JAVAC_CLASSPATH), |
746 |
LibrariesNode.createAddFolderAction(project, J2SEProjectProperties.JAVAC_CLASSPATH), |
747 |
null, |
748 |
new PreselectPropertiesAction(project, "Libraries", CustomizerLibraries.COMPILE), // NOI18N |
749 |
} |
750 |
), |
751 |
}; |
752 |
} else if (key == TEST_LIBRARIES) { |
753 |
result = new Node[] { |
754 |
new LibrariesNode(NbBundle.getMessage(J2SELogicalViewProvider.class,"CTL_TestLibrariesNode"), |
755 |
project, evaluator, helper, resolver, J2SEProjectProperties.RUN_TEST_CLASSPATH, |
756 |
new String[] { |
757 |
J2SEProjectProperties.BUILD_TEST_CLASSES_DIR, |
758 |
J2SEProjectProperties.JAVAC_CLASSPATH, |
759 |
J2SEProjectProperties.BUILD_CLASSES_DIR, |
760 |
}, |
761 |
null, |
762 |
new Action[] { |
763 |
LibrariesNode.createAddProjectAction(project, J2SEProjectProperties.JAVAC_TEST_CLASSPATH), |
764 |
LibrariesNode.createAddLibraryAction(project, J2SEProjectProperties.JAVAC_TEST_CLASSPATH), |
765 |
LibrariesNode.createAddFolderAction(project, J2SEProjectProperties.JAVAC_TEST_CLASSPATH), |
766 |
null, |
767 |
new PreselectPropertiesAction(project, "Libraries", CustomizerLibraries.COMPILE_TESTS), // NOI18N |
768 |
} |
769 |
), |
770 |
}; |
771 |
} |
772 |
// else if (key instanceof SourceGroup) { |
773 |
else if (key instanceof SourceGroupKey) { |
774 |
//Source root |
775 |
result = new Node[] {new PackageViewFilterNode(((SourceGroupKey) key).group, project)}; |
776 |
|
777 |
} else if (key == KEY_SERVICE_REFS) { |
778 |
result = null; |
779 |
FileObject clientRoot = project.getProjectDirectory(); |
780 |
WebServicesClientView clientView = WebServicesClientView.getWebServicesClientView(clientRoot); |
781 |
if (clientView != null) { |
782 |
WebServicesClientSupport wss = WebServicesClientSupport.getWebServicesClientSupport(clientRoot); |
783 |
if (wss!=null) { |
784 |
FileObject wsdlFolder = wss.getWsdlFolder(); |
785 |
if (wsdlFolder!=null) { |
786 |
FileObject[] children = wsdlFolder.getChildren(); |
787 |
boolean foundWsdl = false; |
788 |
for (int i=0;i<children.length;i++) { |
789 |
if (children[i].getExt().equalsIgnoreCase(WSDL_FOLDER)) { //NOI18N |
790 |
foundWsdl=true; |
791 |
break; |
792 |
} |
793 |
} |
794 |
if (foundWsdl) { |
795 |
result = new Node[] {clientView.createWebServiceClientView(wsdlFolder)}; |
796 |
} |
797 |
} |
798 |
} |
799 |
} |
800 |
} else { |
801 |
assert false : "Unknown key type"; //NOI18N |
802 |
result = new Node[0]; |
803 |
} |
804 |
return result; |
805 |
} |
806 |
|
807 |
public void stateChanged(ChangeEvent e) { |
808 |
// setKeys(getKeys()); |
809 |
// The caller holds ProjectManager.mutex() read lock |
810 |
SwingUtilities.invokeLater(new Runnable() { |
811 |
public void run() { |
812 |
setKeys(getKeys()); |
813 |
} |
814 |
}); |
815 |
} |
816 |
|
817 |
// Private methods ----------------------------------------------------- |
818 |
|
819 |
private Collection getKeys() { |
820 |
//#60800, #61584 - when the project is deleted externally do not try to create children, the source groups |
821 |
//are not valid |
822 |
if (this.project.getProjectDirectory() == null || !this.project.getProjectDirectory().isValid()) { |
823 |
return Collections.EMPTY_LIST; |
824 |
} |
825 |
Sources sources = getSources(); |
826 |
SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); |
827 |
|
828 |
List result = new ArrayList(groups.length); |
829 |
for( int i = 0; i < groups.length; i++ ) { |
830 |
result.add(new SourceGroupKey(groups[i])); |
831 |
} |
832 |
result.add(LIBRARIES); |
833 |
URL[] testRoots = this.testSources.getRootURLs(); |
834 |
boolean addTestSources = false; |
835 |
for (int i = 0; i < testRoots.length; i++) { |
836 |
File f = new File(URI.create(testRoots[i].toExternalForm())); |
837 |
if (f.exists()) { |
838 |
addTestSources = true; |
839 |
break; |
840 |
} |
841 |
} |
842 |
if (addTestSources) { |
843 |
result.add(TEST_LIBRARIES); |
844 |
} |
845 |
|
846 |
result.add(KEY_SERVICE_REFS); |
847 |
|
848 |
return result; |
849 |
} |
850 |
|
851 |
private Sources getSources() { |
852 |
return ProjectUtils.getSources(project); |
853 |
} |
854 |
|
855 |
private static class SourceGroupKey { |
856 |
|
857 |
public final SourceGroup group; |
858 |
public final FileObject fileObject; |
859 |
|
860 |
SourceGroupKey(SourceGroup group) { |
861 |
this.group = group; |
862 |
this.fileObject = group.getRootFolder(); |
863 |
} |
864 |
|
865 |
public int hashCode() { |
866 |
return fileObject.hashCode(); |
867 |
} |
868 |
|
869 |
public boolean equals(Object obj) { |
870 |
if (!(obj instanceof SourceGroupKey)) { |
871 |
return false; |
872 |
} else { |
873 |
SourceGroupKey otherKey = (SourceGroupKey) obj; |
874 |
String thisDisplayName = this.group.getDisplayName(); |
875 |
String otherDisplayName = otherKey.group.getDisplayName(); |
876 |
// XXX what is the operator binding order supposed to be here?? |
877 |
return fileObject.equals(otherKey.fileObject) && |
878 |
thisDisplayName == null ? otherDisplayName == null : thisDisplayName.equals(otherDisplayName); |
879 |
} |
880 |
} |
881 |
|
882 |
} |
883 |
|
884 |
private final class WsdlCreationListener extends FileChangeAdapter { |
885 |
|
886 |
public void fileDataCreated (FileEvent fe) { |
887 |
if (WSDL_FOLDER.equalsIgnoreCase(fe.getFile().getExt())) { |
888 |
SwingUtilities.invokeLater(new Runnable() { |
889 |
public void run() { |
890 |
refreshKey(KEY_SERVICE_REFS); |
891 |
} |
892 |
}); |
893 |
} |
894 |
} |
895 |
|
896 |
public void fileDeleted (FileEvent fe) { |
897 |
if (WSDL_FOLDER.equalsIgnoreCase(fe.getFile().getExt())) { |
898 |
SwingUtilities.invokeLater(new Runnable() { |
899 |
public void run() { |
900 |
refreshKey(KEY_SERVICE_REFS); |
901 |
} |
902 |
}); |
903 |
} else if (fe.getFile().isFolder() && WSDL_FOLDER.equals(fe.getFile().getName())) { |
904 |
SwingUtilities.invokeLater(new Runnable() { |
905 |
public void run() { |
906 |
refreshKey(KEY_SERVICE_REFS); |
907 |
} |
908 |
}); |
909 |
} |
910 |
} |
911 |
} |
912 |
|
913 |
private final class MetaInfListener extends FileChangeAdapter { |
914 |
|
915 |
public void fileFolderCreated (FileEvent fe) { |
916 |
if (fe.getFile().isFolder() && WSDL_FOLDER.equals(fe.getFile().getName())) { |
917 |
fe.getFile().addFileChangeListener(wsdlListener); |
918 |
} else if (fe.getFile().isFolder() && "META-INF".equals(fe.getFile().getName())) { //NOI18N |
919 |
fe.getFile().addFileChangeListener(metaInfListener); |
920 |
} |
921 |
} |
922 |
|
923 |
public void fileDeleted (FileEvent fe) { |
924 |
if (fe.getFile().isFolder() && WSDL_FOLDER.equals(fe.getFile().getName())) { |
925 |
fe.getFile().removeFileChangeListener(wsdlListener); |
926 |
SwingUtilities.invokeLater(new Runnable() { |
927 |
public void run() { |
928 |
refreshKey(KEY_SERVICE_REFS); |
929 |
} |
930 |
}); |
931 |
} else if (fe.getFile().isFolder() && "META-INF".equals(fe.getFile().getName())) { //NOI18N |
932 |
fe.getFile().removeFileChangeListener(metaInfListener); |
933 |
} |
934 |
} |
935 |
} |
936 |
} |
937 |
|
938 |
/** Yet another cool filter node just to add properties action |
939 |
*/ |
940 |
private static class PackageViewFilterNode extends FilterNode { |
941 |
|
942 |
private String nodeName; |
943 |
private Project project; |
944 |
|
945 |
Action[] actions; |
946 |
|
947 |
public PackageViewFilterNode(SourceGroup sourceGroup, Project project) { |
948 |
super(PackageView.createPackageView(sourceGroup)); |
949 |
this.project = project; |
950 |
this.nodeName = "Sources"; |
951 |
} |
952 |
|
953 |
|
954 |
public Action[] getActions(boolean context) { |
955 |
if (!context) { |
956 |
if (actions == null) { |
957 |
Action superActions[] = super.getActions(context); |
958 |
actions = new Action[superActions.length + 2]; |
959 |
System.arraycopy(superActions, 0, actions, 0, superActions.length); |
960 |
actions[superActions.length] = null; |
961 |
actions[superActions.length + 1] = new PreselectPropertiesAction(project, nodeName); |
962 |
} |
963 |
return actions; |
964 |
} else { |
965 |
return super.getActions(context); |
966 |
} |
967 |
} |
968 |
|
969 |
} |
970 |
|
971 |
|
972 |
/** The special properties action |
973 |
*/ |
974 |
private static class PreselectPropertiesAction extends AbstractAction { |
975 |
|
976 |
private final Project project; |
977 |
private final String nodeName; |
978 |
private final String panelName; |
979 |
|
980 |
public PreselectPropertiesAction(Project project, String nodeName) { |
981 |
this(project, nodeName, null); |
982 |
} |
983 |
|
984 |
public PreselectPropertiesAction(Project project, String nodeName, String panelName) { |
985 |
super(NbBundle.getMessage(J2SELogicalViewProvider.class, "LBL_Properties_Action")); |
986 |
this.project = project; |
987 |
this.nodeName = nodeName; |
988 |
this.panelName = panelName; |
989 |
} |
990 |
|
991 |
public void actionPerformed(ActionEvent e) { |
992 |
// J2SECustomizerProvider cp = (J2SECustomizerProvider) project.getLookup().lookup(J2SECustomizerProvider.class); |
993 |
CustomizerProviderImpl cp = (CustomizerProviderImpl) project.getLookup().lookup(CustomizerProviderImpl.class); |
994 |
if (cp != null) { |
995 |
cp.showCustomizer(nodeName, panelName); |
996 |
} |
997 |
|
998 |
} |
999 |
} |
649 |
} |
1000 |
|
650 |
|
1001 |
} |
651 |
} |