Author: chatellier Date: 2009-04-20 17:19:37 +0000 (Mon, 20 Apr 2009) New Revision: 2125 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx Log: Make class abstract, add comments... Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx 2009-04-20 17:14:44 UTC (rev 2124) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx 2009-04-20 17:19:37 UTC (rev 2125) @@ -1,4 +1,4 @@ -<JPanel layout='{new BorderLayout()}'> +<JPanel layout='{new BorderLayout()}' abstract="true"> <!-- ui state when editing --> <Boolean id='actif' javaBean='false'/> @@ -11,6 +11,7 @@ <!-- Next button title --> <java.lang.String id='nextPath' javaBean='null'/> + <!-- TODO is both of blocking UI used ? --> <jaxx.runtime.swing.BlockingLayerUI id='layerUI' blockIcon='{SwingUtil.createImageIcon("building.png")}' acceptIcon='{SwingUtil.createImageIcon("building_add.png")}' @@ -46,38 +47,47 @@ import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI; import jaxx.runtime.JAXXInitialContext; -public void refresh(){} +// TODO comment this empty method !!! +public void refresh() { + +} + public InputAction getAction() { return getContextValue(InputAction.class); } -public InputSaveVerifier getVerifier(){ +public InputSaveVerifier getVerifier() { return getContextValue(InputSaveVerifier.class); } -public FisheryRegion getRegion(){ +public FisheryRegion getRegion() { return getContextValue(FisheryRegion.class); } -public void setInfoText(String msg){ +public void setInfoText(String msg) { WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); if (root != null){ root.setInfoText(msg); } } -protected void goTo(){ +protected void goTo() { getParentContainer(InputUI.class).setTreeSelection(getNextPath()); } -public void setBean(TopiaEntity t){}; +// TODO this method cause a lot of probleme +// must cast TopiaEntity to impl in inherited UIs... +public void setBean(TopiaEntity t) { + +} + public void setLayer(boolean active) { - if (this.get$objectMap() != null){ + if (this.get$objectMap() != null) { for (JComponent boxed : SwingUtil.getLayeredComponents(this)) { // Verifie si dans l'entré existe dans le fichier sensitivity.properties Class classBean = (Class)boxed.getClientProperty("bean"); String method = (String)boxed.getClientProperty("method"); boolean isSensitivity = false; - if (classBean != null){ + if (classBean != null) { isSensitivity = UtilsUI.isSensitivity(classBean.getSimpleName().replace("Impl", "") + "." + method); } - if (isSensitivity){ + if (isSensitivity) { jaxx.runtime.swing.BlockingLayerUI2 ui = active ? layerUI2.clone() : null; SwingUtil.getLayer(boxed).setUI(ui); } else { @@ -90,21 +100,19 @@ } } - protected void accept(ActionEvent e) { - JComponent source = (JComponent) e.getSource(); - Class classBean = (Class)source.getClientProperty("bean"); - TopiaEntity bean = getVerifier().getEntity(classBean); - if (bean != null){ - FactorWizard wizard = new FactorWizard(this); - - wizard.initNew(source, bean, EditorHelper.canBeContinue(source, bean)); - wizard.pack(); - wizard.setVisible(true); - } +protected void accept(ActionEvent e) { + JComponent source = (JComponent) e.getSource(); + Class classBean = (Class)source.getClientProperty("bean"); + TopiaEntity bean = getVerifier().getEntity(classBean); + if (bean != null) { + FactorWizard wizard = new FactorWizard(this); + wizard.initNew(source, bean, EditorHelper.canBeContinue(source, bean)); + wizard.pack(); + wizard.setVisible(true); } +} -]]> - </script> +]]></script> <JPanel id='body' constraints='BorderLayout.CENTER'/> <JButton id='next' text='{getButtonTitle()}' constraints='BorderLayout.SOUTH' visible='{getNextPath() != null}' onActionPerformed='goTo()'/> </JPanel>
participants (1)
-
chatellier@users.labs.libre-entreprise.org