This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit b6395aee0e6128251453fef4b6ba2d61d7e2df14 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Sep 4 20:54:08 2016 +0200 Ajout des informations techniques sur tous les écrans de saisie --- .../application/swing/ui/content/ContentUI.jaxx | 3 + .../application/swing/ui/content/ContentUI.jcss | 9 ++ .../swing/ui/content/ContentUIHandler.java | 165 +++++++++++++++++---- .../swing/ui/content/ref/ContentReferenceUI.jaxx | 3 +- .../swing/ui/content/ref/ContentReferenceUI.jcss | 4 - .../ui/content/ref/ContentReferenceUIHandler.java | 96 +----------- 6 files changed, 151 insertions(+), 129 deletions(-) diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx index b7457ef..8e391c8 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx @@ -138,6 +138,9 @@ public void delete() { <JButton id='actionDown'/> </JXLayer> + <JButton id='showTechnicalInformations' + onActionPerformed='getHandler().showTechnicalInformations((JButton) event.getSource());'/> + <JLabel id='titleRight'/> </JToolBar> diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss index 37f56de..9edb264 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss @@ -56,3 +56,12 @@ #contentContainer { layout:{new BorderLayout()}; } + +#showTechnicalInformations { + _original:true; + toolTipText:"observe.action.show.technical.informations.tip"; + actionIcon:"show-informations"; + enabled:{!model.isCreatingMode() && (model.getBean() != null)}; + focusPainted:false; + borderPainted:false; +} diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java index afc2a71..ca5eefb 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java @@ -27,13 +27,21 @@ import com.google.common.collect.Lists; import fr.ird.observe.application.swing.ObserveOpenDataManager; import fr.ird.observe.application.swing.ObserveSwingApplicationContext; import fr.ird.observe.application.swing.ObserveSwingTechnicalException; +import fr.ird.observe.application.swing.db.DataContext; +import fr.ird.observe.application.swing.db.ObserveSwingDataSource; +import fr.ird.observe.application.swing.db.constants.DataContextType; import fr.ird.observe.application.swing.decoration.DecoratorService; import fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper; import fr.ird.observe.application.swing.decoration.decorators.DataReferenceDecorator; import fr.ird.observe.application.swing.decoration.decorators.ReferentialReferenceDecorator; -import fr.ird.observe.application.swing.db.DataContext; -import fr.ird.observe.application.swing.db.ObserveSwingDataSource; -import fr.ird.observe.application.swing.db.constants.DataContextType; +import fr.ird.observe.application.swing.ui.UIHelper; +import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction; +import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler; +import fr.ird.observe.application.swing.ui.tree.AbstractObserveTreeCellRenderer; +import fr.ird.observe.application.swing.ui.tree.ObserveNode; +import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper; +import fr.ird.observe.application.swing.ui.util.SpringUtilities; +import fr.ird.observe.application.swing.validation.ValidationContext; import fr.ird.observe.services.dto.AbstractObserveDto; import fr.ird.observe.services.dto.DataDto; import fr.ird.observe.services.dto.DataReference; @@ -46,13 +54,6 @@ import fr.ird.observe.services.dto.referential.ReferentialDto; import fr.ird.observe.services.dto.referential.ReferentialReference; import fr.ird.observe.services.dto.referential.ReferentialReferenceSet; import fr.ird.observe.services.dto.referential.ReferentialReferences; -import fr.ird.observe.application.swing.ui.UIHelper; -import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction; -import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler; -import fr.ird.observe.application.swing.ui.tree.AbstractObserveTreeCellRenderer; -import fr.ird.observe.application.swing.ui.tree.ObserveNode; -import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper; -import fr.ird.observe.application.swing.validation.ValidationContext; import jaxx.runtime.JAXXContext; import jaxx.runtime.swing.JAXXButtonGroup; import jaxx.runtime.swing.editor.bean.BeanComboBox; @@ -61,6 +62,7 @@ import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel; import jaxx.runtime.validator.swing.SwingValidatorUtil; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.reflect.ConstructorUtils; +import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.decorator.Decorator; @@ -73,16 +75,27 @@ import org.nuiton.validator.NuitonValidatorScope; import javax.swing.AbstractButton; import javax.swing.ActionMap; import javax.swing.Icon; +import javax.swing.JButton; import javax.swing.JComponent; +import javax.swing.JLabel; import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JTextField; import javax.swing.JToolBar; +import javax.swing.SpringLayout; import javax.swing.UIManager; +import javax.swing.border.TitledBorder; import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Optional; import java.util.Set; @@ -110,7 +123,7 @@ public abstract class ContentUIHandler<E extends IdDto> { /** l'interface graphique que le controleur utilise */ protected final ObserveContentUI<E> ui; - public static <E extends IdDto> ContentUIHandler<E> newHandler(ObserveContentUI<E> ui) { + static <E extends IdDto> ContentUIHandler<E> newHandler(ObserveContentUI<E> ui) { String uiName = ui.getClass().getName(); String modelName = uiName + "Handler"; @@ -135,7 +148,7 @@ public abstract class ContentUIHandler<E extends IdDto> { * @return {@code true} if ui can be safelty closed, {@code false} * otherwise. */ - public static boolean checkEdit(ObserveContentUI<?> ui) { + protected static boolean checkEdit(ObserveContentUI<?> ui) { ContentUIModel<? extends AbstractObserveDto> model = ui.getModel(); @@ -169,7 +182,7 @@ public abstract class ContentUIHandler<E extends IdDto> { boolean wasClosed = true; - if (! ui.getDataSource().isExpired()) { + if (!ui.getDataSource().isExpired()) { if (model.isValid()) { // ask user if wants to save int reponse = UIHelper.askUser( @@ -243,7 +256,7 @@ public abstract class ContentUIHandler<E extends IdDto> { model.removeMessages(ui, fieldName, scope); } - public static void removeAllMessages(ObserveContentUI<?> ui) { + protected static void removeAllMessages(ObserveContentUI<?> ui) { SwingValidatorMessageTableModel model = ui.getErrorTableModel(); model.removeMessages((JComponent) ui, null); } @@ -257,6 +270,12 @@ public abstract class ContentUIHandler<E extends IdDto> { log.debug("New handler [" + this + "] for ui " + prefix); } errorIcon = UIManager.getIcon("action.error"); + Locale locale = ObserveSwingApplicationContext.get().getConfig().getLocale(); + if (Locale.ENGLISH.equals(locale)) { + dateFormat = FastDateFormat.getInstance("yyyy-MM-ddZZ hh:mm:ss"); + } else { + dateFormat = FastDateFormat.getInstance("dd/MM/yyyy hh:mm:ss"); + } } public ObserveContentUI<E> getUi() { @@ -387,7 +406,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } } - public void restartEditUI() { + void restartEditUI() { ContentUIModel<E> model = getModel(); @@ -419,7 +438,7 @@ public abstract class ContentUIHandler<E extends IdDto> { updateActions(); } - public final void saveUI(boolean refresh) { + protected final void saveUI(boolean refresh) { boolean ok = false; try { ok = doSave(getBean()); @@ -433,7 +452,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } } - public final boolean closeUI() { + final boolean closeUI() { boolean b = checkEdit(ui); if (log.isDebugEnabled()) { log.debug("Can close " + ui.getClass() + " : " + b); @@ -444,7 +463,7 @@ public abstract class ContentUIHandler<E extends IdDto> { return b; } - public final void deleteUI() { + final void deleteUI() { boolean ok = false; ui.stopEdit(); removeAllMessages(ui); @@ -461,7 +480,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } } - public <C extends DataDto> void gotoChild(DataReference<C> entity) { + protected <C extends DataDto> void gotoChild(DataReference<C> entity) { if (entity == null) { // rien a faire @@ -483,13 +502,13 @@ public abstract class ContentUIHandler<E extends IdDto> { treeHelper.addUnsavedNode(parentNode, type); } - public <E> List<E> updateList(BeanListHeader<E> list, List<E> data, String message) { + protected <EE> List<EE> updateList(BeanListHeader<EE> list, List<EE> data, String message) { if (data != null && !data.isEmpty()) { if (log.isDebugEnabled()) { log.debug(list.getName() + " - " + data.size()); } - Decorator<E> decorator = list.getHandler().getDecorator(); - DecoratorUtil.sort((JXPathDecorator<E>) decorator, data, 0); + Decorator<EE> decorator = list.getHandler().getDecorator(); + DecoratorUtil.sort((JXPathDecorator<EE>) decorator, data, 0); return data; } else { return new ArrayList<>(); @@ -506,7 +525,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } } - public String updateTitle(String title) { + String updateTitle(String title) { if (ContentReferenceUIHandler.class.isAssignableFrom(getClass())) { return ObserveI18nDecoratorHelper.getTypeI18nKey(getBeanType()); } @@ -760,7 +779,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } } - protected Icon updateModeIcon(ContentMode mode) { + Icon updateModeIcon(ContentMode mode) { Icon icon = null; if (mode != null) { icon = (Icon) ((JComponent) ui).getClientProperty(mode.name() + "Icon"); @@ -768,7 +787,7 @@ public abstract class ContentUIHandler<E extends IdDto> { return icon; } - protected String updateModeTip(ContentMode mode) { + String updateModeTip(ContentMode mode) { String tip = null; if (mode != null) { tip = (String) ((JComponent) ui).getClientProperty(mode.name() + "Tip"); @@ -868,7 +887,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } - protected <R extends DataDto> void updateDataFilterableDoubleList(Class<R> dtoClass, FilterableDoubleList<DataReference<R>> list) { + private <R extends DataDto> void updateDataFilterableDoubleList(Class<R> dtoClass, FilterableDoubleList<DataReference<R>> list) { List<DataReference<R>> data; @@ -893,7 +912,7 @@ public abstract class ContentUIHandler<E extends IdDto> { list.putClientProperty("data", data); } - protected <R extends ReferentialDto> void updateReferentialFilterableDoubleList(Class<R> dtoClass, FilterableDoubleList<ReferentialReference<R>> list) { + private <R extends ReferentialDto> void updateReferentialFilterableDoubleList(Class<R> dtoClass, FilterableDoubleList<ReferentialReference<R>> list) { Boolean forceLoadComboBox = (Boolean) list.getClientProperty(ObserveContentUI.CLIENT_PROPERTY_FORCE_LOAD); @@ -952,7 +971,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } - protected <R extends DataDto> void updateDataBeanListHeader(Class<R> dtoClass, BeanListHeader<DataReference<R>> list) { + private <R extends DataDto> void updateDataBeanListHeader(Class<R> dtoClass, BeanListHeader<DataReference<R>> list) { Boolean noLoad = (Boolean) list.getClientProperty(ObserveContentUI.CLIENT_PROPERTY_LIST_NO_LOAD); @@ -983,7 +1002,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } - protected <R extends ReferentialDto> void updateReferentialBeanComboBox(Class<R> dtoClass, BeanComboBox<ReferentialReference<R>> comboBox) { + private <R extends ReferentialDto> void updateReferentialBeanComboBox(Class<R> dtoClass, BeanComboBox<ReferentialReference<R>> comboBox) { Boolean noLoad = (Boolean) comboBox.getClientProperty(ObserveContentUI.CLIENT_PROPERTY_LIST_NO_LOAD); Boolean forceLoadComboBox = (Boolean) comboBox.getClientProperty(ObserveContentUI.CLIENT_PROPERTY_FORCE_LOAD); @@ -991,7 +1010,7 @@ public abstract class ContentUIHandler<E extends IdDto> { List<ReferentialReference<R>> data; - if (BooleanUtils.isNotTrue(forceLoadComboBox) && (BooleanUtils.isTrue(noLoad) || getModel().getForm() == null ) ) { + if (BooleanUtils.isNotTrue(forceLoadComboBox) && (BooleanUtils.isTrue(noLoad) || getModel().getForm() == null)) { if (log.isInfoEnabled()) { log.info(String.format("Skip loading of comboBox [%s-%s] (listNoLoad property found or form is null)", dtoClass.getSimpleName(), propertyName)); @@ -1023,7 +1042,7 @@ public abstract class ContentUIHandler<E extends IdDto> { } - protected <R extends DataDto> void updateDataBeanComboBox(Class<R> dtoClass, BeanComboBox<DataReference<R>> comboBox) { + private <R extends DataDto> void updateDataBeanComboBox(Class<R> dtoClass, BeanComboBox<DataReference<R>> comboBox) { Boolean noLoad = (Boolean) comboBox.getClientProperty(ObserveContentUI.CLIENT_PROPERTY_LIST_NO_LOAD); String propertyName = comboBox.getProperty(); @@ -1059,7 +1078,7 @@ public abstract class ContentUIHandler<E extends IdDto> { comboBox.setData(data); } - protected <R extends IdDto> Class<R> getDtoClass(JComponent list) { + private <R extends IdDto> Class<R> getDtoClass(JComponent list) { Object clientProperty = list.getClientProperty(ObserveContentUI.CLIENT_PROPERTY_ENTITY_CLASS); return (Class<R>) clientProperty; } @@ -1087,6 +1106,88 @@ public abstract class ContentUIHandler<E extends IdDto> { } + private final FastDateFormat dateFormat; + + protected E getSelectedBean() { + return getModel().getBean(); + } + + /** + * Pour afficher une popup avec l'ensemble des informations techniques. + * + * @param button le boutton qui a declanche l'action + */ + void showTechnicalInformations(JButton button) { + + E bean = getModel().isEditing() ? getBean() : getSelectedBean(); + + JPanel content = new JPanel(new SpringLayout()); + + FocusListener l = new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + JTextField source = (JTextField) e.getSource(); + source.setSelectionStart(0); + source.setSelectionEnd(source.getText().length()); + } + + @Override + public void focusLost(FocusEvent e) { + + } + }; + + { + content.add(new JLabel(t("observe.common.topiaId"))); + JTextField comp = new JTextField(bean.getId()); + comp.setEditable(false); + comp.addFocusListener(l); + content.add(comp); + } + + boolean isReferential = ReferentialDto.class.isAssignableFrom(getBeanType()); + if (isReferential) { + content.add(new JLabel(t("observe.common.topiaCreateDate"))); + JTextField comp = new JTextField(dateFormat.format(((ReferentialDto) bean).getCreateDate())); + comp.setEditable(false); + comp.addFocusListener(l); + content.add(comp); + } + + { + content.add(new JLabel(t("observe.common.lastUpdateDate"))); + JTextField comp = new JTextField(dateFormat.format(bean.getLastUpdateDate())); + comp.setEditable(false); + comp.addFocusListener(l); + content.add(comp); + } + + if (isReferential) { + content.add(new JLabel(t("observe.common.topiaVersion"))); + JTextField comp = new JTextField(String.valueOf(((ReferentialDto) bean).getVersion())); + comp.setEditable(false); + comp.addFocusListener(l); + content.add(comp); + } + + SpringUtilities.makeCompactGrid(content, isReferential ? 4 : 2, 2, 5, 5, 5, 5); + + Decorator<E> decorator = getDecoratorService().getDecoratorByType(getBeanType()); + + String title = t("observe.title.technical.informations", "\n" + decorator.toString(bean)); + + content.setBorder(new TitledBorder(title)); + + JPopupMenu popup = new JPopupMenu(); + popup.setBorderPainted(true); + popup.add(content); + popup.pack(); + Dimension dim = popup.getPreferredSize(); + int x = (int) (button.getPreferredSize().getWidth() - dim.getWidth()); + int y = button.getHeight(); + popup.show(button, x, y); + } + // protected static class LogPropertyChanges implements PropertyChangeListener { // diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx index 4f8cf04..5431b03 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx @@ -200,8 +200,7 @@ viewLayout.addLayoutComponent(editView, DETAIL_VIEW); <JButton id='showUniqueKeys' onActionPerformed='getHandler().showUniqueKeys((JButton) event.getSource());'/> - <JButton id='showTechnicalInformations' - onActionPerformed='getHandler().showTechnicalInformations((JButton) event.getSource());'/> + <JButton id='showTechnicalInformations'/> </JPanel> diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss index 179a340..47ea585 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss @@ -133,10 +133,6 @@ } #showTechnicalInformations { - toolTipText:"observe.action.show.technical.informations.tip"; - actionIcon:"show-informations"; enabled:{!model.isCreatingMode() && (model.isEditing() || model.getSelectedBean() != null)}; - focusPainted:false; - borderPainted:false; } diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java index 4e630d6..aafbd7a 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java @@ -32,7 +32,6 @@ import fr.ird.observe.application.swing.ui.content.ContentMode; import fr.ird.observe.application.swing.ui.content.ContentUIHandler; import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper; import fr.ird.observe.application.swing.ui.usage.UsagesUI; -import fr.ird.observe.application.swing.ui.util.SpringUtilities; import fr.ird.observe.application.swing.validation.ValidationContext; import fr.ird.observe.services.dto.Form; import fr.ird.observe.services.dto.IdDto; @@ -54,7 +53,6 @@ import jaxx.runtime.swing.editor.bean.BeanListHeader; import jaxx.runtime.validator.swing.SwingValidatorUtil; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.decorator.Decorator; @@ -65,30 +63,24 @@ import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JOptionPane; -import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JTable; -import javax.swing.JTextField; import javax.swing.JToolBar; import javax.swing.RowSorter; import javax.swing.SortOrder; -import javax.swing.SpringLayout; import javax.swing.SwingUtilities; import javax.swing.border.TitledBorder; import javax.swing.table.DefaultTableCellRenderer; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; import java.beans.Introspector; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; -import java.util.Locale; import java.util.Set; import static org.nuiton.i18n.I18n.t; @@ -110,17 +102,9 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content private final ReferentialContentUIInitializer<E, ContentReferenceUI<E>> uiInitializer; - private final FastDateFormat dateFormat; - public ContentReferenceUIHandler(ContentReferenceUI<E> ui) { super(ui, null, null); uiInitializer = new ReferentialContentUIInitializer<>(ui); - Locale locale = ui.getConfig().getLocale(); - if (Locale.ENGLISH.equals(locale)) { - dateFormat = FastDateFormat.getInstance("yyyy-MM-ddZZ hh:mm:ss"); - } else { - dateFormat = FastDateFormat.getInstance("dd/MM/yyyy hh:mm:ss"); - } revalidate = () -> { @@ -372,78 +356,9 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content 0); } - /** - * Pour afficher une popup avec l'ensemble des informations techniques. - * - * @param button le boutton qui a declanche l'action - */ - void showTechnicalInformations(JButton button) { - - ReferentialDto bean = getModel().isEditing() ? getBean() : getModel().getSelectedBean(); - - JPanel content = new JPanel(new SpringLayout()); - - FocusListener l = new FocusListener() { - @Override - public void focusGained(FocusEvent e) { - JTextField source = (JTextField) e.getSource(); - source.setSelectionStart(0); - source.setSelectionEnd(source.getText().length()); - } - - @Override - public void focusLost(FocusEvent e) { - - } - }; - - { - content.add(new JLabel(t("observe.common.topiaId"))); - JTextField comp = new JTextField(bean.getId()); - comp.setEditable(false); - comp.addFocusListener(l); - content.add(comp); - } - { - content.add(new JLabel(t("observe.common.topiaCreateDate"))); - JTextField comp = new JTextField(dateFormat.format(bean.getCreateDate())); - comp.setEditable(false); - comp.addFocusListener(l); - content.add(comp); - } - - { - content.add(new JLabel(t("observe.common.lastUpdateDate"))); - JTextField comp = new JTextField(dateFormat.format(bean.getLastUpdateDate())); - comp.setEditable(false); - comp.addFocusListener(l); - content.add(comp); - } - - { - content.add(new JLabel(t("observe.common.topiaVersion"))); - JTextField comp = new JTextField(String.valueOf(bean.getVersion())); - comp.setEditable(false); - comp.addFocusListener(l); - content.add(comp); - } - - SpringUtilities.makeCompactGrid(content, 4, 2, 5, 5, 5, 5); - - Decorator<E> decorator = getDecoratorService().getDecoratorByType(getBeanType()); - - String title = t("observe.title.technical.informations", "\n" + decorator.toString(bean)); - - content.setBorder(new TitledBorder(title)); - - JPopupMenu popup = new JPopupMenu(); - popup.setBorderPainted(true); - popup.add(content); - popup.pack(); - Dimension dim = popup.getPreferredSize(); - int x = (int) (button.getPreferredSize().getWidth() - dim.getWidth()); - int y = button.getHeight(); - popup.show(button, x, y); + @Override + protected E getSelectedBean() { + return getModel().getSelectedBean(); } @Override @@ -477,8 +392,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content // on met en gras le libelle selectionne en base ReferentialLocale localeEnum; - localeEnum = ReferentialLocale.valueOf( - ui.getConfig().getDbLocale()); + localeEnum = ReferentialLocale.valueOf(ui.getConfig().getDbLocale()); String libelleName = localeEnum.getLibelle() + "Label"; for (int i = 1; i <= 8; i++) { String lib = "label" + i + "Label"; @@ -520,7 +434,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content ContentReferenceUI<E> ui = getUi(); JToolBar toolBar = ui.getTitleRightToolBar(); toolBar.add(ui.getShowUniqueKeys(), 2); - toolBar.add(ui.getShowTechnicalInformations(), 2); +// toolBar.add(ui.getShowTechnicalInformations(), 2); toolBar.add(ui.getShowUsages(), 2); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.