Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: f3212497 by Tony Chemit at 2017-07-19T00:04:41+02:00 Fix pom version - - - - - 4 changed files: - application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIInitializer.java - application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java - application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java - pom.xml Changes: ===================================== application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIInitializer.java ===================================== --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIInitializer.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIInitializer.java @@ -103,15 +103,11 @@ public class ObserveMainUIInitializer { if (source == null || !source.isOpen()) { // no open data source - if (log.isDebugEnabled()) { - log.debug("No open Data source."); - } + log.debug("No open Data source."); return; } if (ui.getNavigation().isSelectionEmpty()) { - if (log.isDebugEnabled()) { - log.debug("No selection, show empty panel..."); - } + log.debug("No selection, show empty panel..."); boolean foundEmptySelection = false; for (Component component : ui.getContent().getComponents()) { @@ -225,9 +221,7 @@ public class ObserveMainUIInitializer { } } if (focusOnNavigation) { - if (log.isInfoEnabled()) { - log.info("Focus on navigation: " + focusOwner); - } + log.debug("Focus on navigation: " + focusOwner); } ContentUI<?, ?> previousSelectedContent = manager.getSelectedContentUI(); ===================================== application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java ===================================== --- 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 @@ -126,9 +126,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U public void beforeInit(U ui) { this.ui = ui; prefix = "[" + ui.getClass().getSimpleName() + "] "; - if (log.isDebugEnabled()) { - log.debug("[" + this + "] for ui " + prefix); - } + log.debug("[" + this + "] Before init " + prefix); } public void afterInit(U ui) { @@ -198,9 +196,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U } } - if (log.isDebugEnabled()) { - log.debug("previousUI is in edit mode"); - } + log.debug("previousUI is in edit mode"); boolean wasClosed = true; @@ -247,9 +243,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U t("observe.choice.continue"), t("observe.choice.cancel")}, 0); - if (log.isDebugEnabled()) { - log.debug("response : " + reponse); - } + log.debug("response : " + reponse); switch (reponse) { case JOptionPane.CLOSED_OPTION: case 1: @@ -340,9 +334,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U ValidationContext context = applicationContext.getValidationContext(); context.cleanCache(); - if (log.isDebugEnabled()) { - log.debug("ui " + ui.getClass()); - } + log.debug("Open ui " + ui.getClass()); // suppression des messages de validation removeAllMessages(ui); NavigationTree tree = getNavigationTree(); @@ -373,9 +365,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U treeHelper.reloadSelectedNode(false, true); NavigationTreeNodeSupport parentNode = treeHelper.getSelectedNode().getParent(); - if (log.isDebugEnabled()) { - log.debug("PARENT NODE = " + parentNode); - } + log.debug("PARENT NODE = " + parentNode); treeHelper.addUnsavedNode(parentNode, getBeanType()); } @@ -390,10 +380,8 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U SwingUtilities.invokeLater(() -> { mainUI.getNavigation().requestFocusInWindow(); - if (log.isInfoEnabled()) { - log.info("Focus old owner: " + focusOwner); - log.info("Focus new owner: " + mainUI.getFocusOwner()); - } + log.debug("Focus old owner: " + focusOwner); + log.debug("Focus new owner: " + mainUI.getFocusOwner()); }); } }); @@ -401,9 +389,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U FocusTraversalPolicy focusTraversalPolicy = ui.getFocusTraversalPolicy(); if (focusTraversalPolicy != null) { JComponent firstComponent = (JComponent) focusTraversalPolicy.getFirstComponent(ui); - if (log.isInfoEnabled()) { - log.info("Grab focus on first component: " + firstComponent); - } + log.debug("Grab focus on first component: " + firstComponent); UIHelper.askFocus(firstComponent); } } @@ -492,9 +478,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U // on quite de suite return; } - if (log.isInfoEnabled()) { - log.info(prefix + "Will restart edit " + getUi().getClass().getName()); - } + log.debug(prefix + "Will restart edit " + getUi().getClass().getName()); // on ne peut redemarrer une edition que si la donnee // est exactement une entites (pas possible sur une liste) @@ -531,9 +515,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U final boolean closeUI() { boolean b = checkEdit(ui); - if (log.isDebugEnabled()) { - log.debug("Can close " + ui.getClass() + " : " + b); - } + log.debug("Can close " + ui.getClass() + " : " + b); if (b) { closeSafeUI(); } @@ -609,9 +591,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U ImmutableMap.Builder<String, ReferentialReferenceSet<?>> modelReferentialReferenceSets = ImmutableMap.builder(); - if (log.isInfoEnabled()) { - log.info("Update referential reference sets for: " + requestName); - } + log.info("Update referential reference sets for: " + requestName); // mettre à jour le cache de référentiel ImmutableMap<Class<?>, ReferentialReferenceSet<?>> referentialReferenceSetsByType = getDataSource().updateReferentialReferenceSetsCache(requestName); @@ -640,14 +620,10 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U protected <D extends ReferentialDto> Collection<ReferentialReference<D>> filterReferentialReferences(Class<D> dtoType, String propertyName, LinkedList<ReferentialReference<D>> incomingReferences) { - if (log.isDebugEnabled()) { - log.debug(String.format("Filter referential references (type %s - property %s), original size: %d", dtoType.getSimpleName(), propertyName, incomingReferences.size())); - } + log.debug(String.format("Filter referential references (type %s - property %s), original size: %d", dtoType.getSimpleName(), propertyName, incomingReferences.size())); // by default always remove obsolete references List<ReferentialReference<D>> referentialReferences = ReferentialReferences.filterEnabled(incomingReferences); - if (log.isDebugEnabled()) { - log.debug(String.format("Filter referential references (type %s - property %s), without diabled size: %d", dtoType.getSimpleName(), propertyName, incomingReferences.size())); - } + log.debug(String.format("Filter referential references (type %s - property %s), without diabled size: %d", dtoType.getSimpleName(), propertyName, incomingReferences.size())); return referentialReferences; } @@ -811,9 +787,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U } AbstractUIAction action = (AbstractUIAction) actionMap.get(actionId); - if (log.isDebugEnabled()) { - log.debug("update common action " + actionId); - } + log.debug("update common action " + actionId); action.updateAction(ui, button); } @@ -968,9 +942,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U if (!"referentialListHeader".equals(propertyName) && (BooleanUtils.isTrue(noLoad) || getModel().getForm() == null)) { - if (log.isInfoEnabled()) { - log.info(String.format("Skip loading of BeanListHeader [%s-%s] (listNoLoad property found or form is null)", dtoClass.getSimpleName(), propertyName)); - } + log.debug(String.format("Skip loading of BeanListHeader [%s-%s] (listNoLoad property found or form is null)", dtoClass.getSimpleName(), propertyName)); data = Collections.emptyList(); } else { @@ -1000,9 +972,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U if (BooleanUtils.isTrue(noLoad) || getModel().getForm() == null) { - if (log.isInfoEnabled()) { - log.info(String.format("Skip loading of BeanListHeader [%s-%s] (listNoLoad property found or form is null)", dtoClass.getSimpleName(), propertyName)); - } + log.debug(String.format("Skip loading of BeanListHeader [%s-%s] (listNoLoad property found or form is null)", dtoClass.getSimpleName(), propertyName)); data = Collections.emptyList(); } else { @@ -1031,9 +1001,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U 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)); - } + log.debug(String.format("Skip loading of comboBox [%s-%s] (listNoLoad property found or form is null)", dtoClass.getSimpleName(), propertyName)); data = Collections.emptyList(); } else { @@ -1053,9 +1021,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U } - if (log.isInfoEnabled()) { - log.info(String.format("comboBox [%s-%s] : %d", dtoClass.getSimpleName(), propertyName, data.size())); - } + log.debug(String.format("comboBox [%s-%s] : %d", dtoClass.getSimpleName(), propertyName, data.size())); comboBox.setData(data); @@ -1070,9 +1036,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U if (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)); - } + log.debug(String.format("Skip loading of comboBox [%s-%s] (listNoLoad property found or form is null)", dtoClass.getSimpleName(), propertyName)); data = Collections.emptyList(); } else { @@ -1090,9 +1054,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U } - if (log.isInfoEnabled()) { - log.info(String.format("entity comboBox [%s-%s] : %d", dtoClass.getSimpleName(), propertyName, data.size())); - } + log.debug(String.format("entity comboBox [%s-%s] : %d", dtoClass.getSimpleName(), propertyName, data.size())); comboBox.setData(data); } ===================================== application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java ===================================== --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java @@ -119,7 +119,7 @@ import static org.nuiton.i18n.I18n.t; /** * To initialize ui. - * + * <p> * Created on 9/26/14. * * @author Tony Chemit - dev@tchemit.fr @@ -207,10 +207,6 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> public void initUI() { - if (log.isDebugEnabled()) { - log.debug("ui " + getClass()); - } - ObserveActionMap actionMap = ObserveSwingApplicationContext.get().getActionMap(); InputMap inputMap = ObserveSwingApplicationContext.get().getMainUI().getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); // initialisation des éditeurs @@ -428,9 +424,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> beanList.setI18nPrefix("observe.common."); - if (log.isInfoEnabled()) { - log.info("init list for " + beanList.getBeanType()); - } + log.debug("init list for " + beanList.getBeanType()); Class dtoClass = getDtoClass(beanList); @@ -448,9 +442,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> beanList.getAddButton().setFocusable(false); beanList.getRemoveButton().setFocusable(false); - if (log.isInfoEnabled()) { - log.info("init list for " + beanList.getBeanType()); - } + log.debug("init list for " + beanList.getBeanType()); Class dtoClass = getDtoClass(beanList); @@ -463,9 +455,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> } protected void init(TimeEditor editor) { - if (log.isDebugEnabled()) { - log.debug("init time editor " + editor.getName()); - } + log.debug("init time editor " + editor.getName()); editor.init(); if (isAutoSelectOnFocus(editor)) { @@ -476,9 +466,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> } protected void init(DateTimeEditor editor) { - if (log.isDebugEnabled()) { - log.debug("init date time editor " + editor.getName()); - } + log.debug("init date time editor " + editor.getName()); editor.init(); editor.getSliderHidor().setFocusable(false); if (isAutoSelectOnFocus(editor)) { @@ -500,9 +488,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> Object oldValue = UIHelper.getProperty(editor.getModel().getBean(), editor.getModel().getPropertyDayDate()); if (!Objects.equals(oldValue, newDate)) { editor.getDayDateEditor().commitEdit(); - if (log.isInfoEnabled()) { - log.info("quit date editor, commit value: " + source.getValue()); - } + log.debug("quit date editor, commit value: " + source.getValue()); } } catch (ParseException e1) { // l'édition est valide donc pas de problème ici @@ -520,9 +506,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> } protected void init(CoordinatesEditor editor) { - if (log.isDebugEnabled()) { - log.debug("init coordinates editor " + editor.getName()); - } + log.debug("init coordinates editor " + editor.getName()); editor.setFormat(ObserveSwingApplicationContext.get().getConfig().getCoordinateFormat()); editor.init(); editor.getDmdFormat().setFocusable(false); @@ -614,9 +598,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> } protected void init(BooleanEditor editor) { - if (log.isDebugEnabled()) { - log.debug("init boolean editor " + editor.getName()); - } + log.debug("init boolean editor " + editor.getName()); final String propertyName = (String) editor.getClientProperty(CLIENT_PROPERTY_PROPERTY_NAME); if (propertyName != null) { editor.addItemListener(event -> { @@ -647,9 +629,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> } protected void init(JCheckBox editor) { - if (log.isDebugEnabled()) { - log.debug("init simple boolean editor " + editor.getName()); - } + log.debug("init simple boolean editor " + editor.getName()); final String propertyName = (String) editor.getClientProperty(CLIENT_PROPERTY_PROPERTY_NAME); if (propertyName != null) { editor.addItemListener(event -> { @@ -661,9 +641,8 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> protected void init(JXDatePicker picker) { - if (log.isDebugEnabled()) { - log.debug("init JXDatePicker editor" + picker.getName()); - }picker.setLocale(ObserveSwingApplicationContext.get().getConfig().getLocale()); + log.debug("init JXDatePicker editor" + picker.getName()); + picker.setLocale(ObserveSwingApplicationContext.get().getConfig().getLocale()); JFormattedTextField editor = picker.getEditor(); editor.setEditable(true); JXMonthView monthView = new JXMonthView(); @@ -695,9 +674,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> if (source.isEditValid()) { try { picker.commitEdit(); - if (log.isInfoEnabled()) { - log.info("quit date editor, commit value: " + source.getValue()); - } + log.debug("quit date editor, commit value: " + source.getValue()); } catch (ParseException e1) { // l'édition est valide donc pas de problème ici } @@ -708,9 +685,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> } protected <B extends Enum<B>> void init(EnumEditor<B> editor) { - if (log.isDebugEnabled()) { - log.debug("init enumEditor editor " + editor.getName()); - } + log.debug("init enumEditor editor " + editor.getName()); ImmutableMap.Builder<B, String> labelsBuilder = ImmutableMap.builder(); for (B e : EnumSet.allOf(editor.getType())) { String label = I18nEnumHelper.getLabel(e); @@ -748,9 +723,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> protected <D extends DataDto> void prepareDataFilterableDoubleList(Class<D> dtoClass, FilterableDoubleList<DataReference<D>> list) { DataReferenceDecorator<D> decorator = decoratorService.getDataReferenceDecorator(dtoClass); - if (log.isDebugEnabled()) { - log.debug("Will use decorator " + decorator); - } + log.debug("Will use decorator " + decorator); String entityLabel = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoClass)); list.getPopupSortLabel().setText(t("observe.content.type.data", entityLabel)); @@ -777,9 +750,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> protected <D extends ReferentialDto> void prepareReferentialFilterableDoubleList(Class<D> dtoClass, FilterableDoubleList<ReferentialReference<D>> list) { ReferentialReferenceDecorator<D> decorator = decoratorService.getReferentialReferenceDecorator(dtoClass); - if (log.isDebugEnabled()) { - log.debug("Will use decorator " + decorator); - } + log.debug("Will use decorator " + decorator); String entityLabel = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoClass)); list.getPopupSortLabel().setText(t("observe.content.type.referential", entityLabel)); @@ -806,9 +777,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> protected <D extends DataDto> void prepareDataEntityList(Class<D> dtoClass, BeanListHeader<DataReference<D>> list) { DataReferenceDecorator<D> decorator = decoratorService.getDataReferenceDecorator(dtoClass); - if (log.isDebugEnabled()) { - log.debug("Will use decorator " + decorator); - } + log.debug("Will use decorator " + decorator); String entityLabel = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoClass)); list.setPopupTitleText(t("observe.content.type.data", entityLabel)); @@ -833,9 +802,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> protected <D extends ReferentialDto> void prepareReferentialEntityList(Class<D> dtoClass, BeanListHeader<ReferentialReference<D>> list) { ReferentialReferenceDecorator<D> decorator = decoratorService.getReferentialReferenceDecorator(dtoClass); - if (log.isDebugEnabled()) { - log.debug("Will use decorator " + decorator); - } + log.debug("Will use decorator " + decorator); String entityLabel = t(ObserveI18nDecoratorHelper.getTypeI18nKey(dtoClass)); list.setPopupTitleText(t("observe.content.type.referential", entityLabel)); @@ -869,9 +836,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> ListCellRenderer<DataReference<D>> toolTipRenderer = new ComboBoxListCellRenderer<>(combobox.getRenderer()); combobox.setRenderer(toolTipRenderer); - if (log.isDebugEnabled()) { - log.debug("combo list [" + dtoClass.getName() + "] : " + comboBox.getData().size()); - } + log.debug("combo list [" + dtoClass.getName() + "] : " + comboBox.getData().size()); } @@ -894,9 +859,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> ListCellRenderer<ReferentialReference<D>> toolTipRenderer = new ComboBoxListCellRenderer<>(combobox.getRenderer()); combobox.setRenderer(toolTipRenderer); - if (log.isDebugEnabled()) { - log.debug("combo list [" + dtoClass.getName() + "] : " + comboBox.getData().size()); - } + log.debug("combo list [" + dtoClass.getName() + "] : " + comboBox.getData().size()); } ===================================== pom.xml ===================================== --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>io.ultreia.maven</groupId> <artifactId>pom</artifactId> - <version>15-SNAPSHOT</version> + <version>15</version> </parent> <groupId>fr.ird.observe</groupId> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/f3212497b06c7b4b9ab8c922f8d3... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/f3212497b06c7b4b9ab8c922f8d3... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT