Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a901cfb3c585756a59dfd14180fa80d4e5a5508e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*****************************************************************************
 * Copyright (c) 2010 CEA LIST.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Nicolas Guyomar (Mia-Software) - initial API and implementation
 *   Nicolas Bros (Mia-Software)
 *   Nicolas Bros (Mia-Software) - Bug 334539 - [celleditors] change listener
 *****************************************************************************/
package org.eclipse.papyrus.emf.facet.widgets.celleditors;

import org.eclipse.swt.widgets.Composite;

/** Implemented by {@link Composite}s that are encapsulated in {@link IModelCellEditor cell editors} */
public interface IWidget2<T extends Object> {
	/** @return the validator used to determine whether an entered value is accepted */
	IValidator getValidator();

	/**
	 * Add a listener that is notified when the value in the widget is "committed". That is, when
	 * the user hits Enter or clicks outside the widget.
	 */
	void addCommitListener(IListener listener);

	/** Remove an existing commit listener */
	void removeCommitListener(IListener listener);

	/** Add a listener for changes to the value */
	void addChangeListener(IListener listener);

	/** Remove an existing change listener */
	void removeChangeListener(IListener listener);

	/** Set the given value in the widget */
	void setValue(final T value);

	/** Get the value from the widget */
	T getValue();
}

Back to the top