+ Use + ServiceTabNodeRegistration to register your nodes + into Services in the IDE. +
+This document lists changes made to the Core IDE API.
+ + +@FOOTER@
+ + ++ This module contains various generic IDE-like extensions. +
++ We have few unit tests. +
++ Module will be available for 6.7 version. +
+
+
+ XXX no answer for compat-deprecation +
++ XXX no answer for compat-i18n +
++ XXX no answer for compat-standards +
++ XXX no answer for compat-version +
++ XXX no answer for dep-jre +
++ XXX no answer for dep-jrejdk +
++ XXX no answer for dep-non-nb +
++ XXX no answer for dep-platform +
++ XXX no answer for deploy-dependencies +
++ XXX no answer for deploy-jar +
++ XXX no answer for deploy-nbm +
++ XXX no answer for deploy-packages +
++ XXX no answer for deploy-shared +
++ XXX no answer for exec-ant-tasks +
++ XXX no answer for exec-classloader +
++ XXX no answer for exec-component +
++ XXX no answer for exec-introspection +
++ XXX no answer for exec-privateaccess +
++ XXX no answer for exec-process +
++ XXX no answer for exec-property +
++ XXX no answer for exec-reflection +
++ XXX no answer for exec-threading +
++ XXX no answer for format-clipboard +
++ XXX no answer for format-dnd +
++ XXX no answer for format-types +
++ XXX no answer for lookup-lookup +
++ XXX no answer for lookup-register +
++ XXX no answer for lookup-remove +
++ XXX no answer for perf-exit +
++ XXX no answer for perf-huge_dialogs +
++ XXX no answer for perf-limit +
++ XXX no answer for perf-mem +
++ XXX no answer for perf-menus +
++ XXX no answer for perf-progress +
++ XXX no answer for perf-scale +
++ XXX no answer for perf-spi +
++ XXX no answer for perf-startup +
++ XXX no answer for perf-wakeup +
++ XXX no answer for resources-file +
++ XXX no answer for resources-layer +
++ XXX no answer for resources-mask +
++ XXX no answer for resources-preferences +
++ XXX no answer for resources-read +
++ XXX no answer for security-grant +
++ XXX no answer for security-policy +
+#KEY
to reference a key in
+ * Bundle.properties
file next to the node class
+ * or factory method.
+ *
+ * @return human readable name or reference to bundle
+ */
+ String displayName();
+
+ /** Description of the node. Use #KEY
to reference a key in
+ * Bundle.properties
file next to the node class
+ * or factory method.
+ *
+ * @return human readable short description or readable to bundle
+ */
+ String shortDescription() default "";
+
+ /** Icon to use for the node. The icon can have additional variants
+ * see {@link AbstractNode#setIconBaseWithExtension(java.lang.String)}
+ * for more info.
+ *
+ */
+ String iconResource();
+
+ /** Ordering location of the {@link Node}.
+ */
+ int position() default Integer.MAX_VALUE;
+}
diff -r fab8ea7d1591 core.ide/src/org/netbeans/core/ide/ServiceTabProcessor.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core.ide/src/org/netbeans/core/ide/ServiceTabProcessor.java Tue Mar 31 16:47:09 2009 +0200
@@ -0,0 +1,95 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, 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-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2008 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.core.ide;
+
+import java.util.Set;
+import javax.annotation.processing.Processor;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.TypeMirror;
+import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
+import org.omg.PortableServer.POA;
+import org.openide.filesystems.annotations.LayerBuilder.File;
+import org.openide.filesystems.annotations.LayerGeneratingProcessor;
+import org.openide.filesystems.annotations.LayerGenerationException;
+import org.openide.nodes.Node;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ * processor for {@link ServiceTabNodeRegistration} annotation.
+ * @author Jaroslav Tulach
+ */
+@ServiceProvider(service=Processor.class)
+@SupportedSourceVersion(SourceVersion.RELEASE_6)
+@SupportedAnnotationTypes("org.netbeans.api.core.ide.ServiceTabNodeRegistration")//NOI18N
+public class ServiceTabProcessor extends LayerGeneratingProcessor {
+ @Override
+ protected boolean handleProcess(Set extends TypeElement> annotations, RoundEnvironment roundEnv) throws LayerGenerationException {
+ if (roundEnv.processingOver()) {
+ return false;
+ }
+ for (Element e : roundEnv.getElementsAnnotatedWith(ServiceTabNodeRegistration.class)) {
+ ServiceTabNodeRegistration reg = e.getAnnotation(ServiceTabNodeRegistration.class);
+ File f = layer(e).
+ instanceFile("UI/Runtime", null, Node.class).
+ stringvalue("iconResource", reg.iconResource()).
+ stringvalue("name", reg.name()).
+ methodvalue("instanceCreate", "org.openide.nodes.NodeOp", "factory").
+ bundlevalue("displayName", reg.displayName()).
+ instanceAttribute("original", Node.class);
+ if (!"".equals(reg.shortDescription())) {
+ f.bundlevalue("shortDescription", reg.shortDescription());
+ }
+ if (reg.position() != Integer.MAX_VALUE) {
+ f.intvalue("position", reg.position());
+ }
+ f.write();
+ }
+ return true;
+ }
+
+}
diff -r fab8ea7d1591 core.ide/test/unit/src/org/netbeans/core/ide/ServiceTabProcessorTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core.ide/test/unit/src/org/netbeans/core/ide/ServiceTabProcessorTest.java Tue Mar 31 16:47:09 2009 +0200
@@ -0,0 +1,117 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, 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-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.core.ide;
+
+import java.awt.Image;
+import java.beans.BeanInfo;
+import java.util.Collection;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openide.util.ImageUtilities;
+import org.openide.util.lookup.Lookups;
+import static org.junit.Assert.*;
+
+/**
+ *
+ * @author Jaroslav Tulach + NodeOp.factory + is new method, particularly useful from + layers + that allows declarative definition of a root node. +
+