78
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2005, 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 *******************************************************************************/
|
|
11 module org.eclipse.jface.internal.databinding.swt.ListObservableList;
|
|
12
|
|
13 import java.lang.all;
|
|
14
|
|
15 import org.eclipse.jface.databinding.swt.SWTObservables;
|
|
16 import org.eclipse.swt.widgets.List;
|
|
17
|
|
18 /**
|
|
19 * @since 3.2
|
|
20 *
|
|
21 */
|
|
22 public class ListObservableList : SWTObservableList {
|
|
23
|
|
24 private final List list;
|
|
25
|
|
26 /**
|
|
27 * @param list
|
|
28 */
|
|
29 public this(List list) {
|
|
30 super(SWTObservables.getRealm(list.getDisplay()));
|
|
31 this.list = list;
|
|
32 }
|
|
33
|
|
34 protected int getItemCount() {
|
|
35 return list.getItemCount();
|
|
36 }
|
|
37
|
|
38 protected void setItems(String[] newItems) {
|
|
39 list.setItems(newItems);
|
|
40 }
|
|
41
|
|
42 protected String[] getItems() {
|
|
43 return list.getItems();
|
|
44 }
|
|
45
|
|
46 protected String getItem(int index) {
|
|
47 return list.getItem(index);
|
|
48 }
|
|
49
|
|
50 protected void setItem(int index, String string) {
|
|
51 list.setItem(index, string);
|
|
52 }
|
|
53 }
|