From 15fc383c5714be4974b8cec2b970ff4c5dc41de3 Mon Sep 17 00:00:00 2001 From: Pascal Junck Date: Wed, 27 Oct 2004 12:28:13 +0000 Subject: [PATCH] INTEGRATION: CWS dbwizard1 (1.2.34); FILE MERGED 2004/08/13 15:00:38 bc 1.2.34.1: #111602# several changes for Formwizard and TableWizard --- .../star/wizards/common/Configuration.java | 84 ++++++++++++++++++- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/wizards/com/sun/star/wizards/common/Configuration.java b/wizards/com/sun/star/wizards/common/Configuration.java index 35903d7b43e2..10ba43e3b0b4 100644 --- a/wizards/com/sun/star/wizards/common/Configuration.java +++ b/wizards/com/sun/star/wizards/common/Configuration.java @@ -2,9 +2,9 @@ * * $RCSfile: Configuration.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: kz $ $Date: 2004-05-19 12:35:52 $ + * last change: $Author: pjunck $ $Date: 2004-10-27 13:28:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -278,4 +278,84 @@ public abstract class Configuration { xUpdateControl.commitChanges(); } + + public static String[] getNodeDisplayNames(XNameAccess _xNameAccessNode){ + String[] snames = null; + try { + return getNodeChildNames(_xNameAccessNode, "Name"); + } catch (Exception e) { + e.printStackTrace(System.out); + return snames; + }} + + + public static String[] getNodeChildNames(XNameAccess xNameAccessNode, String _schildname){ + String[] snames = null; + try { + snames = xNameAccessNode.getElementNames(); + String[] sdisplaynames = new String[snames.length]; + for (int i = 0; i < snames.length; i++){ + sdisplaynames[i] = (String) Helper.getUnoPropertyValue(xNameAccessNode.getByName(snames[i]), _schildname); + } + return sdisplaynames; + } catch (Exception e) { + e.printStackTrace(System.out); + return snames; + }} + + + public static XNameAccess getChildNodebyIndex(Object _oNode, int _index){ + XNameAccess xNameAccessNode = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, _oNode); + return getChildNodebyIndex(xNameAccessNode, _index); + } + + + public static XNameAccess getChildNodebyIndex(XNameAccess _xNameAccess, int _index){ + try { + String[] snames = _xNameAccess.getElementNames(); + Object oNode = _xNameAccess.getByName(snames[_index]); + XNameAccess xNameAccessNode = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oNode); + return xNameAccessNode; + } catch (Exception e) { + e.printStackTrace(System.out); + return null; + }} + + + public static XNameAccess getChildNodebyName(XNameAccess _xNameAccessNode, String _SubNodeName){ + try { + if (_xNameAccessNode.hasByName(_SubNodeName)) + return (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(_SubNodeName)); + } catch (Exception e) { + e.printStackTrace(System.out); + } + return null; + } + + + public static XNameAccess getChildNodebyDisplayName(XNameAccess _xNameAccessNode, String _displayname){ + String[] snames = null; + return getChildNodebyDisplayName(_xNameAccessNode, _displayname, "Name"); + } + + + public static XNameAccess getChildNodebyDisplayName(XNameAccess _xNameAccessNode, String _displayname, String _nodename){ + String[] snames = null; + try { + snames = _xNameAccessNode.getElementNames(); + String[] sdisplaynames = new String[snames.length]; + for (int i = 0; i < snames.length; i++){ + String curdisplayname = (String) Helper.getUnoPropertyValue(_xNameAccessNode.getByName(snames[i]), _nodename); + if (curdisplayname.equals(_displayname)) + return (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(snames[i])); + } + } catch (Exception e) { + e.printStackTrace(System.out); + } + return null; + } + + + + }