Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f3449f59be9a337b86bbc3299648a0ab4d107d69 (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
/*
 * Copyright (c) 2014 CEA and others.
 *
 * 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:
 *   Christian W. Damus (CEA) - Initial API and implementation
 *
 */
package org.eclipse.papyrus.infra.ui.editor.reload;


/**
 * An adapter protocol for objects that can provide {@code context}s to be included in the
 * re-load state of dependent parts in an {@link EditorReloadEvent}, for the purpose of
 * restoring the state of those objects after re-load has completed.
 */
public interface IReloadContextProvider {

	/**
	 * Creates an opaque token from which the receiver can be {@linkplain #restore(Object) restored} after the editor has reloaded.
	 *
	 * @return an opaque editor re-load context, or {@code null} if none is needed on this occasion (for example because the receiver
	 *         is in its default state)
	 */
	Object createReloadContext();

	/**
	 * Reloads the receiver's state from a token previously {@linkplain #createReloadContext() provided}.
	 *
	 * @param reloadContext
	 *            the opaque re-load context token
	 */
	void restore(Object reloadContext);
}

Back to the top