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 [34/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/util/datamodel/Constants.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Constants.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Constants.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Constants.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Constants.java,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/09/06 17:14: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.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.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;
+
+public class Constants extends PropertyContainer implements NbNodeObject {
+    
+    public static final int PROPERTY_COUNT = 2;
+
+    public Constants(String nameValue, String pkgValue) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_PACKAGE,
+        });
+        initializeProperties(nameValue, pkgValue);
+    }
+
+    private void initializeProperties(String nameValue, String pkgValue) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                nameValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Name_Tooltip"),
+                this, null);
+        properties[PROPERTY_Package] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PACKAGE, 
+                pkgValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Type_Tooltip"),
+                this, null);
+    }
+    
+    public NbNodeObject getParent() {
+        return null;
+    }
+
+    public String getDisplayName() {
+        try {
+            return getSimpleProperty(PROPERTY_CONTAINER_PACKAGE).concat(".").concat(
+                getSimpleProperty(PROPERTY_CONTAINER_NAME)); // NOI18N
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return "unkwon display name"; // NOI18N
+    }
+
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<Object> nodeObjects = new Vector<Object>();
+        // first direct properties
+        NbNodeObject[] subs = new NbNodeObject[PROPERTY_COUNT];
+        subs[0] = (NbNodeObject)properties[PROPERTY_Name];
+        subs[1] = (NbNodeObject)properties[PROPERTY_Package];
+        return subs;
+    }
+
+    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_Package]).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) {
+        // empty
+    }
+
+    public int getType() {
+        return NbNodeObject.CONSTANTS_TYPE;
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Function.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Function.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Function.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Function.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,474 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Function.java,v $
+ *
+ *  $Revision: 1.11 $
+ *
+ *  last change: $Author: sg $ $Date: 2008/07/03 08:31:32 $
+ *
+ *  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.Enumeration;
+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.FunctionAction;
+import org.openoffice.extensions.util.datamodel.actions.ParameterAction;
+import org.openoffice.extensions.util.datamodel.localization.LanguageDefinition;
+import org.openoffice.extensions.util.datamodel.properties.ExceptionPropertyEditor;
+import org.openoffice.extensions.util.datamodel.properties.LocalizedOpenOfficeOrgProperty;
+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 Function extends PropertyContainer implements OpenOfficeOrgMultiLanguageSet, NbNodeObject {
+    
+    private OrderedContainer<Parameter> parameters;
+    NbNodeObject parent;
+
+    // executes the actual selected action for context menu
+    private BaseAction baseActions;
+    
+    private boolean languageSupport;
+
+    /** Creates a new instance of Function */
+    public Function(String nameValue, String typeValue, NbNodeObject parent) {
+        this(nameValue, typeValue, parent, new Integer[0]);
+    }
+    
+    public Function(String nameValue, String typeValue, NbNodeObject parent, Integer[] languages) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_TYPE,
+            PROPERTY_CONTAINER_DESCRIPTION,
+            PROPERTY_CONTAINER_CATEGORY,
+            PROPERTY_CONTAINER_DISPLAY_NAME,
+            PROPERTY_CONTAINER_EXCEPTIONS,
+            PROPERTY_CONTAINER_COMPATIBILITY_NAME,
+        });
+        this.parent = parent;
+        parameters = new OrderedContainer<Parameter>();
+        initializeProperties(nameValue, typeValue);
+        if (languages == null) { // no language support
+            this.languageSupport = false;
+        }
+        else if (languages.length > 0) {
+            this.languageSupport = true;
+            initializeLanguageProperties(nameValue, typeValue, languages[0].intValue());
+            for (int i=1; i<languages.length; i++) {
+                addLanguage(languages[i].intValue(), ""); // NOI18N
+            }
+        } else { // use default as fallback
+            this.languageSupport = true;
+            initializeLanguageProperties(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_Function_Name_Tooltip"),
+                this, null);
+        // settings for the return type; different depending on usage
+        boolean readOnly = false;
+        PropertyEditor editor = null;  
+        if (parent.getType() == NbNodeObject.ADDIN_TYPE) {
+            editor = new AddInPropertyEditor(AddInPropertyEditor.RETURN_TYPE_EDITOR);
+        }
+        else {
+            int length = UnoTypes.SIMPLE_TYPE_TAGS.length;
+            String []tags = new String[length + 1];
+            System.arraycopy(UnoTypes.SIMPLE_TYPE_TAGS, 0, tags, 0, length);
+            tags[length] = "[]"; // NOI18N
+            editor = new ComponentTypePropertyEditor(tags);
+        }
+        properties[PROPERTY_Type] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_TYPE, 
+                typeValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Type_Tooltip"),
+                this, editor, readOnly); // NOI18N
+        properties[PROPERTY_Exceptions] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_EXCEPTIONS, 
+                "", 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Type_Tooltip"),
+                this, new ExceptionPropertyEditor()); // NOI18N
+    }
+    
+    private void initializeLanguageProperties(String nameValue, String typeValue, int language) {
+        if (parent.getType() == NbNodeObject.ADDIN_TYPE) {
+            properties[PROPERTY_DisplayName] = new LocalizedOpenOfficeOrgProperty(
+                    PROPERTY_CONTAINER_DISPLAY_NAME, 
+                    "<".concat(nameValue).concat(">"), 
+                    NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_DisplayName_Tooltip"),
+                    this, language, null); // NOI18N
+            properties[PROPERTY_Description] = new LocalizedOpenOfficeOrgProperty(
+                    PROPERTY_CONTAINER_DESCRIPTION, 
+                    NbBundle.getMessage(AddinWizardIterator.class, "PROP_Function_Description"), 
+                    NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Description_Tooltip"),
+                    this, language, null); // NOI18N
+    //        properties[PROPERTY_CategoryDisplayName] = new LocalizedOpenOfficeOrgProperty(CATEGORY_DISPLAY_NAME, "add your localized category display name here.", this,
+    //                language, null);
+            properties[PROPERTY_CompatibilityName] = new LocalizedOpenOfficeOrgProperty(
+                    PROPERTY_CONTAINER_COMPATIBILITY_NAME, 
+                    "<".concat(nameValue).concat(">"), 
+                    NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_CompatibilityName_Tooltip"),
+                    this, language, null); // NOI18N
+            // not xcu/xcs relevant, only for skeleton creation
+            properties[PROPERTY_Category] = new SimpleOpenOfficeOrgProperty(
+                    PROPERTY_CONTAINER_CATEGORY, 
+                    "Add-In", 
+                    NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Category_Tooltip"),
+                    this, new AddInPropertyEditor(AddInPropertyEditor.CATEGORY_EDITOR)); // NOI18N
+        }
+        else if (parent.getType() == NbNodeObject.ADDON_TYPE) {
+            properties[PROPERTY_DisplayName] = new LocalizedOpenOfficeOrgProperty(
+                    PROPERTY_CONTAINER_DISPLAY_NAME, 
+                    "<".concat(nameValue).concat(">"), 
+                    NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_DisplayName_Tooltip"),
+                    this, language, null); // NOI18N
+        }
+    }
+    
+    public void addLanguage(int languageID, String defaultText) {
+        try {
+            // set text on all parameters
+            Enumeration keys = parameters.keys();
+            while (keys.hasMoreElements()) {
+                Parameter p = (Parameter)parameters.get(keys.nextElement());
+                p.setLanguageWithDefaultText(languageID, defaultText);
+            }
+            // set text on all props here
+            this.setLanguageWithDefaultText(languageID, defaultText);
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+    }
+    
+    public void printLanguages() { // just for debugging
+        try {
+            LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, 
+                "## Function " + 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
+//        LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, "-> CategoryDisplayName: " + ((LocalizedOpenOfficeOrgProperty)properties[PROPERTY_CategoryDisplayName]).getUsedLanguageIndexes().length);ni 
+        LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, "-> CompatibiltyName: " + ((LocalizedOpenOfficeOrgProperty)properties[PROPERTY_CompatibilityName]).getUsedLanguageIndexes().length); // NOI18N
+        
+        Enumeration keys = parameters.keys();
+        while (keys.hasMoreElements()) {
+            Parameter p = (Parameter)parameters.get(keys.nextElement());
+            p.printLanguages();
+        }
+    }
+    
+    public void removeLanguage(int languageID) {
+        try {
+            // remove language on all props here
+            this.removeLanguageAndText(languageID);
+            // set text on all parameters
+            Enumeration keys = parameters.keys();
+            while (keys.hasMoreElements()) {
+                Parameter p = (Parameter)parameters.get(keys.nextElement());
+                p.removeLanguageAndText(languageID);
+            }
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+    }
+    
+    public Parameter getParameter(String name) {
+        Enumeration keys = parameters.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            Parameter p = (Parameter)parameters.get(keys.nextElement());
+            try {
+                found = name.equals(p.getSimpleProperty(p.PROPERTY_CONTAINER_NAME));
+            } catch (UnknownOpenOfficeOrgPropertyException ex) {
+                LogWriter.getLogWriter().printStackTrace(ex);
+            }
+            if (found) return p;
+        }
+        return null;
+    }
+    
+    public Parameter addParameter() {
+        return addParameter(null);
+    }
+    
+    public Parameter addParameter(NbNodeObject topObject) {
+        int position = 0;  // use 0 if topObject is function
+        if (topObject == null) {  // if null append
+            position = parameters.size();
+        }
+        else if (topObject instanceof Parameter) {
+            position = parameters.getPositionFromObject((Parameter)topObject) + 1;
+        }
+        String name = "parameter".concat(parameters.getNextNumber("parameter")); // NOI18N
+        Parameter param = null;
+        if (this.languageSupport) {
+            Integer[] indexes = ((LocalizedOpenOfficeOrgProperty)properties[PROPERTY_DisplayName]).getUsedLanguageIndexes();
+            param = new Parameter(name, "int", this, indexes); // NOI18N
+        }
+        else {
+            param = new Parameter(name, "int", this, null); // NOI18N
+        }
+        addSetObject(name, param, position);
+        return param;
+    }
+    
+    public void removeParameter(String name) {
+        Enumeration<String> keys = parameters.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            String key = keys.nextElement();
+            Parameter p = (Parameter)parameters.get(key);
+            try {
+                found = name.equals(p.getProperty(p.PROPERTY_Name).getValueForLanguage(-1));
+            } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            }
+            if (found) {
+                parameters.remove(key);
+            }
+        }
+    }
+    
+    public void removeParameter(Parameter parameter) {
+        String[] names = getAllSetObjectNames();
+        for (int i=0; i<names.length; i++) {
+            if (getSetObject(names[i]).equals(parameter)) {
+                parameters.remove(names[i]);
+            }
+        }
+    }
+    
+    public String[] getAllSetObjectNames() {
+        return parameters.getKeysInOrder();
+    }
+    
+    public Object getSetObject(String internalName) {
+        return parameters.get(internalName);
+    }
+    
+    public void addSetObject(String internalName, Object setObject) {
+        parameters.put(internalName, (Parameter)setObject);
+    }
+    
+    public void addSetObject(String internalName, Object setObject, int position) {
+        parameters.insertElementAt(internalName, (Parameter)setObject, position);
+    }
+    
+    public String getDisplayName() {
+        StringBuffer buf = new StringBuffer();
+        try {
+            buf.append(properties[PROPERTY_Type].getValueForLanguage(-1));
+            buf.append(" ").append(properties[PROPERTY_Name].getValueForLanguage(-1)); // NOI18N
+            buf.append("("); // NOI18N
+            String[] paramNames = getAllSetObjectNames();
+            for (int i=0; i<paramNames.length; i++) {
+                if (i > 0) {
+                    buf.append(", "); // NOI18N
+                }
+                Parameter param = (Parameter)getSetObject(paramNames[i]);
+                // 2do: parametrize this:
+                buf.append(param.getProperty(PROPERTY_Type).getValueForLanguage(-1)).append(" "); // NOI18N
+                buf.append(param.getProperty(PROPERTY_Name).getValueForLanguage(-1));
+            }
+            buf.append(");"); // NOI18N
+        } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            buf.append(ex.toString());
+        }
+        return buf.toString();
+    }
+    
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<Object> nodeObjects = new Vector<Object>();
+        // first direct properties
+        nodeObjects.add(properties[PROPERTY_Name]);
+        nodeObjects.add(properties[PROPERTY_Type]);
+        nodeObjects.add(properties[PROPERTY_Exceptions]);
+        if (getParent().getType() == NbNodeObject.ADDIN_TYPE) {
+            nodeObjects.add(properties[PROPERTY_Category]);
+//          nodeObjects.add(properties[PROPERTY_CategoryDisplayName]);
+            nodeObjects.add(properties[PROPERTY_DisplayName]);
+            nodeObjects.add(properties[PROPERTY_Description]);
+            nodeObjects.add(properties[PROPERTY_CompatibilityName]);
+        }
+        // then parameters
+        String[] keys = parameters.getKeysInOrder();
+        for(int i=0; i<keys.length; i++) {
+            nodeObjects.add(parameters.get(keys[i]));
+        }
+        return (NbNodeObject[])nodeObjects.toArray(new NbNodeObject[nodeObjects.size()]);
+    }
+    
+//    public void fireDataChangeEvent() {
+//        parent.fireDataChangeEvent();
+//    }
+    
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+        int parentType = getParent().getType();
+        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)));
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Exceptions]).createProperties(null, listener)));
+        if (parentType == NbNodeObject.ADDIN_TYPE) {
+            v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Category]).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);
+            
+//            set = sheet.createPropertiesSet();
+//            set.setName(((NbNodeObject)properties[PROPERTY_CategoryDisplayName]).getDisplayName());
+//            set.setDisplayName(set.getName().concat(" - Localized Property"));
+//            set.put(((NbNodeObject)properties[PROPERTY_CategoryDisplayName]).createProperties(null, listener));
+//            sheet.put(set);
+
+            if (parentType == NbNodeObject.ADDIN_TYPE) {
+                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);
+
+                set = sheet.createPropertiesSet();
+                set.setName(((NbNodeObject)properties[PROPERTY_CompatibilityName]).getDisplayName());
+                set.setDisplayName(set.getName().concat(" - ").concat( // NOI18N
+                        NbBundle.getMessage(AddinWizardIterator.class, "LB_LocalizedProperty")));
+                set.put(((NbNodeObject)properties[PROPERTY_CompatibilityName]).createProperties(null, listener));
+                sheet.put(set);
+            }
+            else if (parentType == NbNodeObject.ADDON_TYPE) {
+                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);
+            }
+        }
+        if (parentType == NbNodeObject.ADDIN_TYPE) {
+            v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_DisplayName]).createProperties(null, listener)));
+            v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_Description]).createProperties(null, listener)));
+//          v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_CategoryDisplayName]).createProperties(null, listener)));
+            v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_CompatibilityName]).createProperties(null, listener)));
+        }
+        else if (parentType == NbNodeObject.ADDON_TYPE) {
+            v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_DisplayName]).createProperties(null, listener)));
+        }
+        return (Node.Property[])v.toArray(new Node.Property[v.size()]);
+    }
+    
+    public boolean hasActions(int type) {
+        return baseActions != null;
+    }
+    
+    public Action[] getActions(boolean b) {
+        Action[] rightMouseClickAction = null;
+        if (getParent().getType() == NbNodeObject.ADDIN_TYPE) {
+            rightMouseClickAction = new Action[]{new MyNewFunctionAction(), new MyDeleteFunctionAction(),
+                null, new MyAddParameterAction()};
+        }
+        else if (getParent().getType() == NbNodeObject.ADDON_TYPE) {
+            rightMouseClickAction = new Action[]{new MyNewFunctionAction(), new MyDeleteFunctionAction()};
+        }
+        return rightMouseClickAction;
+    }
+    
+    /**
+     * set the actions for all operations
+     */
+    public void setActions(BaseAction baseActions) {
+        this.baseActions = baseActions;
+    }
+    
+    public NbNodeObject getParent() {
+        return parent;
+    }
+
+    public int getType() {
+        return NbNodeObject.FUNCTION_TYPE;
+    }
+    
+    private class MyNewFunctionAction extends AbstractAction {
+        public MyNewFunctionAction() {
+            putValue(NAME, NbBundle.getMessage(LocalizedOpenOfficeOrgProperty.class, "LBL_AddFunction"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            ((FunctionAction)baseActions).addFunctionAction();
+        }
+    }
+    private class MyDeleteFunctionAction extends AbstractAction {
+        public MyDeleteFunctionAction() {
+            putValue(NAME, NbBundle.getMessage(LocalizedOpenOfficeOrgProperty.class, "LBL_DeleteFunction"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            baseActions.deleteAction();
+        }
+    }
+    public class MyAddParameterAction extends AbstractAction {
+        public MyAddParameterAction() {
+            putValue(NAME, NbBundle.getMessage(Function.class, "LBL_AddParameter"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            ((ParameterAction)baseActions).addParameterAction();
+        }
+    }
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/FunctionException.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/FunctionException.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/FunctionException.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/FunctionException.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: FunctionException.java,v $
+ *
+ *  $Revision: 1.7 $
+ *
+ *  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.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.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.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class FunctionException extends PropertyContainer implements NbNodeObject {
+
+    public static final int PROPERTY_COUNT = 3;
+
+    /** Creates a new instance of Parameter */
+    public FunctionException(String nameValue, String pkgValue) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_PACKAGE,
+            PROPERTY_CONTAINER_PARENT_EXCPTION,
+        });
+        initializeProperties(nameValue, pkgValue);
+    }
+
+    private void initializeProperties(String nameValue, String pkgValue) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                nameValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Name_Tooltip"),
+                this, null);
+        properties[PROPERTY_Package] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PACKAGE, 
+                pkgValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Type_Tooltip"),
+                this, null);
+        properties[PROPERTY_ParentException] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PARENT_EXCPTION, 
+                "com.sun.star.uno.Exception", 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Type_Tooltip"),
+                this, null); // NOI18N
+    }
+    
+    public String getDisplayName() {
+        try {
+            return getSimpleProperty(PROPERTY_CONTAINER_PACKAGE).concat(".").concat(
+                getSimpleProperty(PROPERTY_CONTAINER_NAME)); // NOI18N
+        } catch (UnknownOpenOfficeOrgPropertyException ex) {
+            LogWriter.getLogWriter().printStackTrace(ex);
+        }
+        return "unkwon display name"; // NOI18N
+    }
+
+    public OpenOfficeOrgProperty getProperty(int propertyIndex) {
+        return properties[propertyIndex];
+    }
+    
+    public NbNodeObject[] getAllSubObjects() {
+        Vector<Object> nodeObjects = new Vector<Object>();
+        // first direct properties
+        NbNodeObject[] subs = new NbNodeObject[PROPERTY_COUNT];
+        subs[0] = (NbNodeObject)properties[PROPERTY_Name];
+        subs[1] = (NbNodeObject)properties[PROPERTY_Package];
+        subs[2] = (NbNodeObject)properties[PROPERTY_ParentException];
+        return subs;
+    }
+
+    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_Package]).createProperties(null, listener)));
+        v.addAll(Arrays.asList(((NbNodeObject)properties[PROPERTY_ParentException]).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 null;
+    }
+
+    public int getType() {
+        return NbNodeObject.EXCEPTION_TYPE;
+    }
+    
+/*    private class MyAddParameterAction extends AbstractAction {
+        int counter;
+        public MyAddParameterAction() {
+            putValue(NAME, NbBundle.getMessag("Add Parameter"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            addinAction.addParameterAction();
+        }
+    }
+    private class MyDeleteParameterAction extends AbstractAction {
+        public MyDeleteParameterAction() {
+            putValue(NAME, NbBundle.getMessag("Delete Parameter"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            addinAction.deleteActions();
+        }
+    }
+*/    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/IdlEnum.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/IdlEnum.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/IdlEnum.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/IdlEnum.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: IdlEnum.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 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 IdlEnum extends PropertyContainer implements NbNodeObject {
+
+    public static final int PROPERTY_COUNT = 1;
+
+    private NbNodeObject parent;
+
+    private boolean languageSupport;
+
+    public IdlEnum(String nameValue, NbNodeObject parent) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME
+        });
+        this.parent = parent;
+        initializeProperties(nameValue);
+    }
+
+    private void initializeProperties(String nameValue) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                nameValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Parameter_Name_Tooltip"),
+                this, null);
+    }
+    
+    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() {
+        return new NbNodeObject[]{(NbNodeObject)properties[PROPERTY_Name]};
+    }
+
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener) {
+        Node.Property[]nameProp = new Node.Property[1];
+        nameProp[0] = ((NbNodeObject)properties[PROPERTY_Name]).createProperties(null, listener)[0];
+        if (sheet != null) {
+            Sheet.Set set = sheet.createPropertiesSet();
+            set.put(nameProp);
+            sheet.put(set);
+        }
+        return nameProp;
+    }
+    
+    /**
+     * 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.ENUM_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/IdlEnumeration.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/IdlEnumeration.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/IdlEnumeration.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/IdlEnumeration.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: IdlEnumeration.java,v $
+ *
+ *  $Revision: 1.7 $
+ *
+ *  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 IdlEnumeration extends PropertyContainer implements OpenOfficeOrgPropertyContainer, NbNodeObject {
+    
+    private OrderedContainer<IdlEnum> enums;
+    
+    private boolean languageSupport;
+
+    public IdlEnumeration(String nameValue, String pkgValue) {
+        super(new String[] {
+            PROPERTY_CONTAINER_NAME,
+            PROPERTY_CONTAINER_PACKAGE,
+        });
+        enums = new OrderedContainer<IdlEnum>();
+        initializeProperties(nameValue, pkgValue);
+    }
+    
+    private void initializeProperties(String nameValue, String pkgValue) {
+        properties[PROPERTY_Name] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_NAME, 
+                nameValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Name_Tooltip"),
+                this, null);
+        properties[PROPERTY_Package] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PACKAGE, 
+                pkgValue, 
+                NbBundle.getMessage(AddinWizardIterator.class, "TF_Function_Name_Tooltip"),
+                this, null);
+    }
+    
+    public IdlEnum getEnum(String name) {
+        Enumeration keys = enums.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            IdlEnum p = enums.get(keys.nextElement());
+            try {
+                found = name.equals(p.getProperty(PROPERTY_Name).getValueForLanguage(-1));
+            } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+                LogWriter.getLogWriter().printStackTrace(ex);
+            }
+            if (found) return p;
+        }
+        return null;
+    }
+    
+    public IdlEnum addEnum() {
+        return addEnum(null);
+    }
+    
+    public IdlEnum addEnum(NbNodeObject topObject) {
+        int position = 0;  // use 0 if topObject is function
+        if (topObject == null) {  // if null append
+            position = enums.size();
+        }
+        else if (topObject instanceof IdlEnum) {
+            position = enums.getPositionFromObject((IdlEnum)topObject) + 1;
+        }
+        String name = "enum".concat(enums.getNextNumber("enum")); // NOI18N
+        IdlEnum enm = new IdlEnum(name, this);
+        addSetObject(name, enm, position);
+        return enm;
+    }
+    
+    public void removeEnum(String name) {
+        Enumeration<String> keys = enums.keys();
+        boolean found = false;
+        while (!found && keys.hasMoreElements()) {
+            String key = keys.nextElement();
+            IdlEnum p = enums.get(key);
+            try {
+                found = name.equals(p.getProperty(PROPERTY_Name).getValueForLanguage(-1));
+            } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+            }
+            if (found) {
+                enums.remove(key);
+            }
+        }
+    }
+    
+    public void removeEnum(IdlEnum enm) {
+        String[] names = getAllSetObjectNames();
+        for (int i=0; i<names.length; i++) {
+            if (getSetObject(names[i]).equals(enm)) {
+                enums.remove(names[i]);
+            }
+        }
+    }
+    
+    public String[] getAllSetObjectNames() {
+        return enums.getKeysInOrder();
+    }
+    
+    public Object getSetObject(String internalName) {
+        return enums.get(internalName);
+    }
+    
+    public void addSetObject(String internalName, Object setObject) {
+        if (setObject instanceof IdlEnum)
+            enums.put(internalName, (IdlEnum)setObject);
+    }
+    
+    public void addSetObject(String internalName, Object setObject, int position) {
+        if (setObject instanceof IdlEnum)
+            enums.insertElementAt(internalName, (IdlEnum)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 enums
+        String[] keys = enums.getKeysInOrder();
+        for(int i=0; i<keys.length; i++) {
+            nodeObjects.add(enums.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;
+//        return 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.ENUMERATION_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/Interface.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Interface.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Interface.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/Interface.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: Interface.java,v $
+ *
+ *  $Revision: 1.9 $
+ *
+ *  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.Arrays;
+import java.util.Vector;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.properties.SimpleOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgLanguageIDException;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+/**
+ *
+ * @author sg128468
+ */
+public class Interface extends PropertyContainer implements OpenOfficeOrgMultiLanguageSet, NbNodeObject {
+    
+    int interfaceType;
+    private OrderedContainer<Function> functions;
+    private OrderedContainer<Interface> ifcAggregation;
+
+    /** Creates a new instance of Interface */
+    public Interface(String name, String pkg) {
+        super( 
+            new String[]{
+                PROPERTY_CONTAINER_NAME, 
+                PROPERTY_CONTAINER_PACKAGE,
+                PROPERTY_CONTAINER_PARENT,
+        });
+        initializeProperties(name, pkg);
+        functions = new OrderedContainer<Function>();
+        ifcAggregation = new OrderedContainer<Interface>();
+        interfaceType = NbNodeObject.INTERFACE_TYPE;
+    }
+
+    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);
+        properties[PROPERTY_Package] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PACKAGE, 
+                pkg, 
+                "", //NbBundle.getMessage(AddinWizardIterator.class, "TF_Interface_Name_Tooltip"),
+                this, null);
+        properties[PROPERTY_Parent] = new SimpleOpenOfficeOrgProperty(
+                PROPERTY_CONTAINER_PARENT, 
+                "com.sun.star.uno.XInterface", 
+                "", //NbBundle.getMessage(AddinWizardIterator.class, "TF_Interface_Name_Tooltip"),
+                this, null); // NOI18N
+    }
+    
+    public void addAggregatedInterface(Interface ifc) {
+        String internalName = "interface".concat(ifcAggregation.getNextNumber("interface")); // NOI18N
+        ifcAggregation.put(internalName, ifc);
+    }
+
+    public Interface[] getAllAggregatedInterfaces() {
+        return (Interface[])ifcAggregation.values().toArray(new Interface[ifcAggregation.size()]);
+    }
+    
+    public Interface removeAggregatedInterface(String name) {
+        String[] keys = ifcAggregation.getKeysInOrder();
+        for (int i=0; i<keys.length; i++) {
+            Interface ifc = (Interface)ifcAggregation.get(keys[i]);
+            try {
+                String propName = ifc.getSimpleProperty(Interface.PROPERTY_CONTAINER_NAME);
+                if (propName.equals(name)) {
+                    ifcAggregation.remove(keys[i]);
+                    return ifc;
+                }
+            }
+            catch (UnknownOpenOfficeOrgPropertyException e) {
+                // ignore, go on
+            }
+        }
+        return null;
+    }
+    
+    public Function addFunction() {
+        String internalName = "function".concat(functions.getNextNumber("function")); // NOI18N
+        NbNodeObject[] subFunctions = this.getAllSubObjects();
+        Function function = new Function(internalName, "int", this, null); // NOI18N
+        function.addParameter();
+        addSetObject(internalName, function);
+        return function;
+    }
+    
+    public void removeFunction(Function function) {
+        String[] names = getAllSetObjectNames();
+        for (int i=0; i<names.length; i++) {
+            if (getSetObject(names[i]).equals(function)) {
+                functions.remove(names[i]);
+            }
+        }
+    }
+    
+    public void setType(int type) {
+        interfaceType = type;
+    }
+
+    public int getType() {
+        if (ifcAggregation.size() > 0) {
+            return MULTI_INHERITANCE_INTERFACE_TYPE;
+        }
+        return interfaceType;
+    }
+    
+    public String[] getAllSetObjectNames() {
+        return functions.getKeysInOrder();
+    }
+
+    public Object getSetObject(String internalName) {
+        return functions.get(internalName);
+    }
+
+    public void addSetObject(String internalName, Object setObject) {
+        functions.put(internalName, (Function)setObject);
+    }
+
+    public void addLanguage(int languageID, String defaultText) {
+        String[] names = getAllSetObjectNames();
+        for (int i=0; i<names.length; i++) {
+            ((Function)getSetObject(names[i])).addLanguage(languageID, defaultText);
+        }
+    }
+
+    public void removeLanguage(int languageID) {
+        String[] names = getAllSetObjectNames();
+        for (int i=0; i<names.length; i++) {
+            ((Function)getSetObject(names[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_Parent]);
+        
+        // then parameters
+        String[] keys = functions.getKeysInOrder();
+        for(int i=0; i<keys.length; i++) {
+            nodeObjects.add(functions.get(keys[i]));
+        }
+        return 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_Parent]).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/MultiLanguage.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/MultiLanguage.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/MultiLanguage.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/MultiLanguage.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: MultiLanguage.java,v $
+ *
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/02/28 15:56:24 $
+ *
+ *  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;
+
+/**
+ *
+ */
+public interface MultiLanguage {
+    
+    public void addLanguage(int languageID, String text);
+
+    public void removeLanguage(int languageID);
+
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/NbNodeObject.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/NbNodeObject.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/NbNodeObject.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/NbNodeObject.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: NbNodeObject.java,v $
+ *
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/09/06 17:14: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 javax.swing.Action;
+import org.openide.nodes.Node;
+import org.openide.nodes.Sheet;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+
+/**
+ *
+ * @author sg128468
+ */
+public interface NbNodeObject {
+
+    public static final int SERVICE_TYPE = 0;
+    public static final int INTERFACE_TYPE = 1;
+    public static final int ADDIN_TYPE = 2;
+    public static final int PROPERTY_TYPE = 3;
+    public static final int LOCALIZED_PROPERTY_TYPE = 4;
+    public static final int FUNCTION_TYPE = 5;
+    public static final int PARAMETER_TYPE = 6;
+    public static final int MULTI_INHERITANCE_INTERFACE_TYPE = 7;
+    public static final int OFFICE_SERVICE_TYPE = 8;
+    public static final int OFFICE_INTERFACE_TYPE = 9;
+    public static final int ENUM_TYPE = 10;
+    public static final int ENUMERATION_TYPE = 11;
+    public static final int STRUCT_TYPE = 12;
+    public static final int EXCEPTION_TYPE = 13;
+    public static final int POLY_STRUCT_TYPE = 14;
+    public static final int TEMPLATE_TYPE = 15;
+    public static final int ADDON_TYPE = 16;
+    public static final int COMPONENT_TYPE = 17;
+    public static final int CONSTANTS_TYPE = 18;
+
+    public static final int UI_MENU_TYPE = 1024;
+    public static final int UI_SEPARATOR_TYPE = 1025;
+    
+    /**
+     * return the parent; maybe null for the root object
+     * @return the parent node object
+     */
+    public NbNodeObject getParent();
+    
+    public String getDisplayName();
+    
+    public NbNodeObject[] getAllSubObjects();
+    
+    public Node.Property[] createProperties(Sheet sheet, PropertyChangeListener listener);
+    
+    public boolean hasActions(int type);
+    
+    public Action[] getActions(boolean context);
+    
+    // this name is confusing rename to make the meaning clear: 
+    // getActions() will deliver a wrapper around the actions set here
+    public void setActions(BaseAction actions);
+
+//    public void fireDataChangeEvent();
+    
+    public int getType();
+
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgMultiLanguageSet.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgMultiLanguageSet.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgMultiLanguageSet.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgMultiLanguageSet.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: OpenOfficeOrgMultiLanguageSet.java,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: sg $ $Date: 2006/12/07 16:36:33 $
+ *
+ *  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;
+
+/**
+ *
+ * @author sg128468
+ */
+public interface OpenOfficeOrgMultiLanguageSet extends OpenOfficeOrgSimpleSet, MultiLanguage {
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgPropertyContainer.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgPropertyContainer.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgPropertyContainer.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgPropertyContainer.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: OpenOfficeOrgPropertyContainer.java,v $
+ *
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: sg $ $Date: 2007/04/24 10:11:07 $
+ *
+ *  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 interface OpenOfficeOrgPropertyContainer {
+
+    String[] getAllPropertyNames();
+
+    OpenOfficeOrgProperty getProperty(String propertyName) throws UnknownOpenOfficeOrgPropertyException;
+
+    void setProperty(String propertyName, OpenOfficeOrgProperty value) throws UnknownOpenOfficeOrgPropertyException;
+
+    String getSimpleProperty(String propertyName) throws UnknownOpenOfficeOrgPropertyException;
+
+    void setSimpleProperty(String propertyName, String value) throws UnknownOpenOfficeOrgPropertyException;
+
+    String getLocalizedProperty(String propertyName, int languageID) throws UnknownOpenOfficeOrgPropertyException, UnknownOpenOfficeOrgLanguageIDException;
+
+    boolean isPropertyLocalized(String propertyName) throws UnknownOpenOfficeOrgPropertyException;
+
+    void setLocalizedProperty(String propertyName, int languageID, String value) throws UnknownOpenOfficeOrgLanguageIDException;
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgSimpleSet.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgSimpleSet.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgSimpleSet.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OpenOfficeOrgSimpleSet.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: OpenOfficeOrgSimpleSet.java,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: sg $ $Date: 2006/12/07 16:36:33 $
+ *
+ *  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;
+
+/**
+ *
+ */
+public interface OpenOfficeOrgSimpleSet {
+    
+    public String[] getAllSetObjectNames();
+    
+    public Object getSetObject(String name);
+
+    public void addSetObject(String name, Object setObject);
+    
+}

Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OrderedContainer.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OrderedContainer.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OrderedContainer.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/util/datamodel/OrderedContainer.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: OrderedContainer.java,v $
+ *
+ *  $Revision: 1.5 $
+ *
+ *  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.util.Collection;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Vector;
+import org.openoffice.extensions.util.LogWriter;
+
+public class OrderedContainer<T> {
+    private Hashtable<String,T> objects;
+    private Vector<String> order;
+    public OrderedContainer() {
+        objects = new Hashtable<String,T>();
+        order = new Vector<String>();
+    }
+
+    public void put(String key, T o) {
+        order.remove(key);
+        order.add(key);
+        objects.put(key, o);
+    }
+
+    public void insertElementAt(String key, T o, int position) {
+        order.remove(key);
+        order.insertElementAt(key, position);
+        objects.put(key, o);
+    }
+
+    public T get(Object name) {
+        return objects.get(name);
+    }
+
+    public T get(int position) {
+        return objects.get(order.get(position));
+    }
+
+    public String getKeyFromObject(T o) {
+        int pos = getPositionFromObject(o);
+        return order.get(pos);
+    }
+    
+    public Enumeration<String> keys() {
+        return order.elements();
+    }
+
+    public Collection<T> values() {
+        return valuesInOrder();
+    }
+    
+    public T remove(String key) {
+        T o = objects.remove(key);
+        order.remove(key);
+        return o;
+    }
+
+    public int getPositionFromKey(String key) {
+        return order.indexOf(key);
+    }
+
+    public int size() {
+        return order.size();
+    }
+    
+    public int getPositionFromObject(T o) {
+        Enumeration<String> keys = objects.keys();
+        while (keys.hasMoreElements()) {
+            String key = keys.nextElement();
+            if (objects.get(key).equals(o)) {
+                return getPositionFromKey(key);
+            }
+        }
+        return -1;  // analog to Vector.indexof() which also returns -1
+    }
+
+    public String[] getKeysInOrder() {
+        String[] keys = new String[order.size()];
+        return order.toArray(keys);
+    }
+    
+    public Collection<T> valuesInOrder() {
+        Vector<T> v = new Vector<T>();
+        for (Enumeration<String> e = order.elements(); e.hasMoreElements();) {
+            v.add(objects.get(e.nextElement()));
+        }
+        return v;
+    } 
+    
+    public String getNextNumber(String prefix) {
+        int number = 0;
+        Vector<String> names = new Vector<String>();
+        int namePrefixLength = prefix.length();
+        for (Iterator<String> it = order.iterator(); it.hasNext();) {
+            try {
+                int n = Integer.parseInt(it.next().substring(namePrefixLength));
+                if (number <= n) {
+                    number = n + 1;
+                }
+            }
+            catch (NumberFormatException ex) {
+                // uncritical exception
+                LogWriter.getLogWriter().log(LogWriter.LEVEL_INFO, ex.getMessage());
+            }
+        }
+        return String.valueOf(number);
+    }
+}



Mime
View raw message