1 17 18 package org.objectweb.jac.aspects.gui.swing; 19 20 import org.objectweb.jac.aspects.gui.Constants; 21 import org.objectweb.jac.aspects.gui.FieldEditor; 22 import org.objectweb.jac.aspects.gui.GuiAC; 23 import org.objectweb.jac.aspects.gui.TabsView; 24 import org.objectweb.jac.aspects.gui.View; 25 import org.objectweb.jac.core.rtti.FieldItem; 26 import java.util.Iterator ; 27 import java.util.List ; 28 import java.util.Vector ; 29 30 public class ObjectView extends SwingContainerView 31 { 32 Vector editors = new Vector (); 33 boolean showButtons = true; 34 35 public ObjectView() { 36 super(Constants.VERTICAL); 37 } 38 39 public void addEditor(FieldEditor editor) { 40 editors.add(editor); 41 } 42 43 public List getEditors() { 44 return editors; 45 } 46 47 public void setShowButtons(boolean value) { 48 this.showButtons = value; 49 } 50 51 public void setFocus(FieldItem field, Object option) { 52 String [] categories = GuiAC.getCategories(field); 53 if (categories!=null && categories.length>0) { 54 Iterator it = getViews().iterator(); 55 while(it.hasNext()) { 56 View view = (View)it.next(); 57 if (view instanceof TabsView) { 58 ((TabsView)view).select(categories[0]); 59 } 60 } 61 } 62 } 63 64 } 65 | Popular Tags |