129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2006 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.text.edits.MalformedTreeException;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16
|
|
17 /**
|
|
18 * Thrown to indicate that an edit got added to a parent edit
|
|
19 * but the child edit somehow conflicts with the parent or
|
|
20 * one of it siblings.
|
|
21 * <p>
|
|
22 * This class is not intended to be serialized.
|
|
23 * </p>
|
|
24 *
|
|
25 * @see TextEdit#addChild(TextEdit)
|
|
26 * @see TextEdit#addChildren(TextEdit[])
|
|
27 *
|
|
28 * @since 3.0
|
|
29 */
|
|
30 public class MalformedTreeException : RuntimeException {
|
|
31
|
|
32 // Not intended to be serialized
|
|
33 private static final long serialVersionUID= 1L;
|
|
34
|
|
35 private TextEdit fParent;
|
|
36 private TextEdit fChild;
|
|
37
|
|
38 /**
|
|
39 * Constructs a new malformed tree exception.
|
|
40 *
|
|
41 * @param parent the parent edit
|
|
42 * @param child the child edit
|
|
43 * @param message the detail message
|
|
44 */
|
|
45 public MalformedTreeException(TextEdit parent, TextEdit child, String message) {
|
|
46 super(message);
|
|
47 fParent= parent;
|
|
48 fChild= child;
|
|
49 }
|
|
50
|
|
51 /**
|
|
52 * Returns the parent edit that caused the exception.
|
|
53 *
|
|
54 * @return the parent edit
|
|
55 */
|
|
56 public TextEdit getParent() {
|
|
57 return fParent;
|
|
58 }
|
|
59
|
|
60 /**
|
|
61 * Returns the child edit that caused the exception.
|
|
62 *
|
|
63 * @return the child edit
|
|
64 */
|
|
65 public TextEdit getChild() {
|
|
66 return fChild;
|
|
67 }
|
|
68
|
|
69 void setParent(TextEdit parent) {
|
|
70 fParent= parent;
|
|
71 }
|
|
72 }
|