View Javadoc

1   /*
2    * Copyright 1999-2006 Faculty of Mathematics, Physics and Informatics, Comenius
3    * University, Bratislava. This file is protected by the Mozilla Public License
4    * version 1.1 (the License); you may not use this file except in compliance
5    * with the License. You may obtain a copy of the License at
6    * http://euromath2.sourceforge.net/license.html Unless required by applicable
7    * law or agreed to in writing, software distributed under the License is
8    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9    * KIND, either express or implied. See the License for the specific language
10   * governing permissions and limitations under the License.
11   */
12  
13  package sk.uniba.euromath.editor.selections;
14  
15  import sk.baka.ikslibs.interval.DOMIntervalSet;
16  
17  /***
18   * Interface common to all classes that provide a selection over xml document.
19   * Selection is coded in DOMIntervalSet.
20   */
21  public interface IDOMSelectionProvider {
22  	/***
23  	 * Adds a listener for selection changes in this selection provider. Has no
24  	 * effect if an identical listener is already registered.
25  	 * 
26  	 * @param listener
27  	 *            a DOM selection changed listener
28  	 */
29  	public void addSelectionChangedListener(
30  			IDOMSelectionChangedListener listener);
31  
32  	/***
33  	 * Returns copy of the current selection of provider.
34  	 * 
35  	 * @return the current selection by copy
36  	 */
37  	public DOMIntervalSet getDOMSelection();
38  
39  	/***
40  	 * Removes the given selection change listener from this selection provider.
41  	 * Has no affect if listener is not registered.
42  	 * 
43  	 * @param listener
44  	 *            a DOM selection changed listener
45  	 */
46  	public void removeSelectionChangedListener(
47  			IDOMSelectionChangedListener listener);
48  
49  	/***
50  	 * Sets new selection for this selection provider.
51  	 * 
52  	 * @param selection
53  	 *            the new XML selection
54  	 */
55  	public void setSelection(DOMIntervalSet selection);
56  }