r2450 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: input sensitivity
Author: tchemit Date: 2009-07-01 10:03:24 +0000 (Wed, 01 Jul 2009) New Revision: 2450 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityNavigationTreeSelectionAdapter.java Log: fix bug 1858 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-07-01 09:57:59 UTC (rev 2449) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-07-01 10:03:24 UTC (rev 2450) @@ -182,43 +182,26 @@ return null; } - ChildBuilder<TopiaEntity> childParentBuilder = new ChildBuilder<TopiaEntity>(builder) { - - Decorator<? extends TopiaEntity> decorator; - - public void init(Class<? extends TopiaEntity> klass) { - decorator = jaxx.runtime.PropertyDecorator.newDecorator(klass, "name"); - } - - public Decorator<? extends TopiaEntity> getDecorator(TopiaEntity child) { - return decorator; - } - - public String getJXPath(TopiaEntity child) { - return "..[@topiaId=\"" + child.getTopiaId() + "\"]"; - } - - public String getNavigationPath(TopiaEntity child) { - return child.getTopiaId(); - } - }; - ChildBuilder<TopiaEntity> childBuilder = new ChildBuilder<TopiaEntity>(builder) { Decorator<? extends TopiaEntity> decorator; + @Override public void init(Class<? extends TopiaEntity> klass) { decorator = jaxx.runtime.PropertyDecorator.newDecorator(klass, "name"); } + @Override public Decorator<? extends TopiaEntity> getDecorator(TopiaEntity child) { return decorator; } + @Override public String getJXPath(TopiaEntity child) { return "..[@topiaId=\"" + child.getTopiaId() + "\"]"; } + @Override public String getNavigationPath(TopiaEntity child) { return child.getTopiaId(); } @@ -240,7 +223,7 @@ NavigationTreeNode species = builder.build(root, _("isisfish.input.tree.species"), "../species", "$species", SpeciesUI.class, null); for (Species specie : fisheryRegion.getSpecies()) { - NavigationTreeNode speciesChild = builder.build(species, specie.toString(), "..[@topiaId=\"" + specie.getTopiaId() + "\"]", specie.getTopiaId(), SpeciesUI.class, null); + NavigationTreeNode speciesChild = builder.build(species,jaxx.runtime.PropertyDecorator.newDecorator(Species.class, "name"), "..[@topiaId=\"" + specie.getTopiaId() + "\"]", specie.getTopiaId(), SpeciesUI.class, null); NavigationTreeNode populations = builder.build(speciesChild, _("isisfish.input.tree.populations"), "../population", "$populations", PopulationUI.class, null); childBuilder.build(populations, true, Population.class, specie.getPopulation(), PopulationUI.class, null); } Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityNavigationTreeSelectionAdapter.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityNavigationTreeSelectionAdapter.java 2009-07-01 09:57:59 UTC (rev 2449) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityNavigationTreeSelectionAdapter.java 2009-07-01 10:03:24 UTC (rev 2450) @@ -47,6 +47,7 @@ import javax.swing.JPanel; import javax.swing.event.TreeSelectionEvent; import java.awt.Component; +import jaxx.runtime.PropertyDecorator; /** @author letellier */ public class SensitivityNavigationTreeSelectionAdapter extends NavigationTreeSelectionAdapterWithCardLayout { @@ -149,43 +150,26 @@ return null; } - ChildBuilder<TopiaEntity> childParentBuilder = new ChildBuilder<TopiaEntity>(builder) { - - Decorator<? extends TopiaEntity> decorator; - - public void init(Class<? extends TopiaEntity> klass) { - decorator = jaxx.runtime.PropertyDecorator.newDecorator(klass, "name"); - } - - public Decorator<? extends TopiaEntity> getDecorator(TopiaEntity child) { - return decorator; - } - - public String getJXPath(TopiaEntity child) { - return "..[@topiaId=\"" + child.getTopiaId() + "\"]"; - } - - public String getNavigationPath(TopiaEntity child) { - return child.getTopiaId(); - } - }; - ChildBuilder<TopiaEntity> childBuilder = new ChildBuilder<TopiaEntity>(builder) { Decorator<? extends TopiaEntity> decorator; + @Override public void init(Class<? extends TopiaEntity> klass) { decorator = jaxx.runtime.PropertyDecorator.newDecorator(klass, "name"); } + @Override public Decorator<? extends TopiaEntity> getDecorator(TopiaEntity child) { return decorator; } + @Override public String getJXPath(TopiaEntity child) { return "..[@topiaId=\"" + child.getTopiaId() + "\"]"; } + @Override public String getNavigationPath(TopiaEntity child) { return child.getTopiaId(); } @@ -207,7 +191,7 @@ NavigationTreeNode species = builder.build(root, _("isisfish.input.tree.species"), "../species", "$species", SpeciesUI.class, null); for (Species specie : fisheryRegion.getSpecies()) { - NavigationTreeNode speciesChild = builder.build(species, specie.toString(), "..[@topiaId=\"" + specie.getTopiaId() + "\"]", specie.getTopiaId(), SpeciesUI.class, null); + NavigationTreeNode speciesChild = builder.build(species, PropertyDecorator.newDecorator(Species.class, "name"), "..[@topiaId=\"" + specie.getTopiaId() + "\"]", specie.getTopiaId(), SpeciesUI.class, null); NavigationTreeNode populations = builder.build(speciesChild, _("isisfish.input.tree.populations"), "../population", "$populations", PopulationUI.class, null); childBuilder.build(populations, true, Population.class, specie.getPopulation(), PopulationUI.class, null); }
participants (1)
-
tchemit@users.labs.libre-entreprise.org