Mercurial > projects > dwt2
comparison org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/IConcurrentModel.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2004, 2008 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 org.eclipse.jface.viewers.deferred.IConcurrentModel; | |
14 | |
15 import java.lang.all; | |
16 | |
17 import org.eclipse.jface.viewers.deferred.IConcurrentModelListener; | |
18 | |
19 /** | |
20 * Interface for a set of unordered elements that can fire change notifications. | |
21 * IConcurrentModel returns its contents asynchronous. Rather than implementing | |
22 * "get" methods, listeners can request an update and the model fires back | |
23 * information at its earliest convenience. | |
24 * | |
25 * <p> | |
26 * The model is allowed to send back notifications to its listeners in any thread, | |
27 * and the listeners must not assume that the notifications will arrive in the UI | |
28 * thread. | |
29 * </p> | |
30 * | |
31 * <p> | |
32 * Not intended to be implemented by clients. Clients should subclass | |
33 * <code>AbstractConcurrentModel</code> instead. | |
34 * </p> | |
35 * | |
36 * @since 3.1 | |
37 * @noimplement This interface is not intended to be implemented by clients. | |
38 */ | |
39 public interface IConcurrentModel { | |
40 | |
41 /** | |
42 * Requests that the receiver to call the given listener's setContents(...) | |
43 * method at its earliest convenience. The receiver is allowed to compute the | |
44 * elements asynchronously. That is, it can compute the result in a background | |
45 * thread and call setContents(...) once the result is ready. If the result is | |
46 * too large to return in one batch, it can call setContents with an empty array | |
47 * followed by a sequence of adds. | |
48 * <p> | |
49 * Has no effect if an update is already queued for an identical listener. | |
50 * </p> | |
51 * | |
52 * @param listener listener whose setContents method should be called. The | |
53 * listener must have been previously registered with addListener. | |
54 */ | |
55 public void requestUpdate(IConcurrentModelListener listener); | |
56 | |
57 /** | |
58 * Adds a listener to this model. The listener should be given the model's | |
59 * current contents (either through setContents or a sequence of adds) at the | |
60 * receiver's earliest convenience. The receiver will notify the listener | |
61 * about any changes in state until the listener is removed. | |
62 * | |
63 * <p> | |
64 * Has no effect if an identical listener is already registered. | |
65 * </p> | |
66 * | |
67 * @param listener listener to add | |
68 */ | |
69 public void addListener(IConcurrentModelListener listener); | |
70 | |
71 /** | |
72 * Removes a listener from this model. The receiver will stop sending | |
73 * notifications to the given listener as soon as possible (although | |
74 * some additional notifications may still if arrive if the receiver | |
75 * was in the process of sending notifications in another thread). | |
76 * Any pending updates for this listener will be cancelled. | |
77 * <p> | |
78 * Has no effect if the given listener is not known to this model. | |
79 * </p> | |
80 * | |
81 * @param listener listener to remove | |
82 */ | |
83 public void removeListener(IConcurrentModelListener listener); | |
84 } |