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 [27/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/NewTypeBrowserDialog.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/NewTypeBrowserDialog.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/NewTypeBrowserDialog.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/NewTypeBrowserDialog.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: NewTypeBrowserDialog.java,v $
+ *
+ *  $Revision: 1.12 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/07/03 08:28:04 $
+ *
+ *  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;
+
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.view.BeanTreeView;
+import org.openide.nodes.Node;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.typebrowser.logic.UnoTypes;
+import org.openoffice.extensions.util.typebrowser.logic.TypeBrowserChildren;
+import org.openoffice.extensions.util.typebrowser.logic.TypeNode;
+
+/**
+ *
+ * @author  sg128468
+ */
+public class NewTypeBrowserDialog extends javax.swing.JPanel 
+        implements ExplorerManager.Provider, ActionListener {
+    
+    private ExplorerManager manager = new ExplorerManager();
+
+    private TypeNode rootNode;
+
+    private ComponentPanelVisual2IdlFiles comp;
+    private ComponentWizardPanel2IdlFiles panel;
+
+    /** Creates new form NewTypeBrowserDialog */
+    public NewTypeBrowserDialog(Component component, ComponentWizardPanel2IdlFiles panel) {
+        initComponents();
+        this.comp = (ComponentPanelVisual2IdlFiles)component;
+        this.panel = panel;
+        
+        this.rootNode = TypeNode.createRootNode(
+                new String[] {UnoTypes.MODULE, 
+                              UnoTypes.INTERFACE,
+                              UnoTypes.SERVICE,
+                }
+        );
+        
+        manager.setRootContext(rootNode);
+        
+        BeanTreeView typeView = (BeanTreeView)jScrollPane1;
+        if (rootNode.getChildren().getNodesCount() != 0)
+            typeView.setRootVisible(false);
+        else
+            typeView.setRootVisible(true);
+    }
+    
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
+    private void initComponents() {
+        jScrollPane1 = new BeanTreeView();
+        jLabel1 = new javax.swing.JLabel();
+        jComboBox1 = new javax.swing.JComboBox();
+
+        jScrollPane1.setName("typeBrowserList");
+
+        jLabel1.setLabelFor(jComboBox1);
+        jLabel1.setText(NbBundle.getMessage(ComponentWizardIterator.class, "LBL_Show"));
+
+        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All", "Services", "Interfaces" }));
+        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jComboBox1ActionPerformed(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(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+                .addContainerGap()
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE)
+                    .add(layout.createSequentialGroup()
+                        .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE)
+                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                        .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 299, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+                .addContainerGap()
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                    .add(jLabel1))
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
+
+        int index = jComboBox1.getSelectedIndex();
+        switch(index) {
+            case 1:
+                rootNode.setDisplayedTypes(new String[]{
+                    UnoTypes.MODULE, 
+                    UnoTypes.SERVICE,});
+                break;
+            case 2:
+                rootNode.setDisplayedTypes(new String[]{
+                    UnoTypes.MODULE, 
+                    UnoTypes.INTERFACE,
+                });
+                break;
+            default:
+                rootNode.setDisplayedTypes(new String[]{
+                    UnoTypes.MODULE, 
+                    UnoTypes.INTERFACE,
+                    UnoTypes.SERVICE,                
+                });
+        }
+        Node node = manager.getExploredContext();
+        if (node == null) {
+            node = manager.getRootContext();
+        }
+        TypeBrowserChildren tbc = (TypeBrowserChildren)node.getChildren();
+        tbc.update();
+        
+    }//GEN-LAST:event_jComboBox1ActionPerformed
+    
+    /**
+     */
+    public static void start(final Component component, final ComponentWizardPanel2IdlFiles panel) {
+        
+        NewTypeBrowserDialog typeBrowser = new NewTypeBrowserDialog(component, panel);
+        
+        DialogDescriptor ddscr = new DialogDescriptor(typeBrowser,
+                NbBundle.getMessage(ComponentWizardIterator.class, "LBL_TypeBrowser_Title"));
+
+        typeBrowser.addDialogDescriptor(ddscr);
+        
+        Dialog d = DialogDisplayer.getDefault().createDialog(ddscr);
+        d.setVisible(true);
+    }
+
+    public ExplorerManager getExplorerManager() {
+        return manager;
+    }
+
+    private void addDialogDescriptor(DialogDescriptor ddsc) {
+//        this.dialogDescriptor = ddsc;
+        ddsc.setButtonListener(this);
+
+        // set help context eventually
+//        dialogDescriptor.setHelpCtx(new HelpCtx("helpCtxString")); // NOI18N  
+    }
+    
+    public void actionPerformed(ActionEvent e) {
+        if (e.getActionCommand().equals("OK")) { // NOI18N
+            Node[] nodes = manager.getSelectedNodes();
+            for (int i=0; i<nodes.length; i++) {
+                TypeNode node = (TypeNode)nodes[i];
+                comp.addNewServiceOrInterface(node.getHierarchicalName(), node.getNodeType(), node.isOwnDesign());
+            }
+            if (panel != null)
+                panel.fireChangeEvent();
+        }
+    }
+    
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JComboBox jComboBox1;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JScrollPane jScrollPane1;
+    // End of variables declaration//GEN-END:variables
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,3 @@
+# Sample ResourceBundle properties file
+LBL_ServiceDisplayName=Service
+LBL_MultipleInheritanceInterfaceDisplayName=MultipleInheritedInterface
\ No newline at end of file

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_ja.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_ja.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_ja.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_ja.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,7 @@
+# Sample ResourceBundle properties file
+# LBL_ServiceDisplayName=Service
+LBL_ServiceDisplayName=\u30b5\u30fc\u30d3\u30b9
+# LBL_MultipleInheritanceInterfaceDisplayName=MultipleInheritedInterface
+LBL_MultipleInheritanceInterfaceDisplayName=MultipleInheritedInterface
+
+

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_pt_BR.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_pt_BR.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_pt_BR.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_pt_BR.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,3 @@
+# Sample ResourceBundle properties file
+LBL_ServiceDisplayName=Service
+LBL_MultipleInheritanceInterfaceDisplayName=MultipleInheritedInterface
\ No newline at end of file

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_zh_CN.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_zh_CN.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_zh_CN.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Bundle_zh_CN.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,3 @@
+# Sample ResourceBundle properties file
+LBL_ServiceDisplayName=Service
+LBL_MultipleInheritanceInterfaceDisplayName=MultipleInheritedInterface

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/DataType.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/DataType.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/DataType.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/DataType.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: DataType.java,v $
+ *
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: jsc $ $Date: 2008/02/11 10:57:00 $
+ *
+ *  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.datamodel;
+
+import java.util.Collection;
+import java.util.Hashtable;
+import org.openoffice.extensions.util.typebrowser.logic.TypeNode;
+
+/**
+ *
+ * @author sg128468
+ */
+public class DataType {
+    
+    public static final int INTERFACE_TYPE = 0;
+    public static final int STRUCT_TYPE = 1;
+    public static final int ENUM_TYPE = 2;
+    public static final int FOLDER_TYPE = 3;
+    public static final int SERVICE_TYPE = 4;
+    public static final int EXCEPTION_TYPE = 5;
+    public static final int CONSTANT_TYPE = 6;
+    public static final int POLY_STRUCT_TYPE = 7;
+
+    
+    public static final String SERVICE_TYPE_NAME = "Service"; // NOI18N
+    public static final String INTERFACE_TYPE_NAME = "Interface"; // NOI18N
+    public static final String STRUCT_TYPE_NAME = "Struct"; // NOI18N
+    public static final String ENUM_TYPE_NAME = "Enumeration"; // NOI18N
+    public static final String FOLDER_TYPE_NAME = "Folder"; // NOI18N
+    public static final String EXCEPTION_TYPE_NAME = "Exception"; // NOI18N
+    public static final String CONSTANT_TYPE_NAME = "Constant"; // NOI18N
+    public static final String POLY_STRUCT_TYPE_NAME = "PolyStruct"; // NOI18N
+    
+    private String typeName;
+    private int type;
+    private String iconPath;
+    private Hashtable<String, DataType> actualTypeObjects;  // only for a folder type that contains other types
+
+    private DataType parent;
+            
+    public DataType(DataType parent, int type) {
+        this(parent, type, FOLDER_TYPE);  // type shouldn't be FOLDER_TYPE for this c'tor
+    }
+    
+    public DataType(DataType parent, int type, int nameType) {
+        this.type = type;
+        this.parent = parent;
+        switch (type) {
+            case STRUCT_TYPE:
+                typeName = STRUCT_TYPE_NAME;
+                iconPath = TypeNode.STRUCT_ICON;
+                break;
+            case ENUM_TYPE:
+                typeName = ENUM_TYPE_NAME;
+                iconPath = TypeNode.ENUM_ICON;
+                break;
+            case SERVICE_TYPE:
+                typeName = SERVICE_TYPE_NAME;
+                iconPath = TypeNode.SERVICE_ICON;
+                break;
+            case EXCEPTION_TYPE:
+                typeName = EXCEPTION_TYPE_NAME;
+                iconPath = TypeNode.EXCEPTION_ICON;
+                break;
+            case CONSTANT_TYPE:
+                typeName = CONSTANT_TYPE_NAME;
+                iconPath = TypeNode.CONSTANTS_ICON;
+                break;
+            case POLY_STRUCT_TYPE:
+                typeName = POLY_STRUCT_TYPE_NAME;
+                iconPath = TypeNode.POLY_STRUCT_ICON;
+                break;
+            case FOLDER_TYPE:
+                switch(nameType) {
+                    case STRUCT_TYPE:
+                        typeName = STRUCT_TYPE_NAME;
+                        break;
+                    case ENUM_TYPE:
+                        typeName = ENUM_TYPE_NAME;
+                        break;
+                    case INTERFACE_TYPE:
+                        typeName = INTERFACE_TYPE_NAME;
+                        break;
+                    case SERVICE_TYPE:
+                        typeName = SERVICE_TYPE_NAME;
+                        break;
+                    case EXCEPTION_TYPE:
+                        typeName = EXCEPTION_TYPE_NAME;
+                        break;
+                    case CONSTANT_TYPE:
+                        typeName = CONSTANT_TYPE_NAME;
+                        break;
+                    case POLY_STRUCT_TYPE:
+                        typeName = POLY_STRUCT_TYPE_NAME;
+                        break;
+                    default:
+                        typeName = FOLDER_TYPE_NAME;
+                }
+                iconPath = TypeNode.FOLDER_ICON;
+                actualTypeObjects = new Hashtable<String, DataType>();
+                break;
+            default:
+                typeName = INTERFACE_TYPE_NAME;
+                iconPath = TypeNode.INTERFACE_ICON;
+                this.type = INTERFACE_TYPE;
+        }
+    }
+    
+    public DataType(DataType parent, int type, String typeName) {
+        this(parent, type);
+        this.typeName = typeName;
+    }
+    
+    public DataType getParent() {
+        return this.parent;
+    }
+    
+    public String getTypesName() {
+        return typeName;
+    }
+   
+    public int getType() {
+        return type;
+    }
+    
+    public String getIconPath() {
+        return iconPath;
+    }
+
+    public DataType getTypeForName(String name) {
+        if (actualTypeObjects != null) {
+            return actualTypeObjects.get(name);
+        }
+        return null;
+    }
+    
+    public void deleteType(String name) {
+        if (actualTypeObjects != null) {
+            actualTypeObjects.remove(name);
+        }
+    }
+    
+    public void addTypeWithName(String name, DataType type) {
+        if (actualTypeObjects != null) {
+            actualTypeObjects.put(name, type);
+        }
+    }
+    
+    public Collection<DataType> getAllTypes() {
+        if (actualTypeObjects != null) {
+            return actualTypeObjects.values();
+        }
+        return null;
+    }
+    
+    public static final int getTypeIdForName(String name) {
+        if (name.equals(INTERFACE_TYPE_NAME))
+            return INTERFACE_TYPE;
+        else if (name.equals(ENUM_TYPE_NAME))
+            return ENUM_TYPE;
+        else if (name.equals(FOLDER_TYPE_NAME))
+            return FOLDER_TYPE;
+        else if (name.equals(SERVICE_TYPE_NAME))
+            return SERVICE_TYPE;
+        else if (name.equals(EXCEPTION_TYPE_NAME))
+            return EXCEPTION_TYPE;
+        else if (name.equals(CONSTANT_TYPE_NAME))
+            return CONSTANT_TYPE;
+        else if (name.equals(POLY_STRUCT_TYPE_NAME))
+            return POLY_STRUCT_TYPE;
+        else if (name.equals(STRUCT_TYPE_NAME))
+            return STRUCT_TYPE;
+        return -1;
+    }
+    
+    public static final String getTypeNameForId(int id) {
+        switch(id) {
+            case INTERFACE_TYPE: return INTERFACE_TYPE_NAME;
+            case STRUCT_TYPE: return STRUCT_TYPE_NAME;
+            case ENUM_TYPE: return ENUM_TYPE_NAME;
+            case FOLDER_TYPE: return FOLDER_TYPE_NAME;
+            case SERVICE_TYPE: return SERVICE_TYPE_NAME;
+            case EXCEPTION_TYPE: return EXCEPTION_TYPE_NAME;
+            case CONSTANT_TYPE: return CONSTANT_TYPE_NAME;
+            case POLY_STRUCT_TYPE: return POLY_STRUCT_TYPE_NAME;
+        }
+        return null;
+    }
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Interface.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Interface.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Interface.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Interface.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Interface.java,v $
+ *
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: jsc $ $Date: 2008/02/11 10:57:41 $
+ *
+ *  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.datamodel;
+
+import java.util.Collection;
+import java.util.Vector;
+
+/**
+ *
+ * @author sg128468
+ */
+public class Interface {
+    
+    private static final String ICON_PATH = 
+            "org/openoffice/extensions/projecttemplates/component/icons/interface.png"; // NOI18N
+
+    private String name;
+    private String displayName;
+    
+    private Vector<Interface> ifcs;
+
+    private boolean isOwnDesign;
+
+    private String pkg;
+    
+    /** Creates a new instance of Interface */
+    public Interface(String name, String pkg) {
+        this(name, pkg, false);
+    }
+
+    /** Creates a new instance of Interface */
+    public Interface(String name, String pkg, boolean isOwnDesign) {
+        this.name = name;
+        this.isOwnDesign = isOwnDesign;
+        this.pkg =pkg;
+        ifcs = new Vector<Interface>();
+//        displayName = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    
+    public void setHierarchicalName(String fullName) {
+        int index = fullName.lastIndexOf('.');
+        if (index != -1) {
+            pkg = fullName.substring(0, index);
+            name = fullName.substring(index + 1);
+        }
+        else  {
+            pkg = ""; // NOI18N
+            name = fullName;
+        }
+    }
+    
+    public String getHierarchicalName() {
+        return pkg.concat(".").concat(name); // NOI18N
+    }
+    
+    public String getDisplayName() {
+        return getHierarchicalName();
+    }
+    
+    public String getIconPath() {
+        return ICON_PATH;
+    }
+    
+    public void addInterface(Interface ifc) {
+        if (isOwnDesign) 
+            ifcs.add(ifc);
+    }
+    
+    public void removeInterface(Interface ifc) {
+        if (isOwnDesign) 
+            ifcs.remove(ifc);
+    }
+    
+    public Collection<Interface> getInterfaces() {
+        return ifcs;
+    }
+
+    public boolean isOwnDesign() {
+        return isOwnDesign;
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Service.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Service.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Service.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/Service.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Service.java,v $
+ *
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: jsc $ $Date: 2008/02/11 10:57:41 $
+ *
+ *  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.datamodel;
+
+import java.util.Collection;
+import java.util.Vector;
+
+/**
+ *
+ * @author sg128468
+ */
+public class Service {
+    
+    private String name;
+    private String displayName;
+    private static final String ICON_PATH = 
+            "org/openoffice/extensions/projecttemplates/component/icons/service.png"; // NOI18N
+    private Interface ifc;
+
+    private boolean isOwnDesign;
+
+    private String pkg;
+    
+    /** Creates a new instance of Service */
+    public Service(String name, String pkg) {
+        this(name, pkg, true);
+    }
+
+    /** Creates a new instance of Service */
+    public Service(String name, String pkg, boolean isOwnDesign) {
+        this.name = name;
+        this.isOwnDesign = isOwnDesign;
+        this.pkg = pkg;
+//        displayName = name;// NbBundle.getMessage(Service.class, "LBL_ServiceDisplayName");
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setHierarchicalName(String fullName) {
+        int index = fullName.lastIndexOf('.');
+        if (index != -1) {
+            pkg = fullName.substring(0, index);
+            name = fullName.substring(index + 1);
+        }
+        else  {
+            pkg = ""; // NOI18N
+            name = fullName;
+        }
+    }
+    
+    public String getHierarchicalName() {
+        return pkg.concat(".").concat(name); // NOI18N
+    }
+
+    public String getDisplayName() {
+        return getHierarchicalName();
+    }
+    
+    public String getIconPath() {
+        return ICON_PATH;
+    }
+
+    public void addInterface(Interface ifc) {
+        this.ifc = ifc;
+    }
+    
+    public void removeInterface(Interface ifc) {
+        if (ifc.equals(this.ifc)) {
+            this.ifc = null;
+        }
+    }
+    
+    public Collection<Interface> getInterfaces() {
+        Vector<Interface> v = new Vector<Interface>();
+        if (ifc != null)
+            v.add(ifc);
+        return v;
+    }
+    
+    public boolean isOwnDesign() {
+        return isOwnDesign;
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentNodeChildren.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentNodeChildren.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentNodeChildren.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentNodeChildren.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentNodeChildren.java,v $
+ *
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: jsc $ $Date: 2008/02/11 10:54:02 $
+ *
+ *  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.datamodel.node;
+
+import java.util.Collection;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openoffice.extensions.projecttemplates.component.datamodel.Interface;
+import org.openoffice.extensions.projecttemplates.component.datamodel.Service;
+
+/**
+ *
+ * @author sg128468
+ */
+public class ComponentNodeChildren extends Children.Keys<Object> {
+    
+    /**
+     * Creates a new instance of ComponentNodeChildren
+     */
+    public ComponentNodeChildren() {
+    }
+
+    protected Node[] createNodes(Object object) {
+        Node[] node = null;
+        if (object instanceof Service) {
+            node = new Node[]{new ServiceNode(
+                    (Service)object, new ComponentNodeChildren())};
+        }
+        else if (object instanceof Interface) {
+            node = new Node[]{new InterfaceNode(
+                    (Interface)object, new ComponentNodeChildren())};
+        }
+/*        else {
+            node = new Node[]{new ComponentRootNode(
+                    object, new ComponentNodeChildren())};
+        } */
+
+        return node;
+    }
+
+    @Override
+    protected void addNotify() {
+        Node node = getNode();
+        if (node instanceof ComponentRootNode) {
+            ComponentRootNode set = (ComponentRootNode)node;
+            if (set.hasChildren()) {
+                setKeys(set.getSubTypesAsCollection());
+            }
+            else {
+                setKeys(new Object[]{});
+            }
+        }
+        else if (node instanceof ServiceNode) {
+            Service serv = (Service)node.getLookup().lookup(Service.class);
+            if (serv.getInterfaces().size() > 0) {
+                Collection<Interface> ifcs = serv.getInterfaces();
+                setKeys(ifcs);
+            }
+            else {
+                setKeys(new Object[]{});
+            }
+        }
+        else if (node instanceof InterfaceNode) {
+            Interface inf = (Interface)node.getLookup().lookup(Interface.class);
+            if (inf.getInterfaces().size() > 0) {
+                Collection<Interface> ifcs = inf.getInterfaces();
+                setKeys(ifcs);
+            }
+            else {
+                setKeys(new Object[]{});
+            }
+        }
+    }
+    
+    @Override
+    protected void removeNotify() {
+        setKeys(new Object[]{} );
+    }
+    
+    public void update() {
+        addNotify();
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentRootNode.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentRootNode.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentRootNode.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ComponentRootNode.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentRootNode.java,v $
+ *
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: sg $ $Date: 2009/07/10 08:32:42 $
+ *
+ *  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.datamodel.node;
+
+import java.awt.Image;
+import java.util.Collection;
+import java.util.Vector;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openide.util.ImageUtilities;
+import org.openide.util.NbBundle;
+import org.openide.util.lookup.Lookups;
+import org.openoffice.extensions.projecttemplates.component.ComponentWizardIterator;
+
+/**
+ *
+ * @author sg128468
+ */
+public class ComponentRootNode extends AbstractNode {
+    
+    Vector<Object> subTypes;
+    private static final String ICON = 
+            "org/openoffice/extensions/projecttemplates/component/icons/folder.png"; // NOI18N
+    private static final String OPEN_ICON = 
+            "org/openoffice/extensions/projecttemplates/component/icons/folderopen.png"; // NOI18N
+    
+    /**
+     * Creates a new instance of ComponentRootNode
+     */
+    public ComponentRootNode(Object obj, Children children) {
+        super(children, Lookups.singleton(obj));
+        subTypes = new Vector<Object>();
+    }
+    
+    public Collection<Object> getSubTypesAsCollection() {
+        return subTypes;
+    }
+   
+    public boolean hasChildren() {
+        return subTypes.size() > 0;
+    }
+    
+    public void addSubType(Object subType) {
+        if (subType != null) {
+            subTypes.add(subType);
+        }
+    }
+
+    public void removeSubType(Object subType) {
+        if (subType != null) {
+            subTypes.remove(subType);
+        }
+    }
+    
+    public static Node createInitialNodeStructure(String serviceName, String interfaceName) {
+        ComponentRootNode node = new ComponentRootNode(new Object(), new ComponentNodeChildren());
+/*        Service serv = new Service(serviceName, false);
+        Interface ifc = new Interface(interfaceName);
+        serv.addInterface(ifc);
+        node.addSubType(serv); */
+        return node;
+    }
+    
+    public void update() {
+        this.fireDisplayNameChange("", "newname"); // NOI18N
+    }
+
+    public String getDisplayName() {
+        return NbBundle.getMessage(ComponentWizardIterator.class, "LBL_Implement");
+    }
+
+    public Image getIcon(int i) {
+        return ImageUtilities.loadImage(ICON);
+    }
+
+    public Image getOpenedIcon(int i) {
+        return ImageUtilities.loadImage(OPEN_ICON);
+    }
+}
+

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/DataTypeNode.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/DataTypeNode.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/DataTypeNode.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/DataTypeNode.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: DataTypeNode.java,v $
+ *
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: sg $ $Date: 2009/07/10 08:32:42 $
+ *
+ *  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.datamodel.node;
+
+import java.awt.Image;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.util.ImageUtilities;
+import org.openide.util.lookup.Lookups;
+import org.openoffice.extensions.projecttemplates.component.datamodel.DataType;
+import org.openoffice.extensions.util.typebrowser.logic.TypeNode;
+
+/**
+ *
+ * @author sg128468
+ */
+public class DataTypeNode extends AbstractNode {
+    
+    String displayName;
+    String iconPath;
+    
+    /**
+     * Creates a new instance of DataTypeNode
+     */
+    public DataTypeNode(DataType obj, Children children) {
+        super(children, Lookups.singleton(obj));
+        this.displayName = obj.getTypesName();
+        this.iconPath = obj.getIconPath();
+        this.setName(displayName);
+    }
+    
+    public String getDisplayName() {
+        return displayName;
+    }
+    
+    public Image getIcon(int type) {
+       return ImageUtilities.loadImage(iconPath);
+    }
+    
+    public Image getOpenedIcon (int type) {
+        DataType dataType = (DataType)this.getLookup().lookup(DataType.class);
+        if (dataType.getType() == DataType.FOLDER_TYPE) {
+           return ImageUtilities.loadImage(TypeNode.OPEN_FOLDER_ICON);
+        }
+        return getIcon(type);
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/InterfaceNode.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/InterfaceNode.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/InterfaceNode.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/InterfaceNode.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: InterfaceNode.java,v $
+ *
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: sg $ $Date: 2009/07/10 08:32:42 $
+ *
+ *  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.datamodel.node;
+
+import java.awt.Image;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.util.ImageUtilities;
+import org.openide.util.lookup.Lookups;
+import org.openoffice.extensions.projecttemplates.component.datamodel.Interface;
+
+/**
+ *
+ * @author sg128468
+ */
+public class InterfaceNode extends AbstractNode {
+
+    private boolean deletable;
+    
+    /** Creates a new instance of InterfaceNode */
+    public InterfaceNode(Interface obj, Children children) {
+        super(children, Lookups.singleton(obj));
+    }
+
+    public Image getIcon(int type) {
+       Interface ifc = (Interface)this.getLookup().lookup(Interface.class);
+       return ImageUtilities.loadImage(ifc.getIconPath());
+    }
+    
+    public Image getOpenedIcon (int type) {
+        return getIcon(type);
+    }
+
+    public String getDisplayName() {
+       Interface ifc = (Interface)this.getLookup().lookup(Interface.class);
+       return ifc.getDisplayName();
+    }
+
+    public void update() {
+        Interface svc = (Interface)this.getLookup().lookup(Interface.class);
+        this.fireDisplayNameChange("", svc.getDisplayName()); // NOI18N
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ServiceNode.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ServiceNode.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ServiceNode.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/ServiceNode.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ServiceNode.java,v $
+ *
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: sg $ $Date: 2009/07/10 08:32:42 $
+ *
+ *  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.datamodel.node;
+
+import java.awt.Image;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.util.ImageUtilities;
+import org.openide.util.lookup.Lookups;
+import org.openoffice.extensions.projecttemplates.component.datamodel.Service;
+
+/**
+ *
+ * @author sg128468
+ */
+public class ServiceNode extends AbstractNode {
+
+    private boolean deletable;
+    
+    /**
+     * Creates a new instance of ServiceNode
+     */
+    public ServiceNode(Service obj, Children children) {
+        super(children, Lookups.singleton(obj));
+    }
+
+    public Image getIcon(int type) {
+        Service svc = (Service)this.getLookup().lookup(Service.class);
+        return ImageUtilities.loadImage(svc.getIconPath());
+    }
+    
+    public Image getOpenedIcon (int type) {
+        return getIcon(type);
+    }
+
+    public String getDisplayName() {
+        Service svc = (Service)this.getLookup().lookup(Service.class);
+        return svc.getDisplayName();
+    }
+    
+    public void update() {
+        Service svc = (Service)this.getLookup().lookup(Service.class);
+        this.fireDisplayNameChange("", svc.getDisplayName()); // NOI18N
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeNodeChildren.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeNodeChildren.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeNodeChildren.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeNodeChildren.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: TypeNodeChildren.java,v $
+ *
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/10/07 10:19:23 $
+ *
+ *  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.datamodel.node;
+
+import java.util.Collection;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openoffice.extensions.projecttemplates.component.datamodel.DataType;
+
+/**
+ *
+ * @author sg128468
+ */
+public class TypeNodeChildren extends Children.Keys<DataType> {
+    
+    /** Creates a new instance of TypeNodeChildren */
+    public TypeNodeChildren() {
+    }
+
+    protected Node[] createNodes(DataType object) {
+        Node[] node = null;
+        if (object != null) {
+            Collection coll = object.getAllTypes();
+            if ((coll != null && coll.size() > 0) || object.getType() == DataType.FOLDER_TYPE)
+                node = new Node[]{new DataTypeNode(object, new TypeNodeChildren())};
+            else 
+                node = new Node[]{new DataTypeNode(object, Children.LEAF)};
+        }
+        return node;
+    }
+
+    @Override
+    protected void addNotify() {
+        Node node = getNode();
+        if (node instanceof TypeRootNode) {
+            TypeRootNode set = (TypeRootNode)node;
+            if (set.hasChildren()) {
+                setKeys(set.getSubTypesAsCollection());
+            }
+        }
+        else {
+            Object o = node.getLookup().lookup(DataType.class);
+            if (o != null) {
+                DataType set = (DataType)o;
+                Collection<DataType> objects = set.getAllTypes();
+                if (objects != null)
+                    setKeys(objects);
+            }
+        }
+    }
+    
+    @Override
+    protected void removeNotify() {
+        setKeys(new DataType[]{});
+    }
+    
+    public void update() {
+        addNotify();
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeRootNode.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeRootNode.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeRootNode.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/node/TypeRootNode.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: TypeRootNode.java,v $
+ *
+ *  $Revision: 1.8 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/10/07 10:19:22 $
+ *
+ *  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.datamodel.node;
+
+import java.util.Collection;
+import java.util.Vector;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openoffice.extensions.projecttemplates.component.datamodel.DataType;
+
+/**
+ *
+ * @author sg128468
+ */
+public class TypeRootNode extends AbstractNode {
+
+    private Vector<DataType> subTypes;
+    
+    /** Creates a new instance of TypeRootNode */
+    public TypeRootNode(Children children) {
+        super(children);
+        subTypes = new Vector<DataType>();
+    }
+
+    public Collection<DataType> getSubTypesAsCollection() {
+        return subTypes;
+    }
+    
+    public boolean hasChildren() {
+        return subTypes.size() > 0;
+    }
+    
+    public void addSubType(DataType subType) {
+        if (subType != null) {
+            subTypes.add(subType);
+        }
+    }
+    
+    public void removeSubType(DataType subType) {
+        if (subType != null) {
+            subTypes.remove(subType);
+        }
+    }
+    
+    public static Node createInitialNodeStructure(String serviceName, String ifcName) {
+        TypeRootNode node = new TypeRootNode(new TypeNodeChildren());
+        DataType serviceDataType = new DataType(null, DataType.FOLDER_TYPE, DataType.SERVICE_TYPE);
+        DataType interfaceDataType = new DataType(null, DataType.FOLDER_TYPE, DataType.INTERFACE_TYPE);
+        DataType enumDataType = new DataType(null, DataType.FOLDER_TYPE, DataType.ENUM_TYPE);
+        DataType structDataType = new DataType(null, DataType.FOLDER_TYPE, DataType.STRUCT_TYPE);
+        DataType exceptionDataType = new DataType(null, DataType.FOLDER_TYPE, DataType.EXCEPTION_TYPE);
+        DataType polyStructDataType = new DataType(null, DataType.FOLDER_TYPE, DataType.POLY_STRUCT_TYPE);
+        node.addSubType(serviceDataType);
+        node.addSubType(interfaceDataType);
+        node.addSubType(enumDataType);
+        node.addSubType(structDataType);
+        node.addSubType(exceptionDataType);
+        node.addSubType(polyStructDataType);
+        return node;
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_generateMnemonicsCode" 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" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jScrollPane1" pref="451" max="32767" attributes="0"/>
+              <EmptySpace 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"/>
+              <Component id="jScrollPane1" pref="220" max="32767" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+      <Properties>
+        <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+          <Color blue="ff" green="ff" red="ff" type="rgb"/>
+        </Property>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+            <EtchetBorder/>
+          </Border>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new BeanTreeView();"/>
+      </AuxValues>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+    </Container>
+  </SubComponents>
+</Form>

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypeCustomEditor.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentInterfaceTypeCustomEditor.java,v $
+ *
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/07/03 08:29:17 $
+ *
+ *  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.datamodel.types.node;
+
+import java.beans.FeatureDescriptor;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.beans.VetoableChangeListener;
+import javax.swing.tree.TreeSelectionModel;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.propertysheet.PropertyEnv;
+import org.openide.explorer.propertysheet.editors.EnhancedCustomPropertyEditor;
+import org.openide.explorer.view.BeanTreeView;
+import org.openide.nodes.Node;
+import org.openoffice.extensions.projecttemplates.component.ComponentPanelVisual2IdlFiles;
+import org.openoffice.extensions.util.datamodel.Interface;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.datamodel.Service;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+import org.openoffice.extensions.util.typebrowser.logic.UnoTypes;
+import org.openoffice.extensions.util.typebrowser.logic.TypeNode;
+
+/**
+ *
+ * @author  sg128468
+ */
+public class ComponentInterfaceTypeCustomEditor extends javax.swing.JPanel 
+        implements ExplorerManager.Provider, PropertyChangeListener, 
+        VetoableChangeListener, EnhancedCustomPropertyEditor {
+    
+    private ExplorerManager manager = new ExplorerManager();
+    private PropertyEnv propertyEnv;
+    private ComponentInterfaceTypePropertyEditor editor;
+    
+//    private String selectedType;
+    private TypeNode rootNode;
+
+    // the return type, set into the editor
+    private String fullName;
+    private Service service;
+    
+    /** Creates new form ComponentTypeCustomEditor */
+    public ComponentInterfaceTypeCustomEditor(ComponentInterfaceTypePropertyEditor editor, 
+            PropertyEnv propertyEnv) {
+        initComponents();
+        this.propertyEnv = propertyEnv;
+        this.editor = editor;
+        propertyEnv.setState(PropertyEnv.STATE_INVALID);
+        propertyEnv.addVetoableChangeListener(this);
+
+        FeatureDescriptor desc = propertyEnv.getFeatureDescriptor();
+        SimpleOpenOfficeOrgProperty.SimpleProperty property = (SimpleOpenOfficeOrgProperty.SimpleProperty)desc;
+        NbNodeObject obj = property.getPropertyParent();
+        this.service = (Service)obj;
+        
+        this.rootNode = TypeNode.createRootNode(
+                new String[] { 
+                      UnoTypes.INTERFACE,
+                }
+        );
+  
+        manager.setRootContext(rootNode);
+        BeanTreeView typeView = (BeanTreeView)jScrollPane1;
+        typeView.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+        manager.addPropertyChangeListener(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.
+     */
+    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
+    private void initComponents() {
+        jScrollPane1 = new BeanTreeView();
+
+        jScrollPane1.setBackground(new java.awt.Color(255, 255, 255));
+        jScrollPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+
+        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(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(layout.createSequentialGroup()
+                .addContainerGap()
+                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    public ExplorerManager getExplorerManager() {
+        return manager;
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        Node[] nodes = manager.getSelectedNodes();
+        if (nodes != null && nodes.length > 0) {
+            TypeNode node = (TypeNode)nodes[0];  // single tree selection
+
+            if (node.getNodeType() == UnoTypes.INTERFACE_TYPE) { // do only add interfaces
+                propertyEnv.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
+            }
+            else {
+                propertyEnv.setState(PropertyEnv.STATE_INVALID);
+            }
+        }
+    }
+
+    public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
+        if (PropertyEnv.PROP_STATE.equals(evt.getPropertyName()) &&
+            PropertyEnv.STATE_VALID.equals(evt.getNewValue()) && 
+                    PropertyEnv.STATE_NEEDS_VALIDATION.equals(evt.getOldValue())) { // OK pressed
+            setFullName();
+            ComponentPanelVisual2IdlFiles comp = ComponentPanelVisual2IdlFiles.getComponentPanelVisual2IdlFiles();
+            boolean ifcOwnDesign = false;
+            if (comp != null) {  // TODO something else?
+                NbNodeObject[] designedTypes = comp.getDesignedTypes();
+                if (designedTypes != null) {
+                    String aName = fullName.substring(fullName.lastIndexOf('.') + 1); 
+                    for (int i = 0; i < designedTypes.length; i++) {
+                        if (designedTypes[i].getType() == NbNodeObject.INTERFACE_TYPE) { 
+                            Interface ifc = (Interface)designedTypes[i];
+                            try {
+                                if (ifc.getSimpleProperty(ifc.PROPERTY_CONTAINER_NAME).equals(aName)) {
+                                    service.addSetObject(fullName, ifc);
+                                    ifcOwnDesign = true;
+                                }
+                            } catch (UnknownOpenOfficeOrgPropertyException ex) {
+                                ex.printStackTrace();
+                            }
+                        }
+                    }
+                } 
+            }
+            if (!ifcOwnDesign) {
+                int index = fullName.lastIndexOf('.');
+                String pkg = null;
+                String name = null;
+                if (index != -1) {
+                    pkg = fullName.substring(0, index);
+                    name = fullName.substring(index + 1);
+                }
+                else  {
+                    pkg = ""; // NOI18N
+                    name = fullName;
+                }
+                Interface ifc = new Interface(name, pkg);
+                ifc.setType(NbNodeObject.OFFICE_INTERFACE_TYPE);
+                service.addSetObject(fullName, ifc);
+            }
+        }
+    }
+
+    private void setFullName() {
+        Node[] nodes = manager.getSelectedNodes();
+        if (nodes != null && nodes.length > 0) {
+            TypeNode node = (TypeNode)nodes[0];
+            fullName = node.getHierarchicalName();
+        }
+    }
+    
+    public Object getPropertyValue() throws IllegalStateException {
+        return fullName;
+    }
+    
+//    
+//    public void addTemplateTypes(String polyStructTypes) {
+//        this.type = polyStructTypes;
+//    }
+    
+    
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JScrollPane jScrollPane1;
+    // End of variables declaration//GEN-END:variables
+
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypePropertyEditor.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypePropertyEditor.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypePropertyEditor.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentInterfaceTypePropertyEditor.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentInterfaceTypePropertyEditor.java,v $
+ *
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/07/03 08:29:15 $
+ *
+ *  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.datamodel.types.node;
+
+import java.awt.Component;
+import java.beans.FeatureDescriptor;
+import java.beans.PropertyEditorSupport;
+import org.openide.explorer.propertysheet.ExPropertyEditor;
+import org.openide.explorer.propertysheet.PropertyEnv;
+import org.openoffice.extensions.util.typebrowser.logic.UnoTypes;
+
+/**
+ *
+ * @author sg128468
+ */
+public class ComponentInterfaceTypePropertyEditor 
+        extends PropertyEditorSupport implements ExPropertyEditor {
+    
+    private PropertyEnv propertyEnv;
+    
+    /**
+     * Creates a new instance of ComponentTypePropertyEditor
+     */
+    public ComponentInterfaceTypePropertyEditor() {
+    }
+    
+    public void attachEnv(PropertyEnv propertyEnv) {
+        this.propertyEnv = propertyEnv;
+    }
+    
+    public Component getCustomEditor() {
+        return new ComponentInterfaceTypeCustomEditor(this, propertyEnv);
+    }
+    
+    public boolean supportsCustomEditor() {
+        return true;
+    }    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeChildren.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeChildren.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeChildren.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeChildren.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentTypeChildren.java,v $
+ *
+ *  $Revision: 1.3 $
+ *
+ *  last change: $Author: jsc $ $Date: 2008/02/11 11:02:18 $
+ *
+ *  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.datamodel.types.node;
+
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+
+/**
+ *
+ * @author sg128468
+ */
+public class ComponentTypeChildren extends Children.Keys<NbNodeObject> {
+
+    private boolean noChildren;
+
+    /**
+     * Creates a new instance of ComponentTypeChildren
+     */
+    public ComponentTypeChildren() {
+        this(false);
+    }
+
+    public ComponentTypeChildren(boolean noChildren) {
+        this.noChildren = noChildren;
+    }
+
+    protected Node[] createNodes(NbNodeObject nbNode) {
+        Node[] vNodes = null;
+        if (nbNode.getAllSubObjects() == null || noChildren) {
+            vNodes = new Node[]{new ComponentTypeNode(nbNode, Children.LEAF)};
+        } else {
+            vNodes = new Node[]{new ComponentTypeNode(nbNode, new ComponentTypeChildren())};
+        }
+        return vNodes;
+    }
+
+    @Override
+    protected void addNotify() {
+        Node node = getNode();
+        Object o = node.getLookup().lookup(NbNodeObject.class);
+        if (o != null) {
+            NbNodeObject set = (NbNodeObject) o;
+            NbNodeObject[] objects = set.getAllSubObjects();
+            if (objects != null) {
+                setKeys(objects);
+            }
+        }
+    }
+
+    @Override
+    protected void removeNotify() {
+        setKeys(new NbNodeObject[]{});
+    }
+
+    public void update() {
+        addNotify();
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeCustomEditor.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeCustomEditor.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeCustomEditor.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeCustomEditor.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_generateMnemonicsCode" 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 max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" alignment="1" attributes="0">
+                      <Component id="jLabel1" pref="215" max="32767" attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="selectTypeComboBox" min="-2" pref="251" max="-2" attributes="0"/>
+                  </Group>
+                  <Component id="jScrollPane1" alignment="1" pref="478" max="32767" attributes="0"/>
+                  <Group type="102" alignment="0" attributes="0">
+                      <Component id="optionalCheckBox" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace pref="152" max="32767" attributes="0"/>
+                      <Component id="ambiguousCheckBox" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace min="-2" pref="114" max="-2" attributes="0"/>
+                      <Component id="defaultedCheckBox" min="-2" max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+              <EmptySpace 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="selectTypeComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jScrollPane1" min="-2" pref="167" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="optionalCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="defaultedCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="ambiguousCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="32767" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+      <Properties>
+        <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+          <Color blue="ff" green="ff" red="ff" type="rgb"/>
+        </Property>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+            <EtchetBorder/>
+          </Border>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new BeanTreeView();"/>
+      </AuxValues>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+    </Container>
+    <Component class="javax.swing.JComboBox" name="selectTypeComboBox">
+      <Properties>
+        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+          <Connection code="new DefaultComboBoxModel(getComboBoxList())" type="code"/>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="selectTypeActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JLabel" name="jLabel1">
+      <Properties>
+        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+          <ComponentRef name="selectTypeComboBox"/>
+        </Property>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/component/Bundle.properties" key="LBL_DisplayType" replaceFormat="NbBundle.getMessage(ComponentWizardIterator.class, &quot;LBL_DisplayType&quot;)"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JCheckBox" name="optionalCheckBox">
+      <Properties>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/component/Bundle.properties" key="LBL_optionalCheckBox" replaceFormat="NbBundle.getMessage(ComponentWizardIterator.class, &quot;LBL_optionalCheckBox&quot;)"/>
+        </Property>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
+            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
+          </Border>
+        </Property>
+        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
+          <Insets value="[0, 0, 0, 0]"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JCheckBox" name="ambiguousCheckBox">
+      <Properties>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/component/Bundle.properties" key="LBL_ambiguousCheckBox" replaceFormat="NbBundle.getMessage(ComponentWizardIterator.class, &quot;LBL_ambiguousCheckBox&quot;)"/>
+        </Property>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
+            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
+          </Border>
+        </Property>
+        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
+          <Insets value="[0, 0, 0, 0]"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JCheckBox" name="defaultedCheckBox">
+      <Properties>
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString bundle="org/openoffice/extensions/projecttemplates/component/Bundle.properties" key="LBL_defaultedCheckBox" replaceFormat="NbBundle.getMessage(ComponentWizardIterator.class, &quot;LBL_defaultedCheckBox&quot;)"/>
+        </Property>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
+            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
+          </Border>
+        </Property>
+        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
+          <Insets value="[0, 0, 0, 0]"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+  </SubComponents>
+</Form>



Mime
View raw message