Method: EditingDomainFinderStrategy()

1: /*******************************************************************************
2: * Copyright (c) 2016 RCP Vision (http://www.rcp-vision.com) and others.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * Lorenzo Bettini - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.emf.parsley.edit.domain;
12:
13: import org.eclipse.emf.edit.domain.EditingDomain;
14: import org.eclipse.emf.parsley.edit.EditingDomainFinder;
15:
16: import com.google.inject.Inject;
17:
18: /**
19: * Delegates to {@link EditingDomainFinder}
20: *
21: * @author Lorenzo Bettini - initial API and implementation
22: *
23: */
24: public class EditingDomainFinderStrategy {
25:
26:         @Inject
27:         private EditingDomainFinder editingDomainFinder;
28:
29:         private EditingDomain editingDomain;
30:
31:         public EditingDomain getEditingDomain() {
32:                 return editingDomain;
33:         }
34:
35:         public void setEditingDomain(EditingDomain editingDomain) {
36:                 this.editingDomain = editingDomain;
37:         }
38:
39:         public void updateEditingDomain(Object object) {
40:                 setEditingDomain(editingDomainFinder.getEditingDomainFor(object));
41:         }
42:
43: }