You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ge...@apache.org on 2017/09/20 18:55:22 UTC
[04/13] incubator-netbeans git commit: [NETBEANS-64] Remove NetBeans
Platform Samples
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/osgidemo/showbundles/test/unit/src/org/netbeans/demo/osgi/showbundles/InstallerTest.java
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/osgidemo/showbundles/test/unit/src/org/netbeans/demo/osgi/showbundles/InstallerTest.java b/apisupport.osgidemo/osgidemo/showbundles/test/unit/src/org/netbeans/demo/osgi/showbundles/InstallerTest.java
deleted file mode 100644
index e8ad856..0000000
--- a/apisupport.osgidemo/osgidemo/showbundles/test/unit/src/org/netbeans/demo/osgi/showbundles/InstallerTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * 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.
- */
-
-package org.netbeans.demo.osgi.showbundles;
-
-import org.netbeans.demo.osgi.showbundles.Installer;
-import java.util.List;
-import junit.framework.Test;
-import org.netbeans.junit.NbModuleSuite;
-import org.netbeans.junit.NbTestCase;
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-/** Integration test that launches the application and checks
- * whether appropriate OSGi framework is enabled.
- */
-public class InstallerTest extends NbTestCase {
-
- public InstallerTest(String testName) {
- super(testName);
- }
-
- public static Test suite() {
- return NbModuleSuite.create(
- NbModuleSuite.emptyConfiguration().addTest(InstallerTest.class).gui(false)
- .clusters(".*")<#if netbinox??>.enableModules("org.netbeans.modules.netbinox")</#if>
- );
- }
-
- public void testChildrenAndTheirNodes() throws Exception {
- Children ch = Installer.createBundleChildren();
- List<Node> arr = ch.snapshot();
- String bundleName;
- // <#if !netbinox?? >
- bundleName = "org.apache.felix.framework";
- // <#else>
- bundleName = "org.eclipse.osgi";
- // </#if>
- for (Node n : arr) {
- if (n.getName().equals(bundleName)) {
- // OK
- return;
- }
- }
- fail("Framework " + bundleName + " not found: " + arr);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/Bundle.properties
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/Bundle.properties b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/Bundle.properties
deleted file mode 100644
index 73057ff..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/Bundle.properties
+++ /dev/null
@@ -1,67 +0,0 @@
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-#
-# Copyright (c) 2010, 2016 Oracle and/or its affiliates. All rights reserved.
-#
-# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
-# Other names may be trademarks of their respective owners.
-#
-# 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. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle 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):
-OpenIDE-Module-Name=NetBeans Platform & OSGi Samples
-
-LBL_CreateProjectStep=Create a new NetBeans OSGi based Application project
-LBL_DownloadStep=Download libraries
-OpenIDE-Module-Display-Category=Developing NetBeans
-OpenIDE-Module-Long-Description=\
- Sample application based on the NetBeans Platform and Felix and Equinox.
-OpenIDE-Module-Short-Description=Sample NetBeans Platform and OSGi applications.
-SampleAppFile=Equinox based Platform Application
-SampleFelixFile=Felix based Platform Application
-
-# {0} - step #
-# {1} - step count
-SampleAppWizardIterator.name.format={0} of {1}
-SampleAppPanelVisual.project_name=Project &Name:
-SampleAppPanelVisual.default_prj_name=osgisample
-SampleAppPanelVisual.folder_exists=Project Folder already exists and is not empty.
-SampleAppPanelVisual.folder_creation_error=Project Folder cannot be created.
-SampleAppPanelVisual.invalid_path=Project Folder is not a valid path.
-SampleAppPanelVisual.invalid_folder_name=Project Name is not a valid folder name.
-SampleAppPanelVisual.select_project_location=Select Project Location
-SampleAppPanelVisual.project_folder=Project &Folder:
-SampleAppPanelVisual.browse=Br&owse...
-SampleAppPanelVisual.project_location=Project &Location:
-
-
-#NOI18N
-CTL_NetbinoxProjectName=netbinoxsample
-#NOI18N
-CTL_FelixProjectName=felixsample
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppDescription.html
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppDescription.html b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppDescription.html
deleted file mode 100644
index b406f15..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppDescription.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
-Copyright (c) 2010, 2016 Oracle and/or its affiliates. All rights reserved.
-
-Oracle and Java are registered trademarks of Oracle and/or its affiliates.
-Other names may be trademarks of their respective owners.
-
-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. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle 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):
--->
-
-<html>
-<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-</head>
- <body>
- Illustrates how to use the NetBeans Platform and Equinox together.
- See
- <a href="http://wiki.apidesign.org/wiki/NetbinoxTutorial">tutorial</a>
- for more information.
- </body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.form
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.form b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.form
deleted file mode 100644
index 6a6faff..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.form
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.1" encoding="UTF-8" ?>
-
-<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
- <AuxValues>
- <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
- <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
- <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
- <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
- <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
- </AuxValues>
-
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace min="-2" max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="projectNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="projectLocationLabel" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="createdFolderLabel" alignment="0" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace min="-2" max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="projectNameTextField" alignment="1" pref="191" max="32767" attributes="0"/>
- <Component id="projectLocationTextField" alignment="1" pref="191" max="32767" attributes="0"/>
- <Component id="createdFolderTextField" alignment="1" pref="191" max="32767" attributes="0"/>
- </Group>
- <EmptySpace min="-2" max="-2" attributes="0"/>
- <Component id="browseButton" min="-2" max="-2" attributes="0"/>
- <EmptySpace min="-2" max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="projectNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="projectNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="projectLocationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="projectLocationTextField" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="browseButton" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="createdFolderLabel" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="createdFolderTextField" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace pref="213" max="32767" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JLabel" name="projectNameLabel">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="projectNameTextField"/>
- </Property>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.project_name" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
- </Property>
- </Properties>
- <AccessibilityProperties>
- <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.project_name" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}", {arguments})"/>
- </Property>
- <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.project_name" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}", {arguments})"/>
- </Property>
- </AccessibilityProperties>
- <AuxValues>
- <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
- </AuxValues>
- </Component>
- <Component class="javax.swing.JTextField" name="projectNameTextField">
- </Component>
- <Component class="javax.swing.JLabel" name="projectLocationLabel">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="projectLocationTextField"/>
- </Property>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.project_location" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
- </Property>
- </Properties>
- <AccessibilityProperties>
- <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.project_location" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}", {arguments})"/>
- </Property>
- <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.project_location" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}", {arguments})"/>
- </Property>
- </AccessibilityProperties>
- <AuxValues>
- <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
- </AuxValues>
- </Component>
- <Component class="javax.swing.JTextField" name="projectLocationTextField">
- </Component>
- <Component class="javax.swing.JButton" name="browseButton">
- <Properties>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.browse" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
- </Property>
- </Properties>
- <AccessibilityProperties>
- <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.browse" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}", {arguments})"/>
- </Property>
- <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.browse" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}", {arguments})"/>
- </Property>
- </AccessibilityProperties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="browseButtonActionPerformed"/>
- </Events>
- </Component>
- <Component class="javax.swing.JLabel" name="createdFolderLabel">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="createdFolderTextField"/>
- </Property>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/apisupport/osgidemo/Bundle.properties" key="SampleAppPanelVisual.project_folder" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
- </Property>
- </Properties>
- </Component>
- <Component class="javax.swing.JTextField" name="createdFolderTextField">
- <Properties>
- <Property name="editable" type="boolean" value="false"/>
- </Properties>
- </Component>
- </SubComponents>
-</Form>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.java
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.java b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.java
deleted file mode 100644
index 8af0788..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppPanelVisual.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * 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.
- */
-package org.netbeans.modules.apisupport.osgidemo;
-
-import java.io.File;
-import javax.swing.JFileChooser;
-import javax.swing.JPanel;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.text.Document;
-import org.netbeans.spi.project.ui.support.ProjectChooser;
-import org.openide.WizardDescriptor;
-import org.openide.WizardValidationException;
-import org.openide.filesystems.FileUtil;
-
-public class SampleAppPanelVisual extends JPanel implements DocumentListener {
-
- private static final String WIZARD_PANEL_ERROR_MESSAGE = WizardDescriptor.PROP_ERROR_MESSAGE; // NOI18N
-
- public static final String PROP_PROJECT_NAME = "projectName"; // NOI18N
-
- private SampleAppWizardPanel panel;
-
- /** Creates new form PanelProjectLocationVisual */
- public SampleAppPanelVisual(SampleAppWizardPanel panel) {
- initComponents();
- this.panel = panel;
- // Register listener on the textFields to make the automatic updates
- projectNameTextField.getDocument().addDocumentListener(this);
- projectLocationTextField.getDocument().addDocumentListener(this);
- }
-
-
- public String getProjectName() {
- return this.projectNameTextField.getText();
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
-
- projectNameLabel = new javax.swing.JLabel();
- projectNameTextField = new javax.swing.JTextField();
- projectLocationLabel = new javax.swing.JLabel();
- projectLocationTextField = new javax.swing.JTextField();
- browseButton = new javax.swing.JButton();
- createdFolderLabel = new javax.swing.JLabel();
- createdFolderTextField = new javax.swing.JTextField();
-
- projectNameLabel.setLabelFor(projectNameTextField);
- org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_name")); // NOI18N
-
- projectLocationLabel.setLabelFor(projectLocationTextField);
- org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_location")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.browse")); // NOI18N
- browseButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- browseButtonActionPerformed(evt);
- }
- });
-
- createdFolderLabel.setLabelFor(createdFolderTextField);
- org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_folder")); // NOI18N
-
- createdFolderTextField.setEditable(false);
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(projectNameLabel)
- .addComponent(projectLocationLabel)
- .addComponent(createdFolderLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(projectNameTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
- .addComponent(projectLocationTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
- .addComponent(createdFolderTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(browseButton)
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(projectNameLabel)
- .addComponent(projectNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(projectLocationLabel)
- .addComponent(projectLocationTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(browseButton))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(createdFolderLabel)
- .addComponent(createdFolderTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(213, Short.MAX_VALUE))
- );
-
- projectNameLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_name", new Object[] {})); // NOI18N
- projectNameLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_name", new Object[] {})); // NOI18N
- projectLocationLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_location", new Object[] {})); // NOI18N
- projectLocationLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_location", new Object[] {})); // NOI18N
- browseButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.browse", new Object[] {})); // NOI18N
- browseButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.browse", new Object[] {})); // NOI18N
- }// </editor-fold>//GEN-END:initComponents
-
- private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
- JFileChooser chooser = new JFileChooser();
- chooser.setDialogTitle(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.select_project_location"));
- chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- String path = this.projectLocationTextField.getText();
- if (path.length() > 0) {
- File f = new File(path);
- if (f.exists()) {
- chooser.setSelectedFile(f);
- }
- }
- if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
- File projectDir = chooser.getSelectedFile();
- projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
- }
- panel.fireChangeEvent();
-
- }//GEN-LAST:event_browseButtonActionPerformed
-
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton browseButton;
- private javax.swing.JLabel createdFolderLabel;
- private javax.swing.JTextField createdFolderTextField;
- private javax.swing.JLabel projectLocationLabel;
- private javax.swing.JTextField projectLocationTextField;
- private javax.swing.JLabel projectNameLabel;
- private javax.swing.JTextField projectNameTextField;
- // End of variables declaration//GEN-END:variables
-
- @Override
- public void addNotify() {
- super.addNotify();
- //same problem as in 31086, initial focus on Cancel button
- projectNameTextField.requestFocus();
- }
-
- boolean valid(WizardDescriptor wizardDescriptor) {
-
- if (projectNameTextField.getText().length() == 0) {
- wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE,
- org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.invalid_folder_name"));
- return false; // Display name not specified
- }
- File f = FileUtil.normalizeFile(new File(projectLocationTextField.getText()).getAbsoluteFile());
- if (!f.isDirectory()) {
- String message = org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.invalid_path");
- wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, message);
- return false;
- }
- final File destFolder = FileUtil.normalizeFile(new File(createdFolderTextField.getText()).getAbsoluteFile());
-
- File projLoc = destFolder;
- while (projLoc != null && !projLoc.exists()) {
- projLoc = projLoc.getParentFile();
- }
- if (projLoc == null || !projLoc.canWrite()) {
- wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE,
- org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.folder_creation_error"));
- return false;
- }
-
- if (FileUtil.toFileObject(projLoc) == null) {
- String message = org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.invalid_path");
- wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, message);
- return false;
- }
-
- File[] kids = destFolder.listFiles();
- if (destFolder.exists() && kids != null && kids.length > 0) {
- // Folder exists and is not empty
- wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE,
- org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.folder_exists"));
- return false;
- }
- wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, "");
- return true;
- }
-
- void store(WizardDescriptor d) {
- String name = projectNameTextField.getText().trim();
- String folder = createdFolderTextField.getText().trim();
-
- d.putProperty("projdir", new File(folder)); // NOI18N
- d.putProperty("name", name); // NOI18N
- }
-
- void read(WizardDescriptor settings) {
- File projectLocation = (File) settings.getProperty("projdir"); // NOI18N
- if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) {
- projectLocation = ProjectChooser.getProjectsFolder();
- } else {
- projectLocation = projectLocation.getParentFile();
- }
- this.projectLocationTextField.setText(projectLocation.getAbsolutePath());
-
- String projectName = (String) settings.getProperty("name"); // NOI18N
- if(projectName == null) {
- projectName = org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.default_prj_name");
- }
- this.projectNameTextField.setText(projectName);
- this.projectNameTextField.selectAll();
- }
-
- void validate(WizardDescriptor d) throws WizardValidationException {
- // nothing to validate
- }
-
- // Implementation of DocumentListener --------------------------------------
-
- public void changedUpdate(DocumentEvent e) {
- updateTexts(e);
- if (this.projectNameTextField.getDocument() == e.getDocument()) {
- firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
- }
- }
-
- public void insertUpdate(DocumentEvent e) {
- updateTexts(e);
- if (this.projectNameTextField.getDocument() == e.getDocument()) {
- firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
- }
- }
-
- public void removeUpdate(DocumentEvent e) {
- updateTexts(e);
- if (this.projectNameTextField.getDocument() == e.getDocument()) {
- firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
- }
- }
-
- /** Handles changes in the Project name and project directory, */
- private void updateTexts(DocumentEvent e) {
-
- Document doc = e.getDocument();
-
- if (doc == projectNameTextField.getDocument() || doc == projectLocationTextField.getDocument()) {
- // Change in the project name
-
- String projectName = projectNameTextField.getText();
- String projectFolder = projectLocationTextField.getText();
-
- //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) {
- createdFolderTextField.setText(projectFolder + File.separatorChar + projectName);
- //}
-
- }
- panel.fireChangeEvent(); // Notify that the panel changed
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardIterator.java
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardIterator.java b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardIterator.java
deleted file mode 100644
index 7fae983..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardIterator.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * 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.
- */
-package org.netbeans.modules.apisupport.osgidemo;
-
-import java.awt.Component;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-import javax.script.ScriptContext;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-import javax.swing.JComponent;
-import javax.swing.event.ChangeListener;
-import org.netbeans.api.project.ProjectManager;
-import org.netbeans.spi.project.ui.support.ProjectChooser;
-import org.netbeans.spi.project.ui.templates.support.Templates;
-import org.openide.WizardDescriptor;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileUtil;
-import org.openide.util.NbBundle;
-
-public class SampleAppWizardIterator implements WizardDescriptor.AsynchronousInstantiatingIterator {
-
- private static final long serialVersionUID = 1L;
-
- private transient int index;
- private transient WizardDescriptor.Panel[] panels;
- private transient WizardDescriptor wiz;
- private final boolean netbinox;
-
- public SampleAppWizardIterator(boolean netbinox) {
- this.netbinox = netbinox;
- }
-
- public static SampleAppWizardIterator createIterator(Map<?,?> params) {
- return new SampleAppWizardIterator(params.containsKey("netbinox")); // NOI18N
- }
-
- private WizardDescriptor.Panel[] createPanels() {
- List<WizardDescriptor.Panel<?>> arr = new ArrayList<WizardDescriptor.Panel<?>>();
- arr.add(new SampleAppWizardPanel());
- return arr.toArray(new WizardDescriptor.Panel[0]);
- }
-
- private String[] createSteps() {
- List<String> arr = new ArrayList<String>();
- arr.add(NbBundle.getMessage(SampleAppWizardIterator.class, "LBL_CreateProjectStep"));
- return arr.toArray(new String[0]);
- }
-
- @Override
- public Set/*<FileObject>*/ instantiate() throws IOException {
- Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
- File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir")); // NOI18N
- dirF.mkdirs();
-
- FileObject template = Templates.getTemplate(wiz);
- FileObject dir = FileUtil.toFileObject(dirF);
- Map<String,Object> params = new HashMap<String, Object>();
- if (netbinox) {
- params.put("netbinox", "true"); // NOI18N
- }
- unZipFile(null, template.getInputStream(), params, dir);
-
- // Always open top dir as a project:
- resultSet.add(dir);
- // Look for nested projects to open as well:
- Enumeration e = dir.getFolders(true);
- while (e.hasMoreElements()) {
- FileObject subfolder = (FileObject) e.nextElement();
- if (ProjectManager.getDefault().isProject(subfolder)) {
- resultSet.add(subfolder);
- }
- }
-
- File parent = dirF.getParentFile();
- if (parent != null && parent.exists()) {
- ProjectChooser.setProjectsFolder(parent);
- }
-
- return resultSet;
- }
-
- @Override
- public void initialize(WizardDescriptor wiz) {
- this.wiz = wiz;
- index = 0;
- if (netbinox) {
- wiz.putProperty("name", NbBundle.getMessage(SampleAppWizardIterator.class, "CTL_NetbinoxProjectName"));
- } else {
- wiz.putProperty("name", NbBundle.getMessage(SampleAppWizardIterator.class, "CTL_FelixProjectName"));
- }
- panels = createPanels();
- // Make sure list of steps is accurate.
- String[] steps = createSteps();
- for (int i = 0; i < panels.length; i++) {
- Component c = panels[i].getComponent();
- if (steps[i] == null) {
- // Default step name to component name of panel.
- // Mainly useful for getting the name of the target
- // chooser to appear in the list of steps.
- steps[i] = c.getName();
- }
- if (c instanceof JComponent) { // assume Swing components
- JComponent jc = (JComponent) c;
- // Step #.
- jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N
- // Step name (actually the whole list for reference).
- jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
- }
- }
- }
-
- @Override
- public void uninitialize(WizardDescriptor wiz) {
- this.wiz.putProperty("projdir",null); // NOI18N
- this.wiz.putProperty("name",null); // NOI18N
- this.wiz = null;
- panels = null;
- }
-
- @Override
- public String name() {
- return NbBundle.getMessage(SampleAppWizardIterator.class, "SampleAppWizardIterator.name.format",
- new Object[] {new Integer(index + 1), new Integer(panels.length)});
- }
-
- @Override
- public boolean hasNext() {
- return index < panels.length - 1;
- }
-
- @Override
- public boolean hasPrevious() {
- return index > 0;
- }
-
- @Override
- public void nextPanel() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- index++;
- }
-
- @Override
- public void previousPanel() {
- if (!hasPrevious()) {
- throw new NoSuchElementException();
- }
- index--;
- }
-
- @Override
- public WizardDescriptor.Panel current() {
- return panels[index];
- }
-
- @Override
- public final void addChangeListener(ChangeListener l) {}
- @Override
- public final void removeChangeListener(ChangeListener l) {}
-
- static void unZipFile(FileObject template, InputStream source, Map<String,Object> params, FileObject projectRoot) throws IOException {
- try {
- ZipInputStream str = new ZipInputStream(source);
- ZipEntry entry;
- while ((entry = str.getNextEntry()) != null) {
- if (entry.isDirectory()) {
- FileUtil.createFolder(projectRoot, entry.getName());
- } else {
- FileObject fo = FileUtil.createData(projectRoot, entry.getName());
- String mime = fo.getMIMEType();
- OutputStream out = fo.getOutputStream();
- try {
- if (mime.startsWith("text/")) {
- StringBuilder sb = new StringBuilder();
- for (;;) {
- int r = str.read();
- if (r == -1) {
- break;
- }
- if (r == '$') {
- sb.append("${r\"$\"}");
- } else {
- sb.append((char)r);
- }
- }
- ScriptEngineManager m = new ScriptEngineManager();
- ScriptEngine engine = m.getEngineByName("FreeMarker");
- assert engine != null : "FreeMarker engine needs to be present";
- engine.getBindings(ScriptContext.ENGINE_SCOPE).putAll(params);
- if (template != null) {
- engine.getContext().setAttribute("org.openide.filesystems.FileObject", template, ScriptContext.ENGINE_SCOPE); // NOI18N
- }
- Writer w = new OutputStreamWriter(out, "UTF-8");
- engine.getContext().setWriter(w);
- try {
- engine.eval(sb.toString());
- } catch (ScriptException ex) {
- throw new IOException(sb.toString(), ex);
- }
- w.flush();
- } else {
- FileUtil.copy(str, out);
- }
- } finally {
- out.close();
- }
- }
- }
- } finally {
- source.close();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardPanel.java
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardPanel.java b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardPanel.java
deleted file mode 100644
index 8dd5013..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleAppWizardPanel.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * 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.
- */
-package org.netbeans.modules.apisupport.osgidemo;
-
-import java.awt.Component;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import org.openide.WizardDescriptor;
-import org.openide.WizardValidationException;
-import org.openide.util.HelpCtx;
-import org.openide.util.NbBundle;
-
-/**
- * Panel just asking for basic info.
- */
-class SampleAppWizardPanel implements WizardDescriptor.Panel,
- WizardDescriptor.ValidatingPanel, WizardDescriptor.FinishablePanel {
-
- private WizardDescriptor wizardDescriptor;
- private SampleAppPanelVisual component;
-
- public SampleAppWizardPanel() {
- }
-
- @Override
- public Component getComponent() {
- if (component == null) {
- component = new SampleAppPanelVisual(this);
- component.setName(NbBundle.getMessage(SampleAppWizardPanel.class, "LBL_CreateProjectStep"));
- }
- return component;
- }
-
- @Override
- public HelpCtx getHelp() {
- return null;
- }
-
- @Override
- public boolean isValid() {
- getComponent();
- return component.valid(wizardDescriptor);
- }
-
- private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);
- public final void addChangeListener(ChangeListener l) {
- synchronized (listeners) {
- listeners.add(l);
- }
- }
- @Override
- public final void removeChangeListener(ChangeListener l) {
- synchronized (listeners) {
- listeners.remove(l);
- }
- }
- protected final void fireChangeEvent() {
- Iterator it;
- synchronized (listeners) {
- it = new HashSet<ChangeListener>(listeners).iterator();
- }
- ChangeEvent ev = new ChangeEvent(this);
- while (it.hasNext()) {
- ((ChangeListener) it.next()).stateChanged(ev);
- }
- }
-
- @Override
- public void readSettings(Object settings) {
- wizardDescriptor = (WizardDescriptor) settings;
- component.read(wizardDescriptor);
- wizardDescriptor.putProperty("NewProjectWizard_Title", //NOI18N
- wizardDescriptor.getProperty("NewFileWizard_Title")); //NOI18N
- }
-
- @Override
- public void storeSettings(Object settings) {
- WizardDescriptor d = (WizardDescriptor) settings;
- component.store(d);
- d.putProperty("NewProjectWizard_Title", null); //NOI18N
- }
-
- @Override
- public boolean isFinishPanel() {
- return false;
- }
-
- @Override
- public void validate() throws WizardValidationException {
- getComponent();
- component.validate(wizardDescriptor);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleFelixDescription.html
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleFelixDescription.html b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleFelixDescription.html
deleted file mode 100644
index 171d696..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/SampleFelixDescription.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
-Copyright (c) 2010, 2016 Oracle and/or its affiliates. All rights reserved.
-
-Oracle and Java are registered trademarks of Oracle and/or its affiliates.
-Other names may be trademarks of their respective owners.
-
-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. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle 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):
--->
-
-<html>
-<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-</head>
- <body>
- Illustrates how to use the NetBeans Platform and Felix OSGi container together.
- </body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/bundle.png
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/bundle.png b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/bundle.png
deleted file mode 100644
index 02f76f1..0000000
Binary files a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/bundle.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/equinox.png
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/equinox.png b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/equinox.png
deleted file mode 100644
index 64f1db9..0000000
Binary files a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/equinox.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/layer.xml
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/layer.xml b/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/layer.xml
deleted file mode 100644
index 148b29e..0000000
--- a/apisupport.osgidemo/src/org/netbeans/modules/apisupport/osgidemo/layer.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
-<!--
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
-Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
-
-Oracle and Java are registered trademarks of Oracle and/or its affiliates.
-Other names may be trademarks of their respective owners.
-
-
-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. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle 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]"
-
-Contributor(s):
-
-The Original Software is NetBeans. The Initial Developer of the Original
-Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
-Microsystems, Inc. All Rights Reserved.
-
-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.
--->
-<filesystem>
- <folder name="Templates">
- <folder name="Project">
- <folder name="Samples">
- <folder name="ApiSupport">
- <file name="EquinoxDemo.zip" url="EquinoxDemo.zip">
- <attr name="position" intvalue="99900"/>
- <attr name="iconBase" stringvalue="org/netbeans/modules/apisupport/osgidemo/equinox.png"/>
- <attr name="displayName" bundlevalue="org.netbeans.modules.apisupport.osgidemo.Bundle#SampleAppFile"/>
- <attr name="instantiatingIterator" methodvalue="org.netbeans.modules.apisupport.osgidemo.SampleAppWizardIterator.createIterator"/>
- <attr name="instantiatingWizardURL" urlvalue="nbresloc:/org/netbeans/modules/apisupport/osgidemo/SampleAppDescription.html"/>
- <attr name="template" boolvalue="true"/>
- <attr name="netbinox" stringvalue="true"/>
- </file>
- <file name="FelixDemo.zip" url="EquinoxDemo.zip">
- <attr name="position" intvalue="99800"/>
- <attr name="iconBase" stringvalue="org/netbeans/modules/apisupport/osgidemo/bundle.png"/>
- <attr name="displayName" bundlevalue="org.netbeans.modules.apisupport.osgidemo.Bundle#SampleFelixFile"/>
- <attr name="instantiatingIterator" methodvalue="org.netbeans.modules.apisupport.osgidemo.SampleAppWizardIterator.createIterator"/>
- <attr name="instantiatingWizardURL" urlvalue="nbresloc:/org/netbeans/modules/apisupport/osgidemo/SampleFelixDescription.html"/>
- <attr name="template" boolvalue="true"/>
- </file>
- </folder>
- </folder>
- </folder>
- </folder>
-</filesystem>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildEquinoxSampleApplicationTest.java
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildEquinoxSampleApplicationTest.java b/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildEquinoxSampleApplicationTest.java
deleted file mode 100644
index 455e4de..0000000
--- a/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildEquinoxSampleApplicationTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * 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.
- */
-package org.netbeans.modules.apisupport.osgidemo;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Invokes various Ant targets over osgidemo sample in equinox mode.
- *
- * @author Tomas Musil
- */
-public class BuildEquinoxSampleApplicationTest extends BuildSampleApplicationBase {
- public BuildEquinoxSampleApplicationTest(String testName) {
- super(testName);
- }
-
- @Override
- protected Map<String, Object> params() {
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("netbinox", "true");
- return map;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildFelixSampleApplicationTest.java
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildFelixSampleApplicationTest.java b/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildFelixSampleApplicationTest.java
deleted file mode 100644
index 2482cce..0000000
--- a/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildFelixSampleApplicationTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * 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.
- */
-package org.netbeans.modules.apisupport.osgidemo;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Invokes various Ant targets over osgidemo sample in felix mode.
- *
- * @author Tomas Musil
- */
-public class BuildFelixSampleApplicationTest extends BuildSampleApplicationBase {
- public BuildFelixSampleApplicationTest(String testName) {
- super(testName);
- }
-
- @Override
- protected Map<String, Object> params() {
- Map<String, Object> map = new HashMap<String, Object>();
- return map;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildSampleApplicationBase.java
----------------------------------------------------------------------
diff --git a/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildSampleApplicationBase.java b/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildSampleApplicationBase.java
deleted file mode 100644
index 0f4d9ef..0000000
--- a/apisupport.osgidemo/test/unit/src/org/netbeans/modules/apisupport/osgidemo/BuildSampleApplicationBase.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * 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.
- */
-package org.netbeans.modules.apisupport.osgidemo;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.Properties;
-import org.apache.tools.ant.module.api.support.ActionUtils;
-import org.netbeans.api.project.Project;
-import org.netbeans.api.project.ProjectManager;
-import org.netbeans.modules.apisupport.project.DialogDisplayerImpl;
-import org.netbeans.modules.apisupport.project.InstalledFileLocatorImpl;
-import org.netbeans.modules.apisupport.project.TestAntLogger;
-import org.netbeans.modules.apisupport.project.TestBase;
-import org.netbeans.modules.apisupport.project.layers.LayerTestBase;
-import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
-import org.openide.DialogDescriptor;
-import org.openide.execution.ExecutorTask;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileUtil;
-import org.openide.util.EditableProperties;
-
-/**
- * Invokes various Ant targets over osgidemo sample.
- *
- * @author Tomas Musil
- */
-public abstract class BuildSampleApplicationBase extends TestBase {
-
- private File sampleFolder = null;
-
- static {
- // #65461: do not try to load ModuleInfo instances from ant module
- System.setProperty("org.netbeans.core.startup.ModuleSystem.CULPRIT", "true");
- System.setProperty("org.openide.windows.DummyWindowManager.VISIBLE", "false");
- LayerTestBase.Lkp.setLookup(new Object[0]);
- DialogDisplayerImpl.returnFromNotify(DialogDescriptor.NO_OPTION);
- FileUtil.setMIMEType("properties", "text/x-properties");
- }
-
- public BuildSampleApplicationBase(String testName) {
- super(testName);
- }
-
- protected abstract Map<String,Object> params();
-
- @Override
- protected void setUp() throws Exception {
- clearWorkDir();
- noDataDir = true;
- super.setUp();
- InstalledFileLocatorImpl.registerDestDir(destDirF);
- TestAntLogger.getDefault().setEnabled(true);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestAntLogger.getDefault().setEnabled(false);
- }
-
- public int runAntTargetsOnSample(String[] targets) throws Exception {
- String p = System.getProperty("sample.project");
- FileObject fo;
- if (p == null) {
- InputStream is = getClass().getClassLoader().getResourceAsStream("org/netbeans/modules/apisupport/osgidemo/EquinoxDemo.zip");
- assertNotNull(is);
- sampleFolder = new File(getWorkDir(), "sample");
- sampleFolder.mkdir();
- fo = FileUtil.toFileObject(sampleFolder);
- assertNotNull(fo);
- SampleAppWizardIterator.unZipFile(null, is, params(), fo);
- File buildProps = new File(getWorkDir(), "build.properties");
- File privateFolder = new File(new File(sampleFolder, "nbproject"), "private");
- privateFolder.mkdir();
- FileObject platfPrivateProps = FileUtil.copyFile(FileUtil.toFileObject(buildProps), FileUtil.toFileObject(privateFolder), "platform-private");
- assertNotNull(platfPrivateProps);
- { // In the target platform, libs.junit4 may be in the extra cluster rather than platform:
- FileObject platfProps = fo.getFileObject("nbproject/platform.properties");
- EditableProperties props = new EditableProperties(false);
- is = platfProps.getInputStream();
- props.load(is);
- is.close();
- props.setProperty("cluster.path", (props.getProperty("cluster.path") + ":${nbplatform.active.dir}/extra").split("(?<=:)"));
- OutputStream os = platfProps.getOutputStream();
- props.store(os);
- os.close();
- }
- System.setProperty("sample.project", sampleFolder.getPath());
- } else {
- sampleFolder = new File(p);
- fo = FileUtil.toFileObject(sampleFolder);
- assertNotNull(fo);
- }
-
-
- Project sampleSuite = ProjectManager.getDefault().findProject(fo);
- assertNotNull(sampleSuite);
- FileObject buildScript = sampleSuite.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
- assertNotNull(buildScript);
- assertTrue(buildScript.isValid());
- Properties props = new Properties();
-
- ExecutorTask et = ActionUtils.runTarget(buildScript, targets, props);
- et.waitFinished();
- return et.result();
- }
-
- public void testAntInitAndClean() throws Exception {
- int ret = runAntTargetsOnSample(new String[]{"clean"});
- assertEquals("build successful", 0, ret);
-
- FileObject fo = FileUtil.toFileObject(sampleFolder);
- Enumeration<? extends FileObject> en = fo.getChildren(true);
- while (en.hasMoreElements()) {
- FileObject data = en.nextElement();
- if (data.isFolder()) {
- continue;
- }
- String s = data.asText();
- if (s.contains("#if")) {
- fail("Wrong content of " + data +":\n" + s);
- }
- }
- }
-
- public void testBuildZip() throws Exception {
- int ret = runAntTargetsOnSample(new String[]{"build-zip"});
- assertEquals("build-zipant target should return zero - build successful", 0, ret);
- File dist = new File(sampleFolder, "dist");
- File zipFile = new File(dist, "osgisample.zip");
- assertTrue("ZIP file should be in dist folder", zipFile.exists());
- }
-
- public void testBuild() throws Exception {
- int ret = runAntTargetsOnSample(new String[] {"build"});
- assertEquals("build ant target should return zero - build successful", 0 , ret);
- File buildFolder = new File(sampleFolder,"build");
- assertTrue("build folder should exist", buildFolder.exists() && buildFolder.isDirectory());
- String[] children = buildFolder.list();
- assertTrue("build folder is not empty", children.length>0);
-
- }
-
- public void testBuildNBMs() throws Exception {
- int ret = runAntTargetsOnSample(new String[] {"nbms"});
- assertEquals("build ant target should return zero - build successful", 0 , ret);
- File buildFolder = new File(sampleFolder,"build");
- File updatesFolder = new File(buildFolder,"updates");
- assertTrue("build/update folder exists", updatesFolder.exists() && updatesFolder.isDirectory());
- File showBundles = new File(updatesFolder, "org-netbeans-demo-osgi-showbundles.jar");
- assertTrue("Our NBM is in build/updates folder", showBundles.exists());
- assertEquals("1 nbm is in build/updates folder", 1, updatesFolder.list(new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name) {
- return name.matches(".+[.](nbm|jar)$");
- }
- }).length);
- }
-
- public void testTest() throws Exception {
- int ret = runAntTargetsOnSample(new String[]{"test"});
- assertEquals("test ant target should return zero - build successful", 0, ret);
- FileObject fo = FileUtil.toFileObject(sampleFolder);
- FileObject result = fo.getFileObject("showbundles/build/test/unit/results/TEST-org.netbeans.demo.osgi.showbundles.InstallerTest.xml");
- assertNotNull("Test result found", result);
- final String out = result.asText("UTF-8");
- if (!out.contains("testsuite errors=\"0\" failures=\"0\"")) {
- fail("Expecting no errors and failures:\n" + out);
- }
- }
-
- public void testClean() throws Exception {
- int ret = runAntTargetsOnSample(new String[]{"clean"});
- assertEquals("clean ant target should return zero - build successful", 0, ret);
- File buildFolder = new File(sampleFolder, "build");
- File distFolder = new File(sampleFolder, "dist");
- assertTrue("build and dist folders are deleted", !distFolder.exists() && !buildFolder.exists());
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.paintapp/PaintApp-suite/ColorChooser/build.xml
----------------------------------------------------------------------
diff --git a/apisupport.paintapp/PaintApp-suite/ColorChooser/build.xml b/apisupport.paintapp/PaintApp-suite/ColorChooser/build.xml
deleted file mode 100644
index 7e5ad05..0000000
--- a/apisupport.paintapp/PaintApp-suite/ColorChooser/build.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
-Copyright (c) 2007, 2016 Oracle and/or its affiliates. All rights reserved.
-
-Oracle and Java are registered trademarks of Oracle and/or its affiliates.
-Other names may be trademarks of their respective owners.
-
-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. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle 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):
--->
-<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
-<!-- for some information on what you could do (e.g. targets to override). -->
-<!-- If you delete this file and reopen the project it will be recreated. -->
-<project name="org.netbeans.swing.colorchooser" default="netbeans" basedir=".">
- <description>Builds, tests, and runs the project org.netbeans.swing.colorchooser.</description>
- <import file="nbproject/build-impl.xml"/>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.paintapp/PaintApp-suite/ColorChooser/manifest.mf
----------------------------------------------------------------------
diff --git a/apisupport.paintapp/PaintApp-suite/ColorChooser/manifest.mf b/apisupport.paintapp/PaintApp-suite/ColorChooser/manifest.mf
deleted file mode 100644
index cb6f917..0000000
--- a/apisupport.paintapp/PaintApp-suite/ColorChooser/manifest.mf
+++ /dev/null
@@ -1,5 +0,0 @@
-Manifest-Version: 1.0
-OpenIDE-Module: org.netbeans.swing.colorchooser
-OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/colorchooser/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.0
-