001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.kernel.interfaces;
032:
033: import java.util.*;
034:
035: import de.ug2t.kernel.*;
036:
037: public interface IKeTreeNode extends IKeTreeElement {
038:
039: /**
040: * <p>
041: * Adds a child-node into this node. The child-node has to have a name. Not
042: * unique name are permitted. The pcmf_getSubNode (xName,... method returns
043: * the last node which has been inserted with a not unique name.
044: * </p>
045: * <p>
046: *
047: * @return if xName is not unique the current node with this name is returned.
048: * Else null is returned.
049: * </p>
050: * <p>
051: * @param xName
052: * name of the node to insert
053: * @param xNode
054: * node to insert
055: * </p>
056: */
057: public abstract KeTreeNode pcmf_addNode(String xName,
058: KeTreeNode xNode);
059:
060: /**
061: * <p>
062: * Adds a child-node into this node. The child-node has to have a name. Not
063: * unique name are permitted. The pcmf_getSubNode (xName,... method returns
064: * the last node which has been inserted with a not unique name.
065: * </p>
066: * <p>
067: *
068: * @return if xName is not unique the current node with this name is returned.
069: * Else null is returned.
070: * </p>
071: * <p>
072: * @param xName
073: * name of the node to insert
074: * @param xNode
075: * node to insert
076: * </p>
077: */
078: public abstract KeTreeNode pcmf_addNodeLocal(String xName,
079: KeTreeNode xNode);
080:
081: /**
082: * <p>
083: * Gets the index of a child-node or child-element with the list of
084: * child-nodes. The internal list of child-nodes and child-elements represents
085: * the order of inserting.
086: * </p>
087: * <p>
088: *
089: * @return index of the given node or -1 if the node is not a child-node
090: * </p>
091: * <p>
092: * @param xEl
093: * node or element to search
094: * </p>
095: */
096: public abstract int pcmf_indexOf(KeTreeElement xEl);
097:
098: /**
099: * <p>
100: * Gets a child-node or chld-element at a given index. The internal list of
101: * child-nodes and child-elements represents the order of inserting.
102: * </p>
103: * <p>
104: *
105: * @return child-node or elelemt. If the index is not valid an exception is
106: * rised
107: * </p>
108: * <p>
109: * @param xIdx
110: * child-node or child-element index
111: * </p>
112: */
113: public abstract KeTreeElement pcmf_getElementAt(int xIdx);
114:
115: /**
116: * <p>
117: * Gets a child-node or chld-element at a given index. The internal list of
118: * child-nodes and child-elements represents the order of inserting.
119: *
120: * The only difference between this method and pcmf_getElementAt is an internal cast operation
121: * </p>
122: * <p>
123: *
124: * @return child-node or elelemt. If the index is not valid an exception is
125: * rised
126: * </p>
127: * <p>
128: * @param xIdx
129: * child-node or child-element index
130: * </p>
131: */
132: public abstract KeTreeNode pcmf_getNodeAt(int xIdx);
133:
134: /**
135: * <p>
136: * Adds a child-node into this node at a given index. The child-node has to
137: * have a name. Not unique name are permitted. The pcmf_getSubNode (xName,...
138: * method returns the last node which has been inserted with a not unique
139: * name.
140: * </p>
141: * <p>
142: *
143: * @return if xName is not unique the current node with this name is returned.
144: * Else null is returned.
145: * </p>
146: * <p>
147: * @param xName
148: * name of the node to insert
149: * @param xNode
150: * node to insert
151: * @param xIdx
152: * index where the node is inserted
153: * </p>
154: */
155: public abstract KeTreeNode pcmf_addNode(String xName,
156: KeTreeNode xNode, int xIdx);
157:
158: /**
159: * <p>
160: * Adds a child-node into this node behind a given child-node or
161: * child-element. The child-node has to have a name. Not unique name are
162: * permitted. The pcmf_getSubNode (xName,... method returns the last node
163: * which has been inserted with a not unique name.
164: * </p>
165: * <p>
166: *
167: * @return if xName is not unique the current node with this name is returned.
168: * Else null is returned.
169: * </p>
170: * <p>
171: * @param xName
172: * name of the node to insert
173: * @param xNode
174: * node to insert
175: * @param xBehind
176: * node ore element behind which the new node is inserted
177: * </p>
178: */
179: public abstract KeTreeNode pcmf_addNode(String xName,
180: KeTreeNode xNode, KeTreeElement xBehind);
181:
182: /**
183: * <p>
184: * Removes a node with a given name
185: * </p>
186: * <p>
187: *
188: * @return the removed node
189: * </p>
190: * <p>
191: * @param xName
192: * name of the node to remove
193: * </p>
194: */
195: public abstract KeTreeNode pcmf_removeNode(String xName);
196:
197: /**
198: * <p>
199: * Removes a given node
200: * </p>
201: * <p>
202: *
203: * @return the remove node
204: * </p>
205: * <p>
206: * @param xNode
207: * node-object to remove
208: * </p>
209: */
210: public abstract KeTreeNode pcmf_removeNode(KeTreeNode xNode);
211:
212: /**
213: * <p>
214: * Removes a node with a given name
215: * </p>
216: * <p>
217: *
218: * @return the removed node
219: * </p>
220: * <p>
221: * @param xName
222: * name of the node to remove
223: * </p>
224: */
225: public abstract KeTreeNode pcmf_removeNodeLocal(String xName);
226:
227: /**
228: * <p>
229: * Removes a given node
230: * </p>
231: * <p>
232: *
233: * @return the remove node
234: * </p>
235: * <p>
236: * @param xNode
237: * node-object to remove
238: * </p>
239: */
240: public abstract KeTreeNode pcmf_removeNodeLocal(KeTreeNode xNode);
241:
242: /**
243: * <p>
244: * Adds a child-elelemt into this node. The child-elelemt has to have a name.
245: * Not unique name are permitted. The pcmf_getSubElement (xName,... method
246: * returns the last node which has been inserted with a not unique name.
247: *
248: * </p>
249: * <p>
250: *
251: * @return if xName is not unique the current elelemt with this name is
252: * returned. Else null is returned.
253: * </p>
254: * <p>
255: * @param xName
256: * name of the element to insert
257: * @param xNode
258: * node to insert
259: * </p>
260: */
261: public abstract KeTreeElement pcmf_addElement(String xName,
262: KeTreeElement xNode);
263:
264: /**
265: * <p>
266: * Adds a child-elelemt into this node. The child-elelemt has to have a name.
267: * Not unique name are permitted. The pcmf_getSubElement (xName,... method
268: * returns the last node which has been inserted with a not unique name.
269: * </p>
270: * <p>
271: *
272: * @return if xName is not unique the current elelemt with this name is
273: * returned. Else null is returned.
274: * </p>
275: * <p>
276: * @param xName
277: * name of the element to insert
278: * @param xNode
279: * node to insert
280: * </p>
281: */
282: public abstract KeTreeElement pcmf_addElementLocal(String xName,
283: KeTreeElement xNode);
284:
285: /**
286: * <p>
287: * Adds a child-element into this node behind a given child-node or
288: * child-element. The child-element has to have a name. Not unique name are
289: * permitted. The pcmf_getSubElement (xName,... method returns the last node
290: * which has been inserted with a not unique name.
291: * </p>
292: * <p>
293: *
294: * @return if xName is not unique the current node with this name is returned.
295: * Else null is returned.
296: * </p>
297: * <p>
298: * @param xName
299: * name of the element to insert
300: * @param xNode
301: * element to insert
302: * @param xBehind
303: * node ore element behind which the new node is inserted
304: * </p>
305: */
306: public abstract KeTreeElement pcmf_addElement(String xName,
307: KeTreeElement xNode, KeTreeElement xBehind);
308:
309: /**
310: * <p>
311: * Adds a child-element into this node at a given index. The child-element has
312: * to have a name. Not unique name are permitted. The pcmf_getSubElement
313: * (xName,... method returns the last node which has been inserted with a not
314: * unique name.
315: * </p>
316: * <p>
317: *
318: * @return if xName is not unique the current node with this name is returned.
319: * Else null is returned.
320: * </p>
321: * <p>
322: * @param xName
323: * name of the element to insert
324: * @param xNode
325: * element to insert
326: * @param xIdx
327: * index where the node is inserted
328: * </p>
329: */
330: public abstract KeTreeElement pcmf_addElement(String xName,
331: KeTreeElement xNode, int xIdx);
332:
333: /**
334: * <p>
335: * Removes a element with a given name
336: * </p>
337: * <p>
338: *
339: * @return the removed element
340: * </p>
341: * <p>
342: * @param xName
343: * name of the element to remove
344: * </p>
345: */
346: public abstract KeTreeElement pcmf_removeElement(String xName);
347:
348: /**
349: * <p>
350: * Removes a given element
351: * </p>
352: * <p>
353: *
354: * @return the removed element
355: * </p>
356: * <p>
357: * @param xNode
358: * element to remove
359: * </p>
360: */
361: public abstract KeTreeElement pcmf_removeElement(KeTreeElement xNode);
362:
363: /**
364: * <p>
365: * Gets a sub-node by its name. If the name is not unique the last node of
366: * this name which has been inserted is returned
367: * </p>
368: * <p>
369: *
370: * @return sub-node with the given name of null if no node of this name could
371: * be found
372: * </p>
373: * <p>
374: * @param xName
375: * name of the node
376: * </p>
377: */
378: public abstract KeTreeNode pcmf_getSubNode(String xName);
379:
380: /**
381: * <p>
382: * Gets a sub-element by its name. If the name is not unique the last element
383: * of this name which has been inserted is returned
384: * </p>
385: * <p>
386: *
387: * @return sub-element with the given name of null if no node of this name
388: * could be found
389: * </p>
390: * <p>
391: * @param xName
392: * name of the element
393: * </p>
394: */
395: public abstract KeTreeElement pcmf_getSubElement(String xName);
396:
397: /**
398: * <p>
399: * Gets the number of all children
400: * </p>
401: * <p>
402: *
403: * @return child count
404: * </p>
405: * <p>
406: * </p>
407: */
408: public abstract int pcmf_getChildCount();
409:
410: /**
411: * <p>
412: * Gets the number of children selectable by their hidden-flag
413: * </p>
414: * <p>
415: *
416: * @return child count
417: * </p>
418: * <p>
419: * @param xCountHide
420: * indicates whether hidden childs are counted or not
421: * </p>
422: */
423: public abstract int pcmf_getAllSubCount(boolean xCountHide);
424:
425: /**
426: * <p>
427: * Similar to pcmf_getChildCount
428: * </p>
429: *
430: * @deprecated use pcmf_getChildCount
431: */
432: public abstract int pcmf_getSubCount();
433:
434: /**
435: * <p>
436: * Unhides all children (in deep search manner) and the node itself
437: * </p>
438: */
439: public abstract void pcmf_unHideAll();
440:
441: /**
442: * <p>
443: * Hides all children (in deep search manner) and the node itself
444: * </p>
445: */
446: public abstract void pcmf_hideAll();
447:
448: /**
449: * <p>
450: * Unhides all children (in deep search manner)
451: * </p>
452: */
453: public abstract void pcmf_unHideAllChildren();
454:
455: /**
456: * <p>
457: * Hides all children (in deep search manner)
458: * </p>
459: */
460: public abstract void pcmf_hideAllChildren();
461:
462: /**
463: * <p>
464: * Hides all children (in deep search manner) starting by the specified depth
465: * </p>
466: * <p>
467: * </p>
468: * <p>
469: *
470: * @param xLevel
471: * depth to start
472: * </p>
473: */
474: public abstract void pcmf_hideLevel(int xLevel);
475:
476: /**
477: * <p>
478: * Toggles the hidden-flag of this node
479: * </p>
480: */
481: public abstract void pcmf_toggleHideState();
482:
483: /**
484: * <p>
485: * Returns the hidden-flag of this node
486: * </p>
487: * <p>
488: *
489: * @return idden flag
490: * </p>
491: */
492: public abstract boolean pcmf_isHidden();
493:
494: /**
495: * <p>
496: * Hide this node
497: * </p>
498: */
499: public abstract void pcmf_hide();
500:
501: /**
502: * <p>
503: * Unhide this node
504: * </p>
505: */
506: public abstract void pcmf_unhide();
507:
508: /**
509: * <p>
510: * Gets a sub-node or sub-element by its name. If the name is not unique the
511: * last node or element of this name which has been inserted is returned
512: *
513: * </p>
514: * <p>
515: *
516: * @return sub-node or element with the given name of null if no node of this
517: * name could be found
518: * </p>
519: * <p>
520: * @param xName
521: * name of the node or element
522: * </p>
523: */
524: public abstract KeTreeElement pcmf_getSub(String xName);
525:
526: /**
527: * <p>
528: * Gets a sub-node or sub-element by its path. The path is similar to a path
529: * in a directory tree. Names are separated by / or :
530: * </p>
531: * <p>
532: *
533: * @return sub-node or element with the given path of null if no node or
534: * element could be found
535: * </p>
536: * <p>
537: * @param xPath
538: * path of the node or element
539: * </p>
540: */
541: public abstract KeTreeElement pcmf_getByPath(String xPath);
542:
543: // Setzt auf den Defaultwert zürück
544: /**
545: * <p>
546: * Resets a node and element values (in this node and all children) to the
547: * default value
548: * </p>
549: * <p>
550: *
551: * @return the old value of this node
552: * </p>
553: * <p>
554: * </p>
555: */
556: public abstract Object pcmf_resetRecursive();
557:
558: // Erzeugt einen Vector mit allen Kindern und Kindeskindern und ....
559: /**
560: * <p>
561: * Inserts all nodes of the (sub)tree which is represented by this node into
562: * an array
563: * </p>
564: * <p>
565: * </p>
566: * <p>
567: *
568: * @param l_vect
569: * array whre the nodes and elements are inserted
570: * </p>
571: */
572: public abstract void pcmf_deepSubNodeVector(ArrayList l_vect);
573:
574: // Erzeugt einen Vector mit allen Kindern und Kindeskindern und ....
575: /**
576: * <p>
577: * Creates an iterator over all nodes of the (sub)tree which is represented by
578: * this node
579: * </p>
580: * <p>
581: *
582: * @return iterator
583: * </p>
584: * <p>
585: * </p>
586: */
587: public abstract Iterator pcmf_getDeepSubNodeIt();
588:
589: /**
590: * <p>
591: * Sets the value of the server side part of the node.
592: * </p>
593: * <p>
594: *
595: * </p>
596: * <p>
597: *
598: * @param xValue
599: * new node-value
600: * </p>
601: */
602: public abstract void pcmf_setLocalValue(Object xValue);
603:
604: /**
605: * <p>
606: * Deletes the (sub)tree which is represented by this node and includes this
607: * node
608: * </p>
609: */
610: public abstract void pcmf_releaseSubs();
611:
612: /**
613: * <p>
614: * Deletes the (sub)tree which is represented by this node, but excludes this
615: * node
616: * </p>
617: */
618: public abstract void pcmf_clearAndRelease();
619:
620: /**
621: * <p>
622: * Deletes the (sub)tree which is represented by this node, but excludes this
623: * node and all subtrees of this node are kept alive
624: * </p>
625: */
626: public abstract void pcmf_clear();
627:
628: /**
629: * <p>
630: * Creates an iterator over all child-node and child-element names
631: * </p>
632: * <p>
633: *
634: * @return iterator
635: * </p>
636: * <p>
637: * </p>
638: */
639: public abstract Iterator pcmf_getSubNameIterator();
640:
641: /**
642: * <p>
643: * Creates an iterator over all child-nodes and child-elements
644: * </p>
645: * <p>
646: *
647: * @return iterator
648: * </p>
649: * <p>
650: * </p>
651: */
652: public abstract Iterator pcmf_getSubIterator();
653:
654: /**
655: * <p>
656: * Gets all child-nodes and child elements
657: * </p>
658: * <p>
659: *
660: * @return list with all nodes and elements
661: * </p>
662: * <p>
663: * </p>
664: */
665: public abstract ArrayList pcmf_getAllSubs();
666:
667: /**
668: * <p>
669: * Gets all child-node and child element names
670: * </p>
671: * <p>
672: *
673: * @return list with all node and element names
674: * </p>
675: * <p>
676: * </p>
677: */
678: public abstract ArrayList pcmf_getAllSubNames();
679:
680: /**
681: * <p>
682: * This method resets the property change flag recursively.
683: * </p>
684: *
685: */
686: public abstract void pcmf_resetPropertyChangeFlag();
687:
688: /**
689: * <p>
690: * Sets the ownership of child-nodes and elements. If true a delete of the
691: * parent node deletes all children as well
692: * </p>
693: * <p>
694: *
695: * </p>
696: * <p>
697: *
698: * @param xOwner
699: * </p>
700: */
701: public abstract void pcmf_setSubNodeOwnerShip(boolean xOwner);
702:
703: /**
704: * <p>
705: * Returns the ownership flag
706: * </p>
707: * <p>
708: *
709: * @return ownership
710: * </p>
711: * <p>
712: * </p>
713: */
714: public abstract boolean pcmf_isOwner();
715:
716: /**
717: * <p>
718: * Disables the node and all children
719: * </p>
720: */
721: public abstract void pcmf_disable();
722:
723: /**
724: * <p>
725: * Enables the node and all children
726: * </p>
727: */
728: public abstract void pcmf_enable();
729:
730: /**
731: * <p>
732: * Gets all enabled nodes/elements and includes ths node/element
733: * </p>
734: * <p>
735: *
736: * @param xRes
737: * ArrayList with result
738: * </p>
739: */
740: public abstract void pcmf_getAllEnabled(ArrayList xRes);
741:
742: /**
743: * <p>
744: * Gets all disabled nodes/elements and includes ths node/element
745: * </p>
746: * <p>
747: *
748: * @param xRes
749: * ArrayList with result
750: * </p>
751: */
752: public abstract void pcmf_getAllDisabled(ArrayList xRes);
753:
754: // @@
755:
756: /**
757: * <p>
758: * Tests if a node/element is inserted in the tree.
759: * </p>
760: * <p>
761: *
762: * @return true if the node/element was found, otherwise false
763: * </p>
764: * <p>
765: * @param xObj
766: * node/element to test
767: * </p>
768: */
769: public abstract boolean pcmf_contains(KeTreeElement xObj);
770:
771: /**
772: * <p>
773: * Returns whether a parent is hidden or not
774: * </p>
775: * <p>
776: *
777: * @return true indicates hidden, otherwise false
778: * </p>
779: */
780: public abstract boolean pcmf_isParentHidden();
781: }
|