View Javadoc
1   /**
2    * 
3    * Copyright (c) 2014, Openflexo
4    * 
5    * This file is part of Gina-swing-editor, a component of the software infrastructure 
6    * developed at Openflexo.
7    * 
8    * 
9    * Openflexo is dual-licensed under the European Union Public License (EUPL, either 
10   * version 1.1 of the License, or any later version ), which is available at 
11   * https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
12   * and the GNU General Public License (GPL, either version 3 of the License, or any 
13   * later version), which is available at http://www.gnu.org/licenses/gpl.html .
14   * 
15   * You can redistribute it and/or modify under the terms of either of these licenses
16   * 
17   * If you choose to redistribute it and/or modify under the terms of the GNU GPL, you
18   * must include the following additional permission.
19   *
20   *          Additional permission under GNU GPL version 3 section 7
21   *
22   *          If you modify this Program, or any covered work, by linking or 
23   *          combining it with software containing parts covered by the terms 
24   *          of EPL 1.0, the licensors of this Program grant you additional permission
25   *          to convey the resulting work. * 
26   * 
27   * This software is distributed in the hope that it will be useful, but WITHOUT ANY 
28   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
29   * PARTICULAR PURPOSE. 
30   *
31   * See http://www.openflexo.org/license.html for details.
32   * 
33   * 
34   * Please contact Openflexo (openflexo-contacts@openflexo.org)
35   * or visit www.openflexo.org if you need additional information.
36   * 
37   */
38  
39  package org.openflexo.gina.swing.editor.widget;
40  
41  import java.util.logging.Logger;
42  
43  import org.openflexo.gina.ApplicationFIBLibrary.ApplicationFIBLibraryImpl;
44  import org.openflexo.gina.model.FIBComponent;
45  import org.openflexo.gina.swing.editor.controller.FIBEditorController;
46  import org.openflexo.gina.swing.utils.FIBJPanel;
47  import org.openflexo.localization.FlexoLocalization;
48  import org.openflexo.localization.LocalizedDelegate;
49  import org.openflexo.rm.Resource;
50  import org.openflexo.rm.ResourceLocator;
51  
52  /**
53   * Browser for FIBEditor elements
54   * 
55   * @author sylvain
56   * 
57   */
58  @SuppressWarnings("serial")
59  public class FIBEditorBrowser extends FIBJPanel<FIBComponent> {
60  
61  	protected static final Logger logger = Logger.getLogger(FIBEditorBrowser.class.getPackage().getName());
62  
63  	public static Resource FIB_FILE = ResourceLocator.locateResource("Fib/Browser.fib");
64  
65  	private final FIBEditorController editorController;
66  
67  	public FIBEditorBrowser(FIBComponent fibComponent, FIBEditorController editorController) {
68  		super(FIB_FILE, fibComponent, ApplicationFIBLibraryImpl.instance(), FlexoLocalization.getMainLocalizer());
69  		this.editorController = editorController;
70  		getController().setEditorController(editorController);
71  	}
72  
73  	@Override
74  	protected BrowserFIBController makeFIBController(FIBComponent browserComponent, LocalizedDelegate parentLocalizer) {
75  		return new BrowserFIBController(browserComponent, editorController);
76  	}
77  
78  	@Override
79  	public BrowserFIBController getController() {
80  		return (BrowserFIBController) super.getController();
81  	}
82  
83  	@Override
84  	public Class<FIBComponent> getRepresentedType() {
85  		return FIBComponent.class;
86  	}
87  
88  	@Override
89  	public void delete() {
90  	}
91  
92  }