- No. -
+
+ "Projects/org-netbeans-modules-apisupport-project/Lookup" folder's content is used to construct the project's additional lookup.
+ It's content is expected to be LookupProvider
instances. Apisupport project provides LookupMerger
s
+ for Sources
, PrivilegedTemplates
and RecommendedTemplates
. Implementations added by 3rd parties
+ will be merged into a single instance in the project's lookup.
+
+ "Projects/org-netbeans-modules-apisupport-project-suite/Lookup" folder's content is used to construct the project's additional lookup.
+ It's content is expected to be LookupProvider
instances.
+
+ "Projects/org-netbeans-modules-apisupport-project/Nodes" folder's content is used to construct the project's child nodes.
+ It's content is expected to be NodeFactory
instances.
+
+ "Projects/org-netbeans-modules-apisupport-project-suite/Nodes" folder's content is used to construct the project's child nodes.
+ It's content is expected to be NodeFactory
instances.
+
No. +
++ XXX no answer for compat-deprecation +
++ XXX no answer for exec-ant-tasks +
++ XXX no answer for resources-preferences
htmlDisplayName
, if it is needed, and returns the
+ * result; null
otherwise.
+ */
+ private static String computeAnnotatedHtmlDisplayName(
+ final String htmlDisplayName, final Set files) {
+
+ String result = null;
+ if (files != null && files.iterator().hasNext()) {
+ try {
+ FileObject fo = (FileObject) files.iterator().next();
+ FileSystem.Status stat = fo.getFileSystem().getStatus();
+ if (stat instanceof FileSystem.HtmlStatus) {
+ FileSystem.HtmlStatus hstat = (FileSystem.HtmlStatus) stat;
+
+ String annotated = hstat.annotateNameHtml(htmlDisplayName, files);
+
+ // Make sure the super string was really modified (XXX why?)
+ if (!htmlDisplayName.equals(annotated)) {
+ result = annotated;
+ }
+ }
+ } catch (FileStateInvalidException e) {
+ ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Actual list of important files.
+ */
+ private static final class SuiteImportantFilesChildren extends Children.KeyshtmlDisplayName
, if it is needed, and returns the
- * result; null
otherwise.
- */
- private static String computeAnnotatedHtmlDisplayName(
- final String htmlDisplayName, final Set files) {
-
- String result = null;
- if (files != null && files.iterator().hasNext()) {
- try {
- FileObject fo = (FileObject) files.iterator().next();
- FileSystem.Status stat = fo.getFileSystem().getStatus();
- if (stat instanceof FileSystem.HtmlStatus) {
- FileSystem.HtmlStatus hstat = (FileSystem.HtmlStatus) stat;
-
- String annotated = hstat.annotateNameHtml(htmlDisplayName, files);
-
- // Make sure the super string was really modified (XXX why?)
- if (!htmlDisplayName.equals(annotated)) {
- result = annotated;
- }
- }
- } catch (FileStateInvalidException e) {
- ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
- }
- }
- return result;
- }
-
}
Index: src/org/netbeans/modules/apisupport/project/ui/ModulesNodeFactory.java
===================================================================
RCS file: src/org/netbeans/modules/apisupport/project/ui/ModulesNodeFactory.java
diff -N src/org/netbeans/modules/apisupport/project/ui/ModulesNodeFactory.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/netbeans/modules/apisupport/project/ui/ModulesNodeFactory.java 13 Feb 2007 10:11:55 -0000
@@ -0,0 +1,363 @@
+/*
+ * The contents of this file are subject to the terms of the Common Development
+ * and Distribution License (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
+ * or http://www.netbeans.org/cddl.txt.
+ *
+ * When distributing Covered Code, include this CDDL Header Notice in each file
+ * and include the License file at http://www.netbeans.org/cddl.txt.
+ * If applicable, add the following below the CDDL Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ */
+
+package org.netbeans.modules.apisupport.project.ui;
+
+import java.awt.EventQueue;
+import java.awt.Image;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectInformation;
+import org.netbeans.api.project.ProjectManager;
+import org.netbeans.api.project.ProjectUtils;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.modules.apisupport.project.NbModuleProject;
+import org.netbeans.modules.apisupport.project.Util;
+import org.netbeans.modules.apisupport.project.suite.SuiteProject;
+import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils;
+import org.netbeans.modules.apisupport.project.ui.wizard.NewNbModuleWizardIterator;
+import org.netbeans.spi.project.SubprojectProvider;
+import org.netbeans.spi.project.ui.support.NodeFactory;
+import org.netbeans.spi.project.ui.support.NodeFactorySupport;
+import org.netbeans.spi.project.ui.support.NodeList;
+import org.openide.DialogDisplayer;
+import org.openide.ErrorManager;
+import org.openide.NotifyDescriptor;
+import org.openide.awt.StatusDisplayer;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openide.util.HelpCtx;
+import org.openide.util.NbBundle;
+import org.openide.util.RequestProcessor;
+import org.openide.util.Utilities;
+import org.openide.util.actions.CookieAction;
+import org.openide.util.actions.NodeAction;
+import org.openide.util.lookup.Lookups;
+import org.openide.windows.WindowManager;
+
+/**
+ *
+ * @author mkleint
+ */
+public class ModulesNodeFactory implements NodeFactory {
+
+ /** Creates a new instance of ImportantFilesNodeFactory */
+ public ModulesNodeFactory() {
+ }
+
+ public NodeList createNodes(Project p) {
+ SuiteProject prj = p.getLookup().lookup(SuiteProject.class);
+ assert prj != null;
+ return NodeFactorySupport.fixedNodeList(new ModulesNode(prj));
+ }
+
+ private static String getMessage(final String key) {
+ return NbBundle.getMessage(SuiteLogicalView.class, key);
+ }
+
+
+ /** Represent Modules node in the Suite Logical View. */
+ static final class ModulesNode extends AbstractNode {
+
+ private SuiteProject suite;
+
+ ModulesNode(final SuiteProject suite) {
+ super(new ModuleChildren(suite));
+ this.suite = suite;
+ setName("modules"); // NOI18N
+ setDisplayName(getMessage("CTL_Modules"));
+ }
+
+ public Action[] getActions(boolean context) {
+ return new Action[] {
+ new AddNewSuiteComponentAction(suite),
+ new AddNewLibraryWrapperAction(suite),
+ new AddSuiteComponentAction(suite),
+ };
+ }
+
+ private Image getIcon(boolean opened) {
+ Image badge = Utilities.loadImage("org/netbeans/modules/apisupport/project/suite/resources/module-badge.gif", true);
+ return Utilities.mergeImages(UIUtil.getTreeFolderIcon(opened), badge, 9, 9);
+ }
+
+ public Image getIcon(int type) {
+ return getIcon(false);
+ }
+
+ public Image getOpenedIcon(int type) {
+ return getIcon(true);
+ }
+
+ static final class ModuleChildren extends Children.Keys