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:29 UTC
[11/13] incubator-netbeans git commit: [NETBEANS-64] Remove NetBeans
Platform Samples
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponent.java
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponent.java b/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponent.java
deleted file mode 100644
index 20673f9..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponent.java
+++ /dev/null
@@ -1,367 +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.customereditor;
-
-import demo.Customer;
-import demo.DiscountCode;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.logging.Logger;
-import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-import javax.persistence.Query;
-import javax.swing.SwingUtilities;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import org.netbeans.modules.customerdb.JavaDBSupport;
-import org.netbeans.modules.customerviewer.CustomerTopComponent;
-import org.openide.util.LookupEvent;
-import org.openide.util.NbBundle;
-import org.openide.windows.TopComponent;
-import org.openide.windows.WindowManager;
-import org.openide.DialogDisplayer;
-import org.openide.NotifyDescriptor;
-import org.openide.NotifyDescriptor.Confirmation;
-import org.openide.awt.UndoRedo;
-import org.openide.cookies.SaveCookie;
-import org.openide.util.Lookup;
-import org.openide.util.LookupListener;
-import org.openide.util.RequestProcessor;
-import org.openide.util.lookup.AbstractLookup;
-import org.openide.util.lookup.InstanceContent;
-
-/**
- * Top component which displays something.
- */
-public final class EditorTopComponent extends TopComponent implements LookupListener {
-
- private static EditorTopComponent instance;
- /** path to the icon used by the component and its open action */
-// static final String ICON_PATH = "SET/PATH/TO/ICON/HERE";
- private static final String PREFERRED_ID = "EditorTopComponent";
- private Lookup.Result result = null;
- private UndoRedo.Manager manager = new UndoRedo.Manager();
- private final SaveCookieImpl impl;
- private final InstanceContent content;
- private Customer customer;
-
- public EditorTopComponent() {
- initComponents();
- setName(NbBundle.getMessage(EditorTopComponent.class, "CTL_EditorTopComponent"));
- setToolTipText(NbBundle.getMessage(EditorTopComponent.class, "HINT_EditorTopComponent"));
-// setIcon(ImageUtilities.loadImage(ICON_PATH, true));
- jTextField1.getDocument().addUndoableEditListener(manager);
- jTextField2.getDocument().addUndoableEditListener(manager);
-
- jTextField1.getDocument().addDocumentListener(new DocumentListener() {
-
- @Override
- public void insertUpdate(DocumentEvent arg0) {
- fire(true);
- }
-
- @Override
- public void removeUpdate(DocumentEvent arg0) {
- fire(true);
- }
-
- @Override
- public void changedUpdate(DocumentEvent arg0) {
- fire(true);
- }
- });
-
- jTextField2.getDocument().addDocumentListener(new DocumentListener() {
-
- @Override
- public void insertUpdate(DocumentEvent arg0) {
- fire(true);
- }
-
- @Override
- public void removeUpdate(DocumentEvent arg0) {
- fire(true);
- }
-
- @Override
- public void changedUpdate(DocumentEvent arg0) {
- fire(true);
- }
- });
-
- //Create a new instance of our SaveCookie implementation:
- impl = new SaveCookieImpl();
-
- //Create a new instance of our dynamic object:
- content = new InstanceContent();
-
- //Add the dynamic object to the TopComponent Lookup:
- associateLookup(new AbstractLookup(content));
-
- }
-
- @Override
- public void componentOpened() {
- RequestProcessor.getDefault().post(new Runnable() {
- @Override
- public void run() {
- readCustomer();
- }
- });
- }
-
- private void readCustomer() {
- JavaDBSupport.ensureStartedDB();
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- TopComponent tc = WindowManager.getDefault().findTopComponent("CustomerTopComponent");
- if (tc == null) {
- // XXX: message box?
- return ;
- }
- result = tc.getLookup().lookupResult(Customer.class);
- result.addLookupListener(EditorTopComponent.this);
- resultChanged(new LookupEvent(result));
- }
- });
- }
-
- @Override
- public void componentClosed() {
- result.removeLookupListener(this);
- result = null;
- }
-
- /** 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() {
-
- jLabel1 = new javax.swing.JLabel();
- jLabel2 = new javax.swing.JLabel();
- jTextField1 = new javax.swing.JTextField();
- jTextField2 = new javax.swing.JTextField();
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(EditorTopComponent.class, "EditorTopComponent.jLabel1.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(EditorTopComponent.class, "EditorTopComponent.jLabel2.text")); // NOI18N
-
- 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.TRAILING)
- .addComponent(jLabel1)
- .addComponent(jLabel2))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
- .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE))
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel1)
- .addComponent(jTextField1, 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(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel2))
- .addContainerGap(228, Short.MAX_VALUE))
- );
- }// </editor-fold>//GEN-END:initComponents
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JTextField jTextField1;
- private javax.swing.JTextField jTextField2;
- // End of variables declaration//GEN-END:variables
-
- /**
- * Gets default instance. Do not use directly: reserved for *.settings files only,
- * i.e. deserialization routines; otherwise you could get a non-deserialized instance.
- * To obtain the singleton instance, use {@link #findInstance}.
- */
- public static synchronized EditorTopComponent getDefault() {
- if (instance == null) {
- instance = new EditorTopComponent();
- }
- return instance;
- }
-
- /**
- * Obtain the EditorTopComponent instance. Never call {@link #getDefault} directly!
- */
- public static synchronized EditorTopComponent findInstance() {
- TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
- if (win == null) {
- Logger.getLogger(EditorTopComponent.class.getName()).warning(
- "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
- return getDefault();
- }
- if (win instanceof EditorTopComponent) {
- return (EditorTopComponent) win;
- }
- Logger.getLogger(EditorTopComponent.class.getName()).warning(
- "There seem to be multiple components with the '" + PREFERRED_ID
- + "' ID. That is a potential source of errors and unexpected behavior.");
- return getDefault();
- }
-
- @Override
- public int getPersistenceType() {
- return TopComponent.PERSISTENCE_ALWAYS;
- }
-
- void writeProperties(java.util.Properties p) {
- // better to version settings since initial version as advocated at
- // http://wiki.apidesign.org/wiki/PropertyFiles
- p.setProperty("version", "1.0");
- // TODO store your settings
- }
-
- Object readProperties(java.util.Properties p) {
- if (instance == null) {
- instance = this;
- }
- instance.readPropertiesImpl(p);
- return instance;
- }
-
- private void readPropertiesImpl(java.util.Properties p) {
- String version = p.getProperty("version");
- // TODO read your settings according to their version
- }
-
- @Override
- protected String preferredID() {
- return PREFERRED_ID;
- }
-
- @Override
- public void resultChanged(LookupEvent lookupEvent) {
- Lookup.Result r = (Lookup.Result) lookupEvent.getSource();
- Collection<Customer> coll = r.allInstances();
- if (!coll.isEmpty()) {
- for (Customer cust : coll) {
- customer = cust;
- jTextField1.setText(cust.getName());
- jTextField2.setText(cust.getCity());
- }
- } else {
- jTextField1.setText("[no name]");
- jTextField2.setText("[no city]");
- }
- }
-
- public void fire(boolean modified) {
- if (modified) {
- //If the text is modified,
- //we add SaveCookie impl to Lookup:
- content.add(impl);
- } else {
- //Otherwise, we remove the SaveCookie impl from the lookup:
- content.remove(impl);
- }
- }
-
- public void resetFields() {
- customer = new Customer();
- jTextField1.setText("");
- jTextField2.setText("");
- }
-
- private class SaveCookieImpl implements SaveCookie {
-
- @Override
- public void save() throws IOException {
-
- Confirmation message = new NotifyDescriptor.Confirmation("Do you want to save \""
- + jTextField1.getText() + " (" + jTextField2.getText() + ")\"?",
- NotifyDescriptor.OK_CANCEL_OPTION,
- NotifyDescriptor.QUESTION_MESSAGE);
-
- Object result = DialogDisplayer.getDefault().notify(message);
-
- //When user clicks "Yes", indicating they really want to save,
- //we need to disable the Save button and Save menu item,
- //so that it will only be usable when the next change is made
- //to the text field:
- if (NotifyDescriptor.YES_OPTION.equals(result)) {
- fire(false);
- EntityManager entityManager = Persistence.createEntityManagerFactory("CustomerDBAccessPU").createEntityManager();
- entityManager.getTransaction().begin();
- if (customer!=null && customer.getCustomerId() != null) {
- Customer c = entityManager.find(Customer.class, customer.getCustomerId());
- c.setName(jTextField1.getText());
- c.setCity(jTextField2.getText());
- entityManager.getTransaction().commit();
- } else {
- Query query = entityManager.createQuery("SELECT MAX(c.customerId) FROM Customer c");
- Query zipCodeQuery = entityManager.createQuery("SELECT m.zipCode FROM MicroMarket m").setMaxResults(1);
- Integer newId = (Integer) query.getSingleResult() + 1;
- customer = new Customer();
- customer.setCustomerId(newId);
- customer.setName(jTextField1.getText());
- customer.setCity(jTextField2.getText());
- customer.setZip((String)zipCodeQuery.getSingleResult());
- customer.setDiscountCode(entityManager.find(DiscountCode.class, 'H'));
- entityManager.persist(customer);
- entityManager.getTransaction().commit();
- }
- CustomerTopComponent.refreshNode();
- }
-
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentSettings.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentSettings.xml b/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentSettings.xml
deleted file mode 100644
index 63ea0bd..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentSettings.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) 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):
--->
-<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
-<settings version="1.0">
- <module name="org.netbeans.modules.customereditor" spec="1.0"/>
- <instanceof class="org.openide.windows.TopComponent"/>
- <instanceof class="org.netbeans.modules.customereditor.EditorTopComponent"/>
- <instance class="org.netbeans.modules.customereditor.EditorTopComponent" method="getDefault"/>
-</settings>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentWstcref.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentWstcref.xml b/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentWstcref.xml
deleted file mode 100644
index 3fab3ee..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/EditorTopComponentWstcref.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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):
--->
-<!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd">
-<tc-ref version="2.0" >
- <module name="org.netbeans.modules.customereditor" spec="1.0"/>
- <tc-id id="EditorTopComponent"/>
- <state opened="true"/>
-</tc-ref>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/NewAction.java
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/NewAction.java b/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/NewAction.java
deleted file mode 100644
index bb1d79b..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/NewAction.java
+++ /dev/null
@@ -1,59 +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.customereditor;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-public final class NewAction implements ActionListener {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- EditorTopComponent tc = EditorTopComponent.findInstance();
- tc.resetFields();
- tc.open();
- tc.requestActive();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/layer.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/layer.xml b/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/layer.xml
deleted file mode 100644
index 80ac401..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/layer.xml
+++ /dev/null
@@ -1,103 +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-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.
--->
-
-<filesystem>
- <folder name="Actions">
- <folder name="File">
- <file name="org-netbeans-modules-customereditor-NewAction.instance">
- <attr name="delegate" newvalue="org.netbeans.modules.customereditor.NewAction"/>
- <attr name="displayName" bundlevalue="org.netbeans.modules.customereditor.Bundle#CTL_NewAction"/>
- <attr name="iconBase" stringvalue="org/netbeans/modules/customereditor/record-new.png"/>
- <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
- <attr name="noIconInMenu" boolvalue="false"/>
- </file>
- </folder>
- <folder name="Window">
- <file name="org-netbeans-modules-customereditor-EditorAction.instance">
- <attr name="component" methodvalue="org.netbeans.modules.customereditor.EditorTopComponent.findInstance"/>
- <attr name="displayName" bundlevalue="org.netbeans.modules.customereditor.Bundle#CTL_EditorAction"/>
- <attr name="instanceCreate" methodvalue="org.openide.windows.TopComponent.openAction"/>
- </file>
- </folder>
- </folder>
- <folder name="Menu">
- <folder name="File">
- <file name="org-netbeans-modules-customereditor-NewAction.shadow">
- <attr name="originalFile" stringvalue="Actions/File/org-netbeans-modules-customereditor-NewAction.instance"/>
- <attr name="position" intvalue="0"/>
- </file>
- </folder>
- <folder name="Window">
- <file name="EditorAction.shadow">
- <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-modules-customereditor-EditorAction.instance"/>
- </file>
- </folder>
- </folder>
- <folder name="Windows2">
- <folder name="Components">
- <file name="EditorTopComponent.settings" url="EditorTopComponentSettings.xml"/>
- </folder>
- <folder name="Modes">
- <folder name="editor">
- <file name="EditorTopComponent.wstcref" url="EditorTopComponentWstcref.xml"/>
- </folder>
- </folder>
- </folder>
- <folder name="Toolbars">
- <folder name="File">
- <file name="org-openide-actions-SaveAction.shadow">
- <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-SaveAction.instance"/>
- <attr name="position" intvalue="444"/>
- </file>
- <file name="org-openide-actions-SaveAllAction.shadow_hidden"/>
- <file name="org-netbeans-modules-customereditor-NewAction.shadow">
- <attr name="originalFile" stringvalue="Actions/File/org-netbeans-modules-customereditor-NewAction.instance"/>
- <attr name="position" intvalue="0"/>
- </file>
- </folder>
- </folder>
-</filesystem>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new.png
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new.png b/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new.png
deleted file mode 100644
index 17cb028..0000000
Binary files a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new24.png
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new24.png b/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new24.png
deleted file mode 100644
index 5ae77db..0000000
Binary files a/apisupport.crudsample/crud-sample-application/CustomerEditor/src/org/netbeans/modules/customereditor/record-new24.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/build.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/build.xml b/apisupport.crudsample/crud-sample-application/CustomerViewer/build.xml
deleted file mode 100644
index c85c5cf..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/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) 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):
--->
-<!-- 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.modules.customerviewer" default="netbeans" basedir=".">
- <description>Builds, tests, and runs the project org.netbeans.modules.customerviewer.</description>
- <import file="nbproject/build-impl.xml"/>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/manifest.mf
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/manifest.mf b/apisupport.crudsample/crud-sample-application/CustomerViewer/manifest.mf
deleted file mode 100644
index 7e42369..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/manifest.mf
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-OpenIDE-Module: org.netbeans.modules.customerviewer
-OpenIDE-Module-Layer: org/netbeans/modules/customerviewer/layer.xml
-OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/customerviewer/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.2
-
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/build-impl.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/build-impl.xml b/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/build-impl.xml
deleted file mode 100644
index 5b978d7..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/build-impl.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT ***
-*** EDIT ../build.xml INSTEAD ***
--->
-<project name="org.netbeans.modules.customerviewer-impl" basedir="..">
- <fail message="Please build using Ant 1.7.1 or higher.">
- <condition>
- <not>
- <antversion atleast="1.7.1"/>
- </not>
- </condition>
- </fail>
- <property file="nbproject/private/suite-private.properties"/>
- <property file="nbproject/suite.properties"/>
- <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
- <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
- <property file="${suite.dir}/nbproject/platform.properties"/>
- <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${@{value}}"/>
- </sequential>
- </macrodef>
- <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
- <attribute name="property"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{property}" value="@{value}"/>
- </sequential>
- </macrodef>
- <property file="${user.properties.file}"/>
- <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
- <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
- <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
- <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
- <condition>
- <not>
- <contains string="${cluster.path.evaluated}" substring="platform"/>
- </not>
- </condition>
- </fail>
- <import file="${harness.dir}/build.xml"/>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/genfiles.properties
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/genfiles.properties b/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/genfiles.properties
deleted file mode 100644
index d8f8f6c..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/genfiles.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-build.xml.data.CRC32=a63c5ac5
-build.xml.script.CRC32=4da0e812
-build.xml.stylesheet.CRC32=79c3b980@1.42
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=a63c5ac5
-nbproject/build-impl.xml.script.CRC32=ffa3009d
-nbproject/build-impl.xml.stylesheet.CRC32=261c4bef@1.42
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/platform.properties
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/platform.properties b/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/platform.properties
deleted file mode 100644
index e787580..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/platform.properties
+++ /dev/null
@@ -1,54 +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):
-cluster.path=\
- ${nbplatform.active.dir}/platform
-disabled.modules=\
- org.openide.compat,\
- org.netbeans.modules.autoupdate.services,\
- org.netbeans.api.visual,\
- org.netbeans.core.multiview,\
- org.netbeans.modules.favorites,\
- org.openide.util.enumerations,\
- org.netbeans.modules.core.kit,\
- org.netbeans.modules.autoupdate.ui,\
- org.openide.options,\
- org.netbeans.modules.templates,\
- org.netbeans.libs.jsr223,\
- org.netbeans.core.execution,\
- org.openide.execution
-nbplatform.active=default
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.properties
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.properties b/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.properties
deleted file mode 100644
index d20299a..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.properties
+++ /dev/null
@@ -1,39 +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):
-javac.source=1.6
-javac.compilerargs=-Xlint -Xlint:-serial -proc:none
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.xml b/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.xml
deleted file mode 100644
index 86cccca..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/project.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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):
--->
-<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.apisupport.project</type>
- <configuration>
- <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
- <code-name-base>org.netbeans.modules.customerviewer</code-name-base>
- <suite-component/>
- <module-dependencies>
- <dependency>
- <code-name-base>org.netbeans.core.windows</code-name-base>
- <compile-dependency/>
- <run-dependency>
- <release-version>2</release-version>
- <implementation-version/>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.netbeans.modules.customerdb</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>1.0</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.netbeans.modules.settings</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <release-version>1</release-version>
- <specification-version>1.23.0.1</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.actions</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>6.16</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.awt</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>7.20.0.1</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.explorer</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>6.23.0.1</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.nodes</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>7.13.0.1</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.util</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>9.3</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.util.ui</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>9.3</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.util.lookup</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>8.0.0.1</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.openide.windows</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>6.31</specification-version>
- </run-dependency>
- </dependency>
- </module-dependencies>
- <public-packages>
- <package>org.netbeans.modules.customerviewer</package>
- </public-packages>
- </data>
- </configuration>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/suite.properties
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/suite.properties b/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/suite.properties
deleted file mode 100644
index 78e330f..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/nbproject/suite.properties
+++ /dev/null
@@ -1,38 +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):
-suite.dir=${basedir}/..
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/Bundle.properties
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/Bundle.properties b/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/Bundle.properties
deleted file mode 100644
index ce29866..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/Bundle.properties
+++ /dev/null
@@ -1,41 +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):
-CTL_CustomerAction=Customer
-CTL_CustomerTopComponent=Customer Window
-HINT_CustomerTopComponent=This is a Customer window
-OpenIDE-Module-Name=CustomerViewer
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerChildFactory.java
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerChildFactory.java b/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerChildFactory.java
deleted file mode 100644
index 9b7e206..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerChildFactory.java
+++ /dev/null
@@ -1,127 +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.customerviewer;
-
-import demo.Customer;
-import java.io.IOException;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-import javax.swing.Action;
-import org.openide.actions.DeleteAction;
-import org.openide.actions.PropertiesAction;
-import org.openide.nodes.AbstractNode;
-import org.openide.nodes.ChildFactory;
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-import org.openide.util.actions.SystemAction;
-import org.openide.util.lookup.Lookups;
-
-public class CustomerChildFactory extends ChildFactory<Customer> {
-
- private List<Customer> resultList;
-
- public CustomerChildFactory(List<Customer> resultList) {
- this.resultList = resultList;
- }
-
- @Override
- protected boolean createKeys(List<Customer> list) {
- for (Customer customer : resultList) {
- list.add(customer);
- }
- return true;
- }
-
- @Override
- protected Node createNodeForKey(Customer c) {
- Node node = new AbstractNode(Children.LEAF, Lookups.singleton(c)) {
-
- @Override
- public Action[] getActions(boolean context) {
- Action[] result = new Action[]{
- SystemAction.get(DeleteAction.class),
- SystemAction.get(PropertiesAction.class)
- };
- return result;
- }
-
- @Override
- public boolean canDestroy() {
- Customer customer = this.getLookup().lookup(Customer.class);
- return customer != null;
- }
-
- @Override
- public void destroy() throws IOException {
- if (deleteCustomer(this.getLookup().lookup(Customer.class).getCustomerId())) {
- super.destroy();
- CustomerTopComponent.refreshNode();
- }
- }
-
- };
- node.setDisplayName(c.getName());
- node.setShortDescription(c.getCity());
- return node;
- }
-
- private static boolean deleteCustomer(int customerId) {
- EntityManager entityManager = Persistence.createEntityManagerFactory("CustomerDBAccessPU").createEntityManager();
- entityManager.getTransaction().begin();
- try {
- Customer toDelete = entityManager.find(Customer.class, customerId);
- entityManager.remove(toDelete);
- // so far so good
- entityManager.getTransaction().commit();
- } catch(Exception e) {
- Logger.getLogger(CustomerChildFactory.class.getName()).log(
- Level.WARNING, "Cannot delete a customer with id {0}, cause: {1}", new Object[]{customerId, e});
- entityManager.getTransaction().rollback();
- }
- return true;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerRootNode.java
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerRootNode.java b/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerRootNode.java
deleted file mode 100644
index dde0304..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerRootNode.java
+++ /dev/null
@@ -1,79 +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.customerviewer;
-
-import java.awt.event.ActionEvent;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import org.openide.nodes.AbstractNode;
-import org.openide.nodes.Children;
-
-public class CustomerRootNode extends AbstractNode {
-
- public CustomerRootNode(Children kids) {
- super(kids);
- setDisplayName("Root");
- }
-
- @Override
- public Action[] getActions(boolean context) {
- Action[] result = new Action[]{
- new RefreshAction()
- };
- return result;
- }
-
- private final class RefreshAction extends AbstractAction {
-
- public RefreshAction() {
- putValue(Action.NAME, "Refresh");
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- CustomerTopComponent.refreshNode();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.form
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.form b/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.form
deleted file mode 100644
index ccd5cf8..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.form
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.1" encoding="UTF-8" ?>
-
-<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
- <AuxValues>
- <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
- <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="true"/>
- <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">
- <Component id="beanTreeView1" alignment="1" pref="454" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="beanTreeView1" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="org.openide.explorer.view.BeanTreeView" name="beanTreeView1">
- </Component>
- </SubComponents>
-</Form>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.java
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.java b/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.java
deleted file mode 100644
index 8cac410..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponent.java
+++ /dev/null
@@ -1,223 +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.customerviewer;
-
-import demo.Customer;
-import java.util.List;
-import java.util.logging.Logger;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.persistence.Query;
-import javax.swing.ActionMap;
-import javax.swing.SwingUtilities;
-import org.netbeans.modules.customerdb.JavaDBSupport;
-import org.openide.util.NbBundle;
-import org.openide.windows.TopComponent;
-import org.openide.windows.WindowManager;
-import org.openide.explorer.ExplorerManager;
-import org.openide.explorer.ExplorerUtils;
-import org.openide.nodes.Children;
-import org.openide.util.RequestProcessor;
-
-/**
- * Top component which displays something.
- */
-public final class CustomerTopComponent extends TopComponent implements ExplorerManager.Provider {
-
- private static CustomerTopComponent instance;
-
- private static final String PREFERRED_ID = "CustomerTopComponent";
- private static ExplorerManager em = new ExplorerManager();
-
- public CustomerTopComponent() {
- initComponents();
- setName(NbBundle.getMessage(CustomerTopComponent.class, "CTL_CustomerTopComponent"));
- setToolTipText(NbBundle.getMessage(CustomerTopComponent.class, "HINT_CustomerTopComponent"));
- ActionMap map = this.getActionMap();
- map.put("delete", ExplorerUtils.actionDelete(em, true)); //NOI18N
- associateLookup(ExplorerUtils.createLookup(em, map));
- RequestProcessor.getDefault().post(new Runnable () {
- @Override
- public void run() {
- readCustomer();
- }
- });
- }
-
- private void readCustomer() {
- JavaDBSupport.ensureStartedDB();
- EntityManagerFactory factory = Persistence.createEntityManagerFactory("CustomerDBAccessPU");
- if (factory == null) {
- // XXX: message box?
- return ;
- }
- EntityManager entityManager = null;
- try {
- entityManager = factory.createEntityManager();
- } catch (RuntimeException re) {
- // XXX: message box?
- return ;
- }
- final Query query = entityManager.createQuery("SELECT c FROM Customer c");
- SwingUtilities.invokeLater(new Runnable () {
- @Override
- public void run() {
- @SuppressWarnings("unchecked")
- List<Customer> resultList = query.getResultList();
- em.setRootContext(new CustomerRootNode(Children.create(new CustomerChildFactory(resultList), true)));
- }
- });
- }
-
- /** 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() {
-
- beanTreeView1 = new org.openide.explorer.view.BeanTreeView();
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(beanTreeView1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(beanTreeView1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- }// </editor-fold>//GEN-END:initComponents
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private org.openide.explorer.view.BeanTreeView beanTreeView1;
- // End of variables declaration//GEN-END:variables
-
- /**
- * Gets default instance. Do not use directly: reserved for *.settings files only,
- * i.e. deserialization routines; otherwise you could get a non-deserialized instance.
- * To obtain the singleton instance, use {@link #findInstance}.
- */
- public static synchronized CustomerTopComponent getDefault() {
- if (instance == null) {
- instance = new CustomerTopComponent();
- }
- return instance;
- }
-
- /**
- * Obtain the CustomerTopComponent instance. Never call {@link #getDefault} directly!
- */
- public static synchronized CustomerTopComponent findInstance() {
- TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
- if (win == null) {
- Logger.getLogger(CustomerTopComponent.class.getName()).warning(
- "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
- return getDefault();
- }
- if (win instanceof CustomerTopComponent) {
- return (CustomerTopComponent) win;
- }
- Logger.getLogger(CustomerTopComponent.class.getName()).warning(
- "There seem to be multiple components with the '" + PREFERRED_ID
- + "' ID. That is a potential source of errors and unexpected behavior.");
- return getDefault();
- }
-
- @Override
- public int getPersistenceType() {
- return TopComponent.PERSISTENCE_ALWAYS;
- }
-
- @Override
- public void componentOpened() {
- // TODO add custom code on component opening
- }
-
- @Override
- public void componentClosed() {
- // TODO add custom code on component closing
- }
-
- void writeProperties(java.util.Properties p) {
- // better to version settings since initial version as advocated at
- // http://wiki.apidesign.org/wiki/PropertyFiles
- p.setProperty("version", "1.0");
- // TODO store your settings
- }
-
- Object readProperties(java.util.Properties p) {
- if (instance == null) {
- instance = this;
- }
- instance.readPropertiesImpl(p);
- return instance;
- }
-
- private void readPropertiesImpl(java.util.Properties p) {
- String version = p.getProperty("version");
- // TODO read your settings according to their version
- }
-
- @Override
- protected String preferredID() {
- return PREFERRED_ID;
- }
-
- @Override
- public ExplorerManager getExplorerManager() {
- return em;
- }
-
- public static void refreshNode() {
- EntityManager entityManager = Persistence.createEntityManagerFactory("CustomerDBAccessPU").createEntityManager();
- Query query = entityManager.createQuery("SELECT c FROM Customer c");
- @SuppressWarnings("unchecked")
- List<Customer> resultList = query.getResultList();
- em.setRootContext(new CustomerRootNode(Children.create(new CustomerChildFactory(resultList), true)));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentSettings.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentSettings.xml b/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentSettings.xml
deleted file mode 100644
index 50c9426..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentSettings.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) 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):
--->
-<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
-<settings version="1.0">
- <module name="org.netbeans.modules.customerviewer" spec="1.0"/>
- <instanceof class="org.openide.windows.TopComponent"/>
- <instanceof class="org.netbeans.modules.customerviewer.CustomerTopComponent"/>
- <instance class="org.netbeans.modules.customerviewer.CustomerTopComponent" method="getDefault"/>
-</settings>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentWstcref.xml
----------------------------------------------------------------------
diff --git a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentWstcref.xml b/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentWstcref.xml
deleted file mode 100644
index 24bbff4..0000000
--- a/apisupport.crudsample/crud-sample-application/CustomerViewer/src/org/netbeans/modules/customerviewer/CustomerTopComponentWstcref.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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):
--->
-<!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd">
-<tc-ref version="2.0" >
- <module name="org.netbeans.modules.customerviewer" spec="1.0"/>
- <tc-id id="CustomerTopComponent"/>
- <state opened="true"/>
-</tc-ref>