01: /*
02: * Copyright 2006 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: */
13: package org.pentaho.designstudio.controls;
14:
15: import org.dom4j.Node;
16:
17: /**
18: * Instances of this class are sent as a result of controls being moved or resized.
19: * @author Angelo Rodriguez
20: */
21: public class XmlModificationEvent {
22: Object eventSource;
23: Node[] nodes;
24: int typeOfMod = -1;
25:
26: /**
27: * Indicates that the node(s) have been removed from the document.
28: */
29: public static final int NODE_REMOVED = 0;
30:
31: /**
32: * Indicates that the node(s) have been added to the document.
33: */
34: public static final int NODE_ADDED = 1;
35:
36: /**
37: * Indicates that the node(s) have been renamed.
38: */
39: public static final int NODE_NAME_CHANGED = 2;
40:
41: /**
42: * Indicates that the node(s) value has been changed.
43: */
44: public static final int NODE_VALUE_CHANGED = 3;
45:
46: public static final int NODE_MOVED = 4;
47:
48: /**
49: * @param source the source of this event
50: * @param node the DOM nodes that have been modified
51: * @param typeOfModification the type of modification that has occurred
52: */
53: public XmlModificationEvent(Object source, Node node,
54: int typeOfModification) {
55: eventSource = source;
56: nodes = new Node[] { node };
57: typeOfMod = typeOfModification;
58: }
59:
60: public XmlModificationEvent(Object source, Node[] nodes,
61: int typeOfModification) {
62: eventSource = source;
63: this .nodes = nodes;
64: typeOfMod = typeOfModification;
65: }
66:
67: public int getTypeOfModification() {
68: return typeOfMod;
69: }
70:
71: public Object getSource() {
72: return eventSource;
73: }
74:
75: public Node[] getNodes() {
76: return nodes;
77: }
78: }
|