Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 924eb87e7443e825146c23941b3925d43d357bd6 (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
/**
 * 
 */
package org.eclipse.papyrus.infra.core.editorsfactory;

import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider;
import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr;
import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
import org.eclipse.swt.graphics.Image;

/**
 * Factory used to create an {@link IPageModel} used by the {@link ISashWindowsContainer} to create an instance of the editor represented
 * by the provided Object. Such factory is required by the {@link DiSashModelMngr}. It is called whenever the ISashWindowsContainer need
 * to create an editor from an EObject representing this editor in the Di
 * implementation of the {@link ISashWindowsContentProvider}
 * 
 * 
 * @author cedric dumoulin
 * 
 */
public interface IEditorIconFactory {

	/**
	 * Get the icon associated to the editor used to render the model. Model
	 * represent the top level object of a model editor. Can return a cached
	 * Image.
	 * 
	 * @param pageIdentifier
	 *        the pageIdentifier representing the Editor. This is usually
	 *        the EObject used to reconstruct the editor.
	 * @return the icon representing the editor
	 */
	public Image getEditorIcon(Object pageIdentifier);

	/**
	 * Create the icon associated to the editor used to render the model. Model
	 * represent the top level object of a model editor. Always return a newly
	 * created Image.
	 * 
	 * @param pageIdentifier
	 *        the pageIdentifier representing the Editor. This is usually
	 *        the EObject used to reconstruct the editor.
	 * @return the icon representing the editor
	 */
	public Image createEditorIcon(Object pageIdentifier);

	/**
	 * Return true if the factory can create an IPageModel for the specified
	 * pageIdentifier. Return false otherwise TODO throw an exception
	 * encapsulating problems encountered while creating the model.
	 * 
	 * @param pageIdentifier
	 *        The object representing the page to test
	 * @return
	 */
	public boolean isPageModelFactoryFor(Object pageIdentifier);

}

Back to the top