1 23 24 package org.objectweb.fractal.gui.menu.control; 25 26 import org.objectweb.fractal.api.control.BindingController; 27 28 import org.objectweb.fractal.gui.selection.model.SelectionListener; 29 import org.objectweb.fractal.gui.selection.model.Selection; 30 import org.objectweb.fractal.gui.model.Factory; 31 import org.objectweb.fractal.swing.AbstractAction; 32 33 36 37 public abstract class CreateAction extends AbstractAction implements 38 SelectionListener, 39 BindingController 40 { 41 42 47 48 public final static String SELECTION_BINDING = "selection"; 49 50 54 55 public final static String FACTORY_BINDING = "configuration-factory"; 56 57 60 61 Selection selection; 62 63 66 67 Factory factory; 68 69 73 public String [] listFc () { 74 return new String [] { SELECTION_BINDING, FACTORY_BINDING }; 75 } 76 77 public Object lookupFc (final String clientItfName) { 78 if (SELECTION_BINDING.equals(clientItfName)) { 79 return selection; 80 } else if (FACTORY_BINDING.equals(clientItfName)) { 81 return factory; 82 } 83 return null; 84 } 85 86 public void bindFc ( 87 final String clientItfName, 88 final Object serverItf) 89 { 90 if (SELECTION_BINDING.equals(clientItfName)) { 91 selection = (Selection)serverItf; 92 } else if (FACTORY_BINDING.equals(clientItfName)) { 93 factory = (Factory)serverItf; 94 } 95 } 96 97 public void unbindFc (final String clientItfName) { 98 if (SELECTION_BINDING.equals(clientItfName)) { 99 selection = null; 100 } else if (FACTORY_BINDING.equals(clientItfName)) { 101 factory = null; 102 } 103 } 104 } 105 106 | Popular Tags |