Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d14b76cd615b345e46eb393abf095d6d7f330ecc (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/**
 *  Copyright (c) 2011 Mia-Software.
 *
 *  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:
 *      Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
 *      Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
 */
package org.eclipse.papyrus.emf.facet.custom.ui.internal.exported.dialog;

import java.util.List;

import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
import org.eclipse.papyrus.emf.facet.custom.ui.internal.exported.exception.IllegalParameterException;

/**
 * A dialog to load {@link Customization}s.
 *
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 * @since 0.2.0
 */
public interface ILoadCustomizationsDialog<D> {

	/**
	 * Opens the dialog and blocks until it closes.
	 *
	 * @return the dialog's return code
	 */
	int open();

	/** Opens the dialog asynchronously */
	void asyncOpen();

	/**
	 * Emulate a press on the OK button
	 *
	 * @since 0.2
	 */
	D pressOk();

	/** Selects the given customization in the left "available customizations" pane */
	void selectAvailableCustom(Customization customization);

	/**
	 * Moves the customizations selected in the left "available customizations" pane to the right
	 * "loaded customizations" pane.
	 */
	void loadSelectedCustoms();

	/** Selects the given customization in the right "loaded customizations" pane */
	void selectSelectedCustom(Customization customization);

	/**
	 * Moves the customizations selected in the right "loaded customizations" pane to the left
	 * "available customizations" pane.
	 */
	void unloadSelectedCustoms();

	/**
	 * This method is used to add a customization on the top of the
	 * customization stack.
	 *
	 * @param customization
	 *            must be one element of the list returned by {@link
	 *            ICustomizationLoaderDialo.getAvailableCustomizations()}
	 * @throws IllegalParameterException
	 *             when the parameter is not one element of the list returned by {@link
	 *             ICustomizationLoaderDialo.getAvailableCustomizations()}
	 */
	void addCustomization(Customization customization)
			throws IllegalParameterException;

	/**
	 * This method is used to add customizations on the top of the customization
	 * stack.
	 *
	 * @param customizations
	 *            must be one element of the list returned by {@link
	 *            ICustomizationLoaderDialo.getAvailableCustomizations()}
	 * @throws IllegalParameterException
	 *             when one of the element of the parameter list in not one
	 *             element of the list returned by {@link
	 *             ICustomizationLoaderDialo.getAvailableCustomizations()}
	 */
	void addCustomizations(List<Customization> customizations)
			throws IllegalParameterException;

	/**
	 * This method is used to remove a customization from the list.
	 *
	 * @param customization
	 *            must be one element of the list returned by {@link
	 *            ICustomizationLoaderDialo.getSelectedCustomizations()}
	 * @throws IllegalParameterException
	 *             when the parameter is not one element of the list returned by {@link ICustomizationLoaderDialo.getSelectedCustomizations()}
	 */
	void removeCustomization(Customization customization)
			throws IllegalParameterException;

	/**
	 * This method is used to remove a list of customization from the list.
	 *
	 * @param customizations
	 *            must be one element of the list returned by {@link
	 *            ICustomizationLoaderDialo.getSelectedCustomizations()}
	 * @throws IllegalParameterException
	 *             when one of the element of the parameter list in not one
	 *             element of the list returned by {@link
	 *             ICustomizationLoaderDialo.getSelectedCustomizations()}
	 */
	void removeCustomizations(List<Customization> customizations)
			throws IllegalParameterException;

	/**
	 * Cancel the dialog
	 */
	void cancel();

	/**
	 * Validate the dialog
	 */
	void validate();

	/**
	 * The intersection between getSelectedCustomizations() and
	 * getAvailableCustomizations') has to be empty.
	 *
	 * @return the customizations selected using the dialog.
	 */
	List<Customization> getSelectedCustomizations();

	/**
	 * The intersection between getSelectedCustomizations() and
	 * getAvailableCustomizations') has to be empty.
	 *
	 * @return the available and not yet selected customizations
	 */
	List<Customization> getAvailableCustomizations();

	/**
	 * This method is used to push up a customization.
	 *
	 * @param customization
	 *            a selected customization.
	 * @throws IllegalParameterException
	 *             when the parameter in not on element of the list returned by
	 *             getSelectedCustomizations().
	 */
	void pushUp(Customization customization) throws IllegalParameterException;

	/**
	 * This method is used to push down a customization.
	 *
	 * @param customization
	 *            a selected customization.
	 * @throws IllegalParameterException
	 *             when the parameter in not on element of the list returned by
	 *             getSelectedCustomizations().
	 */
	void pushDown(Customization customization) throws IllegalParameterException;
}

Back to the top