Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: 6e5f9f03 by Tony CHEMIT at 2018-09-19T06:12:41Z L'UI de remplacement de code de référentiel dépasse parfois les limites de l'écran - Closes #1059 - - - - - 5 changed files: - client/src/main/java/fr/ird/observe/client/ui/content/ref/ContentReferenceUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/util/UIHelper.java Changes: ===================================== client/src/main/java/fr/ird/observe/client/ui/content/ref/ContentReferenceUIHandler.java ===================================== @@ -407,12 +407,14 @@ public class ContentReferenceUIHandler<D extends ReferentialDto, R extends Refer UsageForDisplayUI<R> usagesUI = UsageForDisplayUI.build(message, usages); - UIHelper.askUser(ui, - t("observe.title.show.usage"), - usagesUI, - JOptionPane.INFORMATION_MESSAGE, - new Object[]{t("observe.choice.quit")}, - 0); + Object[] options = { + t("observe.choice.quit")}; + JOptionPane pane = new JOptionPane(usagesUI, JOptionPane.INFORMATION_MESSAGE, + JOptionPane.DEFAULT_OPTION, null, + options, options[0]); + + UIHelper.askUser(pane, t("observe.title.show.usage"), options); + } @Override ===================================== client/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDeleteUI.jaxx ===================================== @@ -66,8 +66,16 @@ protected void finalize() throws Throwable { <JLabel text="observe.message.show.usage.for.delete3"/> </JPanel> - <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' constraints="BorderLayout.CENTER" - layout="{new GridLayout(0, 1)}"/> + <Table fill="both" constraints="BorderLayout.CENTER"> + <row> + <cell weighty="1" weightx="1"> + <JScrollPane verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> + <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' + layout="{new GridLayout(0, 1)}"/> + </JScrollPane> + </cell> + </row> + </Table> <JPanel id="replacePanel" border='{new TitledBorder(t("observe.usage.replaceTitle"))}' constraints="BorderLayout.SOUTH" layout="{new GridLayout(0, 1)}"> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDesactivateUI.jaxx ===================================== @@ -66,8 +66,16 @@ protected void finalize() throws Throwable { <JLabel text="observe.message.show.usage.for.desactivated3"/> </JPanel> - <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' constraints="BorderLayout.CENTER" - layout="{new GridLayout(0, 1)}"/> + <Table fill="both" constraints="BorderLayout.CENTER"> + <row> + <cell weighty="1" weightx="1"> + <JScrollPane verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> + <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' + layout="{new GridLayout(0, 1)}"/> + </JScrollPane> + </cell> + </row> + </Table> <JPanel id="replacePanel" constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}"> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/ref/usage/UsageForDisplayUI.jaxx ===================================== @@ -56,7 +56,15 @@ protected void finalize() throws Throwable { <JLabel id="message" constraints="BorderLayout.NORTH"/> - <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' constraints="BorderLayout.CENTER" - layout="{new GridLayout(0, 1)}"/> + <Table fill="both" constraints="BorderLayout.CENTER"> + <row> + <cell weighty="1" weightx="1"> + <JScrollPane verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> + <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' + layout="{new GridLayout(0, 1)}"/> + </JScrollPane> + </cell> + </row> + </Table> </JPanel> ===================================== client/src/main/java/fr/ird/observe/client/ui/util/UIHelper.java ===================================== @@ -37,8 +37,8 @@ import fr.ird.observe.dto.reference.ReferentialDtoReference; import fr.ird.observe.services.security.InvalidAuthenticationTokenException; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.io.FileUtils; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.jdesktop.swingx.painter.Painter; import org.nuiton.decorator.Decorator; import org.nuiton.jaxx.runtime.JAXXObject; @@ -185,10 +185,9 @@ public class UIHelper extends SwingUtil { contentPane.setLayout(new BorderLayout()); contentPane.add(pane, BorderLayout.CENTER); - dialog.setResizable(false); dialog.pack(); - dialog.setLocationRelativeTo(mainUI); + SwingUtil.center(mainUI, dialog); final PropertyChangeListener listener = event -> { // Let the defaultCloseOperation handle the closing View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/6e5f9f038c1654a674819b3b62b5... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/6e5f9f038c1654a674819b3b62b5... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT