incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ar...@apache.org
Subject svn commit: r1236486 [30/43] - in /incubator/ooo/devtools/netbeansintegration: ./ build/ build/public-package-jars/ javahelp/ javahelp/org/ javahelp/org/openoffice/ javahelp/org/openoffice/extensions/ javahelp/org/openoffice/extensions/docs/ javahelp/o...
Date Fri, 27 Jan 2012 01:29:58 GMT
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/StructDataTypePanel.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/StructDataTypePanel.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/StructDataTypePanel.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/StructDataTypePanel.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: StructDataTypePanel.java,v $
+ *
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/08/15 13:45:12 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+
+package org.openoffice.extensions.projecttemplates.component.dialogs;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.MissingResourceException;
+import javax.swing.tree.TreeSelectionModel;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.propertysheet.PropertySheet;
+import org.openide.explorer.view.BeanTreeView;
+import org.openide.nodes.Node;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.component.*;
+import org.openoffice.extensions.projecttemplates.component.datamodel.types.node.IdlTypeTreeCreator;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.datamodel.Struct;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author  sg128468
+ */
+public class StructDataTypePanel extends javax.swing.JPanel 
+        implements ExplorerManager.Provider, PropertyChangeListener {
+    
+    private ExplorerManager manager = new ExplorerManager();
+    private PropertySheet propSheet;
+
+    private ChangeEventPanel panel;    
+    private Node node;
+
+    // all actions that can be done here
+    private ComponentActions actions;
+    private String oldName; 
+    private boolean edit;
+
+    private ValidateDataType dialog;
+    
+    /**
+     * Creates new form InterfaceDataTypeDialog
+     */
+    public StructDataTypePanel(ValidateDataType dialog, DialogProperties props) {
+        initComponents();
+        this.edit = props.getBooleanProperty(props.EDIT);
+        String pkgName = props.getStringProperty(props.PKG);
+        String name = props.getStringProperty(props.NAME);
+        
+        this.panel = (ChangeEventPanel)props.getProperty(props.PANEL);
+        this.dialog = dialog;
+        this.actions = new ComponentActions(manager, panel);
+
+        if (edit) {
+            node = (Node)props.getProperty(props.NODE);
+            NbNodeObject ob = (NbNodeObject)node.getLookup().lookup(NbNodeObject.class);
+            oldName = ob.getDisplayName();
+        }
+        else {
+            if (name == null) name = "Struct"; // NOI18N
+            node = (Node)IdlTypeTreeCreator.createInitialStructTree(name, pkgName);
+        }
+        manager.setRootContext(node);
+        
+        manager.addPropertyChangeListener(this);
+        
+        propSheet = (PropertySheet)jPanel1;
+        propSheet.setNodes(new Node[]{node});
+
+        BeanTreeView componentView = (BeanTreeView)jScrollPane1;
+        componentView.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+    }
+    
+    /** 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() {
+        jSplitPane1 = new javax.swing.JSplitPane();
+        jPanel1 = new PropertySheet();
+        jScrollPane1 = new BeanTreeView();
+        addFunctionjButton = new javax.swing.JButton();
+        deletejButton = new javax.swing.JButton();
+
+        jSplitPane1.setDividerLocation(200);
+        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+        jSplitPane1.setRightComponent(jPanel1);
+
+        jScrollPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+        jSplitPane1.setLeftComponent(jScrollPane1);
+
+        org.openide.awt.Mnemonics.setLocalizedText(addFunctionjButton, NbBundle.getMessage(ComponentWizardIterator.class, "LBL_Button_AddType"));
+        addFunctionjButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                addFunctionActionPerformed(evt);
+            }
+        });
+
+        org.openide.awt.Mnemonics.setLocalizedText(deletejButton, NbBundle.getMessage(ComponentWizardIterator.class, "LBL_ButtonDelete"));
+        deletejButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                deleteActionPerformed(evt);
+            }
+        });
+
+        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(layout.createSequentialGroup()
+                .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 573, Short.MAX_VALUE)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
+                    .add(deletejButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .add(addFunctionjButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(layout.createSequentialGroup()
+                .add(addFunctionjButton)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(deletejButton))
+            .add(jSplitPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 300, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void deleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteActionPerformed
+
+        // no valid necessary: this triggers a propertyChange.
+        actions.deleteActions();
+
+    }//GEN-LAST:event_deleteActionPerformed
+
+    private void addFunctionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFunctionActionPerformed
+
+        // this does not trigger a propertyChange.
+        actions.addParameterAction();
+        // 2do: add this everywhere; problem: custom editor does also not trigger a property change
+        valid();
+
+    }//GEN-LAST:event_addFunctionActionPerformed
+    
+    public ExplorerManager getExplorerManager() {
+        return this.manager;
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        Node[] selectedNodes = manager.getSelectedNodes();
+        if (selectedNodes != null && selectedNodes.length == 1) {
+            propSheet.setNodes(selectedNodes);
+            NbNodeObject nodeObject = (NbNodeObject)selectedNodes[0].getLookup().lookup(NbNodeObject.class);
+            if (nodeObject.getType() == NbNodeObject.PROPERTY_TYPE){
+                deletejButton.setEnabled(false);
+                addFunctionjButton.setEnabled(false);
+            }
+            else if (nodeObject.getType() == NbNodeObject.PARAMETER_TYPE) {
+                deletejButton.setEnabled(true);
+                addFunctionjButton.setEnabled(true);
+            }
+            else {
+                deletejButton.setEnabled(false);
+                addFunctionjButton.setEnabled(true);
+            }
+        }
+        valid();
+    } 
+    
+    private void valid() {
+        NbNodeObject ob = (NbNodeObject)node.getLookup().lookup(NbNodeObject.class);
+        Struct struct = (Struct)ob;
+        try {
+            if (struct.getSimpleProperty(struct.PROPERTY_CONTAINER_NAME).length() == 0 ||
+                struct.getSimpleProperty(struct.PROPERTY_CONTAINER_PACKAGE).length() == 0) {
+                dialog.setEnableError(true, 
+                    NbBundle.getMessage(NewDataTypeBasePanel.class, "LBL_Error_Name"));
+                return;
+            }
+            else if (struct.getAllSetObjectNames().length == 0) {
+                dialog.setEnableError(true, 
+                    NbBundle.getMessage(NewDataTypeBasePanel.class, "LBL_Error_Struct"));
+                return;
+            }
+        } catch (MissingResourceException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        dialog.setEnableError(false, null);
+    }
+    
+    
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton addFunctionjButton;
+    private javax.swing.JButton deletejButton;
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JSplitPane jSplitPane1;
+    // End of variables declaration//GEN-END:variables
+
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ValidateDataType.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ValidateDataType.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ValidateDataType.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ValidateDataType.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ValidateDataType.java,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/04/24 10:08:26 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+
+package org.openoffice.extensions.projecttemplates.component.dialogs;
+
+/**
+ *
+ * @author sg128468
+ */
+public interface ValidateDataType {
+    
+    public void setEnableError(boolean error, String message);    
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/classstructunion.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/classstructunion.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/classstructunion.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/constant.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/constant.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/constant.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/enum.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/enum.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/enum.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/error.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/error.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/error.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/exception.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/exception.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/exception.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/folder.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/folder.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/folder.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/foldererror.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/foldererror.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/foldererror.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/folderopen.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/folderopen.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/folderopen.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/interface.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/interface.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/interface.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/method.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/method.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/method.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/module.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/module.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/module.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/moduleerror.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/moduleerror.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/moduleerror.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/name.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/name.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/name.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/parameter.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/parameter.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/parameter.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/service.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/service.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/service.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/struct.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/struct.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/icons/struct.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,26 @@
+LBL_CreateProjectStep=Name and Location
+Templates/Project/org-openoffice-extensions/UNOClientAppProject=OpenOffice.org Client Application
+
+TF_ProjectName_Tooltip=The name of the newly created project (also used as project folder name)
+TF_ClassName_Tooltip=The name of the class, set as the main class
+TF_JavaPackage_Tooltip=The name of the Java package
+TF_Location_Tooltip=The path to the directory where the project will be created
+TF_ProjectFolder_Tooltip=The final destination folder of the new project
+
+LB_Error_ProjectName=Project Name is not a valid folder name.
+LB_Error_ProjectPath=Project Folder is not a valid path.
+LB_Error_ProjectFolder=Project Folder cannot be created.
+LB_Error_ProjectFolderNotEmpty=Project Folder already exists and is not empty
+LB_Error_ClassName=Class Name is not a valid class name
+LB_Error_Package=Package is not a valid name.
+
+LBL_ProjectName=Project &Name:
+LBL_ClassName=&Class Name:
+LBL_JavaPackage=Java &Package:
+LBL_ProjectLocation=Project &Location:
+LBL_ProjectFolder=Project &Folder:
+LBL_BrowseButton=Br&owse
+
+LBL_FileChooserTitle=Select Project Location
+
+BUTTON_Browse_Tooltip=Select a folder where the project will be created

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_ja.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_ja.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_ja.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_ja.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,50 @@
+# LBL_CreateProjectStep=Name and Location
+LBL_CreateProjectStep=\u540d\u524d\u3068\u5834\u6240
+# Templates/Project/org-openoffice-extensions/UNOClientAppProject=OpenOffice.org Client Application
+Templates/Project/org-openoffice-extensions/UNOClientAppProject=OpenOffice.org \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3
+
+# TF_ProjectName_Tooltip=The name of the newly created project (also used as project folder name)
+TF_ProjectName_Tooltip=\u65b0\u3057\u304f\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u540d\u524d (\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u540d\u3068\u3057\u3066\u3082\u4f7f\u7528)
+# TF_ClassName_Tooltip=The name of the class, set as the main class
+TF_ClassName_Tooltip=\u4e3b\u30af\u30e9\u30b9\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u3001\u30af\u30e9\u30b9\u306e\u540d\u524d
+# TF_JavaPackage_Tooltip=The name of the Java package
+TF_JavaPackage_Tooltip=Java \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u540d\u524d
+# TF_Location_Tooltip=The path to the directory where the project will be created
+TF_Location_Tooltip=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u306e\u30d1\u30b9
+# TF_ProjectFolder_Tooltip=The final destination folder of the new project
+TF_ProjectFolder_Tooltip=\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u6700\u7d42\u7684\u306a\u5c55\u958b\u5148\u30d5\u30a9\u30eb\u30c0
+
+# LB_Error_ProjectName=Project Name is not a valid folder name.
+LB_Error_ProjectName=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u304c\u6709\u52b9\u306a\u30d5\u30a9\u30eb\u30c0\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
+# LB_Error_ProjectPath=Project Folder is not a valid path.
+LB_Error_ProjectPath=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u304c\u4e0d\u6b63\u306a\u30d1\u30b9\u3067\u3059\u3002
+# LB_Error_ProjectFolder=Project Folder cannot be created.
+LB_Error_ProjectFolder=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3002
+# LB_Error_ProjectFolderNotEmpty=Project Folder already exists and is not empty
+LB_Error_ProjectFolderNotEmpty=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u304c\u3059\u3067\u306b\u5b58\u5728\u3057\u3001\u7a7a\u3067\u306f\u3042\u308a\u307e\u305b\u3093
+# LB_Error_ClassName=Class Name is not a valid class name
+LB_Error_ClassName=\u30af\u30e9\u30b9\u540d\u304c\u6709\u52b9\u306a\u30af\u30e9\u30b9\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
+# LB_Error_Package=Package is not a valid name.
+LB_Error_Package=\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u6709\u52b9\u306a\u540d\u524d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
+
+# LBL_ProjectName=Project &Name:
+LBL_ProjectName=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d(&N):
+# LBL_ClassName=&Class Name:
+LBL_ClassName=\u30af\u30e9\u30b9\u540d(&C):
+# LBL_JavaPackage=Java &Package:
+LBL_JavaPackage=Java \u30d1\u30c3\u30b1\u30fc\u30b8(&P):
+# LBL_ProjectLocation=Project &Location:
+LBL_ProjectLocation=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5834\u6240(&L):
+# LBL_ProjectFolder=Project &Folder;
+LBL_ProjectFolder=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0(&F):
+# LBL_BrowseButton=Br&owse
+LBL_BrowseButton=\u53c2\u7167(&O)
+
+# LBL_FileChooserTitle=Select Project Location
+LBL_FileChooserTitle=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5834\u6240\u3092\u9078\u629e
+
+# BUTTON_Browse_Tooltip=Select a folder where the project will be created
+BUTTON_Browse_Tooltip=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044
+
+
+

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_pt_BR.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_pt_BR.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_pt_BR.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_pt_BR.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,26 @@
+LBL_CreateProjectStep=Name and Location
+Templates/Project/org-openoffice-extensions/UNOClientAppProject=OpenOffice.org Client Application
+
+TF_ProjectName_Tooltip=The name of the newly created project (also used as project folder name)
+TF_ClassName_Tooltip=The name of the class, set as the main class
+TF_JavaPackage_Tooltip=The name of the Java package
+TF_Location_Tooltip=The path to the directory where the project will be created
+TF_ProjectFolder_Tooltip=The final destination folder of the new project
+
+LB_Error_ProjectName=Project Name is not a valid folder name.
+LB_Error_ProjectPath=Project Folder is not a valid path.
+LB_Error_ProjectFolder=Project Folder cannot be created.
+LB_Error_ProjectFolderNotEmpty=Project Folder already exists and is not empty
+LB_Error_ClassName=Class Name is not a valid class name
+LB_Error_Package=Package is not a valid name.
+
+LBL_ProjectName=Project &Name:
+LBL_ClassName=&Class Name:
+LBL_JavaPackage=Java &Package:
+LBL_ProjectLocation=Project &Location:
+LBL_ProjectFolder=Project &Folder:
+LBL_BrowseButton=Br&owse
+
+LBL_FileChooserTitle=Select Project Location
+
+BUTTON_Browse_Tooltip=Select a folder where the project will be created

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_zh_CN.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_zh_CN.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_zh_CN.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle_zh_CN.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,26 @@
+LBL_CreateProjectStep=\u540d\u79f0\u548c\u4f4d\u7f6e
+Templates/Project/org-openoffice-extensions/UNOClientAppProject=OpenOffice.org \u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f
+
+TF_ProjectName_Tooltip=\u65b0\u5efa\u9879\u76ee\u7684\u540d\u79f0\uff08\u4e5f\u7528\u4f5c\u9879\u76ee\u6587\u4ef6\u5939\u540d\u79f0\uff09
+TF_ClassName_Tooltip=\u8bbe\u7f6e\u4e3a\u4e3b\u7c7b\u7684\u7c7b\u540d
+TF_JavaPackage_Tooltip=Java \u5305\u540d
+TF_Location_Tooltip=\u5c06\u5728\u5176\u4e2d\u521b\u5efa\u9879\u76ee\u7684\u76ee\u5f55\u8def\u5f84
+TF_ProjectFolder_Tooltip=\u65b0\u5efa\u9879\u76ee\u7684\u6700\u7ec8\u76ee\u6807\u6587\u4ef6\u5939
+
+LB_Error_ProjectName=\u9879\u76ee\u540d\u79f0\u662f\u65e0\u6548\u7684\u6587\u4ef6\u5939\u540d\u79f0\u3002
+LB_Error_ProjectPath=\u9879\u76ee\u6587\u4ef6\u5939\u4e0d\u5177\u5907\u6709\u6548\u7684\u8def\u5f84\u3002
+LB_Error_ProjectFolder=\u65e0\u6cd5\u521b\u5efa\u9879\u76ee\u6587\u4ef6\u5939\u3002
+LB_Error_ProjectFolderNotEmpty=\u9879\u76ee\u6587\u4ef6\u5939\u5df2\u5b58\u5728\u4e14\u4e0d\u4e3a\u7a7a
+LB_Error_ClassName=\u7c7b\u540d\u65e0\u6548
+LB_Error_Package=\u5305\u540d\u65e0\u6548\u3002
+
+LBL_ProjectName=\u9879\u76ee\u540d\u79f0(&N)\uff1a
+LBL_ClassName=\u7c7b\u540d(&C)\uff1a
+LBL_JavaPackage=Java \u5305(&P)\uff1a
+LBL_ProjectLocation=\u9879\u76ee\u4f4d\u7f6e (&L)\uff1a
+LBL_ProjectFolder=\u9879\u76ee\u6587\u4ef6\u5939 (&F)\uff1a
+LBL_BrowseButton=\u6d4f\u89c8(&O)
+
+LBL_FileChooserTitle=\u9009\u62e9\u9879\u76ee\u4f4d\u7f6e
+
+BUTTON_Browse_Tooltip=\u9009\u62e9\u4e00\u4e2a\u5c06\u5728\u5176\u4e2d\u521b\u5efa\u9879\u76ee\u7684\u6587\u4ef6\u5939

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription.html
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription.html?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription.html (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription.html Fri Jan 27 01:29:33 2012
@@ -0,0 +1,10 @@
+<html>
+    <body>
+        Creates a <b>OpenOffice.org Client Application</b> project.<br> 
+        It is a standard J2SE client application project with integrated support of the
+        OpenOffice.org API. The main function contains a code snippet to bootstrap UNO and return
+        an initial component context. The current implementation automatically starts the default
+        OpenOffice.org or connects to a running instance of OpenOffice.org. 
+        The communication is done by using a named pipe connection.
+    </body>
+</html>

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_ja.html
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_ja.html?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_ja.html (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_ja.html Fri Jan 27 01:29:33 2012
@@ -0,0 +1,8 @@
+<html>
+    
+<!-- Inserted by TRADOS: --><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=EUC-JP">
+<body>
+        <b>OpenOffice.org ¥¯¥é¥¤¥¢¥ó¥È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó</b>¥×¥í¥¸¥§¥¯¥È¤òºîÀ®¤¹¤ë¡£<br> OpenOffice.org API ¤Î¥µ¥Ý¡¼¥È¤¬Åý¹ç¤µ¤ì¤¿¡¢É¸½à J2SE ¥¯¥é¥¤¥¢¥ó¥È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥¸¥§¥¯¥È¤Ç¤¹¡£¼ç¤Êµ¡Ç½¤Ë¤Ï¡¢UNO ¤ò¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×¤·¡¢½é´ü¥³¥ó¥Ý¡¼¥Í¥ó¥È¥³¥ó¥Æ¥­¥¹¥È¤òÊÖ¤¹¥³¡¼¥É¥¹¥Ë¥Ú¥Ã¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£¸½ºß¤Î¼ÂÁõ¤Ï¡¢¼«Æ°Åª¤Ë¥Ç¥Õ¥©¥ë¥È¤Î OpenOffice.org ¤òµ¯Æ°¤¹¤ë¤«¡¢OpenOffice.org ¤Î¼Â¹ÔÃæ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ËÀܳ¤·¤Þ¤¹¡£ÄÌ¿®¤Ï¡¢Ì¾Á°ÉÕ¤­¥Ñ¥¤¥×Àܳ¤ò»ÈÍѤ·¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£    </body>
+</html>
+
+

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_pt_BR.html
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_pt_BR.html?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_pt_BR.html (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_pt_BR.html Fri Jan 27 01:29:33 2012
@@ -0,0 +1,10 @@
+<html lang='pt'>
+    <body>
+        Cria um projeto de <b>Aplicação cliente do OpenOffice.org</b>.<br> 
+        É um projeto cliente J2SE padrão com suporte integrado a
+        API do OpenOffice.org. A função principal contém um trecho de código para o bootstrap do UNO e retornar
+        um contexto de componente inicial. A implementação corrente automaticamente inicializa o 
+        OpenOffice.org padrão ou conecta a uma instância em execução do OpenOffice.org. 
+        A comunicação é feita usando uma conexão pipe nomeada.
+    </body>
+</html>

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_zh_CN.html
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_zh_CN.html?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_zh_CN.html (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppDescription_zh_CN.html Fri Jan 27 01:29:33 2012
@@ -0,0 +1,8 @@
+<html lang='zh'>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
+</head>
+<body>
+´´½¨Ò»¸ö <b>OpenOffice.org ¿Í»§¶ËÓ¦ÓóÌÐò</b>ÏîÄ¿¡£<br>¸ÃÏîÄ¿ÊDZê×¼µÄ J2SE ¿Í»§¶ËÓ¦ÓóÌÐòÏîÄ¿£¬Ëü¼¯³ÉÁË¶Ô OpenOffice.org API µÄÖ§³Ö¡£main º¯Êý°üº¬ÓÃÓÚÒýµ¼ UNO ²¢·µ»Ø³õʼ×é¼þÉÏÏÂÎĵĴúÂëƬ¶Î¡£µ±Ç°ÊµÏÖ¿É×Ô¶¯Æô¶¯È±Ê¡µÄ OpenOffice.org »òÁ¬½Ó OpenOffice.org µÄÔËÐÐʵÀý¡£Í¨ÐÅÊÇͨ¹ýʹÓÃÃüÃûµÄ¹ÜµÀÁ¬½ÓÀ´ÊµÏֵġ£
+    </body>
+</html>

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" attributes="0">
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="projectLocationLabel" alignment="0" min="-2" max="-2" attributes="0"/>
+                  <Component id="projectNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
+                  <Component id="projectClassNameLable" alignment="0" min="-2" max="-2" attributes="0"/>
+                  <Component id="projectPackageLabel" alignment="0" min="-2" max="-2" attributes="0"/>
+                  <Component id="createdFolderLabel" alignment="0" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="projectNameTextField" pref="324" max="32767" attributes="0"/>
+                  <Component id="projectClassNameTextField" alignment="0" pref="324" max="32767" attributes="1"/>
+                  <Component id="projectPackageTextField" alignment="0" pref="324" max="32767" attributes="1"/>
+                  <Component id="createdFolderTextField" alignment="0" pref="324" max="32767" attributes="0"/>
+                  <Component id="projectLocationTextField" alignment="1" pref="324" max="32767" attributes="0"/>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="browseButton" min="-2" max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" max="-2" attributes="0">
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="projectNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="projectNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="projectClassNameLable" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="projectClassNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="projectPackageLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="projectPackageTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="projectLocationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="projectLocationTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="browseButton" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="createdFolderLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="createdFolderTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace min="-2" pref="165" max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Component class="javax.swing.JLabel" name="projectNameLabel">
+      <Properties>
+        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+          <ComponentRef name="projectNameTextField"/>
+        </Property>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="LBL_ProjectName" replaceFormat="NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JTextField" name="projectNameTextField">
+      <Properties>
+        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="TF_ClassName_Tooltip" replaceFormat="NbBundle.getMessage(UNOClientAppPanelVisual.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JLabel" name="projectLocationLabel">
+      <Properties>
+        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+          <ComponentRef name="projectLocationTextField"/>
+        </Property>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="LBL_ProjectLocation" replaceFormat="NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JTextField" name="projectLocationTextField">
+      <Properties>
+        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="TF_ProjectFolder_Tooltip" replaceFormat="NbBundle.getMessage(UNOClientAppPanelVisual.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JButton" name="browseButton">
+      <Properties>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="LBL_BrowseButton" replaceFormat="NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+        </Property>
+        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="BUTTON_Browse_Tooltip" replaceFormat="NbBundle.getMessage(UNOClientAppPanelVisual.class, &quot;{key}&quot;)"/>
+        </Property>
+        <Property name="actionCommand" type="java.lang.String" value="BROWSE"/>
+        <Property name="name" type="java.lang.String" value="browse" noResource="true"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="browseButtonActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JLabel" name="createdFolderLabel">
+      <Properties>
+        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+          <ComponentRef name="createdFolderTextField"/>
+        </Property>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="LBL_ProjectFolder" replaceFormat="NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JTextField" name="createdFolderTextField">
+      <Properties>
+        <Property name="editable" type="boolean" value="false"/>
+        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="TF_ProjectFolder_Tooltip" replaceFormat="NbBundle.getMessage(UNOClientAppPanelVisual.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JLabel" name="projectPackageLabel">
+      <Properties>
+        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+          <ComponentRef name="projectPackageTextField"/>
+        </Property>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="LBL_JavaPackage" replaceFormat="NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JTextField" name="projectPackageTextField">
+      <Properties>
+        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="TF_JavaPackage_Tooltip" replaceFormat="NbBundle.getMessage(UNOClientAppPanelVisual.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JLabel" name="projectClassNameLable">
+      <Properties>
+        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+          <ComponentRef name="projectClassNameTextField"/>
+        </Property>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="LBL_ClassName" replaceFormat="NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JTextField" name="projectClassNameTextField">
+      <Properties>
+        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/unoclientapplication/Bundle.properties" key="TF_JavaPackage_Tooltip" replaceFormat="NbBundle.getMessage(UNOClientAppPanelVisual.class, &quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+  </SubComponents>
+</Form>

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppPanelVisual.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,431 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: UNOClientAppPanelVisual.java,v $
+ *
+ *  $Revision: 1.17 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/10/07 10:19:37 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+
+package org.openoffice.extensions.projecttemplates.unoclientapplication;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.filechooser.FileSystemView;
+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;
+import org.openide.util.NbBundle;
+import org.openide.util.Utilities;
+import org.openoffice.extensions.config.ConfigurationSettings;
+import org.openoffice.extensions.projecttemplates.actions.ProjectVersion;
+
+public class UNOClientAppPanelVisual extends JPanel implements DocumentListener {
+    
+    public static final String PROP_PROJECT_NAME = "ProjectName"; // NOI18N
+    public static final String PROP_CLASS_NAME = "ClassName"; // NOI18N
+
+    private boolean classNameModified = false;    
+    private UNOClientAppWizardPanel panel;
+    
+    /** Creates new form PanelProjectLocationVisual */
+    public UNOClientAppPanelVisual(UNOClientAppWizardPanel panel) {
+        initComponents();
+        this.panel = panel;
+        // Register listener on the textFields to make the automatic updates
+        projectNameTextField.getDocument().addDocumentListener(this);
+        projectClassNameTextField.getDocument().addDocumentListener(this);
+        projectLocationTextField.getDocument().addDocumentListener(this);
+        projectPackageTextField.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();
+        projectPackageLabel = new javax.swing.JLabel();
+        projectPackageTextField = new javax.swing.JTextField();
+        projectClassNameLable = new javax.swing.JLabel();
+        projectClassNameTextField = new javax.swing.JTextField();
+
+        projectNameLabel.setLabelFor(projectNameTextField);
+        org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, NbBundle.getMessage(UNOClientAppPanelVisual.class, "LBL_ProjectName"));
+
+        projectNameTextField.setToolTipText(NbBundle.getMessage(UNOClientAppPanelVisual.class, "TF_ClassName_Tooltip"));
+
+        projectLocationLabel.setLabelFor(projectLocationTextField);
+        org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, NbBundle.getMessage(UNOClientAppPanelVisual.class, "LBL_ProjectLocation"));
+
+        projectLocationTextField.setToolTipText(NbBundle.getMessage(UNOClientAppPanelVisual.class, "TF_ProjectFolder_Tooltip"));
+
+        org.openide.awt.Mnemonics.setLocalizedText(browseButton, NbBundle.getMessage(UNOClientAppPanelVisual.class, "LBL_BrowseButton"));
+        browseButton.setToolTipText(NbBundle.getMessage(UNOClientAppPanelVisual.class, "BUTTON_Browse_Tooltip"));
+        browseButton.setActionCommand("BROWSE");
+        browseButton.setName("browse");
+        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, NbBundle.getMessage(UNOClientAppPanelVisual.class, "LBL_ProjectFolder"));
+
+        createdFolderTextField.setEditable(false);
+        createdFolderTextField.setToolTipText(NbBundle.getMessage(UNOClientAppPanelVisual.class, "TF_ProjectFolder_Tooltip"));
+
+        projectPackageLabel.setLabelFor(projectPackageTextField);
+        org.openide.awt.Mnemonics.setLocalizedText(projectPackageLabel, NbBundle.getMessage(UNOClientAppPanelVisual.class, "LBL_JavaPackage"));
+
+        projectPackageTextField.setToolTipText(NbBundle.getMessage(UNOClientAppPanelVisual.class, "TF_JavaPackage_Tooltip"));
+
+        projectClassNameLable.setLabelFor(projectClassNameTextField);
+        org.openide.awt.Mnemonics.setLocalizedText(projectClassNameLable, NbBundle.getMessage(UNOClientAppPanelVisual.class, "LBL_ClassName"));
+
+        projectClassNameTextField.setToolTipText(NbBundle.getMessage(UNOClientAppPanelVisual.class, "TF_JavaPackage_Tooltip"));
+
+        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(layout.createSequentialGroup()
+                .addContainerGap()
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+                    .add(projectLocationLabel)
+                    .add(projectNameLabel)
+                    .add(projectClassNameLable)
+                    .add(projectPackageLabel)
+                    .add(createdFolderLabel))
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+                    .add(projectNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
+                    .add(projectClassNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
+                    .add(projectPackageTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
+                    .add(createdFolderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
+                    .add(org.jdesktop.layout.GroupLayout.TRAILING, projectLocationTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(browseButton)
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(layout.createSequentialGroup()
+                .addContainerGap()
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(projectNameLabel)
+                    .add(projectNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(projectClassNameLable)
+                    .add(projectClassNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+                .add(8, 8, 8)
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(projectPackageLabel)
+                    .add(projectPackageTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(projectLocationLabel)
+                    .add(projectLocationTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                    .add(browseButton))
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(createdFolderLabel)
+                    .add(createdFolderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+                .add(165, 165, 165))
+        );
+    }// </editor-fold>//GEN-END:initComponents
+    
+    private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
+        String command = evt.getActionCommand();
+        if ("BROWSE".equals(command)) { // NOI18N
+            JFileChooser chooser = new JFileChooser(FileSystemView.getFileSystemView());
+            FileUtil.preventFileChooserSymlinkTraversal(chooser, ConfigurationSettings.getDefaultFileChooserStartingDir());
+            chooser.setDialogTitle(
+                NbBundle.getMessage(UNOClientAppPanelVisual.class, "LBL_FileChooserTitle"));
+            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();
+                ConfigurationSettings.storeDefaultFileChooserStartingDir(projectDir);
+                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 projectClassNameLable;
+    private javax.swing.JTextField projectClassNameTextField;
+    private javax.swing.JLabel projectLocationLabel;
+    private javax.swing.JTextField projectLocationTextField;
+    private javax.swing.JLabel projectNameLabel;
+    private javax.swing.JTextField projectNameTextField;
+    private javax.swing.JLabel projectPackageLabel;
+    private javax.swing.JTextField projectPackageTextField;
+    // End of variables declaration//GEN-END:variables
+    
+    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) {
+            String message = NbBundle.getMessage(UNOClientAppWizardIterator.class, "LB_Error_ProjectName");
+            wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+            return false; // Display name not specified
+        }
+        File f = FileUtil.normalizeFile(new File(projectLocationTextField.getText()).getAbsoluteFile());
+        if (!f.isDirectory()) {
+            String message = NbBundle.getMessage(UNOClientAppWizardIterator.class, "LB_Error_ProjectPath");
+            wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+            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()) {
+            String message = NbBundle.getMessage(UNOClientAppWizardIterator.class, "LB_Error_ProjectFolder");
+            wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+            return false;
+        }
+        
+        if (FileUtil.toFileObject(projLoc) == null) {
+            String message = NbBundle.getMessage(UNOClientAppWizardIterator.class, "LB_Error_ProjectPath");
+            wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+            return false;
+        }
+        
+        File[] kids = destFolder.listFiles();
+        if (destFolder.exists() && kids != null && kids.length > 0) {
+            // Folder exists and is not empty
+            String message = NbBundle.getMessage(UNOClientAppWizardIterator.class, "LB_Error_ProjectFolderNotEmpty");
+            wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+            return false;
+        }
+        
+        String mainClass = projectClassNameTextField.getText().trim();
+        if (mainClass.length() == 0 || !mainClass.matches("[a-zA-Z_][a-zA-Z_$0-9]*")) { // NOI18N
+            String message = NbBundle.getMessage(UNOClientAppWizardIterator.class, "LB_Error_ClassName");
+            wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+            return false; // Display name not specified
+        }
+        String packageName = projectPackageTextField.getText().trim();
+        if (packageName.length() == 0 || !packageName.matches("[a-zA-Z_]((\\.[a-zA-Z_0-9]++)|[a-zA-Z_0-9])*")) { // NOI18N
+            String message = NbBundle.getMessage(UNOClientAppWizardIterator.class, "LB_Error_Package");
+            wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+            return false; // Display name not specified
+        }
+        wizardDescriptor.putProperty("WizardPanel_errorMessage", ""); // NOI18N
+        return true;
+    }
+    
+    void store(WizardDescriptor d) {
+        String name = projectNameTextField.getText().trim();
+        String folder = createdFolderTextField.getText().trim();
+
+        ConfigurationSettings settings = ConfigurationSettings.getSettings();
+        
+        String user = System.getProperty ("user.name"); // NOI18N
+        if (user == null) {
+               user = "SomeBody"; // NOI18N
+        }
+        
+        d.putProperty("UserName", settings.getUser()); // NOI18N
+        d.putProperty("BuildUnoVersion", ProjectVersion.getProjectVersion()); // NOI18N
+        d.putProperty("TimeStamp", ConfigurationSettings.getTimeStamp()); // NOI18N
+        d.putProperty("OfficeLibrary", settings.getLibraryName()); // NOI18N
+        d.putProperty("OfficePath", Utilities.replaceString(settings.getValue(settings.KEY_OFFICE_INSTALLATION), "\\", "/")); // NOI18N
+        d.putProperty("SdkPath", Utilities.replaceString(settings.getValue(settings.KEY_SDK_INSTALLATION), "\\", "/")); // NOI18N
+        d.putProperty("projdir", new File(folder)); // NOI18N
+        d.putProperty("ProjectDir", new File(folder)); // NOI18N
+        d.putProperty("UnoClientProjectName", name); // NOI18N
+        d.putProperty("name", name); // NOI18N
+        d.putProperty("ProjectDisplayName", name); // NOI18N
+        d.putProperty("UnoPackage", projectPackageTextField.getText().trim()); // NOI18N
+        d.putProperty("UnoPackagePath", Utilities.replaceString(projectPackageTextField.getText().trim(), ".", "/")); // NOI18N
+        d.putProperty("UnoClientMain", projectClassNameTextField.getText().trim()); // NOI18N
+    }
+    
+    void read(WizardDescriptor settings) {
+        File projectLocation = (File) settings.getProperty("ProjectDir"); // 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("ProjectDisplayName"); // NOI18N
+        if(projectName == null) {
+            projectName = "OfficeUNOClientApp"; // NOI18N
+            String[] fileList = projectLocation.list(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    if (name.startsWith("OfficeUNOClientApp")) return true; // NOI18N
+                    return false;
+                }
+            });
+            boolean searchProjectName = true;
+            int length = projectName.length();
+            for (int i=0; searchProjectName && i<fileList.length + 1; i++) {
+                switch (i) {
+                    case 0: // keep project name
+                        break;
+                    case 1: // append 1
+                        projectName = new StringBuffer(projectName).append(1).toString(); 
+                        break;
+                    default: // remove number and append the next one
+                        projectName = new StringBuffer(projectName.substring(0, length)).append(i).toString();
+                }
+                // test if the name is already used
+                searchProjectName = false;
+                for (int j=0; !searchProjectName && j<fileList.length; j++) {
+                    // if the project name isn't found, searchProjectName stays false and the name is kept
+                    searchProjectName |= fileList[j].equals(projectName);
+                }
+            }
+        }
+        
+        String mainClassName = (String) settings.getProperty("UnoClientMain"); // NOI18N
+        if(mainClassName == null) {
+            mainClassName = projectName;
+        }
+
+        String pkg = (String) settings.getProperty ("UnoPackage"); // NOI18N
+        if (pkg == null) {
+            pkg = NbBundle.getMessage(ConfigurationSettings.class, "default.package"); // NOI18N
+        }        
+        this.projectPackageTextField.setText(pkg);
+        this.projectNameTextField.setText(projectName);
+        this.projectNameTextField.selectAll();
+        this.projectClassNameTextField.setText(mainClassName);
+        this.projectPackageTextField.setText(pkg);
+    }
+    
+    void validate(WizardDescriptor d) throws WizardValidationException {
+        // nothing to validate
+    }
+    
+    // Implementation of DocumentListener --------------------------------------
+    
+    public void changedUpdate(DocumentEvent e) {
+        updateTexts(e);
+        if (this.projectNameTextField.getDocument() == e.getDocument()) {
+            firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
+        }
+        if (this.projectClassNameTextField.getDocument() == e.getDocument()) {
+            firePropertyChange(PROP_CLASS_NAME,null,this.projectClassNameTextField.getText());
+        }
+    }
+    
+    public void insertUpdate(DocumentEvent e) {
+        updateTexts(e);
+        if (this.projectNameTextField.getDocument() == e.getDocument()) {
+            firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
+        }
+        if (this.projectClassNameTextField.getDocument() == e.getDocument()) {
+            firePropertyChange(PROP_CLASS_NAME,null,this.projectClassNameTextField.getText());
+        }
+    }
+    
+    public void removeUpdate(DocumentEvent e) {
+        updateTexts(e);
+        if (this.projectNameTextField.getDocument() == e.getDocument()) {
+            firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
+        }
+        if (this.projectClassNameTextField.getDocument() == e.getDocument()) {
+            firePropertyChange(PROP_CLASS_NAME,null,this.projectClassNameTextField.getText());
+        }
+}
+    
+    /** Handles changes in the Project name and project directory, */
+    private void updateTexts(DocumentEvent e) {
+        
+        Document doc = e.getDocument();
+
+        if (doc == projectClassNameTextField.getDocument() && projectClassNameTextField.getText().length()>0) {
+            if (!projectNameTextField.getText().equals(projectClassNameTextField.getText()))
+                classNameModified = true;
+        }
+        
+        if (doc == projectNameTextField.getDocument() || doc == projectLocationTextField.getDocument()) {
+            // Change in the project name
+            
+            String projectName = projectNameTextField.getText();
+            String projectFolder = projectLocationTextField.getText();
+            
+            if (!classNameModified)
+                projectClassNameTextField.setText(projectName);
+            
+            //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) {
+            createdFolderTextField.setText(projectFolder + File.separatorChar + projectName);
+            //}
+            
+        }
+        panel.fireChangeEvent(); // Notify that the panel changed
+    }
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppProject.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppProject.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppProject.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppProject.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,35 @@
+#                 Sun Public License Notice
+# 
+# The contents of this file are subject to the Sun Public License
+# Version 1.0 (the "License"). You may not use this file except in
+# compliance with the License. A copy of the License is available at
+# http://www.sun.com/
+# 
+# The Original Code is NetBeans. The Initial Developer of the Original
+# Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+# Microsystems, Inc. All Rights Reserved.
+
+# Properties file containing substitutions for file paths and content for the
+# basic UNO client application
+
+# The following special tokens are supported in values:
+#   %UserName% - substitute the user name as determined by system property
+#   %ApplicationName% - the user entered display name of the application (
+#           human readable, may contain spaces, etc.)
+#   %UnoPackagee% - the package name the user entered in the wizard
+#   %UnoPackagePath% - the package name, but with /'s instead of .'s
+
+src/__UnoPackagePath__/=src/%UnoPackagePath%
+src/__UnoPackagePath__/__UnoClientMain__.java=src/%UnoPackagePath%/%UnoClientMain%.java
+
+__UnoPackage__=%UnoPackage%
+__UnoClientMain__=%UnoClientMain%
+__UnoClientProjectName__=%UnoClientProjectName%
+__TimeStamp__=%TimeStamp%
+__UserName__=%UserName%
+
+__BuildUnoVersion__=%BuildUnoVersion%
+
+__OfficeLibrary__=%OfficeLibrary%
+__OfficePath__=%OfficePath%
+__SdkPath__=%SdkPath%

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppWizardIterator.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppWizardIterator.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppWizardIterator.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/unoclientapplication/UNOClientAppWizardIterator.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: UNOClientAppWizardIterator.java,v $
+ *
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: jsc $ $Date: 2008/07/31 09:37:57 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+
+package org.openoffice.extensions.projecttemplates.unoclientapplication;
+
+import java.awt.Component;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.MessageFormat;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.NoSuchElementException;
+import java.util.Set;
+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.spi.project.ui.support.ProjectChooser;
+import org.netbeans.spi.project.ui.templates.support.Templates;
+import org.openide.WizardDescriptor;
+import org.openide.filesystems.FileLock;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.config.ConfigurationValidator;
+import org.openoffice.extensions.util.Substitutions;
+
+
+public class UNOClientAppWizardIterator implements WizardDescriptor.InstantiatingIterator {
+    
+    private int index;
+    private WizardDescriptor.Panel[] panels;
+    private WizardDescriptor wiz;
+    
+    public UNOClientAppWizardIterator() {}
+    
+    public static UNOClientAppWizardIterator createIterator() {
+        return new UNOClientAppWizardIterator();
+    }
+    
+    private WizardDescriptor.Panel[] createPanels() {
+        return new WizardDescriptor.Panel[] {
+            new UNOClientAppWizardPanel(),
+        };
+    }
+    
+    private String[] createSteps() {
+        return new String[] {
+            NbBundle.getMessage(UNOClientAppWizardIterator.class, "LBL_CreateProjectStep")
+        };
+    }
+    
+    public Set<FileObject> instantiate() throws IOException {
+        Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
+        File dirF = FileUtil.normalizeFile((File) wiz.getProperty("ProjectDir")); // NOI18N
+        dirF.mkdirs();
+        
+        FileObject template = Templates.getTemplate(wiz);
+        FileObject dir = FileUtil.toFileObject(dirF);
+      
+        unZipFile(wiz, template.getName(), template.getInputStream(), 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;
+    }
+    
+    public void initialize(WizardDescriptor wiz) {
+        ConfigurationValidator.validateSettings();
+        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("WizardPanel_contentSelectedIndex", new Integer(i)); // NOI18N
+                // Step name (actually the whole list for reference).
+                jc.putClientProperty("WizardPanel_contentData", steps); // NOI18N
+            }
+        }
+    }
+    
+    public void uninitialize(WizardDescriptor wiz) {
+        this.wiz.putProperty("projdir",null); // NOI18N
+        this.wiz.putProperty("name",null); // NOI18N
+        this.wiz = null;
+        panels = null;
+    }
+    
+    public String name() {
+        return MessageFormat.format("{0} of {1}",
+                new Object[] {new Integer(index + 1), new Integer(panels.length)}); // NOI18N
+    }
+    
+    public boolean hasNext() {
+        return index < panels.length - 1;
+    }
+    
+    public boolean hasPrevious() {
+        return index > 0;
+    }
+    
+    public void nextPanel() {
+        if (!hasNext()) {
+            throw new NoSuchElementException();
+        }
+        index++;
+    }
+    
+    public void previousPanel() {
+        if (!hasPrevious()) {
+            throw new NoSuchElementException();
+        }
+        index--;
+    }
+    
+    public WizardDescriptor.Panel current() {
+        return panels[index];
+    }
+    
+    // If nothing unusual changes in the middle of the wizard, simply:
+    public final void addChangeListener(ChangeListener l) {}
+    public final void removeChangeListener(ChangeListener l) {}
+    
+    private static void unZipFile(WizardDescriptor wiz, String templateName, InputStream source, FileObject projectRoot) throws IOException {
+        String[] pathProperties = { "UnoPackagePath", "UnoClientMain"}; // NOI18N
+        String[] contentProperties = { "UnoPackage", "UnoClientMain", "UnoClientProjectName", "TimeStamp", 
+                                       "UserName", "BuildUnoVersion", "OfficePath", "SdkPath", "OfficeLibrary"}; // NOI18N
+        
+        Substitutions substitutions = new Substitutions (wiz, new BufferedInputStream (
+                UNOClientAppWizardIterator.class.getResourceAsStream(templateName + ".properties")), pathProperties, contentProperties); // NOI18N
+        try {
+            ZipInputStream str = new ZipInputStream(source);
+            ZipEntry entry;
+            while ((entry = str.getNextEntry()) != null) {
+                if (entry.isDirectory()) {
+                    FileUtil.createFolder(projectRoot,
+                            substitutions.substitutePath(entry.getName()));
+                } else {
+                    FileObject fo = FileUtil.createData(projectRoot, substitutions.substitutePath(entry.getName()));
+                    FileLock lock = fo.lock();
+                    try {
+                        OutputStream out = fo.getOutputStream(lock);
+                        try {
+                            InputStream substituted = substitutions.substituteContent(entry.getSize(),
+                                    str, entry.getName());
+                            FileUtil.copy(substituted, out);
+                        } finally {
+                            out.close();
+                        }
+                    } finally {
+                        lock.releaseLock();
+                    }
+                }
+            }
+        } finally {
+            source.close();
+        }
+    }
+    
+}



Mime
View raw message