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 [28/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/datamodel/types/node/ComponentTypeCustomEditor.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeCustomEditor.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeCustomEditor.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeCustomEditor.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,342 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentTypeCustomEditor.java,v $
+ *
+ *  $Revision: 1.9 $
+ *
+ *  last change: $Author: sg $ $Date: 2009/07/06 14:51:29 $
+ *
+ *  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.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.beans.VetoableChangeListener;
+import java.util.StringTokenizer;
+import javax.swing.DefaultComboBoxModel;
+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.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.component.ComponentWizardIterator;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.datamodel.PolyStruct;
+import org.openoffice.extensions.util.datamodel.PropertyContainer;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+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 ComponentTypeCustomEditor extends javax.swing.JPanel 
+        implements ExplorerManager.Provider, PropertyChangeListener, 
+        VetoableChangeListener, EnhancedCustomPropertyEditor {
+    
+    private ExplorerManager manager = new ExplorerManager();
+    private PropertyEnv propertyEnv;
+    private ComponentTypePropertyEditor editor;
+    
+//    private String selectedType;
+    private TypeNode rootNode;
+
+    // the return type, set into the editor
+    private String type;
+    
+    /** Creates new form ComponentTypeCustomEditor */
+    public ComponentTypeCustomEditor(ComponentTypePropertyEditor editor, 
+            PropertyEnv propertyEnv) {
+        initComponents();
+        type = ""; // NOI18N
+        this.propertyEnv = propertyEnv;
+        this.editor = editor;
+        propertyEnv.setState(PropertyEnv.STATE_INVALID);
+        propertyEnv.addVetoableChangeListener(this);
+
+//        NbNodeObject[] addNodes = this.comp.getDesignedTypes();
+        
+        // important: in the Resource Budle, entries for the type list
+        // must have this order: all, ifc, enum, struct, consts
+        this.rootNode = TypeNode.createRootNode(
+                new String[] { 
+                      UnoTypes.MODULE,
+                      UnoTypes.INTERFACE,
+                      UnoTypes.STRUCT,
+                      UnoTypes.SIMPLE,
+//                      TypeBrowser.ENUM,
+//                      TypeBrowser.CONSTANTS,
+                }
+//                null
+        );
+  
+//        2do: use this later!        
+//        FeatureDescriptor desc = propertyEnv.getFeatureDescriptor();
+        
+        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();
+        selectTypeComboBox = new javax.swing.JComboBox();
+        jLabel1 = new javax.swing.JLabel();
+        optionalCheckBox = new javax.swing.JCheckBox();
+        ambiguousCheckBox = new javax.swing.JCheckBox();
+        defaultedCheckBox = new javax.swing.JCheckBox();
+
+        jScrollPane1.setBackground(new java.awt.Color(255, 255, 255));
+        jScrollPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+
+        selectTypeComboBox.setModel(new DefaultComboBoxModel(getComboBoxList()));
+        selectTypeComboBox.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                selectTypeActionPerformed(evt);
+            }
+        });
+
+        jLabel1.setLabelFor(selectTypeComboBox);
+        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage(ComponentWizardIterator.class, "LBL_DisplayType"));
+
+        org.openide.awt.Mnemonics.setLocalizedText(optionalCheckBox, NbBundle.getMessage(ComponentWizardIterator.class, "LBL_optionalCheckBox"));
+        optionalCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+        optionalCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
+
+        org.openide.awt.Mnemonics.setLocalizedText(ambiguousCheckBox, NbBundle.getMessage(ComponentWizardIterator.class, "LBL_ambiguousCheckBox"));
+        ambiguousCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+        ambiguousCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
+
+        org.openide.awt.Mnemonics.setLocalizedText(defaultedCheckBox, NbBundle.getMessage(ComponentWizardIterator.class, "LBL_defaultedCheckBox"));
+        defaultedCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+        defaultedCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
+
+        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(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+                        .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)
+                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                        .add(selectTypeComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 251, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
+                    .add(layout.createSequentialGroup()
+                        .add(optionalCheckBox)
+                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 125, Short.MAX_VALUE)
+                        .add(ambiguousCheckBox)
+                        .add(114, 114, 114)
+                        .add(defaultedCheckBox)))
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(layout.createSequentialGroup()
+                .addContainerGap()
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(selectTypeComboBox, 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.PREFERRED_SIZE, 167, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(optionalCheckBox)
+                    .add(defaultedCheckBox)
+                    .add(ambiguousCheckBox))
+                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void selectTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectTypeActionPerformed
+
+        int index = selectTypeComboBox.getSelectedIndex();
+        switch (index) {
+            case 1:
+                TypeNode.setDisplayedTypes(new String[]{UnoTypes.INTERFACE});
+                break;
+            case 2:
+                TypeNode.setDisplayedTypes(new String[]{UnoTypes.STRUCT});
+                break;
+            case 3:
+                TypeNode.setDisplayedTypes(new String[]{UnoTypes.CONSTANTS});
+                break;
+            default:  // default: show all
+                TypeNode.setDisplayedTypes(new String[]{
+                      UnoTypes.INTERFACE,
+                      UnoTypes.SIMPLE,
+                      UnoTypes.STRUCT,
+//                      TypeBrowser.ENUM,
+//                      TypeBrowser.CONSTANTS,
+                  });
+        }
+        // update UI
+        Node node = manager.getExploredContext();
+        if (node == null) {
+            node = manager.getRootContext();
+        }
+        TypeBrowserChildren tbc = (TypeBrowserChildren)node.getChildren();
+        tbc.update();
+        
+    }//GEN-LAST:event_selectTypeActionPerformed
+
+    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.MODULE_TYPE) { // do not add modules to this type
+//                selectedType = getSelectedType();
+                propertyEnv.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
+            }
+            else {
+//                selectedType = null;
+                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
+            getSelectedTypeName();
+            Node[] nodes = manager.getSelectedNodes();
+            if (nodes != null && nodes.length > 0) {
+                TypeNode node = (TypeNode)nodes[0];  // single tree selection
+                if (node.getNodeType() == UnoTypes.POLY_STRUCT_TYPE) {
+                    NbNodeObject[] nodeObjects = node.getDesignedTypes();
+                    if (nodeObjects != null) { 
+                        NbNodeObject polyStructObject = getOwnType(type, nodeObjects);
+                        if (polyStructObject != null) {
+                            PolyStruct plStruct = (PolyStruct)polyStructObject;
+                            NewTemplateTypesDialog.start(editor, plStruct);
+                        }
+                        else {
+                            // 2do for office poly struct types
+                        }
+                    }
+                }
+                else {
+                    editor.setValue(type);
+                }
+            }
+        }
+    }
+
+    public Object getPropertyValue() throws IllegalStateException {
+        getSelectedTypeName();
+        return type;
+    }
+    
+//    public void addTemplateTypes(String polyStructTypes) {
+//        this.type = polyStructTypes;
+//    }
+    
+    private NbNodeObject getOwnType(String type, NbNodeObject[] nodeObjects) {
+        // get own tyope from list
+        for (int i=0; i<nodeObjects.length; i++) {
+            PropertyContainer cont = (PropertyContainer)nodeObjects[i];
+            try {
+                // exception in the next line means it's not a poly struct and can be ignored
+                String displName = cont.getSimpleProperty(PolyStruct.PROPERTY_CONTAINER_PACKAGE).concat(
+                        ".").concat(cont.getSimpleProperty(PolyStruct.PROPERTY_CONTAINER_NAME)); // NOI18N
+                if (type.indexOf(displName) != -1) {
+                    return nodeObjects[i];
+                }
+            } catch (UnknownOpenOfficeOrgPropertyException ex) {
+                LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, ex.getMessage());
+            }
+        }
+        return null;
+    }
+    
+    private String[] getComboBoxList() {
+        String list = NbBundle.getMessage(ComponentWizardIterator.class, "LST_TypeList");
+        StringTokenizer t = new StringTokenizer(list, " "); // NOI18N
+        String[] retVal = new String[t.countTokens()];
+        for (int i=0; t.hasMoreTokens(); i++) {
+            retVal[i] = t.nextToken();
+        }
+        return retVal;
+    }
+    
+    private void getSelectedTypeName() {
+        Node[] nodes = manager.getSelectedNodes();
+        type = ""; // NOI18N
+        if (nodes != null && nodes.length > 0) {
+            TypeNode node = (TypeNode)nodes[0];  // single tree selection
+
+            if (node.getNodeType() != UnoTypes.MODULE_TYPE) { // do not add modules to this type
+                type = node.getHierarchicalName();
+            }
+        }
+        if (optionalCheckBox.isSelected()) {
+            // add optional poly struct
+            type = "com.sun.star.beans.Optional< ".concat(type).concat(" >"); // NOI18N
+        }
+        if (ambiguousCheckBox.isSelected()) {
+            // ad ambiguous poly struct
+            type = "com.sun.star.beans.Ambiguous< ".concat(type).concat(" >"); // NOI18N
+        }
+        if (defaultedCheckBox.isSelected()) {
+            // ad defaulted poly struct
+            type = "com.sun.star.beans.Defaulted< ".concat(type).concat(" >"); // NOI18N
+        }
+    }
+    
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JCheckBox ambiguousCheckBox;
+    private javax.swing.JCheckBox defaultedCheckBox;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JCheckBox optionalCheckBox;
+    private javax.swing.JComboBox selectTypeComboBox;
+    // End of variables declaration//GEN-END:variables
+
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeNode.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeNode.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeNode.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypeNode.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentTypeNode.java,v $
+ *
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: sg $ $Date: 2009/07/06 14:51:29 $
+ *
+ *  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.Image;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.Action;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openide.nodes.Node.Property;
+import org.openide.nodes.Sheet;
+import org.openide.util.ImageUtilities;
+import org.openide.util.lookup.Lookups;
+//import org.openoffice.extensions.projecttemplates.calcaddin.AddinActions;
+import org.openoffice.extensions.util.datamodel.Function;
+import org.openoffice.extensions.util.datamodel.Interface;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.datamodel.PropertyContainer;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+
+/**
+ *
+ * @author sg128468
+ */
+public class ComponentTypeNode extends AbstractNode implements PropertyChangeListener {
+    
+    Action[] actions;
+    
+    // node has subnodes
+    public static final String NODE_ICON = 
+            "org/openoffice/extensions/projecttemplates/component/icons/method.png"; // NOI18N
+    public static final String PARAMETER_ICON = 
+            "org/openoffice/extensions/projecttemplates/component/icons/parameter.png"; // NOI18N
+    public static final String SIMPLE_ICON = 
+            "org/openoffice/extensions/projecttemplates/component/icons/name.png"; // NOI18N
+//    public static final String DESC_ICON = 
+//            "org/openoffice/extensions/projecttemplates/component/icons/description.png"; // NOI18N
+    public static final String INTERFACE_ICON =
+            "org/openoffice/extensions/projecttemplates/component/icons/interface.png"; // NOI18N
+            
+    public ComponentTypeNode(NbNodeObject obj, Children children) {
+        super (children, Lookups.singleton(obj));
+        if (obj.hasActions(NbNodeObject.COMPONENT_TYPE)) {
+            actions = obj.getActions(false);
+        }
+    }
+
+    public ComponentTypeNode() {
+        super (new ComponentTypeChildren());
+        setDisplayName ("Root"); // NOI18N
+    }
+    
+    public Image getIcon (int type) {
+        String icon = SIMPLE_ICON;
+        Object o = this.getLookup().lookup(NbNodeObject.class);
+        if (o instanceof PropertyContainer) {
+            if (o instanceof Function) {
+                icon = NODE_ICON;
+            }
+            else if (o instanceof Interface) {
+                icon = INTERFACE_ICON;
+            }
+            else {
+                icon = PARAMETER_ICON;
+            }
+        }
+        return ImageUtilities.loadImage(icon);
+    }    
+
+    public String getDisplayName() {
+        NbNodeObject object = (NbNodeObject)getLookup().lookup(NbNodeObject.class);
+        String displayName = object.getDisplayName();
+//        if (displayName.equals(super.getDisplayName())) {
+//            return displayName;
+//        }
+//        setDisplayName(displayName);
+        return displayName;
+    }
+
+    public Image getOpenedIcon (int type) {
+        return getIcon(type);
+    }
+
+    public Action[] getActions(boolean context) {
+        if (actions == null)
+            return super.getActions(context);
+        return actions;
+    }
+    
+    /**
+     * set AddinActions into the actions of this node, the AddinActions
+     * are used to perform the actions available in the context menu of the node
+     */
+    public void setActions(BaseAction baseActions) {
+        if (actions != null) {
+            NbNodeObject o = (NbNodeObject)this.getLookup().lookup(NbNodeObject.class);
+            // if the object should have actions for this type, 
+            // give to it the base action class to wrap
+            if (o.hasActions(NbNodeObject.COMPONENT_TYPE)) {
+                // rename setActions to something less confusing?
+                o.setActions(baseActions);
+            }
+        }
+        Node[] subnodes = this.getChildren().getNodes();
+        for (int i=0; i<subnodes.length; i++)
+            ((ComponentTypeNode)subnodes[i]).setActions(baseActions);
+    }
+
+    protected Sheet createSheet() {
+        Sheet sheet = Sheet.createDefault();
+        NbNodeObject object = (NbNodeObject)getLookup().lookup(NbNodeObject.class);
+        // create the properties in the object and let the object set them
+        object.createProperties(sheet, this);
+        return sheet;
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        this.fireCookieChange();
+        this.fireDisplayNameChange("o", "n"); // NOI18N
+        if (this.getParentNode() != null) {
+            ((PropertyChangeListener)this.getParentNode()).propertyChange(evt);
+        }
+    }
+    
+    public void triggerChangeEvent() {
+        this.fireCookieChange();
+        this.fireDisplayNameChange("o", "n"); // NOI18N
+    }
+    
+    public void triggerLanguageChange() {
+        NbNodeObject object = (NbNodeObject)getLookup().lookup(NbNodeObject.class);
+        // create the properties in the object and let the object set them
+        // this triggers the update of the property sheet
+        Sheet newSheet = this.getSheet();
+        Property[] newSet = object.createProperties(newSheet, this); 
+        this.setSheet(newSheet);
+
+// fire property changes did not work: properties were not updated.                 
+//        PropertySet[] propset = this.getPropertySets();
+//        this.firePropertySetsChange(propset, null);
+//        for(int i=0; i<propset.length; i++) {
+//            Property[] prop = propset[i].getProperties();
+//            System.out.println("  " + propset[i].getDisplayName()); // NOI18N
+//            for (int j=0; j<prop.length; j++) {
+//                    System.out.println("    " + prop[j].getDisplayName()); // NOI18N
+//                    this.firePropertyChange(prop[j].getDisplayName(), null, ""); // NOI18N
+//                }
+//            }
+//        }
+
+        Node[] subnodes = this.getChildren().getNodes();
+        for (int i=0; i<subnodes.length; i++)
+            ((ComponentTypeNode)subnodes[i]).triggerLanguageChange();
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypePropertyEditor.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypePropertyEditor.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypePropertyEditor.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/ComponentTypePropertyEditor.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ComponentTypePropertyEditor.java,v $
+ *
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/07/03 08:29:16 $
+ *
+ *  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 ComponentTypePropertyEditor 
+        extends PropertyEditorSupport implements ExPropertyEditor {
+    
+    private PropertyEnv propertyEnv;
+    private String[] simpleTypeTags;
+    
+    /**
+     * Creates a new instance of ComponentTypePropertyEditor
+     */
+    public ComponentTypePropertyEditor() {
+        int length = UnoTypes.SIMPLE_TYPE_TAGS.length;
+        simpleTypeTags = new String[length];
+        System.arraycopy(UnoTypes.SIMPLE_TYPE_TAGS, 1, simpleTypeTags, 0, length - 1);
+        simpleTypeTags[length - 1] = "[]"; // NOI18N
+    }
+    
+    /**
+     * Creates a new instance of ComponentTypePropertyEditor
+     */
+    public ComponentTypePropertyEditor(String[] tags) {
+        simpleTypeTags = tags;
+    }
+
+    public String[] getTags() {
+        return simpleTypeTags;
+    }
+    
+    public String getAsText() {
+        return (String)getValue();
+    }
+    
+    public void setAsText(String text) {
+        if(text.equals("[]")) { // NOI18N
+            String value = (String)getValue();
+            setValue(value.concat("[]")); // NOI18N
+        }
+        else {
+            setValue(text);
+        }
+    }
+    
+    public void attachEnv(PropertyEnv propertyEnv) {
+        this.propertyEnv = propertyEnv;
+    }
+    
+    public PropertyEnv getPropertyEnv() {
+        return propertyEnv;
+    }
+    
+    public Component getCustomEditor() {
+        return new ComponentTypeCustomEditor(this, propertyEnv);
+    }
+    
+    public boolean supportsCustomEditor() {
+        return true;
+    }    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/IdlTypeTreeCreator.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/IdlTypeTreeCreator.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/IdlTypeTreeCreator.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/IdlTypeTreeCreator.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: IdlTypeTreeCreator.java,v $
+ *
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/05/03 09:54:10 $
+ *
+ *  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.PropertyChangeListener;
+import java.util.Vector;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.FunctionException;
+import org.openoffice.extensions.util.datamodel.IdlEnumeration;
+import org.openoffice.extensions.util.datamodel.Interface;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.datamodel.PolyStruct;
+import org.openoffice.extensions.util.datamodel.Service;
+import org.openoffice.extensions.util.datamodel.Struct;
+import org.openoffice.extensions.util.datamodel.TemplateType;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class IdlTypeTreeCreator {
+
+    /**
+     */
+    private IdlTypeTreeCreator() {
+    }
+    
+    public static ComponentTypeNode createInitialInterfaceTree(String interfaceName, String pkgName) {
+        Interface ifc = new Interface(interfaceName, pkgName);
+        ifc.addFunction();
+        ComponentTypeNode rootNode = new ComponentTypeNode(ifc, new ComponentTypeChildren());
+        return rootNode;
+    }
+
+    public static ComponentTypeNode createInitialServiceTree(String serviceName, String pkgName) {
+        Service svrc = new Service(serviceName, pkgName);
+        ComponentTypeNode rootNode = new ComponentTypeNode(svrc, new ComponentTypeChildren(true));
+        return rootNode;
+    }
+
+    public static ComponentTypeNode createInitialEnumTree(String enumName, String pkgName) {
+        IdlEnumeration enm = new IdlEnumeration(enumName, pkgName);
+        enm.addEnum();
+        ComponentTypeNode rootNode = new ComponentTypeNode(enm, new ComponentTypeChildren(true));
+        return rootNode;
+    }
+
+    public static ComponentTypeNode createInitialStructTree(String structName, String pkgName) {
+        Struct str = new Struct(structName, pkgName);
+        str.addStructType();
+        ComponentTypeNode rootNode = new ComponentTypeNode(str, new ComponentTypeChildren(true));
+        return rootNode;
+    }
+
+    public static ComponentTypeNode createInitialException(String exName, String pkgName) {
+        FunctionException ex = new FunctionException(exName, pkgName);
+        ComponentTypeNode rootNode = new ComponentTypeNode(ex, new ComponentTypeChildren(true));
+        return rootNode;
+    }
+
+    public static ComponentTypeNode createInitialPolyStruct(String structName, String pkgName) {
+        PolyStruct ps = new PolyStruct(structName, pkgName);
+        ps.addTemplateType();
+        ps.addPropertyType();
+        ComponentTypeNode rootNode = new ComponentTypeNode(ps, new ComponentTypeChildren(true));
+        return rootNode;
+    }
+    
+    public static ComponentTypeNode createTemplateNode(PolyStruct plStruct) {
+        
+        String[] typeNames = plStruct.getTemplateTypeNames();
+        Vector<TemplateType>templTypes = new Vector<TemplateType>();
+        for (int i=0; i<typeNames.length; i++) {
+            templTypes.add(plStruct.getTemplateType(typeNames[i]));
+        }
+        
+        
+        // create new template types with the right editor.
+        final TemplateType[] newTemplateTypes = new TemplateType[templTypes.size()];
+        for (int i=0; i<newTemplateTypes.length; i++) {
+            TemplateType oldType = templTypes.get(i);
+            try {
+                newTemplateTypes[i] = new TemplateType(
+                        oldType.getSimpleProperty(TemplateType.PROPERTY_CONTAINER_NAME),
+                        oldType.getSimpleProperty(TemplateType.PROPERTY_CONTAINER_TYPE),
+                        null,
+                        true
+                );
+            } catch (UnknownOpenOfficeOrgPropertyException ex) {
+                LogWriter.getLogWriter().printStackTrace(ex);
+            }
+        }
+        // need a simple root object for the templates
+        NbNodeObject ob = new NbNodeObject(){
+            public NbNodeObject getParent() { // no parent
+                return null;
+            }
+            public String getDisplayName() { // will not be displayed
+                return ""; // NOI18N
+            }
+            public NbNodeObject[] getAllSubObjects() { // return the templates
+                return newTemplateTypes;
+            }
+            public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+                // this is important: the properties have to be set for the sheet
+                Sheet.Set set = null;
+                if (sheet != null) {
+                    for (int i=0; i<newTemplateTypes.length; i++) {
+                        set = sheet.createPropertiesSet();
+                        set.setName(new StringBuffer("Template ").append(i+1).toString()); // NOI18N
+                        set.setDisplayName(set.getName());
+                        set.put(newTemplateTypes[i].createProperties(null, listener));
+                        sheet.put(set);
+                    } 
+                }
+                return new Node.Property[0];
+            }
+            public boolean hasActions(int type) { // no nodes, no actions
+                return false;
+            }
+            public Action[] getActions(boolean context) { 
+                return null;
+            }
+            public void setActions(BaseAction actions) {}  // not interested
+            public int getType() { // return the template type: will not be asked anyway
+                return NbNodeObject.TEMPLATE_TYPE;  
+            }
+        };
+        return new ComponentTypeNode(ob, new ComponentTypeChildren(true));
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,41 @@
+<?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"/>
+              <Component id="jPanel1" pref="376" 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="1" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jPanel1" pref="244" max="32767" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JPanel" name="jPanel1">
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new PropertySheet();"/>
+      </AuxValues>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+    </Container>
+  </SubComponents>
+</Form>

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/datamodel/types/node/NewTemplateTypesDialog.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: NewTemplateTypesDialog.java,v $
+ *
+ *  $Revision: 1.3 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/08/15 13:45:11 $
+ *
+ *  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.Dialog;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.FeatureDescriptor;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.propertysheet.PropertySheet;
+import org.openide.nodes.Node;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.component.ComponentWizardIterator;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.datamodel.PolyStruct;
+import org.openoffice.extensions.util.datamodel.TemplateType;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author  sg128468
+ */
+public class NewTemplateTypesDialog extends javax.swing.JPanel 
+            implements ExplorerManager.Provider, ActionListener {
+
+
+    ExplorerManager manager = new ExplorerManager();
+
+    private PolyStruct plStruct;
+    private ComponentTypePropertyEditor editor;    
+    
+    /** Creates new form NewTemplateTypesDialog */
+    public NewTemplateTypesDialog(ComponentTypePropertyEditor editor, PolyStruct plStruct) {
+        this.editor = editor;
+        this.plStruct = plStruct;
+        initComponents();
+        
+        Node node = (Node)IdlTypeTreeCreator.createTemplateNode(plStruct);
+            
+        manager.setRootContext(node);
+
+        PropertySheet propSheet = (PropertySheet)jPanel1;
+        propSheet.setNodes(new Node[]{node});
+    }
+    
+    /** 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() {
+        jPanel1 = new PropertySheet();
+
+        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(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+                .addContainerGap()
+                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+    }// </editor-fold>//GEN-END:initComponents
+    
+    private void performOK() {
+        StringBuffer result = new StringBuffer();
+        // write the information from this copy back to the editor
+        Node[] nodes = manager.getRootContext().getChildren().getNodes();
+        try {
+            String structName = plStruct.getSimpleProperty(plStruct.PROPERTY_CONTAINER_PACKAGE).concat(
+                    ".").concat(plStruct.getSimpleProperty(plStruct.PROPERTY_CONTAINER_NAME)); // NOI18N
+            result.append(structName).append("< "); // NOI18N
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        for (int i=0; i<nodes.length; i++) {
+            NbNodeObject nodeObject = (NbNodeObject)
+            nodes[i].getLookup().lookup(NbNodeObject.class);
+            if (nodeObject instanceof TemplateType) {
+                TemplateType templType = (TemplateType)nodeObject;
+                try {
+                    String type = templType.getSimpleProperty(templType.PROPERTY_CONTAINER_TYPE);
+                    if (i != 0) {
+                        result.append(","); // NOI18N
+                    }
+                    result.append(type);
+                } catch (UnknownOpenOfficeOrgPropertyException ex) {
+                    LogWriter.getLogWriter().printStackTrace(ex);
+                }
+                
+            }
+        }
+        result.append(" >"); // NOI18N
+        FeatureDescriptor desc = editor.getPropertyEnv().getFeatureDescriptor();
+        SimpleOpenOfficeOrgProperty.SimpleProperty prop = (SimpleOpenOfficeOrgProperty.SimpleProperty)desc;
+        editor.setAsText(result.toString());
+        prop.setValue(result.toString());
+    }
+    
+    /**
+     */
+    public static void start(final ComponentTypePropertyEditor editor,
+            final PolyStruct plStruct) {
+        NewTemplateTypesDialog templTypes = new NewTemplateTypesDialog(editor, plStruct);
+        DialogDescriptor ddscr = new DialogDescriptor(templTypes, 
+                NbBundle.getMessage(ComponentWizardIterator.class, "LBL_TemplateTypes_Title"));
+        
+        ddscr.setButtonListener(templTypes);
+        
+        Dialog d = DialogDisplayer.getDefault().createDialog(ddscr);
+        d.setVisible(true);
+    }
+
+    public ExplorerManager getExplorerManager() {
+        return manager;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        if (e.getActionCommand().equals("OK")) { // NOI18N
+            performOK();
+        }
+    }
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JPanel jPanel1;
+    // End of variables declaration//GEN-END:variables
+
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,35 @@
+# Sample ResourceBundle properties file
+
+# NewDataTypedialog
+LBL_Title_Create=Create New Data Type
+LBL_Title_Edit=Edit Data Type
+LBL_DataType=Data &Type
+LBL_OK_Button=OK
+LBL_Cancel_Button=Cancel
+
+# New InterfaceDataTypePanel
+LBL_Button_NewFunction=New &Function
+LBL_Button_NewParameter=New &Parameter
+
+# Poly Struct Data Type
+LBL_Button_AddTemplate=&Add Template
+LBL_Button_AddMember=Add &Member
+LBL_Button_Delete=&Delete
+
+# Service Data Type
+LBL_Error_Interface=You must include an interface to this service.
+
+# PolyStruct Data Type
+LBL_Error_Template=There must be at least one template type.
+
+# Struct Data Type
+LBL_Error_Struct=There must be at least one struct type.
+
+#Enumeration data type
+LBL_Error_Enum=There must be at least one enum type.
+
+# general
+LBL_Error_Name=This type must have a name and a package.
+LBL_ButtonNewFunction=
+
+LBL_ButtonDelete=&Delete

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_ja.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_ja.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_ja.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_ja.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,55 @@
+# Sample ResourceBundle properties file
+
+# NewDataTypedialog
+# LBL_Title_Create=Create New Data Type
+LBL_Title_Create=\u65b0\u898f\u30c7\u30fc\u30bf\u578b\u3092\u4f5c\u6210
+# LBL_Title_Edit=Edit Data Type
+LBL_Title_Edit=\u30c7\u30fc\u30bf\u578b\u3092\u7de8\u96c6
+# LBL_DataType=Data &Type
+LBL_DataType=\u30c7\u30fc\u30bf\u578b(&T)
+# LBL_OK_Button=OK
+LBL_OK_Button=\u4e86\u89e3
+# LBL_Cancel_Button=Cancel
+LBL_Cancel_Button=\u53d6\u6d88\u3057
+
+# New InterfaceDataTypePanel
+# LBL_Button_NewFunction=New &Function
+LBL_Button_NewFunction=\u65b0\u898f\u95a2\u6570(&F)
+# LBL_Button_NewParameter=New &Parameter
+LBL_Button_NewParameter=\u65b0\u898f\u30d1\u30e9\u30e1\u30fc\u30bf(&P)
+
+# Poly Struct Data Type
+# LBL_Button_AddTemplate=&Add Template
+LBL_Button_AddTemplate=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u8ffd\u52a0(&A)
+# LBL_Button_AddMember=Add &Member
+LBL_Button_AddMember=\u30e1\u30f3\u30d0\u30fc\u3092\u8ffd\u52a0(&M)
+# LBL_Button_Delete=&Delete
+LBL_Button_Delete=\u524a\u9664(&D)
+
+# Service Data Type
+# LBL_Error_Interface=You must include an interface to this service.
+LBL_Error_Interface=\u3053\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u542b\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002
+
+# PolyStruct Data Type
+# LBL_Error_Template=There must be at least one template type.
+LBL_Error_Template=\u5c11\u306a\u304f\u3068\u3082 1 \u3064\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u578b\u304c\u5fc5\u8981\u3067\u3059\u3002
+
+# Struct Data Type
+# LBL_Error_Struct=There must be at least one struct type.
+LBL_Error_Struct=\u5c11\u306a\u304f\u3068\u3082 1 \u3064\u306e\u69cb\u9020\u4f53\u306e\u578b\u304c\u5fc5\u8981\u3067\u3059\u3002
+
+#Enumeration data type
+# LBL_Error_Enum=There must be at least one enum type.
+LBL_Error_Enum=\u5c11\u306a\u304f\u3068\u3082 1 \u3064\u306e\u5217\u6319\u578b\u304c\u5fc5\u8981\u3067\u3059\u3002
+
+
+# general
+# LBL_Error_Name=This type must have a name and a package.
+LBL_Error_Name=\u3053\u306e\u578b\u306b\u306f\u3001\u540d\u524d\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3067\u3059\u3002
+# LBL_ButtonNewFunction=
+LBL_ButtonNewFunction=
+
+# LBL_ButtonDelete=&Delete
+LBL_ButtonDelete=\u524a\u9664(&D)
+
+

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_pt_BR.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_pt_BR.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_pt_BR.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_pt_BR.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,35 @@
+# Sample ResourceBundle properties file
+
+# NewDataTypedialog
+LBL_Title_Create=Create New Data Type
+LBL_Title_Edit=Edit Data Type
+LBL_DataType=Data &Type
+LBL_OK_Button=OK
+LBL_Cancel_Button=Cancel
+
+# New InterfaceDataTypePanel
+LBL_Button_NewFunction=New &Function
+LBL_Button_NewParameter=New &Parameter
+
+# Poly Struct Data Type
+LBL_Button_AddTemplate=&Add Template
+LBL_Button_AddMember=Add &Member
+LBL_Button_Delete=&Delete
+
+# Service Data Type
+LBL_Error_Interface=You must include an interface to this service.
+
+# PolyStruct Data Type
+LBL_Error_Template=There must be at least one template type.
+
+# Struct Data Type
+LBL_Error_Struct=There must be at least one struct type.
+
+#Enumeration data type
+LBL_Error_Enum=There must be at least one enum type.
+
+# general
+LBL_Error_Name=This type must have a name and a package.
+LBL_ButtonNewFunction=
+
+LBL_ButtonDelete=&Delete

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_zh_CN.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_zh_CN.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_zh_CN.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/Bundle_zh_CN.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,35 @@
+# Sample ResourceBundle properties file
+
+# NewDataTypedialog
+LBL_Title_Create=\u521b\u5efa\u65b0\u7684\u6570\u636e\u7c7b\u578b
+LBL_Title_Edit=\u7f16\u8f91\u6570\u636e\u7c7b\u578b
+LBL_DataType=\u6570\u636e\u7c7b\u578b(&T)
+LBL_OK_Button=\u786e\u5b9a
+LBL_Cancel_Button=\u53d6\u6d88
+
+# New InterfaceDataTypePanel
+LBL_Button_NewFunction=\u65b0\u5efa\u51fd\u6570(&F)
+LBL_Button_NewParameter=\u65b0\u5efa\u53c2\u6570(&P)
+
+# Poly Struct Data Type
+LBL_Button_AddTemplate=\u6dfb\u52a0\u6a21\u677f(&A)
+LBL_Button_AddMember=\u6dfb\u52a0\u6210\u5458(&M)
+LBL_Button_Delete=\u5220\u9664(&D)
+
+# Service Data Type
+LBL_Error_Interface=\u5fc5\u987b\u5728\u6b64\u670d\u52a1\u4e2d\u5305\u542b\u4e00\u4e2a\u63a5\u53e3\u3002
+
+# PolyStruct Data Type
+LBL_Error_Template=\u5fc5\u987b\u81f3\u5c11\u5177\u6709\u4e00\u4e2a\u6a21\u677f\u7c7b\u578b\u3002
+
+# Struct Data Type
+LBL_Error_Struct=\u5fc5\u987b\u81f3\u5c11\u5177\u6709\u4e00\u4e2a\u7ed3\u6784\u7c7b\u578b\u3002
+
+#Enumeration data type
+LBL_Error_Enum=\u5fc5\u987b\u81f3\u5c11\u5177\u6709\u4e00\u4e2a\u679a\u4e3e\u7c7b\u578b\u3002
+
+# general
+LBL_Error_Name=\u6b64\u7c7b\u578b\u5fc5\u987b\u5177\u6709\u540d\u79f0\u548c\u5305\u3002
+LBL_ButtonNewFunction=
+
+LBL_ButtonDelete=\u5220\u9664(&D)

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ChangeEventPanel.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ChangeEventPanel.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ChangeEventPanel.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ChangeEventPanel.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ChangeEventPanel.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 ChangeEventPanel {
+    public void fireChangeEvent();
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/DialogProperties.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/DialogProperties.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/DialogProperties.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/DialogProperties.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: DialogProperties.java,v $
+ *
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: sg $ $Date: 2009/07/06 14:51:27 $
+ *
+ *  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.util.HashMap;
+import org.openoffice.extensions.util.LogWriter;
+
+/**
+ *
+ * @author sg128468
+ */
+public class DialogProperties {
+
+    public final static String EDIT = "EDIT";  // edit or new // NOI18N
+    public final static String NODE = "NODE";  // the node for editing; null when new // NOI18N
+    public final static String PKG = "PKG";    // the initial package suggestion // NOI18N
+    public final static String SRV = "SRV";    // the initial service name suggestion // NOI18N
+    public final static String IFC = "IFC";    // the initial interface suggestion // NOI18N
+    public final static String NAME = "NAME";    // the initial name suggestion // NOI18N
+    public final static String ALLOW_SELECTION = "ALLOW_SELECTION";  // allow selection of the type: no for wizard // NOI18N
+    public final static String SELECTION = "SELECTION";  // selected item as String[]: if no selection allowed, only item that's created or edited // NOI18N
+    public final static String PANEL = "PANEL";          // the panel to trigger updates // NOI18N
+    public final static String DATA_TYPE = "TYPE";  // a DataType integer type: mandatory // NOI18N
+    
+    private HashMap<String, OneDataType> properties;
+    
+    /** Creates a new instance of DialogProperties */
+    public DialogProperties() {
+        this(new OneDataType[0]);
+    }
+
+    /** Creates a new instance of DialogProperties with properties*/
+    public DialogProperties(OneDataType[]types) {
+        properties = new HashMap<String, OneDataType>();
+        // default props, may be overwritten
+        setDefaultProps();
+        for (int i=0; i<types.length; i++) {
+            properties.put(types[i].n, types[i]);
+        }
+        // plausibility check for dependent variables
+        if (getProperty(NODE) != null) {
+            // whith a node, we edit
+            properties.put(EDIT, new OneDataType<Boolean>(EDIT, Boolean.TRUE));
+            properties.put(ALLOW_SELECTION, new OneDataType<Boolean>(ALLOW_SELECTION, Boolean.FALSE));
+        }
+        // consistency: if edit, then no selection allowed!
+        else if (getBooleanProperty(EDIT)) {
+            properties.put(ALLOW_SELECTION, new OneDataType<Boolean>(ALLOW_SELECTION, Boolean.FALSE));
+            if (getProperty(NODE) == null) {  // this is critical
+                LogWriter.getLogWriter().log(LogWriter.LEVEL_CRITICAL, "NODE is not set for editing it."); // NOI18N
+            }
+        }
+        if (getProperty(DATA_TYPE) == null) {
+            LogWriter.getLogWriter().log(LogWriter.LEVEL_CRITICAL, "No data type set for the plugged panel in NewDataTypeBaseDialog."); // NOI18N
+        }
+    }
+
+    public Object getProperty(String key) {
+        OneDataType type = properties.get(key);
+        if (type == null) return null;
+        return type.o;
+    }
+    
+    public boolean getBooleanProperty(String key) {
+        @SuppressWarnings( value="unchecked" )
+        OneDataType<Boolean> b = properties.get(key);
+        return b.o.booleanValue();
+    }
+    
+    public int getIntProperty(String key) {
+        @SuppressWarnings( value="unchecked" )
+        OneDataType<Integer> b = properties.get(key);
+        return b.o.intValue();
+    }
+    
+    public String getStringProperty(String key) {
+        @SuppressWarnings( value="unchecked" )
+        OneDataType<String> s = properties.get(key);
+        if (s == null) return null;
+        return s.o;
+    }
+    
+    public void setProperty(OneDataType value) {
+        properties.put(value.n, value);
+    }
+    
+    private void setDefaultProps() {
+        // no selection allowed
+        properties.put(ALLOW_SELECTION, new OneDataType<Boolean>(ALLOW_SELECTION, Boolean.FALSE));
+        // set string as "null pointer exception" precaution: should be overwritten
+        properties.put(SELECTION, new OneDataType<String[]>(SELECTION, new String[]{""})); // NOI18N
+        // default is create, not edit
+        properties.put(EDIT, new OneDataType<Boolean>(EDIT, Boolean.FALSE));
+    }
+    
+    public static class OneDataType<T> {
+        public OneDataType(String name, T object) {
+            n = name;
+            o = object;
+        }
+        protected T o;
+        protected String n;
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,112 @@
+<?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="1" attributes="0">
+              <Component id="jSplitPane1" pref="569" max="32767" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                  <Component id="deleteJButton" max="32767" attributes="1"/>
+                  <Component id="addEnumJButton" alignment="0" pref="124" max="32767" attributes="1"/>
+              </Group>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" attributes="0">
+              <Component id="addEnumJButton" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="deleteJButton" min="-2" max="-2" attributes="0"/>
+              <EmptySpace pref="258" max="32767" attributes="0"/>
+          </Group>
+          <Component id="jSplitPane1" alignment="0" pref="316" max="32767" attributes="0"/>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JSplitPane" name="jSplitPane1">
+      <Properties>
+        <Property name="dividerLocation" type="int" value="200"/>
+      </Properties>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
+      <SubComponents>
+        <Container class="javax.swing.JPanel" name="jPanel1">
+          <Properties>
+            <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 PropertySheet();"/>
+          </AuxValues>
+          <Constraints>
+            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+              <JSplitPaneConstraints position="right"/>
+            </Constraint>
+          </Constraints>
+
+          <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+        </Container>
+        <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+          <Properties>
+            <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>
+          <Constraints>
+            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+              <JSplitPaneConstraints position="left"/>
+            </Constraint>
+          </Constraints>
+
+          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+        </Container>
+      </SubComponents>
+    </Container>
+    <Component class="javax.swing.JButton" name="addEnumJButton">
+      <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_Button_AddEnum" replaceFormat="NbBundle.getMessage(ComponentWizardIterator.class, &quot;LBL_Button_AddEnum&quot;)"/>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addFunctionActionPerformed"/>
+      </Events>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JButton" name="deleteJButton">
+      <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_ButtonDelete" replaceFormat="NbBundle.getMessage(ComponentWizardIterator.class, &quot;LBL_ButtonDelete&quot;)"/>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteActionPerformed"/>
+      </Events>
+      <AuxValues>
+        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
+    </Component>
+  </SubComponents>
+</Form>

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/EnumDataTypePanel.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: EnumDataTypePanel.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.Lookup;
+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.IdlEnumeration;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author  sg128468
+ */
+public class EnumDataTypePanel extends javax.swing.JPanel
+        implements ExplorerManager.Provider, PropertyChangeListener {
+    
+    private static final String ICON_PATH = "org/openoffice/extensions/projecttemplates/calcaddin/icons/netbeans.png"; // NOI18N
+    private ExplorerManager manager = new ExplorerManager();
+    private PropertySheet propSheet;
+    private Node node;
+
+    private Lookup lookup;
+    private ChangeEventPanel panel;    
+    // all actions that can be done here
+    private ComponentActions actions;
+    private String oldName; 
+    private boolean edit;
+
+    private ValidateDataType dialog;
+    
+    /**
+     * Creates new form InterfaceDataTypeDialog
+     */
+    public EnumDataTypePanel(ValidateDataType dialog, DialogProperties props) {
+
+        initComponents();
+        this.edit = props.getBooleanProperty(props.EDIT);
+        this.panel = (ChangeEventPanel)props.getProperty(props.PANEL);
+        this.actions = new ComponentActions(manager, panel);
+        this.dialog = dialog;
+
+        String pkgName = props.getStringProperty(props.PKG);
+        String name = props.getStringProperty(props.NAME);
+        
+        if (edit) {
+            node = (Node)props.getProperty(props.NODE);
+            NbNodeObject ob = (NbNodeObject)node.getLookup().lookup(NbNodeObject.class);
+            oldName = ob.getDisplayName();
+        }
+        else {
+            if (name == null) name = "Enum"; // NOI18N
+            node = (Node)IdlTypeTreeCreator.createInitialEnumTree(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);
+        
+        /*
+        actions = new ComponentActions(manager, panel);
+        
+        // for keyboard actions enable this: handle actions must be done, too
+        ActionMap map = jSplitPane1.getActionMap();
+        map.put("delete", ExplorerUtils.actionDelete(manager, true)); // NOI18N
+
+        lookup = ExplorerUtils.createLookup(manager, map);
+        
+        actions = new AddinActions(manager, panel, this);
+
+         // deliver the actual actions to the node-actions
+        Node rootNode = manager.getRootContext();
+        rootNode.setActions(actions);  */
+    }
+    
+    /** 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();
+        addEnumJButton = 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(addEnumJButton, NbBundle.getMessage(ComponentWizardIterator.class, "LBL_Button_AddEnum"));
+        addEnumJButton.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(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+                .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 569, 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(addEnumJButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+            .add(layout.createSequentialGroup()
+                .add(addEnumJButton)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(deleteJButton)
+                .addContainerGap(254, Short.MAX_VALUE))
+            .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE)
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void deleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteActionPerformed
+
+        actions.deleteActions();
+
+    }//GEN-LAST:event_deleteActionPerformed
+
+    private void addFunctionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFunctionActionPerformed
+
+        actions.addEnumAction();
+
+    }//GEN-LAST:event_addFunctionActionPerformed
+    
+    public ExplorerManager getExplorerManager() {
+        return this.manager;
+    }
+
+    public Lookup getLookup() {
+        return this.lookup;
+    }
+    
+    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);
+                addEnumJButton.setEnabled(false);
+            }
+            else if (nodeObject.getType() == NbNodeObject.PARAMETER_TYPE) {
+                deleteJButton.setEnabled(true);
+                addEnumJButton.setEnabled(true);
+            }
+            else {
+                deleteJButton.setEnabled(false);
+                addEnumJButton.setEnabled(true);
+            }
+        }
+        valid();
+//        panel.fireChangeEvent(); // Notify that the panel changed
+    }
+    
+    private void valid() {
+        NbNodeObject ob = (NbNodeObject)node.getLookup().lookup(NbNodeObject.class);
+        IdlEnumeration en = (IdlEnumeration)ob;
+        try {
+            if (en.getSimpleProperty(en.PROPERTY_CONTAINER_NAME).length() == 0 || 
+                    en.getSimpleProperty(en.PROPERTY_CONTAINER_PACKAGE).length() == 0) {
+                dialog.setEnableError(true, 
+                    NbBundle.getMessage(NewDataTypeBasePanel.class, "LBL_Error_Name"));
+                return;
+            }
+            else if (en.getAllSubObjects().length == 0) {
+                dialog.setEnableError(true, 
+                    NbBundle.getMessage(NewDataTypeBasePanel.class, "LBL_Error_Enum"));
+                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 addEnumJButton;
+    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/ExceptionDataTypePanel.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ExceptionDataTypePanel.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ExceptionDataTypePanel.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/component/dialogs/ExceptionDataTypePanel.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,33 @@
+<?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">
+          <Component id="jPanel1" alignment="0" pref="531" max="32767" attributes="0"/>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Component id="jPanel1" alignment="0" pref="272" max="32767" attributes="0"/>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JPanel" name="jPanel1">
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new PropertySheet();"/>
+      </AuxValues>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+    </Container>
+  </SubComponents>
+</Form>



Mime
View raw message