You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2012/01/27 02:29:58 UTC

svn commit: r1236486 [35/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...

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Parameter.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Parameter.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Parameter.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Parameter.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,286 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Parameter.java,v $
+ *
+ *  $Revision: 1.10 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/07/03 08:31:34 $
+ *
+ *  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.util.datamodel;
+
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyEditor;
+import java.util.Arrays;
+import java.util.Vector;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.calcaddin.AddinWizardIterator;
+import org.openoffice.extensions.projecttemplates.calcaddin.datamodel.node.AddInPropertyEditor;
+import org.openoffice.extensions.projecttemplates.component.datamodel.types.node.ComponentTypePropertyEditor;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.actions.ParameterAction;
+import org.openoffice.extensions.util.datamodel.localization.LanguageDefinition;
+import org.openoffice.extensions.util.datamodel.properties.LocalizedOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.OpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgLanguageIDException;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+import org.openoffice.extensions.util.typebrowser.logic.UnoTypes;
+
+/**
+ *
+ * @author sg128468
+ */
+public class Parameter extends PropertyContainer implements NbNodeObject {
+
+    private NbNodeObject parent;
+
+    private BaseAction baseAction;
+
+    private boolean languageSupport;
+
+    /** Creates a new instance of Parameter */
+    public Parameter(String nameValue, String typeValue, NbNodeObject parent) {
+        this(nameValue, typeValue, parent, null);
+    }
+
+    public Parameter(String nameValue, String typeValue, NbNodeObject parent, Integer[] languages) {
+        super(new String[]{
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_TYPE,
+            PROPERTY_CONTAINER_DISPLAY_NAME,
+            PROPERTY_CONTAINER_DESCRIPTION,
+        });
+        this.parent = parent;
+        if (languages == null) {
+            this.languageSupport = false;
+            initializeProperties(nameValue, typeValue);
+        }
+        else if (languages.length > 0) {
+            this.languageSupport = true;
+            initializeProperties(nameValue, typeValue, languages[0].intValue());
+            for (int i=1; i<languages.length; i++) {
+                try {
+                    setLanguageWithDefaultText(languages[i].intValue(), ""); // NOI18N
+                } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+                    // ignore exception: language simply is not filled
+                }
+            }
+        }
+        else { // use default as fallback
+            this.languageSupport = true;
+            initializeProperties(nameValue, typeValue, LanguageDefinition.LANGUAGE_ID_en); 
+        }
+    }
+
+    private void initializeProperties(String nameValue, String typeValue) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                nameValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Name_Tooltip"),
+                this, null);
+        PropertyEditor editor = null;  // 2do: this will not work for reuse as AddOn
+        if (languageSupport)  // 2do: replace this by parent type
+            editor = new AddInPropertyEditor(AddInPropertyEditor.PARAMETER_EDITOR);
+        else 
+            if (parent.getType() == NbNodeObject.POLY_STRUCT_TYPE) {
+                PolyStruct polyStruct = (PolyStruct)parent;
+                int length = UnoTypes.SIMPLE_TYPE_TAGS.length - 1;
+                String[] templateNames = polyStruct.getTemplateTypeNames();
+                // add the template types, e.g. T1, T2, ... to the types
+                for (int i = 0; i < templateNames.length; i++) {
+                    String name = templateNames[i];
+                    TemplateType type = polyStruct.getTemplateType(name);
+                    try {
+                        templateNames[i] = type.getSimpleProperty(type.PROPERTY_CONTAINER_TYPE);
+                    } catch (UnknownOpenOfficeOrgPropertyException ex) {
+                        LogWriter.getLogWriter().printStackTrace(ex);
+                    }
+                }
+                String[] tags = new String[length + templateNames.length + 1];
+                System.arraycopy(UnoTypes.SIMPLE_TYPE_TAGS, 1, tags, 0, length);
+                System.arraycopy(templateNames, 0, tags, length, templateNames.length);
+                tags[tags.length - 1] = "[]"; // NOI18N
+                editor = new ComponentTypePropertyEditor(tags);
+            }
+            else {
+                editor = new ComponentTypePropertyEditor();
+            }
+        
+        properties[PROPERTY_Type] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_TYPE, 
+                typeValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Type_Tooltip"),
+                this, editor);
+    }
+    
+    private void initializeProperties(String nameValue, String typeValue, int language) {
+        // get the following from xcs file.
+        properties[PROPERTY_DisplayName] = new LocalizedOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_DISPLAY_NAME, 
+                "<".concat(nameValue).concat(">"),  // NOI18N
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_DisplayName_Tooltip"),
+                this, language, null);
+        properties[PROPERTY_Description] = new LocalizedOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_DESCRIPTION, 
+                NbBundle.getMessage(AddinWizardIterator.class, "PROP_Function_Description"), 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Description_Tooltip"),
+                this, language, null);
+        // not xcu/xcs relevant, only for skeleton creation
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                nameValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Name_Tooltip"),
+                this, null);
+        properties[PROPERTY_Type] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_TYPE, 
+                typeValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Type_Tooltip"),
+                this, new AddInPropertyEditor(AddInPropertyEditor.PARAMETER_EDITOR));
+    }
+    
+    public void printLanguages() {
+        try {
+            LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, "#### Parameter " + properties[PROPERTY_Name].getValueForLanguage(-1)); // NOI18N
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, "  -> DisplayName: " + ((LocalizedOpenOfficeOrgProperty)properties[PROPERTY_DisplayName]).getUsedLanguageIndexes().length); // NOI18N
+        LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, "  -> Description: " + ((LocalizedOpenOfficeOrgProperty)properties[PROPERTY_Description]).getUsedLanguageIndexes().length); // NOI18N
+    }
+    
+    public String getDisplayName() {
+        try {
+            return properties[PROPERTY_Name].getValueForLanguage(-1);
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return "unkown parameter"; // NOI18N
+    }
+
+    public OpenOfficeOrgProperty getProperty(int propertyIndex) {
+        return properties[propertyIndex];
+    }
+    
+
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<Object> nodeObjects = new Vector<Object>();
+        // first direct properties
+        nodeObjects.add(properties[PROPERTY_Name]);
+        nodeObjects.add(properties[PROPERTY_Type]);
+        if (this.languageSupport) {
+            nodeObjects.add(properties[PROPERTY_DisplayName]);
+            nodeObjects.add(properties[PROPERTY_Description]);
+        }
+        return (NbNodeObject[])nodeObjects.toArray(new NbNodeObject[nodeObjects.size()]);
+    }
+
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+        Vector<Object> v = new Vector<Object>();
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Name]).createProperties(null, listener)));
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Type]).createProperties(null, listener)));
+        
+        Node.Property[]nameProp = (Node.Property[])v.toArray(new Node.Property[v.size()]);
+        if (sheet != null) {
+            Sheet.Set set = sheet.createPropertiesSet();
+            set.put(nameProp);
+            sheet.put(set);
+
+            if (this.languageSupport) {
+                set = sheet.createPropertiesSet();
+                set.setName(((NbNodeObject)properties[PROPERTY_DisplayName]).getDisplayName());
+                set.setDisplayName(set.getName().concat(" - ").concat( // NOI18N
+                        NbBundle.getMessage(AddinWizardIterator.class, "LB_LocalizedProperty")));
+
+                set.put(((NbNodeObject)properties[PROPERTY_DisplayName]).createProperties(null, listener));
+                sheet.put(set);
+
+                set = sheet.createPropertiesSet();
+                set.setName(((NbNodeObject)properties[PROPERTY_Description]).getDisplayName());
+                set.setDisplayName(set.getName().concat(" - ").concat( // NOI18N
+                        NbBundle.getMessage(AddinWizardIterator.class, "LB_LocalizedProperty")));
+                set.put(((NbNodeObject)properties[PROPERTY_Description]).createProperties(null, listener));
+                sheet.put(set);
+            }
+        }
+        if (this.languageSupport) {
+            v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_DisplayName]).createProperties(null, listener)));
+            v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Description]).createProperties(null, listener))); 
+        }
+        return (Node.Property[])v.toArray(new Node.Property[v.size()]);
+    }
+    
+    /**
+     * set the action for context menus
+     */
+    public void setActions(BaseAction baseAction) {
+        this.baseAction = baseAction;
+    }
+    
+    public Action[] getActions(boolean b) {
+        return new Action[]{new MyAddParameterAction(), new MyDeleteParameterAction()};
+    }
+
+    public boolean hasActions(int type) {
+        return true;
+    }
+
+    public NbNodeObject getParent() {
+        return parent;
+    }
+
+    public int getType() {
+        return NbNodeObject.PARAMETER_TYPE;
+    }
+    
+    private class MyAddParameterAction extends AbstractAction {
+        int counter;
+        public MyAddParameterAction() {
+            putValue(NAME, NbBundle.getMessage(LocalizedOpenOfficeOrgProperty.class, "LBL_AddParameter"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            ((ParameterAction)baseAction).addParameterAction();
+        }
+    }
+    private class MyDeleteParameterAction extends AbstractAction {
+        public MyDeleteParameterAction() {
+            putValue(NAME, NbBundle.getMessage(LocalizedOpenOfficeOrgProperty.class, "LBL_DeleteParameter"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            baseAction.deleteAction();
+        }
+    }
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PolyStruct.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PolyStruct.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PolyStruct.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PolyStruct.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,304 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: PolyStruct.java,v $
+ *
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/05/03 09:56: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.util.datamodel;
+
+import java.beans.PropertyChangeListener;
+import java.util.Enumeration;
+import java.util.Vector;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.calcaddin.AddinWizardIterator;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.properties.OpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgLanguageIDException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class PolyStruct extends PropertyContainer implements NbNodeObject {
+    
+    private OrderedContainer<Parameter> structTypes;
+    private OrderedContainer<TemplateType> templateTypes;
+    
+    public static final int PROPERTY_COUNT = 2;
+
+    /** Creates a new instance of Function */
+    public PolyStruct(String name, String pkg) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_PACKAGE,
+        });
+        structTypes = new OrderedContainer<Parameter>();
+        templateTypes = new OrderedContainer<TemplateType>();
+        initializeProperties(name, pkg);
+    }
+    
+    private void initializeProperties(String name, String pkg) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                name, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Name_Tooltip"),
+                this, null);
+        properties[PROPERTY_Package] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PACKAGE, 
+                pkg, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Type_Tooltip"),
+                this, null);
+    }
+    
+    public Parameter getPropertyType(String name) {
+        Enumeration keys = structTypes.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            Parameter p = (Parameter)structTypes.get(keys.nextElement());
+            found = name.equals(p.getProperty(p.PROPERTY_Name));
+            if (found) return p;
+        }
+        return null;
+    }
+    
+    public Parameter addPropertyType() {
+        return addPropertyType(null);
+    }
+    
+    public Parameter addPropertyType(NbNodeObject topObject) {
+        int position = 0;  // use 0 if topObject is function
+        if (topObject != null && topObject instanceof Parameter) {
+            position = structTypes.getPositionFromObject((Parameter)topObject) + 1;
+        }
+        String name = "Member".concat(structTypes.getNextNumber("Member")); // NOI18N
+        Parameter param = null;
+        param = new Parameter(name, "int", this, null); // NOI18N
+        addSetObject(name, param, position);
+        return param;
+    }
+    
+    public void removePropertyType(String name) {
+        Enumeration keys = structTypes.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            Object key = keys.nextElement();
+            Parameter p = (Parameter)structTypes.get(key);
+            try {
+                found = name.equals(p.getProperty(p.PROPERTY_Name).getValueForLanguage(-1));
+            } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            }
+            if (found) {
+                structTypes.remove((String)key);
+            }
+        }
+    }
+    
+    public void removePropertyType(Parameter parameter) {
+        String[] names = getAllSetObjectNames();
+        for (int i=0; i<names.length; i++) {
+            if (getSetObject(names[i]).equals(parameter)) {
+                structTypes.remove(names[i]);
+            }
+        }
+    }
+    
+    public TemplateType getTemplateType(String name) {
+        Enumeration keys = templateTypes.keys();
+        while (keys.hasMoreElements()) {
+            if (name.equals(keys.nextElement())) {
+                return (TemplateType)templateTypes.get(name);
+            }
+        }
+        return null;
+    }
+    
+    public TemplateType addTemplateType() {
+        return addTemplateType(null);
+    }
+    
+    public TemplateType addTemplateType(NbNodeObject topObject) {
+        int position = 0;  // use 0 if topObject is function
+        if (topObject != null && topObject instanceof TemplateType) {
+            position = templateTypes.getPositionFromObject((TemplateType)topObject) + 1;
+        }
+        String number = templateTypes.getNextNumber("Template"); // NOI18N
+        String name = "Template".concat(number); // NOI18N
+        String type = "T".concat(number); // NOI18N
+        TemplateType templ = new TemplateType(name, type, this);
+        templateTypes.insertElementAt(name, templ, position);
+
+        return templ;
+    }
+    
+    public void removeTemplateType(String name) {
+        Enumeration keys = templateTypes.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            Object key = keys.nextElement();
+            Parameter p = (Parameter)structTypes.get(key);
+            try {
+                found = name.equals(p.getProperty(p.PROPERTY_Name).getValueForLanguage(-1));
+            } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            }
+            if (found) {
+                templateTypes.remove((String)key);
+            }
+        }
+    }
+    
+    public void removeTemplateType(TemplateType templ) {
+        String[] names = templateTypes.getKeysInOrder();
+        for (int i=0; i<names.length; i++) {
+            if (templateTypes.get(names[i]).equals(templ)) {
+                templateTypes.remove(names[i]);
+            }
+        }
+    }
+    
+    public String[] getTemplateTypeNames() {
+        return templateTypes.getKeysInOrder();
+    }
+    
+    public String[] getAllSetObjectNames() {
+        return structTypes.getKeysInOrder();
+    }
+    
+    public Object getSetObject(String internalName) {
+        return structTypes.get(internalName);
+    }
+    
+    public void addSetObject(String internalName, Object setObject) {
+        structTypes.put(internalName, (Parameter)setObject);
+    }
+    
+    public void addSetObject(String internalName, Object setObject, int position) {
+        structTypes.insertElementAt(internalName, (Parameter)setObject, position);
+    }
+    
+    public String getDisplayName() {
+        try {
+            return getProperty(PROPERTY_Package).getValueForLanguage(-1).concat(
+                    ".").concat(getProperty(PROPERTY_Name).getValueForLanguage(-1)); // NOI18N
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return ""; // NOI18N
+    }
+    
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<Object> nodeObjects = new Vector<Object>();
+        // first direct properties
+        nodeObjects.add(properties[PROPERTY_Name]);
+        nodeObjects.add(properties[PROPERTY_Package]);
+        // then templates
+        String[] keys = templateTypes.getKeysInOrder();
+        for(int i=0; i<keys.length; i++) {
+            nodeObjects.add(templateTypes.get(keys[i]));
+        }
+        // then properties
+        keys = structTypes.getKeysInOrder();
+        for(int i=0; i<keys.length; i++) {
+            nodeObjects.add(structTypes.get(keys[i]));
+        }
+        return (NbNodeObject[])nodeObjects.toArray(new NbNodeObject[nodeObjects.size()]);
+    }
+    
+    public OpenOfficeOrgProperty getProperty(int propertyIndex) {
+        return properties[propertyIndex];
+    }
+    
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+        Node.Property[]nameProp = new Node.Property[2];
+        nameProp[0] = ((NbNodeObject)properties[PROPERTY_Name]).createProperties(null, listener)[0];
+        nameProp[1] = ((NbNodeObject)properties[PROPERTY_Package]).createProperties(null, listener)[0];
+        if (sheet != null) {
+            Sheet.Set set = sheet.createPropertiesSet();
+            set.put(nameProp);
+            sheet.put(set);
+        }
+        return nameProp;
+    }
+    
+    public boolean hasActions(int type) {
+        return false;
+    }
+    
+    public Action[] getActions(boolean b) {
+        return null;
+//            new Action[]{new MyNewFunctionAction(), new MyDeleteFunctionAction(),
+//        null, new MyAddParameterAction()};
+    }
+    
+    /**
+     * set the aczion for context menus
+     */
+    public void setActions(BaseAction baseAction) {
+    }
+    
+    public NbNodeObject getParent() {
+        return null;
+    }
+
+    public int getType() {
+        return NbNodeObject.POLY_STRUCT_TYPE;
+    }
+    
+//    private class MyNewFunctionAction extends AbstractAction {
+//        public MyNewFunctionAction() {
+//            putValue(NAME, "Add Function");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.addFunctionAction();
+//        }
+//    }
+//    private class MyDeleteFunctionAction extends AbstractAction {
+//        public MyDeleteFunctionAction() {
+//            putValue(NAME, "Delete Function");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.deleteActions();
+//        }
+//    }
+//    public class MyAddParameterAction extends AbstractAction {
+//        public MyAddParameterAction() {
+//            putValue(NAME, "Add Parameter");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.addParameterAction();
+//        }
+//    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PropertyContainer.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PropertyContainer.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PropertyContainer.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/PropertyContainer.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,277 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: PropertyContainer.java,v $
+ *
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/10/07 08:59: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.util.datamodel;
+
+import org.openoffice.extensions.util.datamodel.properties.OpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgLanguageIDException;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class PropertyContainer implements OpenOfficeOrgPropertyContainer {
+
+    // CAUTION! PROPERTY_CONTAINER_CONTEXTS and PROPERTY_CONTAINER_CONTEXT_REPRESENTATIONS
+    // must always have the same length! Adapt 
+    // org.openoffice.extensions.projecttemplates.addon.datamodel.Command c'tor 
+    // when something changes here.
+    public static final String[] PROPERTY_CONTAINER_CONTEXTS = new String[] {
+        "Bibilography", 
+        "Chart", 
+        "Database",
+        "Draw", 
+        "Formula", 
+        "Presentation", 
+        "Spreadsheet", 
+        "Writer",
+        "Global",
+    }; // NOI18N
+    
+    public static final String[] PROPERTY_CONTAINER_CONTEXT_REPRESENTATIONS = new String[] {
+        "com.sun.star.frame.Bibliography", 
+        "com.sun.star.chart.ChartDocument", 
+        "com.sun.star.sdb.OfficeDatabaseDocument",
+        "com.sun.star.drawing.DrawingDocument", 
+        "com.sun.star.formula.FormulaProperties", 
+        "com.sun.star.presentation.PresentationDocument", 
+        "com.sun.star.sheet.SpreadsheetDocument", 
+        "com.sun.star.text.TextDocument",
+        "com.sun.star.text.GlobalDocument",
+    }; // NOI18N
+
+    // typical properties index
+    public int PROPERTY_DisplayName;
+    public int PROPERTY_Description;
+    public int PROPERTY_Type;
+    public int PROPERTY_Name;
+    public int PROPERTY_Category;
+    public int PROPERTY_CompatibilityName;
+    public int PROPERTY_Exceptions;
+    public int PROPERTY_Icon_Hires_Big;
+    public int PROPERTY_Icon_Hires_Small;
+    public int PROPERTY_Icon_Lowres_Big;
+    public int PROPERTY_Icon_Lowres_Small;
+    public int PROPERTY_Package;
+    public int PROPERTY_ParentException;
+    public int PROPERTY_Interface;
+    public int PROPERTY_Parent;
+    public int[] PROPERTY_Context = new int[PROPERTY_CONTAINER_CONTEXTS.length];
+            
+    // typical properties name
+    public static final String PROPERTY_CONTAINER_DISPLAY_NAME = "DisplayName"; // NOI18N
+    public static final String PROPERTY_CONTAINER_DESCRIPTION = "Description"; // NOI18N
+    public static final String PROPERTY_CONTAINER_EXCEPTIONS = "Exceptions"; // NOI18N
+    public static final String PROPERTY_CONTAINER_NAME = "Name"; // NOI18N
+    public static final String PROPERTY_CONTAINER_CATEGORY = "Category"; // NOI18N
+    public static final String PROPERTY_CONTAINER_ICON_HIRES_BIG = "Icon, High Contrast, 26x26"; // NOI18N
+    public static final String PROPERTY_CONTAINER_ICON_HIRES_SMALL = "Icon, High Contrast, 16x16"; // NOI18N
+    public static final String PROPERTY_CONTAINER_ICON_LOWRES_BIG = "Icon, Low Contrast, 26x26"; // NOI18N
+    public static final String PROPERTY_CONTAINER_ICON_LOWRES_SMALL = "Icon, Low Contrast, 16x16"; // NOI18N
+    public static final String PROPERTY_CONTAINER_COMPATIBILITY_NAME = "CompatibilityName"; // NOI18N
+    public static final String PROPERTY_CONTAINER_PACKAGE = "Package"; // NOI18N
+    public static final String PROPERTY_CONTAINER_PARENT_EXCPTION = "ParentException"; // NOI18N
+    public static final String PROPERTY_CONTAINER_TYPE = "Type"; // NOI18N
+    public static final String PROPERTY_CONTAINER_INTERFACE = "Interface"; // NOI18N
+    public static final String PROPERTY_CONTAINER_PARENT = "Parent"; // NOI18N
+    
+    // category display name is not used for now
+//    public int PROPERTY_CategoryDisplayName;
+//    private static final String CATEGORY_DISPLAY_NAME = "CategoryDisplayName"; // NOI18N
+
+    protected OpenOfficeOrgProperty[] properties;
+    
+    public PropertyContainer(String[] names) {
+        properties = new OpenOfficeOrgProperty[names.length];
+        for (int i=0; i<names.length; i++) {
+            if (names[i].equals(PROPERTY_CONTAINER_DISPLAY_NAME))
+                PROPERTY_DisplayName = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_DESCRIPTION))
+                PROPERTY_Description = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_EXCEPTIONS))
+                PROPERTY_Exceptions = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_NAME))
+                PROPERTY_Name = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_CATEGORY))
+                PROPERTY_Category = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_ICON_HIRES_BIG))
+                PROPERTY_Icon_Hires_Big = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_ICON_HIRES_SMALL))
+                PROPERTY_Icon_Hires_Small = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_ICON_LOWRES_BIG))
+                PROPERTY_Icon_Lowres_Big = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_ICON_LOWRES_SMALL))
+                PROPERTY_Icon_Lowres_Small = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_COMPATIBILITY_NAME))
+                PROPERTY_CompatibilityName = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_PACKAGE))
+                PROPERTY_Package = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_PARENT_EXCPTION))
+                PROPERTY_ParentException = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_TYPE))
+                PROPERTY_Type = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_INTERFACE))
+                PROPERTY_Interface = i;
+            else if (names[i].equals(PROPERTY_CONTAINER_PARENT))
+                PROPERTY_Parent = i;
+            else {
+                for (int j = 0; j < PROPERTY_CONTAINER_CONTEXTS.length; j++) {
+                    if (names[i].equals(PROPERTY_CONTAINER_CONTEXTS[j]))
+                        PROPERTY_Context[j] = i;
+                }
+            }
+        }
+    }
+    
+    public String getLocalizedProperty(String propertyName, int languageID)
+        throws UnknownOpenOfficeOrgPropertyException, UnknownOpenOfficeOrgLanguageIDException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && properties[i].isLocalized() && propertyName.equals(properties[i].getPropertyName())) {
+                return properties[i].getValueForLanguage(languageID);
+            }
+        }
+        throw new UnknownOpenOfficeOrgPropertyException("Cannot get property " + propertyName); // NOI18N
+    }
+
+    public void setLocalizedProperty(String propertyName, int languageID, String value)
+        throws UnknownOpenOfficeOrgLanguageIDException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && properties[i].isLocalized() && propertyName.equals(properties[i].getPropertyName())) {
+                properties[i].setValueForLanguage(languageID, value);
+            }
+        }
+    }
+    
+    public String getSimpleProperty(String propertyName)
+            throws UnknownOpenOfficeOrgPropertyException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && !properties[i].isLocalized() && propertyName.equals(properties[i].getPropertyName())) {
+                try {
+                    return properties[i].getValueForLanguage(-1);
+                } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+                    // will never be thrown
+                }
+            }
+        }
+        throw new UnknownOpenOfficeOrgPropertyException("Unknown: " + propertyName);// NOI18N 
+    }
+
+    public void setSimpleProperty(String propertyName, String value) 
+            throws UnknownOpenOfficeOrgPropertyException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && !properties[i].isLocalized() && propertyName.equals(properties[i].getPropertyName())) {
+                try {
+                    properties[i].setValueForLanguage(-1, value);
+                    return; // evil construct, but function is short anyway
+                }
+                catch (UnknownOpenOfficeOrgLanguageIDException e) {
+                    // will never be thrown
+                }
+            }
+        }
+        throw new UnknownOpenOfficeOrgPropertyException("Cannot set property " + propertyName); // NOI18N
+    }
+    
+    public boolean isPropertyLocalized(String propertyName) 
+            throws UnknownOpenOfficeOrgPropertyException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && propertyName.equals(properties[i].getPropertyName())) {
+                return properties[i].isLocalized();
+            }
+        }
+        throw new UnknownOpenOfficeOrgPropertyException("No property with name " + propertyName); // NOI18N
+    }
+
+    /**
+     * some default text is set for a new language on all localized properties
+     * existing text is not overwritten
+     */
+    public void setLanguageWithDefaultText(int languageID, String text) 
+            throws UnknownOpenOfficeOrgLanguageIDException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && properties[i].isLocalized()) {
+//                if (properties[i].getValueForLanguage(languageID) == null)
+                    properties[i].setValueForLanguage(languageID, text);
+            }
+        }
+    }
+    
+    public void removeLanguageAndText(int languageID) 
+            throws UnknownOpenOfficeOrgLanguageIDException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && properties[i].isLocalized()) {
+                properties[i].removeValueForLanguage(languageID);
+            }
+        }
+    }
+    
+    public String[] getAllPropertyNames() {
+        String[] propNames = new String[properties.length];
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null)
+                propNames[i] = properties[i].getPropertyName();
+        }
+        return propNames;
+    }
+
+    public OpenOfficeOrgProperty getProperty(String propertyName)
+            throws UnknownOpenOfficeOrgPropertyException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && propertyName.equals(properties[i].getPropertyName())) {
+                return properties[i];
+            }
+        }
+        throw new UnknownOpenOfficeOrgPropertyException("Cannot get property " + propertyName); // NOI18N
+    }
+
+    public void setProperty(String propertyName, OpenOfficeOrgProperty value) 
+            throws UnknownOpenOfficeOrgPropertyException {
+        for (int i=0; i<properties.length; i++) {
+            if (properties[i] != null && propertyName.equals(properties[i].getPropertyName())) {
+                properties[i] = value;
+            }
+        }
+        throw new UnknownOpenOfficeOrgPropertyException("Cannot set property " + propertyName); // NOI18N
+    }
+    
+    public OpenOfficeOrgProperty getProperty(int propertyIndex) {
+        return properties[propertyIndex];
+    }
+
+    public void setProperty(int propertyIndex, OpenOfficeOrgProperty property) {
+        properties[propertyIndex] = property;
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Service.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Service.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Service.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Service.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Service.java,v $
+ *
+ *  $Revision: 1.8 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/08/15 13:45:20 $
+ *
+ *  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.util.datamodel;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyEditor;
+import java.util.Arrays;
+import java.util.Vector;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.config.ConfigurationSettings;
+import org.openoffice.extensions.projecttemplates.component.datamodel.types.node.ComponentInterfaceTypePropertyEditor;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class Service extends PropertyContainer implements OpenOfficeOrgMultiLanguageSet, NbNodeObject {
+    
+    private Interface ifc;
+    
+    /** Creates a new instance of Interface */
+    public Service(String name, String pkg) {
+        super(new String [] {
+            PROPERTY_CONTAINER_NAME, 
+            PROPERTY_CONTAINER_PACKAGE, 
+            PROPERTY_CONTAINER_INTERFACE
+        });
+        initializeProperties(name, pkg);
+        ifc = null;
+    }
+
+    private void initializeProperties(String name, String pkg) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                name, 
+                "", //NbBundle.getMessage(AddinWizardIterator.class, "TF_Interface_Name_Tooltip"),
+                this, null); // NOI18N
+        properties[PROPERTY_Package] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PACKAGE, 
+                pkg, 
+                "", //NbBundle.getMessage(AddinWizardIterator.class, "TF_Interface_Name_Tooltip"),
+                this, null); // NOI18N
+        PropertyEditor editor = new ComponentInterfaceTypePropertyEditor();
+        properties[PROPERTY_Interface] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_INTERFACE, 
+                "", 
+                "", //NbBundle.getMessage(AddinWizardIterator.class, "TF_Interface_Name_Tooltip"),
+                this, editor); // NOI18N
+    }
+    
+    public Interface addInterface() {
+        String pkg = NbBundle.getMessage(ConfigurationSettings.class, "default.package"); // NOI18N
+        try {
+            pkg = getSimpleProperty(PROPERTY_CONTAINER_PACKAGE);
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            ex.printStackTrace();
+        }
+        String ifcName = pkg.concat(".").concat("XInterface"); // NOI18N
+        ifc = new Interface(ifcName, pkg);
+        ifc.addFunction();
+        try {
+            setSimpleProperty(PROPERTY_CONTAINER_INTERFACE, ifcName);
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            ex.printStackTrace();
+        }
+        return ifc;
+    }
+    
+    public void removeInterface(Interface ifc) {
+        try {
+            setSimpleProperty(PROPERTY_CONTAINER_INTERFACE, ""); // NOI18N
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            ex.printStackTrace();
+        }
+        ifc = null;
+    }
+    
+    public int getType() {
+        return SERVICE_TYPE;
+    }
+    
+    public String[] getAllSetObjectNames() {
+        try {
+            return new String[]{getSimpleProperty(PROPERTY_CONTAINER_INTERFACE)};
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return new String[0];
+    }
+
+    public Object getSetObject(String name) {
+        try {
+            String ifcName = getSimpleProperty(PROPERTY_CONTAINER_INTERFACE);
+            if (ifcName.equals(name))
+                return ifc;
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return null;
+    }
+
+    public Object getSetObject() {
+        return ifc;
+    }
+
+    public void addSetObject(String name, Object setObject) {
+        try {
+            setSimpleProperty(PROPERTY_CONTAINER_INTERFACE, name);
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            ex.printStackTrace();
+        }
+        ifc = (Interface)setObject;
+    }
+
+    public void addLanguage(int languageID, String defaultText) {
+        NbNodeObject[] obj = getAllSubObjects();
+        for (int i=0; i<obj.length; i++) {
+            ((Interface)obj[i]).addLanguage(languageID, defaultText);
+        }
+    }
+
+    public void removeLanguage(int languageID) {
+        NbNodeObject[] obj = getAllSubObjects();
+        for (int i=0; i<obj.length; i++) {
+            ((Interface)obj[i]).removeLanguage(languageID);
+        }
+    } 
+
+    public NbNodeObject getParent() {
+        return null;
+    }
+
+    public String getDisplayName() {
+        try {
+            return properties[PROPERTY_Package].getValueForLanguage(-1).concat(
+                    ".").concat(properties[PROPERTY_Name].getValueForLanguage(-1)); // NOI18N
+        }
+        catch (Exception e) {
+            return "no name"; // NOI18N
+        }
+    }
+
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<NbNodeObject> nodeObjects = new Vector<NbNodeObject>();
+        // first direct properties
+        nodeObjects.add((NbNodeObject)properties[PROPERTY_Name]);
+        nodeObjects.add((NbNodeObject)properties[PROPERTY_Package]);
+        nodeObjects.add((NbNodeObject)properties[PROPERTY_Interface]);
+        
+        return (NbNodeObject[])nodeObjects.toArray(new NbNodeObject[nodeObjects.size()]);
+    }
+
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+        Vector<Node.Property> v = new Vector<Node.Property>();
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Name]).createProperties(null, listener)));
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Package]).createProperties(null, listener)));
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Interface]).createProperties(null, listener)));
+        Node.Property[]nameProp = (Node.Property[])v.toArray(new Node.Property[v.size()]);
+        if (sheet != null) {
+            Sheet.Set set = sheet.createPropertiesSet();
+            set.put(nameProp);
+            sheet.put(set);
+        }
+        return (Node.Property[])v.toArray(new Node.Property[v.size()]);
+    }
+
+    public boolean hasActions(int type) {
+        return false;
+    }
+
+    public Action[] getActions(boolean context) {
+        return null;
+    }
+
+    public void setActions(BaseAction actions) {
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Struct.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Struct.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Struct.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Struct.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Struct.java,v $
+ *
+ *  $Revision: 1.8 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/08/15 13:45:20 $
+ *
+ *  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.util.datamodel;
+
+import java.beans.PropertyChangeListener;
+import java.util.Enumeration;
+import java.util.Vector;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.calcaddin.AddinWizardIterator;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.properties.OpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgLanguageIDException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class Struct extends PropertyContainer implements NbNodeObject {
+    
+    private OrderedContainer<Parameter> structTypes;
+    
+    public static final int PROPERTY_COUNT = 2;
+
+    private boolean languageSupport;
+
+    /** Creates a new instance of Function */
+    public Struct(String name, String pkg) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_PACKAGE,
+        });
+        structTypes = new OrderedContainer<Parameter>();
+        initializeProperties(name, pkg);
+    }
+    
+    private void initializeProperties(String name, String pkg) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                name, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Name_Tooltip"),
+                this, null);
+        properties[PROPERTY_Package] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PACKAGE, 
+                pkg, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Type_Tooltip"),
+                this, null);
+    }
+    
+    public Parameter getStructType(String name) {
+        Enumeration keys = structTypes.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            Parameter p = (Parameter)structTypes.get(keys.nextElement());
+            found = name.equals(p.getProperty(p.PROPERTY_Name));
+            if (found) return p;
+        }
+        return null;
+    }
+    
+    public Parameter addStructType() {
+        return addStructType(null);
+    }
+    
+    public Parameter addStructType(NbNodeObject topObject) {
+        int position = 0;  // use 0 if topObject is function
+        if (topObject == null) {  // if null append
+            position = structTypes.size();
+        }
+        else if (topObject instanceof Parameter) {
+            position = structTypes.getPositionFromObject((Parameter)topObject) + 1;
+        }
+        String name = "Type".concat(structTypes.getNextNumber("Type")); // NOI18N
+        Parameter param = null;
+        param = new Parameter(name, "int", this, null); // NOI18N
+        addSetObject(name, param, position);
+        return param;
+    }
+    
+    public void removeStructType(String name) {
+        Enumeration keys = structTypes.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            Object key = keys.nextElement();
+            Parameter p = (Parameter)structTypes.get(key);
+            try {
+                found = name.equals(p.getProperty(p.PROPERTY_Name).getValueForLanguage(-1));
+            } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            }
+            if (found) {
+                structTypes.remove((String)key);
+            }
+        }
+    }
+    
+    public void removeStructType(Parameter parameter) {
+        String[] names = getAllSetObjectNames();
+        for (int i=0; i<names.length; i++) {
+            if (getSetObject(names[i]).equals(parameter)) {
+                structTypes.remove(names[i]);
+            }
+        }
+    }
+    
+    public String[] getAllSetObjectNames() {
+        return structTypes.getKeysInOrder();
+    }
+    
+    public Object getSetObject(String internalName) {
+        return structTypes.get(internalName);
+    }
+    
+    public void addSetObject(String internalName, Object setObject) {
+        structTypes.put(internalName, (Parameter)setObject);
+    }
+    
+    public void addSetObject(String internalName, Object setObject, int position) {
+        structTypes.insertElementAt(internalName, (Parameter)setObject, position);
+    }
+    
+    public String getDisplayName() {
+        try {
+            return properties[PROPERTY_Package].getValueForLanguage(-1).concat(
+                    ".").concat(properties[PROPERTY_Name].getValueForLanguage(-1)); // NOI18N
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return ""; // NOI18N
+    }
+    
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<Object> nodeObjects = new Vector<Object>();
+        // first direct properties
+        nodeObjects.add(properties[PROPERTY_Name]);
+        nodeObjects.add(properties[PROPERTY_Package]);
+        // then parameters
+        String[] keys = structTypes.getKeysInOrder();
+        for(int i=0; i<keys.length; i++) {
+            nodeObjects.add(structTypes.get(keys[i]));
+        }
+        return (NbNodeObject[])nodeObjects.toArray(new NbNodeObject[nodeObjects.size()]);
+    }
+    
+    public OpenOfficeOrgProperty getProperty(int propertyIndex) {
+        return properties[propertyIndex];
+    }
+    
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+        Node.Property[]nameProp = new Node.Property[2];
+        nameProp[0] = ((NbNodeObject)properties[PROPERTY_Name]).createProperties(null, listener)[0];
+        nameProp[1] = ((NbNodeObject)properties[PROPERTY_Package]).createProperties(null, listener)[0];
+        if (sheet != null) {
+            Sheet.Set set = sheet.createPropertiesSet();
+            set.put(nameProp);
+            sheet.put(set);
+        }
+        return nameProp;
+    }
+    
+    public boolean hasActions(int type) {
+        return false;
+    }
+    
+    public Action[] getActions(boolean b) {
+        return null;
+//            new Action[]{new MyNewFunctionAction(), new MyDeleteFunctionAction(),
+//        null, new MyAddParameterAction()};
+    }
+    
+    /**
+     * set the aczion for context menus
+     */
+    public void setActions(BaseAction baseAction) {
+    }
+    
+    public NbNodeObject getParent() {
+        return null;
+    }
+
+    public int getType() {
+        return NbNodeObject.STRUCT_TYPE;
+    }
+    
+//    private class MyNewFunctionAction extends AbstractAction {
+//        public MyNewFunctionAction() {
+//            putValue(NAME, "Add Function");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.addFunctionAction();
+//        }
+//    }
+//    private class MyDeleteFunctionAction extends AbstractAction {
+//        public MyDeleteFunctionAction() {
+//            putValue(NAME, "Delete Function");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.deleteActions();
+//        }
+//    }
+//    public class MyAddParameterAction extends AbstractAction {
+//        public MyAddParameterAction() {
+//            putValue(NAME, "Add Parameter");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.addParameterAction();
+//        }
+//    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/TemplateType.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/TemplateType.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/TemplateType.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/TemplateType.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: TemplateType.java,v $
+ *
+ *  $Revision: 1.3 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/05/03 09:56: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.util.datamodel;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyEditor;
+import java.util.Arrays;
+import java.util.Vector;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.calcaddin.AddinWizardIterator;
+import org.openoffice.extensions.projecttemplates.component.datamodel.types.node.ComponentTypePropertyEditor;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.properties.OpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgLanguageIDException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class TemplateType extends PropertyContainer implements NbNodeObject {
+
+    private NbNodeObject parent;
+    private boolean customPropertyEditor;
+
+    public TemplateType(String nameValue, String typeValue, NbNodeObject parent) {
+        this(nameValue, typeValue, parent, false);
+    }
+            
+    public TemplateType(String nameValue, String typeValue, NbNodeObject parent, boolean customPropertyEditor) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_TYPE,
+        });
+        this.parent = parent;
+        this.customPropertyEditor = customPropertyEditor;
+        initializeProperties(nameValue, typeValue);
+    }
+
+    private void initializeProperties(String nameValue, String typeValue) {
+        PropertyEditor edit = null;
+        if (customPropertyEditor) {
+            edit = new ComponentTypePropertyEditor();
+        }
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                nameValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Name_Tooltip"),
+                this, null, customPropertyEditor);
+        properties[PROPERTY_Type] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_TYPE, 
+                typeValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Type_Tooltip"),
+                this, edit);
+    }
+    
+    public String getDisplayName() {
+        try {
+            return properties[PROPERTY_Name].getValueForLanguage(-1);
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return "unkown name"; // NOI18N
+    }
+
+    public OpenOfficeOrgProperty getProperty(int propertyIndex) {
+        return properties[propertyIndex];
+    }
+    
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<Object> nodeObjects = new Vector<Object>();
+        // first direct properties
+        nodeObjects.add(properties[PROPERTY_Name]);
+        nodeObjects.add(properties[PROPERTY_Type]);
+        return (NbNodeObject[])nodeObjects.toArray(new NbNodeObject[nodeObjects.size()]);
+    }
+
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+        Vector<Object> v = new Vector<Object>();
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Name]).createProperties(null, listener)));
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Type]).createProperties(null, listener)));
+        
+        Node.Property[]nameProp = (Node.Property[])v.toArray(new Node.Property[v.size()]);
+        if (sheet != null) {
+            Sheet.Set set = sheet.createPropertiesSet();
+            set.put(nameProp);
+            sheet.put(set);
+        }
+        return (Node.Property[])v.toArray(new Node.Property[v.size()]);
+    }
+    
+    /**
+     * set the action for context menus
+     */
+    public void setActions(BaseAction baseAction) {
+    }
+    
+    public Action[] getActions(boolean b) {
+        return null;//new Action[]{new MyAddParameterAction(), new MyDeleteParameterAction()};
+    }
+
+    public boolean hasActions(int type) {
+        return false;
+    }
+
+    public NbNodeObject getParent() {
+        return parent;
+    }
+
+    public int getType() {
+        return NbNodeObject.TEMPLATE_TYPE;
+    }
+    
+//    private class MyAddParameterAction extends AbstractAction {
+//        int counter;
+//        public MyAddParameterAction() {
+//            putValue(NAME, "Add Parameter");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.addParameterAction();
+//        }
+//    }
+//    private class MyDeleteParameterAction extends AbstractAction {
+//        public MyDeleteParameterAction() {
+//            putValue(NAME, "Delete Parameter");
+//        }
+//        public void actionPerformed(ActionEvent e) {
+//            addinAction.deleteActions();
+//        }
+//    }
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/BaseAction.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/BaseAction.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/BaseAction.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/BaseAction.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,42 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: BaseAction.java,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: sg $ $Date: 2006/12/07 16:36:54 $
+ *
+ *  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.util.datamodel.actions;
+
+/**
+ * Interface for actions on a NbNodeObject object. This only provides a delete.
+ */
+public interface BaseAction {
+    public void deleteAction();
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/FunctionAction.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/FunctionAction.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/FunctionAction.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/FunctionAction.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: FunctionAction.java,v $
+ *
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/08/15 13:45: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.util.datamodel.actions;
+
+/**
+ * Add a function to the Function class, extending NbNodeObject
+ */
+public interface FunctionAction extends BaseAction {
+    public void addFunctionAction();
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/LanguageAction.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/LanguageAction.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/LanguageAction.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/LanguageAction.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: LanguageAction.java,v $
+ *
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/08/15 13:45: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.util.datamodel.actions;
+
+/**
+ * Implementing classes must provide language actions on NbNodeObjects
+ */
+public interface LanguageAction {
+    public void addLanguageAction();
+    public void deleteLanguageAction();
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/ParameterAction.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/ParameterAction.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/ParameterAction.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/actions/ParameterAction.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: ParameterAction.java,v $
+ *
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/08/15 13:45: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.util.datamodel.actions;
+
+/**
+ * add a paramter to the Parameter class, extending NbNodeObject
+ */
+public interface ParameterAction extends BaseAction {
+    public void addParameterAction();
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,69 @@
+# Country names for localizations
+Albanian=Albanian
+Arabic=Arabic
+Armenian=Armenian
+Azerbaijani=Azerbaijani
+Brazil=Brazil
+Basque=Basque
+Bengali=Bengali
+Breton=Breton
+Bulgarian=Bulgarian
+Catalan=Catalan
+Chinese=Chinese
+Czech=Czech
+Croatian=Croatian
+Danish=Danish
+Dutch=Dutch
+English=English
+Esperanto=Esperanto
+Estonian=Estonian
+Finnish=Finnish
+French=French
+Galician=Galician
+GaelicIrish=Gaelic - Irish
+GaelicScottish=Gaelic - Scottish
+Georgian=Georgian
+German=German
+Greek=Greek
+Gujarati=Gujarati
+Hebrew=Hebrew
+Hindi=Hindi
+Hungarian=Hungarian
+Indonesian=Indonesian
+Italiano=Italiano
+Japanese=Japanese
+Khmer=Khmer
+Korean=Korean
+Lao=Lao
+Lithuanian=Lithuanian
+Macedonian=Macedonian
+Malayalam=Malayalam
+Marathi=Marathi
+Malaysian=Malaysian
+Nepali=Nepali
+Norwegian=Norwegian
+Persian=Persian
+Polish=Polish
+Portuguese=Portuguese
+PortugueseBrasil=Portuguese of Brasil
+Punjabi=Punjabi
+Romanian=Romanian
+Russian=Russian
+# encoded special characters
+Sangu=S\u00E4ng\u00FC
+Serbian=Serbian
+Sinhala=Sinhala
+Slovenian=Slovenian
+Slovakian=Slovakian
+Spanish=Spanish
+Swedish=Swedish
+Tajik=Tajik
+Tamil=Tamil
+Telegu=Telegu
+Tetum=Tetum
+Thai=Thai
+Tibetan=Tibetan
+Turkish=Turkish
+Ukrainian=Ukrainian
+Vietnamese=Vietnamese
+Welsh=Welsh
\ No newline at end of file

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_ja.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_ja.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_ja.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_ja.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,136 @@
+# Country names for localizations
+# Albanian=Albanian
+Albanian=\u30a2\u30eb\u30d0\u30cb\u30a2\u8a9e
+# Arabic=Arabic
+Arabic=\u30a2\u30e9\u30d3\u30a2\u8a9e
+# Armenian=Armenian
+Armenian=\u30a2\u30eb\u30e1\u30cb\u30a2\u8a9e
+# Azerbaijani=Azerbaijani
+Azerbaijani=\u30a2\u30bc\u30eb\u30d0\u30a4\u30b8\u30e3\u30f3\u8a9e
+# Basque=Basque
+Basque=\u30d0\u30b9\u30af\u8a9e
+# Bengali=Bengali
+Bengali=\u30d9\u30f3\u30ac\u30eb\u8a9e
+# Breton=Breton
+Breton=\u30d6\u30eb\u30bf\u30fc\u30cb\u30e5\u8a9e
+# Bulgarian=Bulgarian
+Bulgarian=\u30d6\u30eb\u30ac\u30ea\u30a2\u8a9e
+# Catalan=Catalan
+Catalan=\u30ab\u30bf\u30ed\u30cb\u30a2\u8a9e
+# Chinese=Chinese
+Chinese=\u4e2d\u56fd\u8a9e
+# Czech=Czech
+Czech=\u30c1\u30a7\u30b3\u8a9e
+# Croatian=Croatian
+Croatian=\u30af\u30ed\u30a2\u30c1\u30a2\u8a9e
+# Danish=Danish
+Danish=\u30c7\u30f3\u30de\u30fc\u30af\u8a9e
+# Dutch=Dutch
+Dutch=\u30aa\u30e9\u30f3\u30c0\u8a9e
+# English=English
+English=\u82f1\u8a9e
+# Esperanto=Esperanto
+Esperanto=\u30a8\u30b9\u30da\u30e9\u30f3\u30c8\u8a9e
+# Estonian=Estonian
+Estonian=\u30a8\u30b9\u30c8\u30cb\u30a2\u8a9e
+# Finnish=Finnish
+Finnish=\u30d5\u30a3\u30f3\u30e9\u30f3\u30c9\u8a9e
+# French=French
+French=\u30d5\u30e9\u30f3\u30b9\u8a9e
+# Galician=Galician
+Galician=\u30ac\u30ea\u30b7\u30a2\u8a9e
+# GaelicIrish=Gaelic - Irish
+GaelicIrish=\u30b2\u30fc\u30eb - \u30a2\u30a4\u30eb\u30e9\u30f3\u30c9\u8a9e
+# GaelicScottish=Gaelic - Scottish
+GaelicScottish=\u30b2\u30fc\u30eb - \u30b9\u30b3\u30c3\u30c8\u30e9\u30f3\u30c9\u8a9e
+# Georgian=Georgian
+Georgian=\u30b0\u30eb\u30b8\u30a2\u8a9e
+# German=German
+German=\u30c9\u30a4\u30c4\u8a9e
+# Greek=Greek
+Greek=\u30ae\u30ea\u30b7\u30e3\u8a9e
+# Gujarati=Gujarati
+Gujarati=\u30b0\u30b8\u30e3\u30e9\u30fc\u30c8\u8a9e
+# Hebrew=Hebrew
+Hebrew=\u30d8\u30d6\u30e9\u30a4\u8a9e
+# Hindi=Hindi
+Hindi=\u30d2\u30f3\u30c7\u30a3\u30fc\u8a9e
+# Hungarian=Hungarian
+Hungarian=\u30cf\u30f3\u30ac\u30ea\u30fc\u8a9e
+# Indonesian=Indonesian
+Indonesian=\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u8a9e
+# Italiano=Italiano
+Italiano=\u30a4\u30bf\u30ea\u30a2\u8a9e
+# Japanese=Japanese
+Japanese=\u65e5\u672c\u8a9e
+# Khmer=Khmer
+Khmer=\u30af\u30e1\u30fc\u30eb\u8a9e
+# Korean=Korean
+Korean=\u97d3\u56fd\u8a9e
+# Lao=Lao
+Lao=\u30e9\u30aa\u8a9e
+# Lithuanian=Lithuanian
+Lithuanian=\u30ea\u30c8\u30a2\u30cb\u30a2\u8a9e
+# Macedonian=Macedonian
+Macedonian=\u30de\u30b1\u30c9\u30cb\u30a2\u8a9e
+# Malayalam=Malayalam
+Malayalam=\u30de\u30e9\u30e4\u30fc\u30e9\u30e0\u8a9e
+# Marathi=Marathi
+Marathi=\u30de\u30e9\u30fc\u30c6\u30a3\u30fc\u8a9e
+# Malaysian=Malaysian
+Malaysian=\u30de\u30ec\u30fc\u30b7\u30a2\u8a9e
+# Nepali=Nepali
+Nepali=\u30cd\u30d1\u30fc\u30eb\u8a9e
+# Norwegian=Norwegian
+Norwegian=\u30ce\u30eb\u30a6\u30a7\u30fc\u8a9e
+# Persian=Persian
+Persian=\u30da\u30eb\u30b7\u30a2\u8a9e
+# Polish=Polish
+Polish=\u30dd\u30fc\u30e9\u30f3\u30c9\u8a9e
+# Portuguese=Portuguese
+Portuguese=\u30dd\u30eb\u30c8\u30ac\u30eb\u8a9e
+# PortugueseBrasil=Portuguese of Brasil
+PortugueseBrasil=\u30d6\u30e9\u30b8\u30eb\u30fb\u30dd\u30eb\u30c8\u30ac\u30eb\u8a9e
+# Punjabi=Punjabi
+Punjabi=\u30d1\u30f3\u30b8\u30e3\u30d6\u8a9e
+# Romanian=Romanian
+Romanian=\u30eb\u30fc\u30de\u30cb\u30a2\u8a9e
+# Russian=Russian
+Russian=\u30ed\u30b7\u30a2\u8a9e
+# encoded special characters
+# Sangu=S\u00E4ng\u00FC
+Sangu=S\u00E4ng\u00FC
+# Serbian=Serbian
+Serbian=\u30bb\u30eb\u30d3\u30a2\u8a9e
+# Sinhala=Sinhala
+Sinhala=\u30b7\u30f3\u30cf\u30e9\u8a9e
+# Slovenian=Slovenian
+Slovenian=\u30b9\u30ed\u30d9\u30cb\u30a2\u8a9e
+# Slovakian=Slovakian
+Slovakian=\u30b9\u30ed\u30d0\u30ad\u30a2\u8a9e
+# Spanish=Spanish
+Spanish=\u30b9\u30da\u30a4\u30f3\u8a9e
+# Swedish=Swedish
+Swedish=\u30b9\u30a6\u30a7\u30fc\u30c7\u30f3\u8a9e
+# Tajik=Tajik
+Tajik=\u30bf\u30b8\u30af\u8a9e
+# Tamil=Tamil
+Tamil=\u30bf\u30df\u30eb\u8a9e
+# Telegu=Telegu
+Telegu=\u30c6\u30ec\u30b0\u8a9e
+# Tetum=Tetum
+Tetum=\u30c6\u30c8\u30a5\u30e0\u8a9e
+# Thai=Thai
+Thai=\u30bf\u30a4\u8a9e
+# Tibetan=Tibetan
+Tibetan=\u30c1\u30d9\u30c3\u30c8\u8a9e
+# Turkish=Turkish
+Turkish=\u30c8\u30eb\u30b3\u8a9e
+# Ukrainian=Ukrainian
+Ukrainian=\u30a6\u30af\u30e9\u30a4\u30ca\u8a9e
+# Vietnamese=Vietnamese
+Vietnamese=\u30d9\u30c8\u30ca\u30e0\u8a9e
+# Welsh=Welsh
+Welsh=\u30a6\u30a7\u30fc\u30eb\u30ba\u8a9e
+
+

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_pt_BR.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_pt_BR.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_pt_BR.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_pt_BR.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,68 @@
+# Country names for localizations
+Albanian=Albanian
+Arabic=Arabic
+Armenian=Armenian
+Azerbaijani=Azerbaijani
+Basque=Basque
+Bengali=Bengali
+Breton=Breton
+Bulgarian=Bulgarian
+Catalan=Catalan
+Chinese=Chinese
+Czech=Czech
+Croatian=Croatian
+Danish=Danish
+Dutch=Dutch
+English=English
+Esperanto=Esperanto
+Estonian=Estonian
+Finnish=Finnish
+French=French
+Galician=Galician
+GaelicIrish=Gaelic - Irish
+GaelicScottish=Gaelic - Scottish
+Georgian=Georgian
+German=German
+Greek=Greek
+Gujarati=Gujarati
+Hebrew=Hebrew
+Hindi=Hindi
+Hungarian=Hungarian
+Indonesian=Indonesian
+Italiano=Italiano
+Japanese=Japanese
+Khmer=Khmer
+Korean=Korean
+Lao=Lao
+Lithuanian=Lithuanian
+Macedonian=Macedonian
+Malayalam=Malayalam
+Marathi=Marathi
+Malaysian=Malaysian
+Nepali=Nepali
+Norwegian=Norwegian
+Persian=Persian
+Polish=Polish
+Portuguese=Portuguese
+PortugueseBrasil=Portuguese of Brasil
+Punjabi=Punjabi
+Romanian=Romanian
+Russian=Russian
+# encoded special characters
+Sangu=S\u00E4ng\u00FC
+Serbian=Serbian
+Sinhala=Sinhala
+Slovenian=Slovenian
+Slovakian=Slovakian
+Spanish=Spanish
+Swedish=Swedish
+Tajik=Tajik
+Tamil=Tamil
+Telegu=Telegu
+Tetum=Tetum
+Thai=Thai
+Tibetan=Tibetan
+Turkish=Turkish
+Ukrainian=Ukrainian
+Vietnamese=Vietnamese
+Welsh=Welsh
\ No newline at end of file

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_zh_CN.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_zh_CN.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_zh_CN.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/localization/Bundle_zh_CN.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,68 @@
+# Country names for localizations
+Albanian=\u963f\u5c14\u5df4\u5c3c\u4e9a\u8bed
+Arabic=\u963f\u62c9\u4f2f\u8bed
+Armenian=\u4e9a\u7f8e\u5c3c\u4e9a\u8bed
+Azerbaijani=\u963f\u585e\u62dc\u7586\u8bed
+Basque=\u5df4\u65af\u514b\u8bed
+Bengali=\u5b5f\u52a0\u62c9\u8bed
+Breton=\u5e03\u5217\u5854\u5c3c\u8bed
+Bulgarian=\u4fdd\u52a0\u5229\u4e9a\u8bed
+Catalan=\u52a0\u6cf0\u7f57\u5c3c\u4e9a\u8bed
+Chinese=\u4e2d\u6587
+Czech=\u6377\u514b\u8bed
+Croatian=\u514b\u7f57\u5730\u4e9a\u8bed
+Danish=\u4e39\u9ea6\u8bed
+Dutch=\u8377\u5170\u8bed
+English=\u82f1\u8bed
+Esperanto=\u4e16\u754c\u8bed
+Estonian=\u7231\u6c99\u5c3c\u4e9a\u8bed
+Finnish=\u82ac\u5170\u8bed
+French=\u6cd5\u8bed
+Galician=\u52a0\u5229\u897f\u4e9a\u8bed
+GaelicIrish=\u76d6\u5c14\u8bed - \u7231\u5c14\u5170
+GaelicScottish=\u76d6\u5c14\u8bed - \u82cf\u683c\u5170
+Georgian=\u683c\u9c81\u5409\u4e9a\u8bed
+German=\u5fb7\u8bed
+Greek=\u5e0c\u814a\u8bed
+Gujarati=\u53e4\u5409\u62c9\u7279\u8bed
+Hebrew=\u5e0c\u4f2f\u6765\u8bed
+Hindi=\u5370\u5730\u8bed
+Hungarian=\u5308\u7259\u5229\u8bed
+Indonesian=\u5370\u5ea6\u5c3c\u897f\u4e9a\u8bed
+Italiano=\u610f\u5927\u5229\u8bed
+Japanese=\u65e5\u8bed
+Khmer=\u9ad8\u68c9\u8bed
+Korean=\u97e9\u8bed
+Lao=\u8001\u631d\u8bed
+Lithuanian=\u7acb\u9676\u5b9b\u8bed
+Macedonian=\u9a6c\u5176\u987f\u8bed
+Malayalam=\u9a6c\u62c9\u96c5\u62c9\u59c6\u8bed
+Marathi=\u9a6c\u62c9\u5730\u8bed
+Malaysian=\u9a6c\u6765\u897f\u4e9a\u8bed
+Nepali=\u5c3c\u6cca\u5c14\u8bed
+Norwegian=\u632a\u5a01\u8bed
+Persian=\u6ce2\u65af\u8bed
+Polish=\u6ce2\u5170\u8bed
+Portuguese=\u8461\u8404\u7259\u8bed
+PortugueseBrasil=\u5df4\u897f\u8461\u8404\u7259\u8bed
+Punjabi=\u65c1\u906e\u666e\u8bed
+Romanian=\u7f57\u9a6c\u5c3c\u4e9a\u8bed
+Russian=\u4fc4\u8bed
+# encoded special characters
+Sangu=\u6851\u6208\u8bed
+Serbian=\u585e\u5c14\u7ef4\u4e9a\u8bed
+Sinhala=\u50e7\u4f3d\u7f57\u8bed
+Slovenian=\u65af\u6d1b\u6587\u5c3c\u4e9a\u8bed
+Slovakian=\u65af\u6d1b\u4f10\u514b\u8bed
+Spanish=\u897f\u73ed\u7259\u8bed
+Swedish=\u745e\u5178\u8bed
+Tajik=\u5854\u5409\u514b\u8bed
+Tamil=\u6cf0\u7c73\u5c14\u8bed
+Telegu=\u6cf0\u5362\u56fa\u8bed
+Tetum=\u5fb7\u987f\u8bed
+Thai=\u6cf0\u8bed
+Tibetan=\u85cf\u8bed
+Turkish=\u571f\u8033\u5176\u8bed
+Ukrainian=\u4e4c\u514b\u5170\u8bed
+Vietnamese=\u8d8a\u5357\u8bed
+Welsh=\u5a01\u5c14\u58eb\u8bed