Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 11a55052f5303f91e237481193bf6b734def2ee4 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*****************************************************************************
 * 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:
 *  Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
 *****************************************************************************/
package org.eclipse.papyrus.properties.runtime.controller;

import java.util.List;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.papyrus.properties.runtime.controller.descriptor.IPropertyEditorControllerDescriptor;
import org.eclipse.papyrus.properties.runtime.propertyeditor.descriptor.IPropertyEditorDescriptor;
import org.eclipse.swt.widgets.Composite;


/**
 * Interface implemented by all property editor controllers
 */
public interface IPropertyEditorController {

	/**
	 * Sets the objectToEdit
	 * 
	 * @param objectToEdit
	 *        the objectToEdit to set
	 */
	public void setObjectsToEdit(List<? extends Object> objectToEdit);

	/**
	 * Indicates that the list of objects to edit should change. It removes old listeners, and adds new ones
	 * 
	 * @param objectToEdit
	 *        the new list of objects to edit
	 */
	public void changeObjectsToEdit(List<? extends Object> objectToEdit);

	/**
	 * Sets the parent composite for all controls created by the editor
	 * 
	 * @param composite
	 *        the composite to set
	 */
	public void setParent(Composite composite);

	/**
	 * Indicates if the controller manages multi-selection of objects
	 * 
	 * @return <code>true</code> if the controller accepts multi-selection
	 */
	public boolean acceptMultiSelection();

	/**
	 * Creates the property editor, with label on the specified position and the given icon.
	 * 
	 * @param descriptor
	 *        the image descriptor for the property editor
	 */
	public void createPropertyEditor(IPropertyEditorDescriptor descriptor);

	/**
	 * Initialize the controller.
	 * 
	 * @param parent
	 *        the composite parent of the controls created by the editor
	 * @param objectsToEdit
	 *        the list of objects to edit
	 * @param descriptor
	 *        the descriptor that realize specific configuration for this controller
	 * @return the status of the initialization
	 */
	public IStatus initController(Composite parent, List<Object> objectsToEdit, IPropertyEditorControllerDescriptor descriptor);

	/**
	 * Refresh the content of the editor, given values in the model.
	 */
	public void refreshDisplay();

}

Back to the top