Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
6e5f9f03
by Tony CHEMIT at 2018-09-19T06:12:41Z
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:
| ... | ... | @@ -407,12 +407,14 @@ public class ContentReferenceUIHandler<D extends ReferentialDto, R extends Refer |
| 407 | 407 |
|
| 408 | 408 |
UsageForDisplayUI<R> usagesUI = UsageForDisplayUI.build(message, usages);
|
| 409 | 409 |
|
| 410 |
- UIHelper.askUser(ui,
|
|
| 411 |
- t("observe.title.show.usage"),
|
|
| 412 |
- usagesUI,
|
|
| 413 |
- JOptionPane.INFORMATION_MESSAGE,
|
|
| 414 |
- new Object[]{t("observe.choice.quit")},
|
|
| 415 |
- 0);
|
|
| 410 |
+ Object[] options = {
|
|
| 411 |
+ t("observe.choice.quit")};
|
|
| 412 |
+ JOptionPane pane = new JOptionPane(usagesUI, JOptionPane.INFORMATION_MESSAGE,
|
|
| 413 |
+ JOptionPane.DEFAULT_OPTION, null,
|
|
| 414 |
+ options, options[0]);
|
|
| 415 |
+ |
|
| 416 |
+ UIHelper.askUser(pane, t("observe.title.show.usage"), options);
|
|
| 417 |
+ |
|
| 416 | 418 |
}
|
| 417 | 419 |
|
| 418 | 420 |
@Override
|
| ... | ... | @@ -66,8 +66,16 @@ protected void finalize() throws Throwable { |
| 66 | 66 |
<JLabel text="observe.message.show.usage.for.delete3"/>
|
| 67 | 67 |
</JPanel>
|
| 68 | 68 |
|
| 69 |
- <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' constraints="BorderLayout.CENTER"
|
|
| 70 |
- layout="{new GridLayout(0, 1)}"/>
|
|
| 69 |
+ <Table fill="both" constraints="BorderLayout.CENTER">
|
|
| 70 |
+ <row>
|
|
| 71 |
+ <cell weighty="1" weightx="1">
|
|
| 72 |
+ <JScrollPane verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
|
|
| 73 |
+ <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}'
|
|
| 74 |
+ layout="{new GridLayout(0, 1)}"/>
|
|
| 75 |
+ </JScrollPane>
|
|
| 76 |
+ </cell>
|
|
| 77 |
+ </row>
|
|
| 78 |
+ </Table>
|
|
| 71 | 79 |
|
| 72 | 80 |
<JPanel id="replacePanel" border='{new TitledBorder(t("observe.usage.replaceTitle"))}'
|
| 73 | 81 |
constraints="BorderLayout.SOUTH" layout="{new GridLayout(0, 1)}">
|
| ... | ... | @@ -66,8 +66,16 @@ protected void finalize() throws Throwable { |
| 66 | 66 |
<JLabel text="observe.message.show.usage.for.desactivated3"/>
|
| 67 | 67 |
</JPanel>
|
| 68 | 68 |
|
| 69 |
- <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' constraints="BorderLayout.CENTER"
|
|
| 70 |
- layout="{new GridLayout(0, 1)}"/>
|
|
| 69 |
+ <Table fill="both" constraints="BorderLayout.CENTER">
|
|
| 70 |
+ <row>
|
|
| 71 |
+ <cell weighty="1" weightx="1">
|
|
| 72 |
+ <JScrollPane verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
|
|
| 73 |
+ <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}'
|
|
| 74 |
+ layout="{new GridLayout(0, 1)}"/>
|
|
| 75 |
+ </JScrollPane>
|
|
| 76 |
+ </cell>
|
|
| 77 |
+ </row>
|
|
| 78 |
+ </Table>
|
|
| 71 | 79 |
|
| 72 | 80 |
<JPanel id="replacePanel"
|
| 73 | 81 |
constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}">
|
| ... | ... | @@ -56,7 +56,15 @@ protected void finalize() throws Throwable { |
| 56 | 56 |
|
| 57 | 57 |
<JLabel id="message" constraints="BorderLayout.NORTH"/>
|
| 58 | 58 |
|
| 59 |
- <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}' constraints="BorderLayout.CENTER"
|
|
| 60 |
- layout="{new GridLayout(0, 1)}"/>
|
|
| 59 |
+ <Table fill="both" constraints="BorderLayout.CENTER">
|
|
| 60 |
+ <row>
|
|
| 61 |
+ <cell weighty="1" weightx="1">
|
|
| 62 |
+ <JScrollPane verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
|
|
| 63 |
+ <JPanel id="usages" border='{new TitledBorder(t("observe.usage.usageTitle"))}'
|
|
| 64 |
+ layout="{new GridLayout(0, 1)}"/>
|
|
| 65 |
+ </JScrollPane>
|
|
| 66 |
+ </cell>
|
|
| 67 |
+ </row>
|
|
| 68 |
+ </Table>
|
|
| 61 | 69 |
|
| 62 | 70 |
</JPanel>
|
| ... | ... | @@ -37,8 +37,8 @@ import fr.ird.observe.dto.reference.ReferentialDtoReference; |
| 37 | 37 |
import fr.ird.observe.services.security.InvalidAuthenticationTokenException;
|
| 38 | 38 |
import org.apache.commons.beanutils.PropertyUtils;
|
| 39 | 39 |
import org.apache.commons.io.FileUtils;
|
| 40 |
-import org.apache.logging.log4j.Logger;
|
|
| 41 | 40 |
import org.apache.logging.log4j.LogManager;
|
| 41 |
+import org.apache.logging.log4j.Logger;
|
|
| 42 | 42 |
import org.jdesktop.swingx.painter.Painter;
|
| 43 | 43 |
import org.nuiton.decorator.Decorator;
|
| 44 | 44 |
import org.nuiton.jaxx.runtime.JAXXObject;
|
| ... | ... | @@ -185,10 +185,9 @@ public class UIHelper extends SwingUtil { |
| 185 | 185 |
|
| 186 | 186 |
contentPane.setLayout(new BorderLayout());
|
| 187 | 187 |
contentPane.add(pane, BorderLayout.CENTER);
|
| 188 |
- dialog.setResizable(false);
|
|
| 189 | 188 |
|
| 190 | 189 |
dialog.pack();
|
| 191 |
- dialog.setLocationRelativeTo(mainUI);
|
|
| 190 |
+ SwingUtil.center(mainUI, dialog);
|
|
| 192 | 191 |
|
| 193 | 192 |
final PropertyChangeListener listener = event -> {
|
| 194 | 193 |
// Let the defaultCloseOperation handle the closing
|