/**
 * Copyright 2015 S-CASE Consortium
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.scasefp7.eclipse.core.ui.preferences.internal;

/**
 * @author emaorli
 *
 */
public class DomainEntry {
	private String name;
	private DomainEntry[] children;
	private int	id;
	
	/**
	 * Create the object using supplied values.
	 * 
	 * @param id
	 * @param name
	 * @param children
	 */
	public DomainEntry (int id, String name, DomainEntry[] children) {
		setId(id);
		setName(name);
		setChildren(children);
	}

	/**
	 * Create the object using supplied values.
	 * 
	 * @param id
	 * @param name
	 */
	public DomainEntry (int id, String name) {
		setId(id);
		setName(name);
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the children
	 */
	public DomainEntry[] getChildren() {
		return children;
	}
	/**
	 * @param children the children to set
	 */
	public void setChildren(DomainEntry[] children) {
		this.children = children;
	}
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	
	
	
}

@@ -749,24 +749,31 @@
  String name
+ = null
 ;%0D%0A%09private 
@@ -790,24 +790,68 @@
 y%5B%5D children
+ = null;%0D%0A%09private DomainEntry parent = null
 ;%0D%0A%09private 
@@ -1707,32 +1707,120 @@
 en = children;%0D%0A
+%09%09%0D%0A%09%09for(int ix=0; ix%3Cchildren.length; ix++) %7B%0D%0A%09%09%09children%5Bix%5D.setParent(this);%0D%0A%09%09%7D%0D%0A
 %09%7D%0D%0A%09/**%0D%0A%09 * @r
@@ -1971,16 +1971,403 @@
 id;%0D%0A%09%7D%0D
+%0A%0D%0A%09/**%0D%0A%09 * @return the parent%0D%0A%09 */%0D%0A%09public DomainEntry getParent() %7B%0D%0A%09%09return parent;%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * @param parent the parent to set%0D%0A%09 */%0D%0A%09public void setParent(DomainEntry parent) %7B%0D%0A%09%09this.parent = parent;%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * @return true if the entry has children%0D%0A%09 */%0D%0A%09public boolean hasChildren() %7B%0D%0A%09%09return this.getChildren() != null && this.getChildren().length %3E 0;%0D%0A%09%7D%0D
 %0A%09%0D%0A%09%0D%0A%09

Add parent to domain entry