http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppPanelVisual.java ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppPanelVisual.java b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppPanelVisual.java deleted file mode 100755 index 22dd43b..0000000 --- a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppPanelVisual.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ -package org.netbeans.modules.apisupport.crudsample; - -import java.io.File; -import javax.swing.JFileChooser; -import javax.swing.JPanel; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.text.Document; -import org.netbeans.spi.project.ui.support.ProjectChooser; -import org.openide.WizardDescriptor; -import org.openide.WizardValidationException; -import org.openide.filesystems.FileUtil; - -public class SampleAppPanelVisual extends JPanel implements DocumentListener { - - private static final String WIZARD_PANEL_ERROR_MESSAGE = WizardDescriptor.PROP_ERROR_MESSAGE; // NOI18N - - public static final String PROP_PROJECT_NAME = "projectName"; // NOI18N - - private SampleAppWizardPanel panel; - - /** Creates new form PanelProjectLocationVisual */ - @SuppressWarnings("LeakingThisInConstructor") - public SampleAppPanelVisual(SampleAppWizardPanel panel) { - initComponents(); - this.panel = panel; - // Register listener on the textFields to make the automatic updates - projectNameTextField.getDocument().addDocumentListener(this); - projectLocationTextField.getDocument().addDocumentListener(this); - } - - - public String getProjectName() { - return this.projectNameTextField.getText(); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { - - projectNameLabel = new javax.swing.JLabel(); - projectNameTextField = new javax.swing.JTextField(); - projectLocationLabel = new javax.swing.JLabel(); - projectLocationTextField = new javax.swing.JTextField(); - browseButton = new javax.swing.JButton(); - createdFolderLabel = new javax.swing.JLabel(); - createdFolderTextField = new javax.swing.JTextField(); - - projectNameLabel.setLabelFor(projectNameTextField); - org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_name")); // NOI18N - - projectLocationLabel.setLabelFor(projectLocationTextField); - org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_location")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.browse")); // NOI18N - browseButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - browseButtonActionPerformed(evt); - } - }); - - createdFolderLabel.setLabelFor(createdFolderTextField); - org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.project_folder")); // NOI18N - - createdFolderTextField.setEditable(false); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(projectNameLabel) - .addComponent(projectLocationLabel) - .addComponent(createdFolderLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(projectNameTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) - .addComponent(projectLocationTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) - .addComponent(createdFolderTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(browseButton) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(projectNameLabel) - .addComponent(projectNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(projectLocationLabel) - .addComponent(projectLocationTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(browseButton)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(createdFolderLabel) - .addComponent(createdFolderTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(213, Short.MAX_VALUE)) - ); - }// </editor-fold>//GEN-END:initComponents - - private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed - JFileChooser chooser = new JFileChooser(); - chooser.setCurrentDirectory(null); - chooser.setDialogTitle(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.select_project_location")); - chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - String path = this.projectLocationTextField.getText(); - if (path.length() > 0) { - File f = new File(path); - if (f.exists()) { - chooser.setSelectedFile(f); - } - } - if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { - File projectDir = chooser.getSelectedFile(); - projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath()); - } - panel.fireChangeEvent(); - - }//GEN-LAST:event_browseButtonActionPerformed - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton browseButton; - private javax.swing.JLabel createdFolderLabel; - private javax.swing.JTextField createdFolderTextField; - private javax.swing.JLabel projectLocationLabel; - private javax.swing.JTextField projectLocationTextField; - private javax.swing.JLabel projectNameLabel; - private javax.swing.JTextField projectNameTextField; - // End of variables declaration//GEN-END:variables - - @Override - public void addNotify() { - super.addNotify(); - //same problem as in 31086, initial focus on Cancel button - projectNameTextField.requestFocus(); - } - - boolean valid(WizardDescriptor wizardDescriptor) { - - if (projectNameTextField.getText().length() == 0) { - wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, - org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.invalid_folder_name")); - return false; // Display name not specified - } - File f = FileUtil.normalizeFile(new File(projectLocationTextField.getText()).getAbsoluteFile()); - if (!f.isDirectory()) { - String message = org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.invalid_path"); - wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, message); - return false; - } - final File destFolder = FileUtil.normalizeFile(new File(createdFolderTextField.getText()).getAbsoluteFile()); - - File projLoc = destFolder; - while (projLoc != null && !projLoc.exists()) { - projLoc = projLoc.getParentFile(); - } - if (projLoc == null || !projLoc.canWrite()) { - wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, - org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.folder_creation_error")); - return false; - } - - if (FileUtil.toFileObject(projLoc) == null) { - String message = org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.invalid_path"); - wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, message); - return false; - } - - File[] kids = destFolder.listFiles(); - if (destFolder.exists() && kids != null && kids.length > 0) { - // Folder exists and is not empty - wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, - org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.folder_exists")); - return false; - } - wizardDescriptor.putProperty(WIZARD_PANEL_ERROR_MESSAGE, ""); - return true; - } - - void store(WizardDescriptor d) { - String name = projectNameTextField.getText().trim(); - String folder = createdFolderTextField.getText().trim(); - - d.putProperty("projdir", new File(folder)); // NOI18N - d.putProperty("name", name); // NOI18N - } - - void read(WizardDescriptor settings) { - File projectLocation = (File) settings.getProperty("projdir"); // NOI18N - if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) { - projectLocation = ProjectChooser.getProjectsFolder(); - } else { - projectLocation = projectLocation.getParentFile(); - } - this.projectLocationTextField.setText(projectLocation.getAbsolutePath()); - - String projectName = (String) settings.getProperty("name"); // NOI18N - if(projectName == null) { - projectName = org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.default_prj_name"); - } - this.projectNameTextField.setText(projectName); - this.projectNameTextField.selectAll(); - } - - void validate(WizardDescriptor d) throws WizardValidationException { - // nothing to validate - } - - // Implementation of DocumentListener -------------------------------------- - - @Override - public void changedUpdate(DocumentEvent e) { - updateTexts(e); - if (this.projectNameTextField.getDocument() == e.getDocument()) { - firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText()); - } - } - - @Override - public void insertUpdate(DocumentEvent e) { - updateTexts(e); - if (this.projectNameTextField.getDocument() == e.getDocument()) { - firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText()); - } - } - - @Override - public void removeUpdate(DocumentEvent e) { - updateTexts(e); - if (this.projectNameTextField.getDocument() == e.getDocument()) { - firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText()); - } - } - - /** Handles changes in the Project name and project directory, */ - private void updateTexts(DocumentEvent e) { - - Document doc = e.getDocument(); - - if (doc == projectNameTextField.getDocument() || doc == projectLocationTextField.getDocument()) { - // Change in the project name - - String projectName = projectNameTextField.getText(); - String projectFolder = projectLocationTextField.getText(); - - //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) { - createdFolderTextField.setText(projectFolder + File.separatorChar + projectName); - //} - - } - panel.fireChangeEvent(); // Notify that the panel changed - } - -}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraPanel.java ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraPanel.java b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraPanel.java deleted file mode 100644 index 677cc89..0000000 --- a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraPanel.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ -package org.netbeans.modules.apisupport.crudsample; - -import java.awt.Component; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import org.netbeans.api.project.libraries.Library; -import org.openide.WizardDescriptor; -import org.openide.WizardValidationException; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * Panel just asking for basic info. - */ -public class SampleAppWizardExtraPanel implements WizardDescriptor.Panel, - WizardDescriptor.ValidatingPanel, WizardDescriptor.FinishablePanel { - - private WizardDescriptor wizardDescriptor; - private SampleAppWizardExtraVisual component; - - /** Creates a new instance of templateWizardPanel */ - public SampleAppWizardExtraPanel() { - } - - @Override - public Component getComponent() { - if (component == null) { - component = new SampleAppWizardExtraVisual(this); - component.setName(NbBundle.getMessage(SampleAppWizardExtraPanel.class, "LBL_CreatePersistenceStep")); - } - return component; - } - - @Override - public HelpCtx getHelp() { - return new HelpCtx(SampleAppWizardExtraPanel.class); - } - - @Override - public boolean isValid() { - getComponent(); - return component.valid(wizardDescriptor); - } - - private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); - @Override - public final void addChangeListener(ChangeListener l) { - synchronized (listeners) { - listeners.add(l); - } - } - @Override - public final void removeChangeListener(ChangeListener l) { - synchronized (listeners) { - listeners.remove(l); - } - } - protected final void fireChangeEvent() { - Iterator it; - synchronized (listeners) { - it = new HashSet<ChangeListener>(listeners).iterator(); - } - ChangeEvent ev = new ChangeEvent(this); - while (it.hasNext()) { - ((ChangeListener) it.next()).stateChanged(ev); - } - } - - @Override - public void readSettings(Object settings) { - wizardDescriptor = (WizardDescriptor) settings; - } - - @Override - public void storeSettings(Object settings) { - WizardDescriptor d = (WizardDescriptor) settings; - } - - @Override - public boolean isFinishPanel() { - return true; - } - - @Override - public void validate() throws WizardValidationException { - getComponent(); - component.validate(wizardDescriptor); - } - - public String getDerbyLocation() { - return component.getDerbyLocation(); - } - - public Library getSelectedLibrary() { - return component.getSelectedLibrary(); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.form ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.form b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.form deleted file mode 100644 index 4b31905..0000000 --- a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.form +++ /dev/null @@ -1,117 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="0"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lDerby" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lLibarary" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lDerbyHint" alignment="0" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <Component id="tfDerby" pref="202" max="32767" attributes="0"/> - <EmptySpace min="-2" pref="9" max="-2" attributes="1"/> - <Component id="bDerby" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="cbLibrary" pref="202" max="32767" attributes="0"/> - <EmptySpace min="-2" pref="79" max="-2" attributes="1"/> - </Group> - </Group> - <EmptySpace min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lDerby" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="tfDerby" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="bDerby" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="lDerbyHint" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lLibarary" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="cbLibrary" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="lDerby"> - <Properties> - <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor"> - <ComponentRef name="tfDerby"/> - </Property> - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> - <ResourceString bundle="org/netbeans/modules/apisupport/crudsample/Bundle.properties" key="SampleAppWizardExtraVisual.lDerby.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="tfDerby"> - <Properties> - <Property name="columns" type="int" value="280"/> - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> - <ResourceString bundle="org/netbeans/modules/apisupport/crudsample/Bundle.properties" key="SampleAppWizardExtraVisual.tfDerby.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="bDerby"> - <Properties> - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> - <ResourceString bundle="org/netbeans/modules/apisupport/crudsample/Bundle.properties" key="SampleAppWizardExtraVisual.bDerby.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - </Property> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bDerbyActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="lDerbyHint"> - <Properties> - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> - <ResourceString bundle="org/netbeans/modules/apisupport/crudsample/Bundle.properties" key="SampleAppWizardExtraVisual.lDerbyHint.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lLibarary"> - <Properties> - <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor"> - <ComponentRef name="cbLibrary"/> - </Property> - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> - <ResourceString bundle="org/netbeans/modules/apisupport/crudsample/Bundle.properties" key="SampleAppWizardExtraVisual.lLibarary.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JComboBox" name="cbLibrary"> - <Properties> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="0"/> - </Property> - </Properties> - </Component> - </SubComponents> -</Form> http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.java ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.java b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.java deleted file mode 100644 index 9d29563..0000000 --- a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardExtraVisual.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 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]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - * - * Portions Copyrighted 2010 Sun Microsystems, Inc. - */ - -package org.netbeans.modules.apisupport.crudsample; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JFileChooser; -import javax.swing.JPanel; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import org.netbeans.api.project.libraries.Library; -import org.netbeans.api.project.libraries.LibraryManager; -import org.netbeans.modules.derby.spi.support.DerbySupport; -import org.openide.WizardDescriptor; -import org.openide.filesystems.FileUtil; - -/** - * - * @author jirka - */ -public class SampleAppWizardExtraVisual extends JPanel implements DocumentListener { - public static final String[] SUPPORTED_PU_LIBRARIES = new String[] {"eclipselink"}; - public static final String JAVADB_HOME = "javadb.home"; - - private final SampleAppWizardExtraPanel panel; - private Map<String, Library> dn2lib = new HashMap<String, Library>(); - - /** Creates new form SampleAppWizardExtraPanelVisual */ - @SuppressWarnings("LeakingThisInConstructor") - public SampleAppWizardExtraVisual(SampleAppWizardExtraPanel panel) { - initComponents(); - this.panel = panel; - this.cbLibrary.setModel(new DefaultComboBoxModel(getLibrariesDN())); - this.tfDerby.setText(getDerbyInstallation()); - this.tfDerby.getDocument().addDocumentListener(this); - } - - /** 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. - */ - @SuppressWarnings("unchecked") - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { - - lDerby = new javax.swing.JLabel(); - tfDerby = new javax.swing.JTextField(); - bDerby = new javax.swing.JButton(); - lDerbyHint = new javax.swing.JLabel(); - lLibarary = new javax.swing.JLabel(); - cbLibrary = new javax.swing.JComboBox(); - - lDerby.setLabelFor(tfDerby); - org.openide.awt.Mnemonics.setLocalizedText(lDerby, org.openide.util.NbBundle.getMessage(SampleAppWizardExtraVisual.class, "SampleAppWizardExtraVisual.lDerby.text")); // NOI18N - - tfDerby.setColumns(280); - tfDerby.setText(org.openide.util.NbBundle.getMessage(SampleAppWizardExtraVisual.class, "SampleAppWizardExtraVisual.tfDerby.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(bDerby, org.openide.util.NbBundle.getMessage(SampleAppWizardExtraVisual.class, "SampleAppWizardExtraVisual.bDerby.text")); // NOI18N - bDerby.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - bDerbyActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(lDerbyHint, org.openide.util.NbBundle.getMessage(SampleAppWizardExtraVisual.class, "SampleAppWizardExtraVisual.lDerbyHint.text")); // NOI18N - - lLibarary.setLabelFor(cbLibrary); - org.openide.awt.Mnemonics.setLocalizedText(lLibarary, org.openide.util.NbBundle.getMessage(SampleAppWizardExtraVisual.class, "SampleAppWizardExtraVisual.lLibarary.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lDerby) - .addComponent(lLibarary)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lDerbyHint) - .addGroup(layout.createSequentialGroup() - .addComponent(tfDerby, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE) - .addGap(9, 9, 9) - .addComponent(bDerby)) - .addGroup(layout.createSequentialGroup() - .addComponent(cbLibrary, 0, 202, Short.MAX_VALUE) - .addGap(79, 79, 79))) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lDerby) - .addComponent(tfDerby, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(bDerby)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(lDerbyHint) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lLibarary) - .addComponent(cbLibrary, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - }// </editor-fold>//GEN-END:initComponents - - private void bDerbyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bDerbyActionPerformed - JFileChooser chooser = new JFileChooser(); - chooser.setCurrentDirectory(null); - chooser.setDialogTitle(org.openide.util.NbBundle.getMessage(SampleAppPanelVisual.class, "SampleAppPanelVisual.select_derby_location")); - chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - String path = this.tfDerby.getText(); - if (path.length() > 0) { - File f = new File(path); - if (f.exists()) { - chooser.setSelectedFile(f); - } - } - if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { - File projectDir = chooser.getSelectedFile(); - tfDerby.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath()); - } - panel.fireChangeEvent(); - }//GEN-LAST:event_bDerbyActionPerformed - - @Override - public void insertUpdate(DocumentEvent e) { - panel.fireChangeEvent(); - } - - @Override - public void removeUpdate(DocumentEvent e) { - panel.fireChangeEvent(); - } - - @Override - public void changedUpdate(DocumentEvent e) { - panel.fireChangeEvent(); - } - - boolean valid(WizardDescriptor wizardDescriptor) { - if (! validateDerby(tfDerby.getText())) { - if (wizardDescriptor != null) { - wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, - org.openide.util.NbBundle.getMessage(SampleAppWizardExtraVisual.class, "SampleAppWizardExtraVisual.invalid_derby_location")); - } - return false; - } else if (! validatePersistenceLibrary()) { - if (wizardDescriptor != null) { - wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, - org.openide.util.NbBundle.getMessage(SampleAppWizardExtraVisual.class, "SampleAppWizardExtraVisual.invalid_persistence_libraries")); - } - return false; - } else { - if (wizardDescriptor != null) { - wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, null); - } - return true; - } - } - - void validate(WizardDescriptor wizardDescriptor) {} - - private String[] getLibrariesDN() { - List<String> res = new ArrayList<String>(); - for (String name : SUPPORTED_PU_LIBRARIES) { - Library l = LibraryManager.getDefault().getLibrary(name); - Logger.getLogger(SampleAppWizardExtraVisual.class.getName()).log(Level.FINE, "Name {0} has library {1}", new Object[]{name, l}); - if (l != null) { - res.add(l.getDisplayName()); - dn2lib.put(l.getDisplayName(), l); - } - } - return res.toArray(new String[0]); - } - - private Library getLibrary(String dn) { - assert dn2lib.get(dn) != null : "Library " + dn + " found in " + dn2lib; - return dn2lib.get(dn); - } - - private static String getDerbyInstallation() { - File f = null; - String javaDBHome = System.getProperty(JAVADB_HOME); - Logger.getLogger(SampleAppWizardExtraVisual.class.getName()).finest("System.getProperty(\"javadb.home\") returns " + javaDBHome); - if (javaDBHome == null) { - String javaDBLoc = DerbySupport.getLocation(); - Logger.getLogger(SampleAppWizardExtraVisual.class.getName()).finer("DerbySupport.getLocation() returns " + javaDBLoc); - if (javaDBLoc != null && javaDBLoc.length() > 0) { - f = new File(javaDBLoc); - } - if (f == null || ! f.exists()) { - // fallback to JDK6 - String javaHome = System.getProperty("java.home"); - // path to JavaDB in JDK6 - f = new File(javaHome + File.separator + ".." + File.separator + "db" + File.separator); - Logger.getLogger(SampleAppWizardExtraVisual.class.getName()).finer("JavaDB in JDK6 is " + f); - } - } else { - f = new File(javaDBHome); - } - String path; - try { - path = f != null && f.exists() ? f.getCanonicalPath() : null; - } catch (IOException ex) { - path = f != null && f.exists() ? f.getAbsolutePath() : null; - } - Logger.getLogger(SampleAppWizardExtraVisual.class.getName()).fine("Java DB installation is " + path); - return path; - } - - private static boolean validateDerby(String path) { - boolean res = path != null; - if (res) { - File dir = new File(path); - res = dir.exists() && dir.isDirectory(); - if (res) { - // finding derbyclient - File f = new File(dir, "lib" + File.separator + "derbyclient.jar"); - res = f.exists() && f.isFile(); - } - } - return res; - } - - private boolean validatePersistenceLibrary() { - return getLibrariesDN().length > 0; - // XXX: maybe also check if drivers really exist - } - - String getDerbyLocation() { - assert validateDerby(tfDerby.getText()) : "DB Location " + tfDerby.getText() + " must contain lib/derbyclient.jar"; - return tfDerby.getText(); - } - - Library getSelectedLibrary() { - assert getLibrary((String) cbLibrary.getSelectedItem()) != null : "Some Persistence Library must found."; - Logger.getLogger(SampleAppWizardExtraVisual.class.getName()).log(Level.FINE, - "Selected library in {0} is {1}", new Object[]{cbLibrary.getSelectedItem(), getLibrary((String) cbLibrary.getSelectedItem())}); - return getLibrary((String) cbLibrary.getSelectedItem()); - } - - - // Variables declaration - do not modify//GEN-BEGIN:variables - javax.swing.JButton bDerby; - javax.swing.JComboBox cbLibrary; - javax.swing.JLabel lDerby; - javax.swing.JLabel lDerbyHint; - javax.swing.JLabel lLibarary; - javax.swing.JTextField tfDerby; - // End of variables declaration//GEN-END:variables - -} http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardIterator.java ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardIterator.java b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardIterator.java deleted file mode 100755 index 43b9c16..0000000 --- a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardIterator.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ -package org.netbeans.modules.apisupport.crudsample; - -import java.awt.Component; -import java.io.File; -import java.io.FileFilter; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Properties; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; -import javax.swing.JComponent; -import javax.swing.event.ChangeListener; -import org.netbeans.api.project.ProjectManager; -import org.netbeans.api.project.libraries.Library; -import org.netbeans.spi.project.ui.support.ProjectChooser; -import org.netbeans.spi.project.ui.templates.support.Templates; -import org.openide.WizardDescriptor; -import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileUtil; -import org.openide.filesystems.URLMapper; -import org.openide.util.NbBundle; -import org.openide.xml.XMLUtil; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class SampleAppWizardIterator implements WizardDescriptor.InstantiatingIterator { - - private static final long serialVersionUID = 1L; - - private transient int index; - private transient WizardDescriptor.Panel[] panels; - private transient WizardDescriptor wiz; - private SampleAppWizardExtraPanel configurationPanel; - - public SampleAppWizardIterator() {} - - public static SampleAppWizardIterator createIterator() { - return new SampleAppWizardIterator(); - } - - private WizardDescriptor.Panel[] createPanels() { - configurationPanel = new SampleAppWizardExtraPanel(); - return new WizardDescriptor.Panel[] { - new SampleAppWizardPanel(configurationPanel.isValid()), - configurationPanel - }; - } - - private String[] createSteps() { - return new String[] { - NbBundle.getMessage(SampleAppWizardIterator.class, "LBL_CreateProjectStep"), // NOI18N - NbBundle.getMessage(SampleAppWizardIterator.class, "LBL_CreatePersistenceStep"), // NOI18N - }; - } - - @Override - public Set/*<FileObject>*/ instantiate() throws IOException { - Set<FileObject> resultSet = new LinkedHashSet<FileObject>(); - File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir")); // NOI18N - dirF.mkdirs(); - - FileObject template = Templates.getTemplate(wiz); - FileObject dir = FileUtil.toFileObject(dirF); - - // 1) unzip - unZipFile(template.getInputStream(), dir); - try { - // 2) copy persistence libraries - copyPersistenceLibraries(configurationPanel.getSelectedLibrary(), dir); - } catch (URISyntaxException ex) { - throw new IOException(ex); - } catch (IllegalStateException ex) { - throw new IOException(ex); - } - - // 3) set DB location in Derby module - configureDerby(configurationPanel.getDerbyLocation(), dir); - - // Always open top dir as a project: - resultSet.add(dir); - // Look for nested projects to open as well: - Enumeration e = dir.getFolders(true); - while (e.hasMoreElements()) { - FileObject subfolder = (FileObject) e.nextElement(); - if (ProjectManager.getDefault().isProject(subfolder)) { - resultSet.add(subfolder); - } - } - - File parent = dirF.getParentFile(); - if (parent != null && parent.exists()) { - ProjectChooser.setProjectsFolder(parent); - } - - return resultSet; - } - - @Override - public void initialize(WizardDescriptor wiz) { - this.wiz = wiz; - index = 0; - panels = createPanels(); - // Make sure list of steps is accurate. - String[] steps = createSteps(); - for (int i = 0; i < panels.length; i++) { - Component c = panels[i].getComponent(); - if (steps[i] == null) { - // Default step name to component name of panel. - // Mainly useful for getting the name of the target - // chooser to appear in the list of steps. - steps[i] = c.getName(); - } - if (c instanceof JComponent) { // assume Swing components - JComponent jc = (JComponent) c; - // Step #. - jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N - // Step name (actually the whole list for reference). - jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N - } - } - } - - @Override - public void uninitialize(WizardDescriptor wiz) { - this.wiz.putProperty("projdir",null); // NOI18N - this.wiz.putProperty("name",null); // NOI18N - this.wiz = null; - panels = null; - } - - @Override - public String name() { - return NbBundle.getMessage(SampleAppWizardIterator.class, "SampleAppWizardIterator.name.format", // NOI18N - new Object[] {new Integer(index + 1), new Integer(panels.length)}); - } - - @Override - public boolean hasNext() { - return index < panels.length - 1; - } - - @Override - public boolean hasPrevious() { - return index > 0; - } - - @Override - public void nextPanel() { - if (!hasNext()) { - throw new NoSuchElementException(); - } - index++; - } - - @Override - public void previousPanel() { - if (!hasPrevious()) { - throw new NoSuchElementException(); - } - index--; - } - - @Override - public WizardDescriptor.Panel current() { - return panels[index]; - } - - // If nothing unusual changes in the middle of the wizard, simply: - @Override - public final void addChangeListener(ChangeListener l) {} - @Override - public final void removeChangeListener(ChangeListener l) {} - - private static void unZipFile(InputStream source, FileObject projectRoot) throws IOException { - try { - ZipInputStream str = new ZipInputStream(source); - ZipEntry entry; - while ((entry = str.getNextEntry()) != null) { - if (entry.isDirectory()) { - FileUtil.createFolder(projectRoot, entry.getName()); - } else { - FileObject fo = FileUtil.createData(projectRoot, entry.getName()); - OutputStream out = fo.getOutputStream(); - try { - FileUtil.copy(str, out); - } finally { - out.close(); - } - } - } - } finally { - source.close(); - } - } - - private void copyPersistenceLibraries(Library l, FileObject projectRoot) throws URISyntaxException, IllegalStateException, FileNotFoundException, IOException { - // 1) source libraries - List<FileObject> libs = new ArrayList<FileObject>(); - for (URL url : l.getContent("classpath")) { //NOI18N - FileObject fo = URLMapper.findFileObject(url); - Logger.getLogger(SampleAppWizardIterator.class.getName()).log(Level.FINE, "Libary {0} has jar: {1}", new Object[]{l.getName(), fo}); - FileObject jarFO = null; - if ("jar".equals(url.getProtocol())) { //NOI18N - jarFO = FileUtil.getArchiveFile(fo); - } - if (jarFO == null) { - throw new IllegalStateException("No file object on " + url); - } - libs.add(jarFO); - } - - // 2) target place - File targetFile = new File(FileUtil.toFile(projectRoot), "CustomerDBAccessLibrary" + File.separator + "external"); // NOI18N - targetFile.mkdirs(); - FileObject targetFO = FileUtil.toFileObject(targetFile); - - // 3) copying - for (FileObject fo : libs) { - File f = FileUtil.toFile(fo); - Logger.getLogger(SampleAppWizardIterator.class.getName()).log(Level.FINE, "Copy {0} in {1} as {2}", new Object[]{fo, targetFO, f.getName()}); - FileUtil.copyFile(fo, targetFO, fo.getName()); - } - - // 4) modify project.xml with native jars names - File projectXMLFile = new File(FileUtil.toFile(projectRoot), "CustomerDBAccessLibrary" + File.separator + // NOI18N - "nbproject" + File.separator + "project.xml"); // NOI18N - FileObject projectXMLFO = FileUtil.toFileObject(projectXMLFile); - - Set<String> publicPackages = new HashSet<String> (); - Collections.addAll(publicPackages, "demo", - "javax.persistence", - "javax.persistence.spi", - "javax.persistence.metamodel", - "javax.persistence.criteria", - "org.netbeans.modules.customerdb"); // NOI18N - Map<String, String> cp2origin = new HashMap<String, String>(libs.size()); - // add wrapping project CustomerDBAccess - cp2origin.put("ext/CustomerDBAccess.jar", "../CustomerDBAccess/dist/CustomerDBAccess.jar"); // NOI18N - for (FileObject jar : libs) { - String cp = "ext/persistence/" + jar.getNameExt(); // NOI18N - String origin = "external/" + jar.getNameExt(); // NOI18N - cp2origin.put(cp, origin); - } - Map<String, String> dep2version = new HashMap<String, String> (); - dep2version.put("org.netbeans.modules.derbyclientlibrary", "1.1"); // NOI18N - dep2version.put("org.openide.execution", "9.0"); // NOI18N - dep2version.put("org.openide.util", "9.3"); // NOI18N - generateLibraryModuleTemplate(projectXMLFO, "org.netbeans.modules.customerdb", // NOI18N - publicPackages, - cp2origin, - dep2version); - Logger.getLogger(SampleAppWizardIterator.class.getName()).log(Level.FINE, "project.xml file written : {0}", new Object[]{projectXMLFO}); // NOI18N - - // 5) modify $persistencelibrary.xml to persistence.xml - File libraryConfFile = new File(FileUtil.toFile(projectRoot), "CustomerDBAccess" + File.separator + // NOI18N - "src" + File.separator + "META-INF" + File.separator + l.getName() + ".xml"); // NOI18N - Logger.getLogger(SampleAppWizardIterator.class.getName()).log(Level.FINE, "META-INF/peristence.xml found at {0}", new Object[]{libraryConfFile}); - assert libraryConfFile.exists() : libraryConfFile + " exists."; // NOI18N - final File persistenceConfFile = new File(libraryConfFile.getParent(), "persistence.xml"); // NOI18N - libraryConfFile.renameTo(persistenceConfFile); - // remove other xml containing persistence info - for (File f : libraryConfFile.getParentFile().listFiles(new FileFilter() { - @Override - public boolean accept(File pathname) { - return pathname.isFile() && pathname.getName().endsWith(".xml") && ! persistenceConfFile.equals(pathname); // - } - })) { - f.delete(); - } - } - - private void configureDerby(String loc, FileObject projectRoot) throws FileNotFoundException, IOException { - File projectPropertiesFile = new File(FileUtil.toFile(projectRoot), "derbyclient-library" + File.separator + // NOI18N - "nbproject" + File.separator + "project.properties"); // NOI18N - FileObject projectPropertiesFO = FileUtil.toFileObject(projectPropertiesFile); - Properties projectProperties = new Properties(); - InputStream inputStream = null; - try { - inputStream = projectPropertiesFO.getInputStream(); - projectProperties.load(inputStream); - } finally { - if (inputStream != null) { - inputStream.close(); - } - } - projectProperties.setProperty("derbyclient.jar", loc + "/lib/derbyclient.jar"); // NOI18N - OutputStream outputStream = null; - try { - outputStream = projectPropertiesFO.getOutputStream(); - projectProperties.store(outputStream, null); - } finally { - if (outputStream != null) { - outputStream.close(); - } - } - Logger.getLogger(SampleAppWizardIterator.class.getName()).log(Level.FINE, "derbyclient.jar location in project.properties is {0}", new Object[]{loc + "/lib/derbyclient.jar"}); - - File bundleFile = new File(FileUtil.toFile(projectRoot), "CustomerDBAccessLibrary" + File.separator + // NOI18N - "src" + File.separator + // NOI18N - "org" + File.separator + // NOI18N - "netbeans" + File.separator + // NOI18N - "modules" + File.separator + // NOI18N - "customerdb" + File.separator + // NOI18N - "Bundle.properties"); // NOI18N - FileObject bundleFO = FileUtil.toFileObject(bundleFile); - Properties bundleProperties = new Properties(); - inputStream = null; - try { - inputStream = bundleFO.getInputStream(); - bundleProperties.load(inputStream); - } finally { - if (inputStream != null) { - inputStream.close(); - } - } - bundleProperties.setProperty("javadb.home", loc); // NOI18N - outputStream = null; - try { - outputStream = bundleFO.getOutputStream(); - bundleProperties.store(outputStream, null); - } finally { - if (outputStream != null) { - outputStream.close(); - } - } - Logger.getLogger(SampleAppWizardIterator.class.getName()).log(Level.FINE, "JavaDB home is {0}", new Object[]{loc}); - } - - /** - * Create a library wrapper project.xml. - * - * @param publicPackages set of <code>String</code>s representing the packages - * @param extensions <key=runtime path(String), value=binary path (String)> - * - * XXX: copy of apisupport.project/src/org/netbeans/modules/apisupport/project/ProjectXMLManager.java - */ - private static void generateLibraryModuleTemplate(FileObject projectXml, String cnb, - Set<String> publicPackages, Map<String,String> extensions, Map<String, String> dep2version) throws IOException { - - Document prjDoc = XMLUtil.createDocument("project", "http://www.netbeans.org/ns/project/1", null, null); // NOI18N - - // generate general project elements - Element typeEl = prjDoc.createElementNS("http://www.netbeans.org/ns/project/1", "type"); // NOI18N - typeEl.appendChild(prjDoc.createTextNode("org.netbeans.modules.apisupport.project")); // NOI18N - prjDoc.getDocumentElement().appendChild(typeEl); - Element confEl = prjDoc.createElementNS("http://www.netbeans.org/ns/project/1", "configuration"); // NOI18N - prjDoc.getDocumentElement().appendChild(confEl); - - // generate NB Module project type specific elements - Element dataEl = createModuleElement(confEl.getOwnerDocument(), "data"); // NOI18N - confEl.appendChild(dataEl); - Document dataDoc = dataEl.getOwnerDocument(); - dataEl.appendChild(createModuleElement(dataDoc, "code-name-base", cnb)); // NOI18N - Element moduleTypeEl = createModuleElement(dataDoc, "suite-component"); // NOI18N - if (moduleTypeEl != null) { - dataEl.appendChild(moduleTypeEl); - } - Element moduleDependeciesElement = createModuleElement(dataDoc, "module-dependencies"); // NOI18N - if (dep2version != null && ! dep2version.isEmpty()) { - for (String dep : dep2version.keySet()) { - createModuleDependencyElement(moduleDependeciesElement, dep, dep2version.get(dep)); - } - } - dataEl.appendChild(moduleDependeciesElement); - Element packages = createModuleElement(dataDoc, "public-packages"); // NOI18N - dataEl.appendChild(packages); - for (String pkg : publicPackages) { - packages.appendChild(createModuleElement(dataDoc, "package", pkg)); // NOI18N - } - for (Map.Entry<String,String> entry : extensions.entrySet()) { - Element cp = createModuleElement(dataDoc, "class-path-extension"); // NOI18N - dataEl.appendChild(cp); - cp.appendChild(createModuleElement(dataDoc, "runtime-relative-path", entry.getKey())); // NOI18N - cp.appendChild(createModuleElement(dataDoc, "binary-origin", entry.getValue())); // NOI18N - } - - // store document to disk - OutputStream os = projectXml.getOutputStream(); - try { - XMLUtil.write(prjDoc, os, "UTF-8"); // NOI18N - } finally { - os.close(); - } - } - - static void createModuleDependencyElement( - Element moduleDependencies, String depCNB, String depSV) { - - Document doc = moduleDependencies.getOwnerDocument(); - Element modDepEl = createModuleElement(doc, "dependency"); // NOI18N - moduleDependencies.insertBefore(modDepEl, null); - - modDepEl.appendChild(createModuleElement(doc, "code-name-base", depCNB)); // NOI18N - if (depCNB.startsWith("org.openide")) { // NOI18N - modDepEl.appendChild(createModuleElement(doc, "build-prerequisite")); // NOI18N - modDepEl.appendChild(createModuleElement(doc, "compile-dependency")); // NOI18N - } - - Element runDepEl = createModuleElement(doc, "run-dependency"); // NOI18N - modDepEl.appendChild(runDepEl); - - if (depSV != null && ! "".equals(depSV)) { // NOI18N - runDepEl.appendChild(createModuleElement( - doc, "specification-version", depSV)); // NOI18N - } - } - - private static Element createModuleElement(Document doc, String name) { - return doc.createElementNS("http://www.netbeans.org/ns/nb-module-project/3", name); // NOI18N - } - - private static Element createModuleElement(Document doc, String name, String innerText) { - Element el = createModuleElement(doc, name); - el.appendChild(doc.createTextNode(innerText)); - return el; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardPanel.java ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardPanel.java b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardPanel.java deleted file mode 100755 index 62d5e00..0000000 --- a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/SampleAppWizardPanel.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ -package org.netbeans.modules.apisupport.crudsample; - -import java.awt.Component; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import org.openide.WizardDescriptor; -import org.openide.WizardValidationException; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * Panel just asking for basic info. - */ -public class SampleAppWizardPanel implements WizardDescriptor.Panel, - WizardDescriptor.ValidatingPanel, WizardDescriptor.FinishablePanel { - - private WizardDescriptor wizardDescriptor; - private SampleAppPanelVisual component; - private final boolean isFinishPanel; - - /** Creates a new instance of templateWizardPanel */ - public SampleAppWizardPanel(boolean isFinishPanel) { - this.isFinishPanel = isFinishPanel; - } - - @Override - public Component getComponent() { - if (component == null) { - component = new SampleAppPanelVisual(this); - component.setName(NbBundle.getMessage(SampleAppWizardPanel.class, "LBL_CreateProjectStep")); - } - return component; - } - - @Override - public HelpCtx getHelp() { - return null; - } - - @Override - public boolean isValid() { - getComponent(); - return component.valid(wizardDescriptor); - } - - private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); - @Override - public final void addChangeListener(ChangeListener l) { - synchronized (listeners) { - listeners.add(l); - } - } - @Override - public final void removeChangeListener(ChangeListener l) { - synchronized (listeners) { - listeners.remove(l); - } - } - protected final void fireChangeEvent() { - Iterator it; - synchronized (listeners) { - it = new HashSet<ChangeListener>(listeners).iterator(); - } - ChangeEvent ev = new ChangeEvent(this); - while (it.hasNext()) { - ((ChangeListener) it.next()).stateChanged(ev); - } - } - - @Override - public void readSettings(Object settings) { - wizardDescriptor = (WizardDescriptor) settings; - component.read(wizardDescriptor); - wizardDescriptor.putProperty("NewProjectWizard_Title", //NOI18N - NbBundle.getMessage(SampleAppWizardPanel.class, - "Templates/Project/Samples/ApiSupport/SampleCRUDAppProject.zip")); //NOI18N - } - - @Override - public void storeSettings(Object settings) { - WizardDescriptor d = (WizardDescriptor) settings; - component.store(d); - d.putProperty("NewProjectWizard_Title", null); //NOI18N - } - - @Override - public boolean isFinishPanel() { - return isFinishPanel; - } - - @Override - public void validate() throws WizardValidationException { - getComponent(); - component.validate(wizardDescriptor); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/layer.xml ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/layer.xml b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/layer.xml deleted file mode 100755 index 0c98f39..0000000 --- a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/layer.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd"> -<!-- -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. - -Oracle and Java are registered trademarks of Oracle and/or its affiliates. -Other names may be trademarks of their respective owners. - - -The contents of this file are subject to the terms of either the GNU -General Public License Version 2 only ("GPL") or the Common -Development and Distribution License("CDDL") (collectively, the -"License"). You may not use this file except in compliance with the -License. You can obtain a copy of the License at -http://www.netbeans.org/cddl-gplv2.html -or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the -specific language governing permissions and limitations under the -License. When distributing the software, include this License Header -Notice in each file and include the License file at -nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this -particular file as subject to the "Classpath" exception as provided -by Oracle in the GPL Version 2 section of the License file that -accompanied this code. If applicable, add the following below the -License Header, with the fields enclosed by brackets [] replaced by -your own identifying information: -"Portions Copyrighted [year] [name of copyright owner]" - -Contributor(s): - -The Original Software is NetBeans. The Initial Developer of the Original -Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun -Microsystems, Inc. All Rights Reserved. - -If you wish your version of this file to be governed by only the CDDL -or only the GPL Version 2, indicate your decision by adding -"[Contributor] elects to include this software in this distribution -under the [CDDL or GPL Version 2] license." If you do not indicate a -single choice of license, a recipient has the option to distribute -your version of this file under either the CDDL, the GPL Version 2 or -to extend the choice of license to its licensees as provided above. -However, if you add GPL Version 2 code and therefore, elected the GPL -Version 2 license, then the option applies only if the new code is -made subject to such option by the copyright holder. ---> -<filesystem> - <folder name="Templates"> - <folder name="Project"> - <folder name="Samples"> - <folder name="ApiSupport"> - <file name="SampleCRUDAppProject.zip" url="SampleCRUDAppProject.zip"> - <!--<attr name="position" intvalue="300"/>--> - <attr name="position" intvalue="3000"/> - <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/apisupport/crudsample/sampleCRUD.png"/> - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.apisupport.crudsample.Bundle"/> - <attr name="instantiatingIterator" methodvalue="org.netbeans.modules.apisupport.crudsample.SampleAppWizardIterator.createIterator"/> - <attr name="instantiatingWizardURL" urlvalue="nbresloc:/org/netbeans/modules/apisupport/crudsample/SampleAppDescription.html"/> - <attr name="template" boolvalue="true"/> - </file> - </folder> - </folder> - </folder> - </folder> -</filesystem> http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/sampleCRUD.png ---------------------------------------------------------------------- diff --git a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/sampleCRUD.png b/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/sampleCRUD.png deleted file mode 100755 index c938743..0000000 Binary files a/apisupport.crudsample/src/org/netbeans/modules/apisupport/crudsample/sampleCRUD.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.feedreader/build.xml ---------------------------------------------------------------------- diff --git a/apisupport.feedreader/build.xml b/apisupport.feedreader/build.xml deleted file mode 100644 index a0b74b1..0000000 --- a/apisupport.feedreader/build.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -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. ---> -<project name="apisupport.feedreader" default="netbeans" basedir="."> - <import file="../nbbuild/templates/projectized.xml"/> - - <target name="jar" depends="zip-project,projectized-common.jar"/> - - <target name="zip-project" depends="init"> - <mkdir dir="build/substituted-project-metadata"/> - <copy todir="build/substituted-project-metadata"> - <fileset dir="feedreader-suite"> - <include name="jdom/nbproject/project.xml"/> - <include name="rome/nbproject/project.xml"/> - <include name="rome-fetcher/nbproject/project.xml"/> - </fileset> - <filterchain> - <replacestring from="binary-origin>../../external/" to="binary-origin>release/modules/ext/"/> - </filterchain> - </copy> - <property name="examples" location="${build.classes.dir}/org/netbeans/modules/apisupport/feedreader/"/> - <mkdir dir="${examples}"/> - <zip basedir="feedreader-suite" destfile="${examples}/FeedReaderProject.zip"> - <exclude name="**/build/"/> - <exclude name="**/dist/"/> - <exclude name="**/nbproject/private/"/> - <exclude name="jdom/nbproject/project.xml"/> - <exclude name="rome/nbproject/project.xml"/> - <exclude name="rome-fetcher/nbproject/project.xml"/> - <fileset dir="build/substituted-project-metadata"/> - <zipfileset dir="external" prefix="rome/release/modules/ext/" > - <include name="rome-0.6.jar" /> - <include name="rome-0.6-license.txt" /> - </zipfileset> - <zipfileset dir="external" prefix="rome-fetcher/release/modules/ext/" > - <include name="rome-fetcher-0.6.jar" /> - <include name="rome-fetcher-0.6-license.txt" /> - </zipfileset> - <zipfileset dir="external" prefix="jdom/release/modules/ext/" > - <include name="jdom-1.0.jar" /> - <include name="jdom-1.0-license.txt" /> - </zipfileset> - </zip> - </target> - -</project> http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.feedreader/external/binaries-list ---------------------------------------------------------------------- diff --git a/apisupport.feedreader/external/binaries-list b/apisupport.feedreader/external/binaries-list deleted file mode 100644 index 2ba5c4d..0000000 --- a/apisupport.feedreader/external/binaries-list +++ /dev/null @@ -1,3 +0,0 @@ -A2AC1CD690AB4C80DEFE7F9BCE14D35934C35CEC jdom-1.0.jar -EA66BB8EBA805BAD567DB5A6730F96AC89062601 rome-0.6.jar -7408D747109A701926646E859C8907D3A7C9B26E rome-fetcher-0.6.jar http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/b7aa832e/apisupport.feedreader/external/jdom-1.0-license.txt ---------------------------------------------------------------------- diff --git a/apisupport.feedreader/external/jdom-1.0-license.txt b/apisupport.feedreader/external/jdom-1.0-license.txt deleted file mode 100644 index 091178b..0000000 --- a/apisupport.feedreader/external/jdom-1.0-license.txt +++ /dev/null @@ -1,56 +0,0 @@ -Name: JDOM -Version: 1.0 -Description: Java API for XML manipulation. -License: Apache-JDOM -OSR: 3391 -Origin: http://www.jdom.org/dist/binary/jdom-1.0.tar.gz - -Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions, and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions, and the disclaimer that follows - these conditions in the documentation and/or other materials - provided with the distribution. - -3. The name "JDOM" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact <request_AT_jdom_DOT_org>. - -4. Products derived from this software may not be called "JDOM", nor - may "JDOM" appear in their name, without prior written permission - from the JDOM Project Management <request_AT_jdom_DOT_org>. - -In addition, we request (but do not require) that you include in the -end-user documentation provided with the redistribution and/or in the -software itself an acknowledgement equivalent to the following: - "This product includes software developed by the - JDOM Project (http://www.jdom.org/)." -Alternatively, the acknowledgment may be graphical using the logos -available at http://www.jdom.org/images/logos. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -This software consists of voluntary contributions made by many -individuals on behalf of the JDOM Project and was originally -created by Jason Hunter <jhunter_AT_jdom_DOT_org> and -Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information -on the JDOM Project, please see <http://www.jdom.org/>.
