diff --git a/sdk/jme3-upgrader/build.xml b/sdk/jme3-upgrader/build.xml
new file mode 100644
index 000000000..1ce7ebb43
--- /dev/null
+++ b/sdk/jme3-upgrader/build.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+ Builds, tests, and runs the project com.jme3.gde.upgrader.
+
+
diff --git a/sdk/jme3-upgrader/manifest.mf b/sdk/jme3-upgrader/manifest.mf
new file mode 100644
index 000000000..0af8c6990
--- /dev/null
+++ b/sdk/jme3-upgrader/manifest.mf
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+OpenIDE-Module: com.jme3.gde.upgrader
+OpenIDE-Module-Implementation-Version: 0
+OpenIDE-Module-Localizing-Bundle: com/jme3/gde/upgrader/Bundle.properties
+
diff --git a/sdk/jme3-upgrader/nbproject/build-impl.xml b/sdk/jme3-upgrader/nbproject/build-impl.xml
new file mode 100644
index 000000000..6005ca1c6
--- /dev/null
+++ b/sdk/jme3-upgrader/nbproject/build-impl.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ You must set 'suite.dir' to point to your containing module suite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-upgrader/nbproject/genfiles.properties b/sdk/jme3-upgrader/nbproject/genfiles.properties
new file mode 100644
index 000000000..aafdf2d38
--- /dev/null
+++ b/sdk/jme3-upgrader/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=872e7e8b
+build.xml.script.CRC32=8cafdaf9
+build.xml.stylesheet.CRC32=a56c6a5b@2.50.1
+# 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=872e7e8b
+nbproject/build-impl.xml.script.CRC32=aa96997a
+nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.50.1
diff --git a/sdk/jme3-upgrader/nbproject/project.properties b/sdk/jme3-upgrader/nbproject/project.properties
new file mode 100644
index 000000000..f7e2314bf
--- /dev/null
+++ b/sdk/jme3-upgrader/nbproject/project.properties
@@ -0,0 +1,3 @@
+javac.source=1.6
+javac.compilerargs=-Xlint -Xlint:-serial
+spec.version.base=3.0.0
diff --git a/sdk/jme3-upgrader/nbproject/project.xml b/sdk/jme3-upgrader/nbproject/project.xml
new file mode 100644
index 000000000..38dfbc8ab
--- /dev/null
+++ b/sdk/jme3-upgrader/nbproject/project.xml
@@ -0,0 +1,47 @@
+
+
+ org.netbeans.modules.apisupport.project
+
+
+ com.jme3.gde.upgrader
+
+
+
+ org.openide.filesystems
+
+
+
+ 7.19
+
+
+
+ org.openide.modules
+
+
+
+ 7.2
+
+
+
+ org.openide.util
+
+
+
+ 8.0
+
+
+
+ org.openide.util.lookup
+
+
+
+ 8.0
+
+
+
+
+ org.netbeans.upgrade
+
+
+
+
diff --git a/sdk/jme3-upgrader/nbproject/suite.properties b/sdk/jme3-upgrader/nbproject/suite.properties
new file mode 100644
index 000000000..29d7cc9bd
--- /dev/null
+++ b/sdk/jme3-upgrader/nbproject/suite.properties
@@ -0,0 +1 @@
+suite.dir=${basedir}/..
diff --git a/sdk/jme3-upgrader/src/com/jme3/gde/upgrader/Bundle.properties b/sdk/jme3-upgrader/src/com/jme3/gde/upgrader/Bundle.properties
new file mode 100644
index 000000000..e3b3a408f
--- /dev/null
+++ b/sdk/jme3-upgrader/src/com/jme3/gde/upgrader/Bundle.properties
@@ -0,0 +1,5 @@
+OpenIDE-Module-Display-Category=jMonkeyEngine
+OpenIDE-Module-Long-Description=\
+ Handles upgrades of the SDK, allows import of previous installs settings
+OpenIDE-Module-Name=Upgrader
+OpenIDE-Module-Short-Description=Handles upgrades of the SDK
diff --git a/sdk/jme3-upgrader/src/org/netbeans/license/AcceptLicense.java b/sdk/jme3-upgrader/src/org/netbeans/license/AcceptLicense.java
new file mode 100644
index 000000000..d1768ec0d
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/license/AcceptLicense.java
@@ -0,0 +1,237 @@
+/*
+ * 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.
+ */
+
+package org.netbeans.license;
+
+import java.awt.BorderLayout;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.URL;
+import java.util.ResourceBundle;
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.KeyStroke;
+import org.netbeans.util.Util;
+import org.openide.util.NbBundle;
+import org.openide.util.Utilities;
+
+/**
+ * Displays LicensePanel to user. User must accept license to continue.
+ * if user does not accept license UserCancelException is thrown.
+ *
+ * @author Marek Slama
+ */
+
+public final class AcceptLicense {
+
+ private static String command;
+
+ /** If License was not accepted during installation user must accept it here.
+ */
+ public static void showLicensePanel () throws Exception {
+ Util.setDefaultLookAndFeel();
+ URL url = AcceptLicense.class.getResource("LICENSE.txt"); // NOI18N
+ LicensePanel licensePanel = new LicensePanel(url);
+ ResourceBundle bundle = NbBundle.getBundle(AcceptLicense.class);
+ String yesLabel = bundle.getString("MSG_LicenseYesButton");
+ String noLabel = bundle.getString("MSG_LicenseNoButton");
+ JButton yesButton = new JButton();
+ JButton noButton = new JButton();
+ setLocalizedText(yesButton,yesLabel);
+ setLocalizedText(noButton,noLabel);
+
+ yesButton.setActionCommand("yes"); // NOI18N
+ noButton.setActionCommand("no"); // NOI18N
+
+ yesButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_AcceptButton"));
+ yesButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSD_AcceptButton"));
+
+ noButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_RejectButton"));
+ noButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSD_RejectButton"));
+
+ Dimension yesPF = yesButton.getPreferredSize();
+ Dimension noPF = noButton.getPreferredSize();
+ int maxWidth = Math.max(yesButton.getPreferredSize().width, noButton.getPreferredSize().width);
+ int maxHeight = Math.max(yesButton.getPreferredSize().height, noButton.getPreferredSize().height);
+ yesButton.setPreferredSize(new Dimension(maxWidth, maxHeight));
+ noButton.setPreferredSize(new Dimension(maxWidth, maxHeight));
+
+ final JDialog d = new JDialog(null, bundle.getString("MSG_LicenseDlgTitle"), Dialog.ModalityType.APPLICATION_MODAL);
+ Util.initIcons(d);
+ d.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_LicenseDlg"));
+ d.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_LicenseDlg"));
+ d.getContentPane().add(licensePanel,BorderLayout.CENTER);
+ ActionListener listener = new ActionListener () {
+ public void actionPerformed (ActionEvent e) {
+ command = e.getActionCommand();
+ d.setVisible(false);
+ }
+ };
+ yesButton.addActionListener(listener);
+ noButton.addActionListener(listener);
+ JPanel buttonPanel = new JPanel();
+ buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ buttonPanel.setBorder(BorderFactory.createEmptyBorder(17,12,11,11));
+ buttonPanel.add(yesButton);
+ buttonPanel.add(noButton);
+ d.getContentPane().add(buttonPanel,BorderLayout.SOUTH);
+ d.setSize(new Dimension(600,600));
+ d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ d.setResizable(true);
+ d.getRootPane().setDefaultButton(yesButton);
+ d.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("ESCAPE"), "exit"); //NOI18N
+ d.getRootPane().getActionMap().put("exit", new AbstractAction() { //NOI18N
+ public void actionPerformed(ActionEvent e) {
+ command = "no"; //NOI18N
+ d.setVisible(false);
+ }
+ });
+
+ licensePanel.jEditorPane1.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"), "accept"); //NOI18N
+ licensePanel.jEditorPane1.getActionMap().put("accept", new AbstractAction() { //NOI18N
+ public void actionPerformed(ActionEvent e) {
+ command = "yes"; //NOI18N
+ d.setVisible(false);
+ }
+ });
+
+ //Center on screen
+ d.setLocationRelativeTo(null);
+ d.setVisible(true);
+
+ if ("yes".equals(command)) { // NOI18N
+ return;
+ } else {
+ throw new org.openide.util.UserCancelException();
+ }
+ }
+
+ /**
+ * Actual setter of the text & mnemonics for the AbstractButton or
+ * their subclasses. We must copy necessary code from org.openide.awt.Mnemonics
+ * because org.openide.awt module is not available yet when this code is called.
+ * @param item AbstractButton
+ * @param text new label
+ */
+ private static void setLocalizedText (AbstractButton button, String text) {
+ if (text == null) {
+ button.setText(null);
+ return;
+ }
+
+ int i = findMnemonicAmpersand(text);
+
+ if (i < 0) {
+ // no '&' - don't set the mnemonic
+ button.setText(text);
+ button.setMnemonic(0);
+ } else {
+ button.setText(text.substring(0, i) + text.substring(i + 1));
+
+ if (Utilities.isMac()) {
+ // there shall be no mnemonics on macosx.
+ //#55864
+ return;
+ }
+
+ char ch = text.charAt(i + 1);
+
+ // it's latin character or arabic digit,
+ // setting it as mnemonics
+ button.setMnemonic(ch);
+
+ // If it's something like "Save &As", we need to set another
+ // mnemonic index (at least under 1.4 or later)
+ // see #29676
+ button.setDisplayedMnemonicIndex(i);
+ }
+ }
+
+ /**
+ * Searches for an ampersand in a string which indicates a mnemonic.
+ * Recognizes the following cases:
+ *
+ *
"Drag & Drop", "Ampersand ('&')" - don't have mnemonic ampersand.
+ * "&" is not found before " " (space), or if enclosed in "'"
+ * (single quotation marks).
+ *
"&File", "Save &As..." - do have mnemonic ampersand.
+ *
"Rock & Ro&ll", "Underline the '&' &character" - also do have
+ * mnemonic ampersand, but the second one.
+ *
+ * @param text text to search
+ * @return the position of mnemonic ampersand in text, or -1 if there is none
+ */
+ public static int findMnemonicAmpersand(String text) {
+ int i = -1;
+
+ do {
+ // searching for the next ampersand
+ i = text.indexOf('&', i + 1);
+
+ if ((i >= 0) && ((i + 1) < text.length())) {
+ // before ' '
+ if (text.charAt(i + 1) == ' ') {
+ continue;
+
+ // before ', and after '
+ } else if ((text.charAt(i + 1) == '\'') && (i > 0) && (text.charAt(i - 1) == '\'')) {
+ continue;
+ }
+
+ // ampersand is marking mnemonics
+ return i;
+ }
+ } while (i >= 0);
+
+ return -1;
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/license/Bundle.properties b/sdk/jme3-upgrader/src/org/netbeans/license/Bundle.properties
new file mode 100644
index 000000000..d3d8a577a
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/license/Bundle.properties
@@ -0,0 +1,66 @@
+# 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.
+
+#Licence dialog
+MSG_LicenseDlgTitle=License Agreement
+MSG_LicenseDlgLabelTop=Please read the following license agreement carefully.
+MSG_LicenseDlgLabelBottom=If you accept all terms of the agreement, click I Accept \
+to start NetBeans IDE. You must accept the agreement to start NetBeans IDE.
+MSG_LicenseYesButton=I &Accept
+MSG_LicenseNoButton=E&xit
+
+ACSN_LicensePanel=License Panel
+ACSD_LicensePanel=N/A
+
+ACSN_LicenseDlg=License Dialog
+ACSD_LicenseDlg=License Agreement
+
+ACSN_EditorPane=License Text
+ACSD_EditorPane=Please read the following license agreement carefully. \
+If you accept all terms of the agreement, click I Accept \
+to start NetBeans IDE. You must accept the agreement to start NetBeans IDE.
+
+ACSN_AcceptButton=Accept Button
+ACSD_AcceptButton=Click to accept license and continue
+
+ACSN_RejectButton=Reject Button
+ACSD_RejectButton=Click to reject license and exit
diff --git a/sdk/jme3-upgrader/src/org/netbeans/license/LicensePanel.form b/sdk/jme3-upgrader/src/org/netbeans/license/LicensePanel.form
new file mode 100644
index 000000000..2ef19595c
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/license/LicensePanel.form
@@ -0,0 +1,87 @@
+
+
+
diff --git a/sdk/jme3-upgrader/src/org/netbeans/license/LicensePanel.java b/sdk/jme3-upgrader/src/org/netbeans/license/LicensePanel.java
new file mode 100644
index 000000000..d62053065
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/license/LicensePanel.java
@@ -0,0 +1,169 @@
+/*
+ * 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.
+ */
+
+package org.netbeans.license;
+
+import java.awt.Rectangle;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ResourceBundle;
+
+import javax.swing.AbstractAction;
+import javax.swing.ActionMap;
+import javax.swing.SwingConstants;
+import javax.swing.text.DefaultEditorKit;
+import org.openide.util.NbBundle;
+
+/**
+ * This class displays license during first start of IDE.
+ *
+ * @author Marek Slama
+ */
+final class LicensePanel extends javax.swing.JPanel {
+
+ /** Creates new form LicensePanel */
+ public LicensePanel(URL url) {
+ this.url = url;
+ initComponents();
+ initAccessibility();
+ try {
+ jEditorPane1.setPage(url);
+ } catch (IOException exc) {
+ //Problem with locating file
+ System.err.println("Exception: " + exc.getMessage()); //NOI18N
+ exc.printStackTrace();
+ }
+ ActionMap actionMap = jEditorPane1.getActionMap();
+ actionMap.put(DefaultEditorKit.upAction, new ScrollAction(-1));
+ actionMap.put(DefaultEditorKit.downAction, new ScrollAction(1));
+ }
+
+ private void initAccessibility() {
+ this.getAccessibleContext().setAccessibleName
+ (bundle.getString("ACSN_LicensePanel"));
+ this.getAccessibleContext().setAccessibleDescription
+ (bundle.getString("ACSD_LicensePanel"));
+
+ jEditorPane1.getAccessibleContext().setAccessibleName
+ (bundle.getString("ACSN_EditorPane"));
+ jEditorPane1.getAccessibleContext().setAccessibleDescription
+ (bundle.getString("ACSD_EditorPane"));
+ }
+
+ /** 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.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jTextAreaTop = new javax.swing.JTextArea();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ jEditorPane1 = new javax.swing.JEditorPane();
+ jTextAreaBottom = new javax.swing.JTextArea();
+
+ setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 0, 11));
+ setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
+
+ jTextAreaTop.setBackground(getBackground());
+ jTextAreaTop.setColumns(20);
+ jTextAreaTop.setEditable(false);
+ jTextAreaTop.setFont(new java.awt.Font("Dialog", 1, 12));
+ jTextAreaTop.setLineWrap(true);
+ jTextAreaTop.setRows(1);
+ jTextAreaTop.setText(bundle.getString("MSG_LicenseDlgLabelTop"));
+ jTextAreaTop.setWrapStyleWord(true);
+ jTextAreaTop.setFocusable(false);
+ jTextAreaTop.setMargin(new java.awt.Insets(0, 0, 2, 0));
+ jTextAreaTop.setRequestFocusEnabled(false);
+ add(jTextAreaTop);
+
+ jEditorPane1.setEditable(false);
+ jEditorPane1.setPreferredSize(new java.awt.Dimension(500, 500));
+ jScrollPane1.setViewportView(jEditorPane1);
+
+ add(jScrollPane1);
+
+ jTextAreaBottom.setBackground(getBackground());
+ jTextAreaBottom.setColumns(20);
+ jTextAreaBottom.setEditable(false);
+ jTextAreaBottom.setFont(new java.awt.Font("Dialog", 1, 12));
+ jTextAreaBottom.setLineWrap(true);
+ jTextAreaBottom.setRows(2);
+ jTextAreaBottom.setText(bundle.getString("MSG_LicenseDlgLabelBottom"));
+ jTextAreaBottom.setWrapStyleWord(true);
+ jTextAreaBottom.setFocusable(false);
+ jTextAreaBottom.setRequestFocusEnabled(false);
+ add(jTextAreaBottom);
+ }// //GEN-END:initComponents
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ javax.swing.JEditorPane jEditorPane1;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextArea jTextAreaBottom;
+ private javax.swing.JTextArea jTextAreaTop;
+ // End of variables declaration//GEN-END:variables
+ private URL url;
+ private static final ResourceBundle bundle = NbBundle.getBundle(LicensePanel.class);
+
+ /**
+ * An action to scroll the browser content up or down.
+ */
+ private class ScrollAction extends AbstractAction {
+ int direction;
+
+ public ScrollAction(int direction) {
+ this.direction = direction;
+ }
+
+ public void actionPerformed(java.awt.event.ActionEvent e) {
+ Rectangle r = jEditorPane1.getVisibleRect();
+ int increment = jEditorPane1.getScrollableUnitIncrement(r, SwingConstants.VERTICAL, direction);
+ r.y += (increment * direction);
+ jEditorPane1.scrollRectToVisible(r);
+ }
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgrade.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgrade.java
new file mode 100644
index 000000000..fd39fe14c
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgrade.java
@@ -0,0 +1,312 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2012 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.upgrade;
+import java.beans.PropertyVetoException;
+import java.io.*;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Logger;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import org.netbeans.upgrade.systemoptions.Importer;
+import org.netbeans.util.Util;
+import org.openide.ErrorManager;
+import org.openide.filesystems.FileUtil;
+import org.openide.filesystems.LocalFileSystem;
+import org.openide.filesystems.MultiFileSystem;
+import org.openide.filesystems.XMLFileSystem;
+import org.openide.modules.InstalledFileLocator;
+import org.openide.util.Exceptions;
+import org.openide.util.NbBundle;
+import org.openide.util.Utilities;
+import org.xml.sax.SAXException;
+
+/** pending
+ *
+ * @author Jiri Rechtacek, Jiri Skrivanek
+ */
+public final class AutoUpgrade {
+
+ private static final Logger LOGGER = Logger.getLogger(AutoUpgrade.class.getName());
+
+ public static void main (String[] args) throws Exception {
+ // show warning if starts for the 1st time on changed userdir (see issue 196075)
+ String noteChangedDefaults = "";
+ if (madeObsoleteMessagesLog()) {
+ noteChangedDefaults = NbBundle.getMessage (AutoUpgrade.class, "MSG_ChangedDefaults", System.getProperty ("netbeans.user", "")); // NOI18N
+ }
+
+ // try new place
+ File sourceFolder = checkPreviousOnOsSpecificPlace (NEWER_VERSION_TO_CHECK);
+ if (sourceFolder == null) {
+ // try former place
+ sourceFolder = checkPrevious (VERSION_TO_CHECK);
+ }
+ if (sourceFolder != null) {
+ if (!showUpgradeDialog (sourceFolder, noteChangedDefaults)) {
+ throw new org.openide.util.UserCancelException ();
+ }
+ copyToUserdir(sourceFolder);
+ //migrates SystemOptions, converts them as a Preferences
+ Importer.doImport();
+ } else if (! noteChangedDefaults.isEmpty()) {
+ // show a note only
+ showNoteDialog(noteChangedDefaults);
+ }
+ }
+
+ //#75324 NBplatform settings are not imported
+ private static void upgradeBuildProperties(final File sourceFolder, final String[] version) throws IOException {
+ File userdir = new File(System.getProperty("netbeans.user", ""));//NOI18N
+ String[] regexForSelection = new String[]{
+ "^nbplatform[.](?!default[.]netbeans[.]dest[.]dir).+[.].+=.+$", //NOI18N
+ // #161616
+ "^var[.].*" //NOI18N
+ };
+ Copy.appendSelectedLines(new File(sourceFolder, "build.properties"), //NOI18N
+ userdir, regexForSelection);
+ }
+
+ // the order of VERSION_TO_CHECK here defines the precedence of imports
+ // the first one will be choosen for import
+ //normen
+ final static private List VERSION_TO_CHECK =
+ Arrays.asList (new String[] {".jmonkeyplatform/3.0Beta", ".jmonkeyplatform/3.0RC2" });//".netbeans/7.1.2", ".netbeans/7.1.1", ".netbeans/7.1", ".netbeans/7.0", ".netbeans/6.9" });//NOI18N
+// Arrays.asList (new String[] {"build/3.0RC2", ".netbeans/7.1.1", ".netbeans/7.1", ".netbeans/7.0", ".netbeans/6.9" });//NOI18N
+
+ // userdir on OS specific root of userdir (see issue 196075)
+ static final List NEWER_VERSION_TO_CHECK =
+ Arrays.asList ("3.0RC2", "3.0Beta"/*7.2, ..."*/); //NOI18N
+
+
+ private static File checkPreviousOnOsSpecificPlace (final List versionsToCheck) {
+ String defaultUserdirRoot = System.getProperty ("netbeans.default_userdir_root"); // NOI18N
+ //normen: to test in ide
+ if(defaultUserdirRoot==null){
+ try {
+ defaultUserdirRoot = new File(System.getProperty("netbeans.user")).getParentFile().getCanonicalPath();
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+ File sourceFolder;
+ if (defaultUserdirRoot != null) {
+ File userHomeFile = new File (defaultUserdirRoot);
+ for (String ver : versionsToCheck) {
+ sourceFolder = new File (userHomeFile.getAbsolutePath (), ver);
+ if (sourceFolder.exists () && sourceFolder.isDirectory ()) {
+ return sourceFolder;
+ }
+ }
+ }
+ return null;
+ }
+
+ static private File checkPrevious (final List versionsToCheck) {
+ String userHome = System.getProperty ("user.home"); // NOI18N
+ File sourceFolder = null;
+
+ if (userHome != null) {
+ File userHomeFile = new File (userHome);
+ Iterator it = versionsToCheck.iterator ();
+ String ver;
+ while (it.hasNext () && sourceFolder == null) {
+ ver = it.next ();
+ sourceFolder = new File (userHomeFile.getAbsolutePath (), ver);
+
+ if (sourceFolder.isDirectory ()) {
+ break;
+ }
+ sourceFolder = null;
+ }
+ return sourceFolder;
+ } else {
+ return null;
+ }
+ }
+
+ private static boolean madeObsoleteMessagesLog() {
+ String ud = System.getProperty ("netbeans.user", "");
+ if ((Utilities.isMac() || Utilities.isWindows()) && ud.endsWith(File.separator + "dev")) { // NOI18N
+ String defaultUserdirRoot = System.getProperty ("netbeans.default_userdir_root", null); // NOI18N
+ if (defaultUserdirRoot != null) {
+ if (new File(ud).getParentFile().equals(new File(defaultUserdirRoot))) {
+ // check the former default root
+ String userHome = System.getProperty("user.home"); // NOI18N
+ if (userHome != null) {
+ File oldUserdir = new File(new File (userHome).getAbsolutePath (), ".netbeans/dev"); // NOI18N
+ if (oldUserdir.exists() && ! oldUserdir.equals(new File(ud))) {
+ // 1. modify messages log
+ File log = new File (oldUserdir, "/var/log/messages.log");
+ File obsolete = new File (oldUserdir, "/var/log/messages.log.obsolete");
+ if (! obsolete.exists() && log.exists()) {
+ return log.renameTo(obsolete);
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private static boolean showUpgradeDialog (final File source, String note) {
+ Util.setDefaultLookAndFeel();
+ JOptionPane p = new JOptionPane (
+ new AutoUpgradePanel (source.getAbsolutePath (), note),
+ JOptionPane.QUESTION_MESSAGE,
+ JOptionPane.YES_NO_OPTION
+ );
+ JDialog d = Util.createJOptionDialog(p, NbBundle.getMessage (AutoUpgrade.class, "MSG_Confirmation_Title"));
+ d.setVisible (true);
+
+ return new Integer (JOptionPane.YES_OPTION).equals (p.getValue ());
+ }
+
+ private static void showNoteDialog (String note) {
+ Util.setDefaultLookAndFeel();
+ JOptionPane p = new JOptionPane(new AutoUpgradePanel (null, note), JOptionPane.INFORMATION_MESSAGE, JOptionPane.DEFAULT_OPTION);
+ JDialog d = Util.createJOptionDialog(p, NbBundle.getMessage (AutoUpgrade.class, "MSG_Note_Title"));
+ d.setVisible (true);
+ }
+
+ static void doUpgrade (File source, String oldVersion)
+ throws java.io.IOException, java.beans.PropertyVetoException {
+ File userdir = new File(System.getProperty ("netbeans.user", "")); // NOI18N
+
+ java.util.Set> includeExclude;
+ try {
+ Reader r = new InputStreamReader (
+ AutoUpgrade.class.getResourceAsStream ("copy" + oldVersion), // NOI18N
+ "utf-8"); // NOI18N
+ includeExclude = IncludeExclude.create (r);
+ r.close ();
+ } catch (IOException ex) {
+ throw new IOException("Cannot import from version: " + oldVersion, ex);
+ }
+
+ ErrorManager.getDefault ().log (
+ ErrorManager.USER, "Import: Old version: " // NOI18N
+ + oldVersion + ". Importing from " + source + " to " + userdir // NOI18N
+ );
+
+ File oldConfig = new File (source, "config"); // NOI18N
+ org.openide.filesystems.FileSystem old;
+ {
+ LocalFileSystem lfs = new LocalFileSystem ();
+ lfs.setRootDirectory (oldConfig);
+
+ XMLFileSystem xmlfs = null;
+ try {
+ URL url = AutoUpgrade.class.getResource("layer" + oldVersion + ".xml"); // NOI18N
+ xmlfs = (url != null) ? new XMLFileSystem(url) : null;
+ } catch (SAXException ex) {
+ throw new IOException("Cannot import from version: " + oldVersion, ex);
+ }
+
+ old = (xmlfs != null) ? createLayeredSystem(lfs, xmlfs) : lfs;
+ }
+
+ Copy.copyDeep (old.getRoot (), FileUtil.getConfigRoot (), includeExclude, PathTransformation.getInstance(oldVersion));
+
+ }
+
+ /* copy-pasted method doUpgrade and slightly modified to copy files relative
+ * to userdir.
+ */
+ private static void doNonStandardUpgrade (File source,String oldVersion)
+ throws IOException, PropertyVetoException {
+ File userdir = new File(System.getProperty("netbeans.user", "")); // NOI18N
+ java.util.Set> includeExclude;
+ try {
+ InputStream is = AutoUpgrade.class.getResourceAsStream("nonstandard" + oldVersion); // NOI18N
+ if (is == null) {
+ return;
+ }
+ Reader r = new InputStreamReader(is, "utf-8"); // NOI18N
+ includeExclude = IncludeExclude.create(r);
+ r.close();
+ } catch (IOException ex) {
+ throw new IOException("Cannot import from version: " + oldVersion + "nonstandard", ex);
+ }
+ ErrorManager.getDefault ().log (ErrorManager.USER, "Import: Old version: " // NOI18N
+ + oldVersion + "nonstandard" + ". Importing from " + source + " to " + userdir // NOI18N
+ );
+
+ LocalFileSystem old = new LocalFileSystem();
+ old.setRootDirectory(source);
+
+ LocalFileSystem nfs = new LocalFileSystem();
+ nfs.setRootDirectory(userdir);
+ Copy.copyDeep(old.getRoot(), nfs.getRoot(), includeExclude, PathTransformation.getInstance(oldVersion));
+ }
+
+
+ static MultiFileSystem createLayeredSystem(final LocalFileSystem lfs, final XMLFileSystem xmlfs) {
+ MultiFileSystem old;
+
+ old = new MultiFileSystem (
+ new org.openide.filesystems.FileSystem[] { lfs, xmlfs }
+ ) {
+ {
+ setPropagateMasks(true);
+ }
+ };
+ return old;
+ }
+
+ /* Copy files from source folder to current userdir according to include/exclude
+ * patterns in etc/netbeans.import file. */
+ private static void copyToUserdir(File source) throws IOException, PropertyVetoException {
+ File userdir = new File(System.getProperty("netbeans.user", "")); // NOI18N
+ File netBeansDir = InstalledFileLocator.getDefault().locate("modules", null, false).getParentFile().getParentFile(); //NOI18N
+ File importFile = new File(netBeansDir, "etc/jmonkeyplatform.import"); //NOI18N
+ LOGGER.fine("Import file: " + importFile);
+ LOGGER.info("Importing from " + source + " to " + userdir); // NOI18N
+ CopyFiles.copyDeep(source, userdir, importFile);
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgradePanel.form b/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgradePanel.form
new file mode 100644
index 000000000..5033b900a
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgradePanel.form
@@ -0,0 +1,53 @@
+
+
+
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgradePanel.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgradePanel.java
new file mode 100644
index 000000000..1f9f5bbeb
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/AutoUpgradePanel.java
@@ -0,0 +1,137 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2012 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.
+ */
+
+package org.netbeans.upgrade;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ResourceBundle;
+import javax.swing.JPanel;
+import javax.swing.event.ChangeListener;
+import org.openide.util.NbBundle;
+
+
+/**
+ * @author Jiri Rechtacek
+ */
+final class AutoUpgradePanel extends JPanel {
+
+ private String source;
+ private String note;
+
+ /** Creates new form UpgradePanel */
+ public AutoUpgradePanel (String directory, String note) {
+ this.source = directory;
+ this.note = note;
+ initComponents();
+ initAccessibility();
+ }
+
+ /** Remove a listener to changes of the panel's validity.
+ * @param l the listener to remove
+ */
+ void removeChangeListener(ChangeListener l) {
+ changeListeners.remove(l);
+ }
+
+ /** Add a listener to changes of the panel's validity.
+ * @param l the listener to add
+ * @see #isValid
+ */
+ void addChangeListener(ChangeListener l) {
+ if (!changeListeners.contains(l)) {
+ changeListeners.add(l);
+ }
+ }
+
+ private void initAccessibility() {
+ this.getAccessibleContext().setAccessibleDescription(bundle.getString("MSG_Confirmation")); // NOI18N
+ }
+
+
+ /** 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.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ txtVersions = new javax.swing.JTextArea();
+
+ setPreferredSize(new java.awt.Dimension(550, source != null && ! note.isEmpty() ? 120 : 60));
+
+ txtVersions.setBackground(getBackground());
+ txtVersions.setColumns(50);
+ txtVersions.setEditable(false);
+ txtVersions.setFont(new java.awt.Font("Dialog", 0, 12));
+ txtVersions.setLineWrap(true);
+ txtVersions.setRows(source != null && ! note.isEmpty() ? 6 : 3);
+ if (source != null) {
+ txtVersions.setText(NbBundle.getMessage (AutoUpgradePanel.class, "MSG_Confirmation", source, note)); // NOI18N
+ } else {
+ txtVersions.setText(note);
+ }
+ txtVersions.setWrapStyleWord(true);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(txtVersions, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(txtVersions, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)
+ );
+ }// //GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextArea txtVersions;
+ // End of variables declaration//GEN-END:variables
+
+ private static final ResourceBundle bundle = NbBundle.getBundle(AutoUpgradePanel.class);
+ private List changeListeners = new ArrayList(1);
+
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/Bundle.properties b/sdk/jme3-upgrader/src/org/netbeans/upgrade/Bundle.properties
new file mode 100644
index 000000000..ac519cfe3
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/Bundle.properties
@@ -0,0 +1,54 @@
+# 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.
+
+OpenIDE-Module-Name=Upgrade
+OpenIDE-Module-Display-Category=Infrastructure
+OpenIDE-Module-Long-Description=The Upgrade imports your IDE environment and settings from previous versions of the IDE.
+OpenIDE-Module-Short-Description=Import IDE environment and settings.
+
+#AutoUpgdare dialog
+MSG_Confirmation = {1}Settings created by a previous version of the IDE were found on your system at {0}. Do you want to import them?
+MSG_Confirmation_Title = Confirm Import Settings
+
+MSG_Note_Title=Note
+MSG_ChangedDefaults=Note: The default location of NetBeans userdir was changed to {0}\n\
+See http://wiki.netbeans.org/UserdirAndCachedirFoldersInSystemSpecificPaths\n\n
\ No newline at end of file
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/ColoringStorage.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/ColoringStorage.java
new file mode 100644
index 000000000..f0c72c3f1
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/ColoringStorage.java
@@ -0,0 +1,335 @@
+/*
+ * 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.
+ */
+
+package org.netbeans.upgrade;
+
+import java.awt.Color;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.StyleConstants;
+import org.netbeans.upgrade.XMLStorage.Attribs;
+import org.openide.ErrorManager;
+
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+
+/**
+ * This class contains support static methods for loading / saving and
+ * translating coloring (fontsColors.xml) files. It calls XMLStorage utilities.
+ *
+ * @author Jan Jancura
+ */
+class ColoringStorage {
+
+
+ // load ....................................................................
+
+ static Map loadColorings (
+ InputStream is,
+ String name
+ ) {
+ return (Map) XMLStorage.load (is, name, new ColoringsReader ());
+ }
+
+ private static class ColoringsReader extends XMLStorage.Handler {
+ private Map colorings = new HashMap ();
+ private SimpleAttributeSet last;
+
+ Object getResult () {
+ return colorings;
+ }
+
+ public void startElement (
+ String uri,
+ String localName,
+ String name,
+ Attributes attributes
+ ) throws SAXException {
+ try {
+ if (name.equals ("fontscolors")) {
+ } else
+ if (name.equals ("fontcolor")) {
+ String n = (String) attributes.getValue ("syntaxName");
+ if (n == null)
+ n = (String) attributes.getValue ("name");
+ if (n == null) {
+ System.out.println("no syntaxName " + attributes);
+ return;
+ }
+ SimpleAttributeSet a = new SimpleAttributeSet ();
+ a.addAttribute (
+ StyleConstants.NameAttribute,
+ n
+ );
+ if (attributes.getValue ("bgColor") != null)
+ a.addAttribute (
+ StyleConstants.Background,
+ XMLStorage.stringToColor (attributes.getValue ("bgColor"))
+ );
+ if (attributes.getValue ("foreColor") != null)
+ a.addAttribute (
+ StyleConstants.Foreground,
+ XMLStorage.stringToColor (attributes.getValue ("foreColor"))
+ );
+ if (attributes.getValue ("underline") != null)
+ a.addAttribute (
+ StyleConstants.Underline,
+ XMLStorage.stringToColor (attributes.getValue ("underline"))
+ );
+ if (attributes.getValue ("strikeThrough") != null)
+ a.addAttribute (
+ StyleConstants.StrikeThrough,
+ XMLStorage.stringToColor (attributes.getValue ("strikeThrough"))
+ );
+ if (attributes.getValue ("waveUnderlined") != null)
+ a.addAttribute (
+ "waveUnderlined",
+ XMLStorage.stringToColor (attributes.getValue ("waveUnderlined"))
+ );
+ if (attributes.getValue ("default") != null)
+ a.addAttribute (
+ "default",
+ (String) attributes.getValue ("default")
+ );
+ colorings.put (n, a);
+ last = a;
+ } else
+ if (name.equals ("font")) {
+ if (attributes.getValue ("name") != null)
+ last.addAttribute (
+ StyleConstants.FontFamily,
+ attributes.getValue ("name")
+ );
+ if (attributes.getValue ("size") != null)
+ try {
+ last.addAttribute (
+ StyleConstants.FontSize,
+ Integer.decode (attributes.getValue ("size"))
+ );
+ } catch (NumberFormatException ex) {
+ ex.printStackTrace ();
+ }
+ if (attributes.getValue ("style") != null) {
+ if (attributes.getValue ("style").indexOf ("bold") >= 0)
+ last.addAttribute (
+ StyleConstants.Bold,
+ Boolean.TRUE
+ );
+ if (attributes.getValue ("style").indexOf ("italic") >= 0)
+ last.addAttribute (
+ StyleConstants.Italic,
+ Boolean.TRUE
+ );
+ }
+ }
+ } catch (Exception ex) {
+ ErrorManager.getDefault ().notify (ex);
+ }
+ }
+
+ public InputSource resolveEntity (String pubid, String sysid) {
+ return new InputSource (
+ new java.io.ByteArrayInputStream (new byte [0])
+ );
+ }
+ }
+
+
+ // save colorings ..........................................................
+
+ static void saveColorings (FileObject fo, Collection colorings) {
+ final StringBuffer sb = XMLStorage.generateHeader ();
+ XMLStorage.generateFolderStart (sb, "fontscolors", null, "");
+ Iterator it = colorings.iterator ();
+ while (it.hasNext ()) {
+ AttributeSet category = (AttributeSet) it.next ();
+ Attribs attributes = new Attribs (true);
+ attributes.add (
+ "name",
+ (String) category.getAttribute (StyleConstants.NameAttribute)
+ );
+ if (category.isDefined (StyleConstants.Foreground))
+ attributes.add (
+ "foreColor",
+ XMLStorage.colorToString (
+ (Color) category.getAttribute (StyleConstants.Foreground)
+ )
+ );
+ if (category.isDefined (StyleConstants.Background))
+ attributes.add (
+ "bgColor",
+ XMLStorage.colorToString (
+ (Color) category.getAttribute (StyleConstants.Background)
+ )
+ );
+ if (category.isDefined (StyleConstants.StrikeThrough))
+ attributes.add (
+ "strikeThrough",
+ XMLStorage.colorToString (
+ (Color) category.getAttribute (StyleConstants.StrikeThrough)
+ )
+ );
+ if (category.isDefined ("waveUnderlined"))
+ attributes.add (
+ "waveUnderlined",
+ XMLStorage.colorToString (
+ (Color) category.getAttribute ("waveUnderlined")
+ )
+ );
+ if (category.isDefined (StyleConstants.Underline))
+ attributes.add (
+ "underline",
+ XMLStorage.colorToString (
+ (Color) category.getAttribute (StyleConstants.Underline)
+ )
+ );
+ if (category.isDefined ("default"))
+ attributes.add (
+ "default",
+ (String) category.getAttribute ("default")
+ );
+ if ( category.isDefined (StyleConstants.FontFamily) ||
+ category.isDefined (StyleConstants.FontSize) ||
+ category.isDefined (StyleConstants.Bold) ||
+ category.isDefined (StyleConstants.Italic)
+ ) {
+ XMLStorage.generateFolderStart (sb, "fontcolor", attributes, " ");
+ attributes = new Attribs (true);
+ if (category.isDefined (StyleConstants.FontFamily))
+ attributes.add (
+ "name",
+ (String) category.getAttribute (StyleConstants.FontFamily)
+ );
+ if (category.isDefined (StyleConstants.FontSize))
+ attributes.add (
+ "size",
+ "" + category.getAttribute (StyleConstants.FontSize)
+ );
+ if (category.isDefined (StyleConstants.Bold) ||
+ category.isDefined (StyleConstants.Italic)
+ ) {
+ Boolean bold = Boolean.FALSE, italic = Boolean.FALSE;
+ if (category.isDefined (StyleConstants.Bold))
+ bold = (Boolean) category.getAttribute (StyleConstants.Bold);
+ if (category.isDefined (StyleConstants.Italic))
+ italic = (Boolean) category.getAttribute (StyleConstants.Italic);
+ attributes.add ("style",
+ bold.booleanValue () ?
+ (italic.booleanValue () ?
+ "bold+italic" :
+ "bold") :
+ (italic.booleanValue () ?
+ "italic" : "plain")
+ );
+ }
+ XMLStorage.generateLeaf (sb, "font", attributes, " ");
+ XMLStorage.generateFolderEnd (sb, "fontcolor", " ");
+ } else
+ XMLStorage.generateLeaf (sb, "fontcolor", attributes, " ");
+ }
+ XMLStorage.generateFolderEnd (sb, "fontscolors", "");
+ XMLStorage.save (fo, new String (sb));
+ }
+
+ /**
+ * Crates FileObject for given mimeTypes and profile.
+ */
+ private static String getFolderName (
+ String[] mimeTypes,
+ String profile
+ ) {
+ StringBuffer sb = new StringBuffer ();
+ sb.append ("Editors");
+ int i, k = mimeTypes.length;
+ for (i = 0; i < k; i++)
+ sb.append ('/').append (mimeTypes [i]);
+ if (profile != null)
+ sb.append ('/').append (profile);
+ return sb.append ('/').toString ();
+ }
+
+ /**
+ * Crates FileObject for given mimeTypes and profile.
+ */
+ private static FileObject createFileObject (
+ FileObject root,
+ String[] mimeTypes,
+ String profile,
+ String fileName
+ ) {
+ try {
+ FileObject fo = getFO (FileUtil.getConfigRoot (), "Editors");
+ int i, k = mimeTypes.length;
+ for (i = 0; i < k; i++)
+ fo = getFO (fo, mimeTypes [i]);
+ if (profile != null)
+ fo = getFO (fo, profile);
+ if (fileName == null)
+ return fo;
+ FileObject fo1 = fo.getFileObject (fileName);
+ if (fo1 != null) return fo1;
+ return fo.createData (fileName);
+ } catch (IOException ex) {
+ ErrorManager.getDefault ().notify (ex);
+ return null;
+ }
+ }
+
+ private static FileObject getFO (FileObject fo, String next) throws IOException {
+ FileObject fo1 = fo.getFileObject (next);
+ if (fo1 == null)
+ return fo.createFolder (next);
+ return fo1;
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/Copy.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/Copy.java
new file mode 100644
index 000000000..e4816b874
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/Copy.java
@@ -0,0 +1,210 @@
+/*
+ * 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.
+ */
+
+package org.netbeans.upgrade;
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.openide.filesystems.*;
+
+/** Does copy of objects on filesystems.
+ *
+ * @author Jaroslav Tulach
+ */
+final class Copy extends Object {
+ private FileObject sourceRoot;
+ private FileObject targetRoot;
+ private Set thoseToCopy;
+ private PathTransformation transformation;
+
+ private Copy(FileObject source, FileObject target, Set thoseToCopy, PathTransformation transformation) {
+ this.sourceRoot = source;
+ this.targetRoot = target;
+ this.thoseToCopy = thoseToCopy;
+ this.transformation = transformation;
+ }
+
+ /** Does a selective copy of one source tree to another.
+ * @param source file object to copy from
+ * @param target file object to copy to
+ * @param thoseToCopy set on which contains (relativeNameOfAFileToCopy)
+ * is being called to find out whether to copy or not
+ * @throws IOException if coping fails
+ */
+ public static void copyDeep (FileObject source, FileObject target, Set thoseToCopy)
+ throws IOException {
+ copyDeep(source, target, thoseToCopy, null);
+ }
+
+ public static void copyDeep (FileObject source, FileObject target, Set thoseToCopy, PathTransformation transformation)
+ throws IOException {
+ Copy instance = new Copy(source, target, thoseToCopy, transformation);
+ instance.copyFolder (instance.sourceRoot);
+ }
+
+
+ private void copyFolder (FileObject sourceFolder) throws IOException {
+ FileObject[] srcChildren = sourceFolder.getChildren();
+ for (int i = 0; i < srcChildren.length; i++) {
+ FileObject child = srcChildren[i];
+ if (child.isFolder()) {
+ copyFolder (child);
+ // make sure 'include xyz/.*' copies xyz folder's attributes
+ if ((thoseToCopy.contains (child.getPath()) || thoseToCopy.contains (child.getPath() + "/")) && //NOI18N
+ child.getAttributes().hasMoreElements()
+ ) {
+ copyFolderAttributes(child);
+ }
+ } else {
+ if (thoseToCopy.contains (child.getPath())) {
+ copyFile(child);
+ }
+ }
+ }
+ }
+
+ private void copyFolderAttributes(FileObject sourceFolder) throws IOException {
+ FileObject targetFolder = FileUtil.createFolder (targetRoot, sourceFolder.getPath());
+ if (sourceFolder.getAttributes ().hasMoreElements ()) {
+ FileUtil.copyAttributes(sourceFolder, targetFolder);
+ }
+ }
+
+ private void copyFile(FileObject sourceFile) throws IOException {
+ String targetPath = (transformation != null) ? transformation.transformPath(sourceFile.getPath()) : sourceFile.getPath();
+ boolean isTransformed = !targetPath.equals(sourceFile.getPath());
+ FileObject tg = targetRoot.getFileObject(targetPath);
+ try {
+ if (tg == null) {
+ // copy the file otherwise keep old content
+ FileObject targetFolder = null;
+ String name = null, ext = null;
+ if (isTransformed) {
+ FileObject targetFile = FileUtil.createData(targetRoot, targetPath);
+ targetFolder = targetFile.getParent();
+ name = targetFile.getName();
+ ext = targetFile.getExt();
+ targetFile.delete();
+ } else {
+ targetFolder = FileUtil.createFolder(targetRoot, sourceFile.getParent().getPath());
+ name = sourceFile.getName();
+ ext = sourceFile.getExt();
+ }
+ tg = FileUtil.copyFile(sourceFile, targetFolder, name, ext);
+ }
+ } catch (IOException ex) {
+ if (sourceFile.getNameExt().endsWith("_hidden")) {
+ return;
+ }
+ throw ex;
+ }
+ FileUtil.copyAttributes(sourceFile, tg);
+ }
+
+ public static void appendSelectedLines(File sourceFile, File targetFolder, String[] regexForSelection)
+ throws IOException {
+ if (!sourceFile.exists()) {
+ return;
+ }
+ Pattern[] linePattern = new Pattern[regexForSelection.length];
+ for (int i = 0; i < linePattern.length; i++) {
+ linePattern[i] = Pattern.compile(regexForSelection[i]);
+ }
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ File targetFile = new File(targetFolder,sourceFile.getName());
+ if (!targetFolder.exists()) {
+ targetFolder.mkdirs();
+ }
+ assert targetFolder.exists();
+
+ if (!targetFile.exists()) {
+ targetFile.createNewFile();
+ } else {
+ //read original content into ByteArrayOutputStream
+ FileInputStream targetIS = new FileInputStream(targetFile);
+ try {
+ FileUtil.copy(targetIS, bos);
+ } finally {
+ targetIS.close();
+ }
+ }
+ assert targetFile.exists();
+
+
+ //append lines into ByteArrayOutputStream
+ String line = null;
+ BufferedReader sourceReader = new BufferedReader(new FileReader(sourceFile));
+ try {
+ while ((line = sourceReader.readLine()) != null) {
+ if (linePattern != null) {
+ for (int i = 0; i < linePattern.length; i++) {
+ Matcher m = linePattern[i].matcher(line);
+ if (m.matches()) {
+ bos.write(line.getBytes());
+ bos.write('\n');
+ break;
+ }
+ }
+ } else {
+ bos.write(line.getBytes());
+ bos.write('\n');
+ }
+ }
+ } finally {
+ sourceReader.close();
+ }
+
+ ByteArrayInputStream bin = new ByteArrayInputStream(bos.toByteArray());
+ FileOutputStream targetOS = new FileOutputStream(targetFile);
+ try {
+ FileUtil.copy(bin, targetOS);
+ } finally {
+ bin.close();
+ targetOS.close();
+ }
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/CopyFiles.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/CopyFiles.java
new file mode 100644
index 000000000..dd9e5c929
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/CopyFiles.java
@@ -0,0 +1,367 @@
+/*
+ * 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.upgrade;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import org.netbeans.util.Util;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.EditableProperties;
+
+/** Does copy of files according to include/exclude patterns.
+ *
+ * @author Jiri Skrivanek
+ */
+final class CopyFiles extends Object {
+
+ private File sourceRoot;
+ private File targetRoot;
+ private EditableProperties currentProperties;
+ private Set includePatterns = new HashSet();
+ private Set excludePatterns = new HashSet();
+ private static final Logger LOGGER = Logger.getLogger(CopyFiles.class.getName());
+
+ private CopyFiles(File source, File target, File patternsFile) {
+ this.sourceRoot = source;
+ this.targetRoot = target;
+ try {
+ InputStream is = new FileInputStream(patternsFile);
+ Reader reader = new InputStreamReader(is, "utf-8"); // NOI18N
+ readPatterns(reader);
+ reader.close();
+ } catch (IOException ex) {
+ // show error message and continue
+ JDialog dialog = Util.createJOptionDialog(new JOptionPane(ex, JOptionPane.ERROR_MESSAGE), ex.getMessage());
+ dialog.setVisible(true);
+ return;
+ }
+ }
+
+ public static void copyDeep(File source, File target, File patternsFile) throws IOException {
+ CopyFiles copyFiles = new CopyFiles(source, target, patternsFile);
+ LOGGER.fine("Copying from: " + copyFiles.sourceRoot + "\nto: " + copyFiles.targetRoot); //NOI18N
+ copyFiles.copyFolder(copyFiles.sourceRoot);
+ }
+
+ private void copyFolder(File sourceFolder) throws IOException {
+ File[] srcChildren = sourceFolder.listFiles();
+ if (srcChildren == null) {
+ LOGGER.info(sourceFolder + " is not a directory or is invalid."); //NOI18N
+ return ;
+ }
+ for (File child : srcChildren) {
+ if (child.isDirectory()) {
+ copyFolder(child);
+ } else {
+ copyFile(child);
+ }
+ }
+ }
+
+ /** Returns slash separated path relative to given root. */
+ private static String getRelativePath(File root, File file) {
+ String result = file.getAbsolutePath().substring(root.getAbsolutePath().length());
+ result = result.replace('\\', '/'); //NOI18N
+ if (result.startsWith("/") && !result.startsWith("//")) { //NOI18N
+ result = result.substring(1);
+ }
+ return result;
+ }
+
+ /** Copy source file to target file. It creates necessary sub folders.
+ * @param sourceFile source file
+ * @param targetFile target file
+ * @throws java.io.IOException if copying fails
+ */
+ private static void copyFile(File sourceFile, File targetFile) throws IOException {
+ ensureParent(targetFile);
+ InputStream ins = null;
+ OutputStream out = null;
+ try {
+ ins = new FileInputStream(sourceFile);
+ out = new FileOutputStream(targetFile);
+ FileUtil.copy(ins, out);
+ } finally {
+ if (ins != null) {
+ ins.close();
+ }
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+
+ /** Copy given file to target root dir if matches include/exclude patterns.
+ * If properties pattern is applicable, it copies only matching keys.
+ * @param sourceFile source file
+ * @throws java.io.IOException if copying fails
+ */
+ private void copyFile(File sourceFile) throws IOException {
+ String relativePath = getRelativePath(sourceRoot, sourceFile);
+ currentProperties = null;
+ boolean includeFile = false;
+ Set includeKeys = new HashSet();
+ Set excludeKeys = new HashSet();
+ for (String pattern : includePatterns) {
+ if (pattern.contains("#")) { //NOI18N
+ includeKeys.addAll(matchingKeys(relativePath, pattern));
+ } else {
+ if (relativePath.matches(pattern)) {
+ includeFile = true;
+ includeKeys.clear(); // include entire file
+ break;
+ }
+ }
+ }
+ if (includeFile || !includeKeys.isEmpty()) {
+ // check excludes
+ for (String pattern : excludePatterns) {
+ if (pattern.contains("#")) { //NOI18N
+ excludeKeys.addAll(matchingKeys(relativePath, pattern));
+ } else {
+ if (relativePath.matches(pattern)) {
+ includeFile = false;
+ includeKeys.clear(); // exclude entire file
+ break;
+ }
+ }
+ }
+ }
+ LOGGER.log(Level.FINEST, "{0}, includeFile={1}, includeKeys={2}, excludeKeys={3}", new Object[]{relativePath, includeFile, includeKeys, excludeKeys}); //NOI18N
+ if (!includeFile && includeKeys.isEmpty()) {
+ // nothing matches
+ return;
+ }
+
+ File targetFile = new File(targetRoot, relativePath);
+ LOGGER.log(Level.FINE, "Path: {0}", relativePath); //NOI18N
+ if (includeKeys.isEmpty() && excludeKeys.isEmpty()) {
+ // copy entire file
+ copyFile(sourceFile, targetFile);
+ } else {
+ if (!includeKeys.isEmpty()) {
+ currentProperties.keySet().retainAll(includeKeys);
+ }
+ currentProperties.keySet().removeAll(excludeKeys);
+ // copy just selected keys
+ LOGGER.log(Level.FINE, " Only keys: {0}", currentProperties.keySet());
+ OutputStream out = null;
+ try {
+ ensureParent(targetFile);
+ out = new FileOutputStream(targetFile);
+ currentProperties.store(out);
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+ }
+
+ /** Returns set of keys matching given pattern.
+ * @param relativePath path relative to sourceRoot
+ * @param propertiesPattern pattern like file.properties#keyPattern
+ * @return set of matching keys, never null
+ * @throws IOException if properties cannot be loaded
+ */
+ private Set matchingKeys(String relativePath, String propertiesPattern) throws IOException {
+ Set matchingKeys = new HashSet();
+ String[] patterns = propertiesPattern.split("#", 2);
+ String filePattern = patterns[0];
+ String keyPattern = patterns[1];
+ if (relativePath.matches(filePattern)) {
+ if (currentProperties == null) {
+ currentProperties = getProperties(relativePath);
+ }
+ for (String key : currentProperties.keySet()) {
+ if (key.matches(keyPattern)) {
+ matchingKeys.add(key);
+ }
+ }
+ }
+ return matchingKeys;
+ }
+
+ /** Returns properties from relative path.
+ * @param relativePath relative path
+ * @return properties from relative path.
+ * @throws IOException if cannot open stream
+ */
+ private EditableProperties getProperties(String relativePath) throws IOException {
+ EditableProperties properties = new EditableProperties(false);
+ InputStream in = null;
+ try {
+ in = new FileInputStream(new File(sourceRoot, relativePath));
+ properties.load(in);
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ }
+ return properties;
+ }
+
+ /** Creates parent of given file, if doesn't exist. */
+ private static void ensureParent(File file) throws IOException {
+ final File parent = file.getParentFile();
+ if (parent != null && !parent.exists()) {
+ if (!parent.mkdirs()) {
+ throw new IOException("Cannot create folder: " + parent.getAbsolutePath()); //NOI18N
+ }
+ }
+ }
+
+ /** Reads the include/exclude set from a given reader.
+ * @param r reader
+ */
+ private void readPatterns(Reader r) throws IOException {
+ BufferedReader buf = new BufferedReader(r);
+ for (;;) {
+ String line = buf.readLine();
+ if (line == null) {
+ break;
+ }
+ line = line.trim();
+ if (line.length() == 0 || line.startsWith("#")) { //NOI18N
+ continue;
+ }
+ if (line.startsWith("include ")) { //NOI18N
+ line = line.substring(8);
+ if (line.length() > 0) {
+ includePatterns.addAll(parsePattern(line));
+ }
+ } else if (line.startsWith("exclude ")) { //NOI18N
+ line = line.substring(8);
+ if (line.length() > 0) {
+ excludePatterns.addAll(parsePattern(line));
+ }
+ } else {
+ throw new java.io.IOException("Wrong line: " + line); //NOI18N
+ }
+ }
+ }
+
+ enum ParserState {
+
+ START,
+ IN_KEY_PATTERN,
+ AFTER_KEY_PATTERN,
+ IN_BLOCK
+ }
+
+ /** Parses given compound string pattern into set of single patterns.
+ * @param pattern compound pattern in form filePattern1#keyPattern1#|filePattern2#keyPattern2#|filePattern3
+ * @return set of single patterns containing just one # (e.g. [filePattern1#keyPattern1, filePattern2#keyPattern2, filePattern3])
+ */
+ private static Set parsePattern(String pattern) {
+ Set patterns = new HashSet();
+ if (pattern.contains("#")) { //NOI18N
+ StringBuilder partPattern = new StringBuilder();
+ ParserState state = ParserState.START;
+ int blockLevel = 0;
+ for (int i = 0; i < pattern.length(); i++) {
+ char c = pattern.charAt(i);
+ switch (state) {
+ case START:
+ if (c == '#') {
+ state = ParserState.IN_KEY_PATTERN;
+ partPattern.append(c);
+ } else if (c == '(') {
+ state = ParserState.IN_BLOCK;
+ blockLevel++;
+ partPattern.append(c);
+ } else if (c == '|') {
+ patterns.add(partPattern.toString());
+ partPattern = new StringBuilder();
+ } else {
+ partPattern.append(c);
+ }
+ break;
+ case IN_KEY_PATTERN:
+ if (c == '#') {
+ state = ParserState.AFTER_KEY_PATTERN;
+ } else {
+ partPattern.append(c);
+ }
+ break;
+ case AFTER_KEY_PATTERN:
+ if (c == '|') {
+ state = ParserState.START;
+ patterns.add(partPattern.toString());
+ partPattern = new StringBuilder();
+ } else {
+ assert false : "Wrong OptionsExport pattern " + pattern + ". Only format like filePattern1#keyPattern#|filePattern2 is supported."; //NOI18N
+ }
+ break;
+ case IN_BLOCK:
+ partPattern.append(c);
+ if (c == ')') {
+ blockLevel--;
+ if (blockLevel == 0) {
+ state = ParserState.START;
+ }
+ }
+ break;
+ }
+ }
+ patterns.add(partPattern.toString());
+ } else {
+ patterns.add(pattern);
+ }
+ return patterns;
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/IncludeExclude.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/IncludeExclude.java
new file mode 100644
index 000000000..0cb9936fa
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/IncludeExclude.java
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+package org.netbeans.upgrade;
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+import org.openide.util.Union2;
+
+
+
+/** A test that is initialized based on includes and excludes.
+ *
+ * @author Jaroslav Tulach
+ */
+final class IncludeExclude extends AbstractSet {
+ /** List
+ */
+ private List> patterns = new ArrayList> ();
+
+ private IncludeExclude () {
+ }
+
+ /** Reads the include/exclude set from a given reader.
+ * @param r reader
+ * @return set that accepts names based on include exclude from the file
+ */
+ public static IncludeExclude create (Reader r) throws IOException {
+ IncludeExclude set = new IncludeExclude ();
+
+ BufferedReader buf = new BufferedReader (r);
+ for (;;) {
+ String line = buf.readLine ();
+ if (line == null) break;
+
+ line = line.trim ();
+ if (line.length () == 0 || line.startsWith ("#")) {
+ continue;
+ }
+
+ Boolean plus;
+ if (line.startsWith ("include ")) {
+ line = line.substring (8);
+ plus = Boolean.TRUE;
+ } else {
+ if (line.startsWith ("exclude ")) {
+ line = line.substring (8);
+ plus = Boolean.FALSE;
+ } else {
+ throw new java.io.IOException ("Wrong line: " + line);
+ }
+ }
+
+ Pattern p = Pattern.compile (line);
+
+ set.patterns.add (Union2.createFirst(plus));
+ set.patterns.add (Union2.createSecond(p));
+ }
+
+ return set;
+ }
+
+
+ public Iterator iterator () {
+ return null;
+ }
+
+ public int size () {
+ return 0;
+ }
+
+ @Override
+ public boolean contains (Object o) {
+ String s = (String)o;
+
+ boolean yes = false;
+
+ Iterator> it = patterns.iterator ();
+ while (it.hasNext ()) {
+ Boolean include = it.next ().first();
+ Pattern p = it.next ().second();
+
+ Matcher m = p.matcher (s);
+ if (m.matches ()) {
+ yes = include.booleanValue ();
+ if (!yes) {
+ // exclude matches => immediately return
+ return false;
+ }
+ }
+ }
+
+ return yes;
+ }
+
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/PathTransformation.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/PathTransformation.java
new file mode 100644
index 000000000..7f17f8490
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/PathTransformation.java
@@ -0,0 +1,93 @@
+/*
+ * 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-2007 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.upgrade;
+
+/**
+ *
+ * @author Radek Matous
+ */
+public class PathTransformation {
+ private String version;
+ private PathTransformation(String version) {
+ this.version = version;
+ }
+ public static PathTransformation getInstance(String version) {
+ return new PathTransformation(version);
+ }
+
+ public String transformPath(String path) {
+ boolean isCreator = version.startsWith("2_");//NOI18N
+ if (isCreator) {
+ return transformCreatorPath(path);
+ }
+
+ boolean i118364 = path.startsWith("Templates/Classes/");//NOI18N
+ if (i118364) {
+ if (!version.startsWith("6")) {
+ return transformTemplatePath118364(path);
+ }
+ }
+
+ return path;
+ }
+
+ private String transformTemplatePath118364(String path) {
+ return path.replace("Templates/Classes/", "Templates/Oldies/Classes/");//NOI18N
+ }
+ //CREATOR
+ private String transformCreatorPath(String path) {
+ String keyToReplace = null;
+ String[] keysToReplace = new String[] {"context.xml"};//NOI18N
+ for (String key : keysToReplace) {
+ if (path.startsWith(key)) {
+ keyToReplace = key;
+ break;
+ }
+ }
+ if (keyToReplace != null) {
+ return path.replace(keyToReplace, "config/"+version+"/"+keyToReplace);//NOI18N
+ }
+ return path;
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/XMLStorage.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/XMLStorage.java
new file mode 100644
index 000000000..d9c4f46f8
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/XMLStorage.java
@@ -0,0 +1,291 @@
+/*
+ * 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.
+ */
+
+package org.netbeans.upgrade;
+
+import java.awt.Color;
+import java.awt.Font;
+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.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.openide.ErrorManager;
+import org.openide.filesystems.FileLock;
+
+import org.openide.filesystems.FileObject;
+import org.openide.util.RequestProcessor;
+import org.openide.xml.XMLUtil;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+
+public class XMLStorage {
+
+ private static final Map colorToName = new HashMap ();
+ private static final Map nameToColor = new HashMap ();
+ private static final Map nameToFontStyle = new HashMap ();
+ private static final Map fontStyleToName = new HashMap ();
+ static {
+ colorToName.put (Color.black, "black");
+ nameToColor.put ("black", Color.black);
+ colorToName.put (Color.blue, "blue");
+ nameToColor.put ("blue", Color.blue);
+ colorToName.put (Color.cyan, "cyan");
+ nameToColor.put ("cyan", Color.cyan);
+ colorToName.put (Color.darkGray, "darkGray");
+ nameToColor.put ("darkGray", Color.darkGray);
+ colorToName.put (Color.gray, "gray");
+ nameToColor.put ("gray", Color.gray);
+ colorToName.put (Color.green, "green");
+ nameToColor.put ("green", Color.green);
+ colorToName.put (Color.lightGray, "lightGray");
+ nameToColor.put ("lightGray", Color.lightGray);
+ colorToName.put (Color.magenta, "magenta");
+ nameToColor.put ("magenta", Color.magenta);
+ colorToName.put (Color.orange, "orange");
+ nameToColor.put ("orange", Color.orange);
+ colorToName.put (Color.pink, "pink");
+ nameToColor.put ("pink", Color.pink);
+ colorToName.put (Color.red, "red");
+ nameToColor.put ("red", Color.red);
+ colorToName.put (Color.white, "white");
+ nameToColor.put ("white", Color.white);
+ colorToName.put (Color.yellow, "yellow");
+ nameToColor.put ("yellow", Color.yellow);
+
+ nameToFontStyle.put ("plain", Integer.valueOf (Font.PLAIN));
+ fontStyleToName.put (Integer.valueOf (Font.PLAIN), "plain");
+ nameToFontStyle.put ("bold", Integer.valueOf (Font.BOLD));
+ fontStyleToName.put (Integer.valueOf (Font.BOLD), "bold");
+ nameToFontStyle.put ("italic", Integer.valueOf (Font.ITALIC));
+ fontStyleToName.put (Integer.valueOf (Font.ITALIC), "italic");
+ nameToFontStyle.put ("bold+italic", Integer.valueOf (Font.BOLD + Font.ITALIC));
+ fontStyleToName.put (Integer.valueOf (Font.BOLD + Font.ITALIC), "bold+italic");
+ }
+
+ static String colorToString (Color color) {
+ if (colorToName.containsKey (color))
+ return (String) colorToName.get (color);
+ return Integer.toHexString (color.getRGB ());
+ }
+
+ static Color stringToColor (String color) throws Exception {
+ if (color.startsWith ("#"))
+ color = color.substring (1);
+ if (nameToColor.containsKey (color))
+ return (Color) nameToColor.get (color);
+ try {
+ return new Color ((int) Long.parseLong (color, 16));
+ } catch (NumberFormatException ex) {
+ throw new Exception ();
+ }
+ }
+
+
+ // generics support methods ................................................
+
+ private static RequestProcessor requestProcessor = new RequestProcessor ("XMLStorage");
+
+ static void save (final FileObject fo, final String content) {
+ if (fo == null) throw new NullPointerException ();
+ if (content == null) throw new NullPointerException ();
+ requestProcessor.post (new Runnable () {
+ public void run () {
+ try {
+ FileLock lock = fo.lock ();
+ try {
+ OutputStream os = fo.getOutputStream (lock);
+ Writer writer = new OutputStreamWriter (os, "UTF-8"); // NOI18N
+ try {
+ writer.write (content);
+ } finally {
+ writer.close ();
+ }
+ } finally {
+ lock.releaseLock ();
+ }
+ } catch (IOException ex) {
+ ErrorManager.getDefault ().notify (ex);
+ }
+ }
+ });
+ }
+
+ static Object load (InputStream is, String name, Handler handler) {
+ try {
+ try {
+ XMLReader reader = XMLUtil.createXMLReader ();
+ reader.setEntityResolver (handler);
+ reader.setContentHandler (handler);
+ reader.parse (new InputSource (is));
+ return handler.getResult ();
+ } finally {
+ is.close ();
+ }
+ } catch (SAXException ex) {
+ if (System.getProperty ("org.netbeans.optionsDialog") != null) {
+ System.out.println("File: " + name);
+ ex.printStackTrace ();
+ }
+ return handler.getResult ();
+ } catch (IOException ex) {
+ if (System.getProperty ("org.netbeans.optionsDialog") != null) {
+ System.out.println("File: " + name);
+ ex.printStackTrace ();
+ }
+ return handler.getResult ();
+ } catch (Exception ex) {
+ if (System.getProperty ("org.netbeans.optionsDialog") != null) {
+ System.out.println("File: " + name);
+ ex.printStackTrace ();
+ }
+ return handler.getResult ();
+ }
+ }
+
+ static StringBuffer generateHeader () {
+ StringBuffer sb = new StringBuffer ();
+ sb.append ("\n\n");
+ return sb;
+ }
+
+ static void generateFolderStart (
+ StringBuffer sb,
+ String name,
+ Attribs attributes,
+ String indentation
+ ) {
+ sb.append (indentation).append ('<').append (name);
+ if (attributes != null) {
+ if (!attributes.oneLine) sb.append ('\n');
+ else sb.append (' ');
+ generateAttributes (sb, attributes, indentation + " ");
+ if (!attributes.oneLine) sb.append (indentation);
+ sb.append (">\n");
+ } else
+ sb.append (">\n");
+ }
+
+ static void generateFolderEnd (StringBuffer sb, String name, String indentation) {
+ sb.append (indentation).append ("").append (name).append (">\n");
+ }
+
+ static void generateLeaf (
+ StringBuffer sb,
+ String name,
+ Attribs attributes,
+ String indentation
+ ) {
+ sb.append (indentation).append ('<').append (name);
+ if (attributes != null) {
+ if (!attributes.oneLine) sb.append ('\n');
+ else sb.append (' ');
+ generateAttributes (sb, attributes, indentation + " ");
+ if (!attributes.oneLine) sb.append (indentation);
+ sb.append ("/>\n");
+ } else
+ sb.append ("/>\n");
+ }
+
+ private static void generateAttributes (
+ StringBuffer sb,
+ Attribs attributes,
+ String indentation
+ ) {
+ if (attributes == null) return;
+ int i, k = attributes.names.size ();
+ for (i = 0; i < k; i++) {
+ if (!attributes.oneLine)
+ sb.append (indentation);
+ sb.append (attributes.names.get (i)).append ("=\"").
+ append (attributes.values.get (i)).append ('\"');
+ if (!attributes.oneLine)
+ sb.append ("\n");
+ else
+ if (i < (k - 1))
+ sb.append (' ');
+ }
+ }
+
+ static class Handler extends DefaultHandler {
+ private Object result;
+ void setResult (Object result) {
+ this.result = result;
+ }
+ Object getResult () {
+ return result;
+ }
+ }
+
+ static class Attribs {
+ private List names = new ArrayList ();
+ private List values = new ArrayList ();
+ private boolean oneLine;
+
+ Attribs (boolean oneLine) {
+ this.oneLine = oneLine;
+ }
+
+ void add (String name, String value) {
+ int i = names.indexOf (name);
+ if (i >= 0) {
+ names.remove (i);
+ values.remove (i);
+ } names.add (name);
+ values.add (value);
+ }
+
+ void clear () {
+ names.clear ();
+ values.clear ();
+ }
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy5.5 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy5.5
new file mode 100644
index 000000000..000a8bff3
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy5.5
@@ -0,0 +1,106 @@
+# 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include CreatorDesignerPalette/.*
+include CreatorDesignerPalette5/.*
+include Databases/.*
+include Editors/.*
+exclude Editors/.*/macros.xml
+exclude Editors/.*/Popup.*
+exclude Editors/.*/.*\.instance
+exclude Editors/.*/Settings\.settings
+include Editors/AnnotationTypes/org-netbeans-modules-java-.*\.xml
+include Editors/AnnotationTypes/TaskAnnotation.*\.xml
+include Favorites/.*
+include FormDesignerPalette/.*
+include HTMLPalette/.*
+include HTTPMonitor/.*
+include J2EE/.*
+include JSPPalette/.*
+include Keymaps/.*
+exclude MVD/.*
+include org-netbeans-api-project-libraries/Libraries/.*\.xml
+include Services/Browsers/.*
+include Services/Collaboration/.*
+include Services/DiffProviders/.*
+include Services/Diffs/.*
+include Services/DiffVisualizers/.*
+include Services/formsettings\.settings
+include Services/Hidden/org-netbeans-modules-diff-DiffSettings\.settings
+include Services/Hidden/org-netbeans-modules-subversion-settings-.*
+include Services/Hidden/org-netbeans-modules-tasklist-suggestions-settings-ManagerSettings\.instance
+include Services/Hidden/org-netbeans-modules-vcscore-settings-GeneralVcsSettings\.settings
+include Services/Hidden/org-netbeans-modules-versioning-system-cvss-settings.*
+include Services/Hidden/VersionControl/org-netbeans-modules-vcscore-grouping-VcsGroupSettings\.settings
+exclude Services/IndentEngine/.*
+include Services/MergeVisualizers/.*
+include Services/org-apache-tools-ant-module-AntSettings\.settings
+include Services/org-netbeans-core-IDESettings\.settings
+include Services/org-netbeans-modules-db-explorer-DatabaseOption\.settings
+include Services/org-netbeans-modules-debugger-Settings\.properties
+include Services/org-netbeans-modules-derby-DerbyOptions\.settings
+include Services/org-netbeans-modules-httpserver-HttpServerSettings\.settings
+include Services/org-netbeans-modules-java-settings-JavaSettings\.settings
+include Services/org-netbeans-modules-javadoc-settings-DocumentationSettings\.settings
+include Services/org-netbeans-modules-profiler-ProfilerIDESettings\.settings
+include Services/org-netbeans-modules-project-ui-OpenProjectList\.settings
+include Services/org-netbeans-modules-tasklist-docscan-Settings\.settings
+include Services/Platforms/org-netbeans-api-java-Platform/.*\.xml
+include Shortcuts/.*
+include TaskList/.*
+include Templates/Classes/.*
+include Templates/J2MEProjectConfigurations/.*\.cfg
+include Toolbars/.*
+exclude Toolbars/Progress/.*
+include vcs/.*
+include VCSMount/.*
+exclude Windows2Local/Components/DesignInspector.settings
+exclude Windows2Local/Groups/mvd/DesignInspector.wstcgrp
+exclude Windows2Local/Modes/navigator/DesignInspector.wstcref
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy5.5.1 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy5.5.1
new file mode 100644
index 000000000..000a8bff3
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy5.5.1
@@ -0,0 +1,106 @@
+# 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include CreatorDesignerPalette/.*
+include CreatorDesignerPalette5/.*
+include Databases/.*
+include Editors/.*
+exclude Editors/.*/macros.xml
+exclude Editors/.*/Popup.*
+exclude Editors/.*/.*\.instance
+exclude Editors/.*/Settings\.settings
+include Editors/AnnotationTypes/org-netbeans-modules-java-.*\.xml
+include Editors/AnnotationTypes/TaskAnnotation.*\.xml
+include Favorites/.*
+include FormDesignerPalette/.*
+include HTMLPalette/.*
+include HTTPMonitor/.*
+include J2EE/.*
+include JSPPalette/.*
+include Keymaps/.*
+exclude MVD/.*
+include org-netbeans-api-project-libraries/Libraries/.*\.xml
+include Services/Browsers/.*
+include Services/Collaboration/.*
+include Services/DiffProviders/.*
+include Services/Diffs/.*
+include Services/DiffVisualizers/.*
+include Services/formsettings\.settings
+include Services/Hidden/org-netbeans-modules-diff-DiffSettings\.settings
+include Services/Hidden/org-netbeans-modules-subversion-settings-.*
+include Services/Hidden/org-netbeans-modules-tasklist-suggestions-settings-ManagerSettings\.instance
+include Services/Hidden/org-netbeans-modules-vcscore-settings-GeneralVcsSettings\.settings
+include Services/Hidden/org-netbeans-modules-versioning-system-cvss-settings.*
+include Services/Hidden/VersionControl/org-netbeans-modules-vcscore-grouping-VcsGroupSettings\.settings
+exclude Services/IndentEngine/.*
+include Services/MergeVisualizers/.*
+include Services/org-apache-tools-ant-module-AntSettings\.settings
+include Services/org-netbeans-core-IDESettings\.settings
+include Services/org-netbeans-modules-db-explorer-DatabaseOption\.settings
+include Services/org-netbeans-modules-debugger-Settings\.properties
+include Services/org-netbeans-modules-derby-DerbyOptions\.settings
+include Services/org-netbeans-modules-httpserver-HttpServerSettings\.settings
+include Services/org-netbeans-modules-java-settings-JavaSettings\.settings
+include Services/org-netbeans-modules-javadoc-settings-DocumentationSettings\.settings
+include Services/org-netbeans-modules-profiler-ProfilerIDESettings\.settings
+include Services/org-netbeans-modules-project-ui-OpenProjectList\.settings
+include Services/org-netbeans-modules-tasklist-docscan-Settings\.settings
+include Services/Platforms/org-netbeans-api-java-Platform/.*\.xml
+include Shortcuts/.*
+include TaskList/.*
+include Templates/Classes/.*
+include Templates/J2MEProjectConfigurations/.*\.cfg
+include Toolbars/.*
+exclude Toolbars/Progress/.*
+include vcs/.*
+include VCSMount/.*
+exclude Windows2Local/Components/DesignInspector.settings
+exclude Windows2Local/Groups/mvd/DesignInspector.wstcgrp
+exclude Windows2Local/Modes/navigator/DesignInspector.wstcref
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.0 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.0
new file mode 100644
index 000000000..566c5692a
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.0
@@ -0,0 +1,82 @@
+# 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include Preferences/.*
+include Databases/.*
+include Editors/.*
+exclude Editors/.*/macros.xml
+exclude Editors/.*/Popup.*
+exclude Editors/.*/.*\.instance
+exclude Editors/.*/Settings\.settings
+include Favorites/.*
+include FormDesignerPalette/.*
+include HTMLPalette/.*
+include J2EE/.*
+include JSPPalette/.*
+include Keymaps/.*
+exclude MVD/.*
+include org-netbeans-api-project-libraries/Libraries/.*\.xml
+include Services/Browsers/.*
+include Services/DiffProviders/.*
+include Services/formsettings.settings
+exclude Services/IndentEngine/.*
+include Services/org-netbeans-modules-db-explorer-DatabaseOption\.settings
+include Services/org-netbeans-modules-debugger-Settings\.properties
+include Services/Platforms/org-netbeans-api-java-Platform/.*\.xml
+include Shortcuts/.*
+include Templates/Classes/.*
+include Templates/J2MEProjectConfigurations/.*\.cfg
+include Toolbars/.*
+exclude Toolbars/Progress/.*
+include WebServices/service-groups.xml
+include WebServices/.*/.*-saas.xml
+exclude Windows2Local/Components/DesignInspector.settings
+exclude Windows2Local/Groups/mvd/DesignInspector.wstcgrp
+exclude Windows2Local/Modes/navigator/DesignInspector.wstcref
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.1 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.1
new file mode 100644
index 000000000..35c7ec6bf
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.1
@@ -0,0 +1,85 @@
+# 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include Preferences/.*
+exclude Preferences/org/netbeans/modules/welcome.properties!feedback.*
+include Databases/.*
+include Editors/.*
+exclude Editors/.*/macros.xml
+exclude Editors/.*/Popup.*
+exclude Editors/.*/.*\.instance
+exclude Editors/.*/Settings\.settings
+include Favorites/.*
+include FormDesignerPalette/.*
+include GlassFish/.*
+include HTMLPalette/.*
+include J2EE/.*
+include JSPPalette/.*
+include Keymaps/.*
+include org-netbeans-api-project-libraries/Libraries/.*\.xml
+include Services/Browsers/.*
+include Services/DiffProviders/.*
+include Services/formsettings.settings
+exclude Services/IndentEngine/.*
+include Services/org-netbeans-modules-db-explorer-DatabaseOption\.settings
+include Services/org-netbeans-modules-debugger-Settings\.properties
+include Services/Platforms/org-netbeans-api-java-Platform/.*\.xml
+include Shortcuts/.*
+exclude Templates/Beans/Bean.java
+exclude Templates/Beans/BeanInfo.java
+exclude Templates/Beans/NoIconBeanInfo.java
+exclude Templates/Beans/Customizer.java
+exclude Templates/Beans/Customizer.form
+exclude Templates/Beans/PropertyEditor.java
+include Templates/Classes/.*
+include Templates/J2MEProjectConfigurations/.*\.cfg
+include Toolbars/.*
+exclude Toolbars/Progress/.*
+include vmd-midp/palette/custom/.*
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.5 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.5
new file mode 100644
index 000000000..03c39ca9e
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copy6.5
@@ -0,0 +1,85 @@
+# 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include Preferences/.*
+exclude Preferences/org/netbeans/modules/welcome.properties!feedback.*
+include Databases/.*
+include Editors/.*
+exclude Editors/.*/macros.xml
+exclude Editors/.*/Popup.*
+exclude Editors/.*/.*\.instance
+exclude Editors/.*/Settings\.settings
+include Favorites/.*
+include FormDesignerPalette/.*
+include GlassFish/.*
+include HTMLPalette/.*
+include J2EE/.*
+include JSPPalette/.*
+include Keymaps/.*
+include org-netbeans-api-project-libraries/Libraries/.*\.xml
+include Services/Browsers/.*
+include Services/DiffProviders/.*
+include Services/formsettings.settings
+exclude Services/IndentEngine/.*
+include Services/MIMEResolver/.*
+include Services/org-netbeans-modules-db-explorer-DatabaseOption\.settings
+include Services/org-netbeans-modules-debugger-Settings\.properties
+include Services/Platforms/org-netbeans-api-java-Platform/.*\.xml
+include Shortcuts/.*
+include Templates/.*
+exclude Templates/Beans/Bean.java
+exclude Templates/Beans/BeanInfo.java
+exclude Templates/Beans/NoIconBeanInfo.java
+exclude Templates/Beans/Customizer.java
+exclude Templates/Beans/Customizer.form
+exclude Templates/Beans/PropertyEditor.java
+include Toolbars/.*
+exclude Toolbars/Progress/.*
+include vmd-midp/palette/custom/.*
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/copyjstudio_6me_user b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copyjstudio_6me_user
new file mode 100644
index 000000000..bb275c405
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/copyjstudio_6me_user
@@ -0,0 +1,90 @@
+# 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include Services/org-netbeans-core-IDESettings\.settings
+include Shortcuts/.*
+
+include Services/Hidden/org-netbeans-modules-vcscore-settings-GeneralVcsSettings\.settings
+
+include Services/DiffProviders/.*
+include Services/Diffs/.*
+include Services/DiffVisualizers/.*
+include Services/MergeVisualizers/.*
+include Services/Hidden/org-netbeans-modules-diff-DiffSettings\.settings
+
+include Services/Browsers/.*
+include Services/org-netbeans-modules-httpserver-HttpServerSettings\.settings
+
+include HTTPMonitor/.*
+
+include J2EE/.*
+
+include Services/JDBCDrivers/.*
+include Services/org-netbeans-modules-db-explorer-DatabaseOption\.settings
+
+include Editors/.*
+include Editors/AnnotationTypes/.*
+include Services/org-openide-text-PrintSettings\.settings
+include Services/IndentEngine/.*
+
+include Services/org-netbeans-modules-java-settings-JavaSettings\.settings
+include Services/org-openide-src-nodes-SourceOptions\.settings
+include Templates/Classes/.*
+include Editors/AnnotationTypes/org-netbeans-modules-java-.*\.xml
+
+include Services/org-netbeans-modules-beans-beans\.settings
+include Templates/Beans/.*
+
+include Services/org-netbeans-modules-javadoc-settings-DocumentationSettings\.settings
+
+include Services/formsettings\.settings
+include Services/org-netbeans-modules-i18n-I18nOptions\.settings
+
+include Services/Emulators/.*\.settings
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer5.5.1.xml b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer5.5.1.xml
new file mode 100644
index 000000000..3fb69b40c
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer5.5.1.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer5.5.xml b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer5.5.xml
new file mode 100644
index 000000000..3fb69b40c
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer5.5.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer6.0.xml b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer6.0.xml
new file mode 100644
index 000000000..3fb69b40c
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer6.0.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer6.1.xml b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer6.1.xml
new file mode 100644
index 000000000..3fb69b40c
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/layer6.1.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard5.5 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard5.5
new file mode 100644
index 000000000..114d07303
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard5.5
@@ -0,0 +1,54 @@
+# 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-2007 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+#creator
+include complibs/.*
+include jdbc-drivers/.*\.jar
+include context\.xml
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard5.5.1 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard5.5.1
new file mode 100644
index 000000000..114d07303
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard5.5.1
@@ -0,0 +1,54 @@
+# 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-2007 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+#creator
+include complibs/.*
+include jdbc-drivers/.*\.jar
+include context\.xml
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.0 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.0
new file mode 100644
index 000000000..8cb190b15
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.0
@@ -0,0 +1,56 @@
+# 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-2007 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+#creator
+include complibs/.*
+include jdbc-drivers/.*\.jar
+include context\.xml
+include .uml
+include var/filehistory/.*
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.1 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.1
new file mode 100644
index 000000000..c14c5ced5
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.1
@@ -0,0 +1,51 @@
+# 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-2007 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include var/filehistory/.*
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.5 b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.5
new file mode 100644
index 000000000..f3555e412
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/nonstandard6.5
@@ -0,0 +1,52 @@
+# 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-2007 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.
+
+# start the line either with # to begin a comment
+# or include to describe a file(s) to be included during copy
+# or exclude to describe a file(s) to be excluded
+# use of regular expressions allowed in file names
+#
+# the list is iterated from first to last and the last match
+# decides the result
+
+include var/filehistory/.*
+include etc/netbeans.conf
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/systemoptions/ColorProcessor.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/systemoptions/ColorProcessor.java
new file mode 100644
index 000000000..d308a2f90
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/systemoptions/ColorProcessor.java
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+package org.netbeans.upgrade.systemoptions;
+import java.lang.Object;
+import java.util.Iterator;
+
+
+/**
+ * @author Radek Matous
+ */
+class ColorProcessor extends PropertyProcessor {
+
+ static final String JAVA_AWT_COLOR = "java.awt.Color"; // NOI18N
+ static final String NETBEANS_COLOREDITOR_SUPERCOLOR = "org.netbeans.beaninfo.editors.ColorEditor.SuperColor"; // NOI18N
+
+ ColorProcessor(String className) {
+ super(className);//NOI18N
+ }
+
+
+ void processPropertyImpl(String propertyName, Object value) {
+ StringBuffer sb = new StringBuffer();
+ if ("connectionBorderColor".equals(propertyName)||
+ "dragBorderColor".equals(propertyName)||
+ "formDesignerBackgroundColor".equals(propertyName)||
+ "formDesignerBorderColor".equals(propertyName)||
+ "guidingLineColor".equals(propertyName)||
+ "selectionBorderColor".equals(propertyName)) {//NOI18N
+ for (Iterator it = ((SerParser.ObjectWrapper)value).data.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if (o instanceof SerParser.NameValue && "value".equals(((SerParser.NameValue)o).name.name)) {//NOI18N
+ addProperty(propertyName, ((SerParser.NameValue)o).value.toString());
+ }
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
diff --git a/sdk/jme3-upgrader/src/org/netbeans/upgrade/systemoptions/ContentProcessor.java b/sdk/jme3-upgrader/src/org/netbeans/upgrade/systemoptions/ContentProcessor.java
new file mode 100644
index 000000000..4e7141244
--- /dev/null
+++ b/sdk/jme3-upgrader/src/org/netbeans/upgrade/systemoptions/ContentProcessor.java
@@ -0,0 +1,135 @@
+/*
+ * 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-2007 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.upgrade.systemoptions;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+class ContentProcessor {
+ private static Map clsname2Delegate = new HashMap();
+ protected String systemOptionInstanceName;
+
+ static {
+ registerContentProcessor(new JUnitContentProcessor("org.netbeans.modules.junit.JUnitSettings"));//NOI18N
+ }
+
+ private static void registerContentProcessor(ContentProcessor instance) {
+ if (clsname2Delegate.put(instance.systemOptionInstanceName, instance) != null) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+
+ protected ContentProcessor(String systemOptionInstanceName) {
+ this.systemOptionInstanceName = systemOptionInstanceName;
+ }
+
+ protected Result parseContent(final Iterator