Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
9fe481cc
by Tony Chemit at 2022-02-15T05:25:32+01:00
-
ba6e0abe
by Tony Chemit at 2022-02-15T05:25:32+01:00
-
b22d6eb2
by Tony Chemit at 2022-02-15T05:25:32+01:00
-
17c59e20
by Tony Chemit at 2022-02-15T05:25:32+01:00
30 changed files:
- client/core/src/main/i18n/getters/java.getter
- client/core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java
- client/datasource/actions/src/main/i18n/getters/java.getter
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/ObserveKeyStrokesActions.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/SelectDataModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/SelectDataUIHandler.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/tree/DataSelectionTreePane.jaxx
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/tree/DataSelectionTreePaneHandler.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/DataSourceEditorHandler.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/ObserveKeyStrokesEditorApi.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/config/TreeConfigUIHandler.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/config/actions/ApplyNavigationConfiguration.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/mode/ChangeModeExecutor.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/NavigationTree.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/NavigationTreeModel.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/actions/ShowConfigure.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/tree/select/SelectNodesByModel.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/tree/select/SelectNodesByModelNode.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/selection/SelectionTreePane.jaxx
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/selection/SelectionTreePane.jcss
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/selection/SelectionTreePaneHandler.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/selection/actions/ShowConfigurePanel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/tree/actions/ShowInformation.java → client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/selection/actions/ShowInformationPanel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/tree/actions/ToggleMenu.java → client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/selection/actions/ToggleMenu.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/wizard/actions/Cancel.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/wizard/tabs/SelectDataUIHandler.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/RouteCloseCallback.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/tree/actions/ShowConfigure.java → core/persistence/java/src/main/java/fr/ird/observe/entities/AbstractObserveTopiaDao.java
- model/src/main/models/Observe/persistence/00-common.model
- pom.xml
Changes:
| ... | ... | @@ -165,6 +165,8 @@ observe.ui.datasource.storage.remote.useSll |
| 165 | 165 | observe.ui.datasource.storage.remoteConfiguration.presets
|
| 166 | 166 | observe.ui.datasource.storage.remoteConfiguration.presets.save
|
| 167 | 167 | observe.ui.datasource.storage.server.dataBase
|
| 168 | +observe.ui.datasource.storage.server.dataBase.name
|
|
| 169 | +observe.ui.datasource.storage.server.default.dataBase
|
|
| 168 | 170 | observe.ui.datasource.storage.serverConfiguration.presets
|
| 169 | 171 | observe.ui.error.hide.error
|
| 170 | 172 | observe.ui.error.show.error
|
| ... | ... | @@ -48,6 +48,7 @@ import fr.ird.observe.dto.db.configuration.ObserveDataSourceConfigurationAndConn |
| 48 | 48 | import fr.ird.observe.dto.db.configuration.ObserveDataSourceConfigurationAndConnectionDto;
|
| 49 | 49 | import fr.ird.observe.dto.db.configuration.ObserveDataSourceConnection;
|
| 50 | 50 | import fr.ird.observe.dto.db.configuration.ObserveDataSourceInformation;
|
| 51 | +import fr.ird.observe.dto.db.configuration.rest.ObserveDataSourceConfigurationRest;
|
|
| 51 | 52 | import fr.ird.observe.dto.db.configuration.topia.ObserveDataSourceConfigurationTopiaH2;
|
| 52 | 53 | import fr.ird.observe.dto.db.configuration.topia.ObserveDataSourceConfigurationTopiaPG;
|
| 53 | 54 | import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
| ... | ... | @@ -93,6 +94,7 @@ import java.util.Date; |
| 93 | 94 | import java.util.Iterator;
|
| 94 | 95 | import java.util.Map;
|
| 95 | 96 | import java.util.Objects;
|
| 97 | +import java.util.Optional;
|
|
| 96 | 98 | import java.util.Set;
|
| 97 | 99 | import java.util.TreeMap;
|
| 98 | 100 | import java.util.TreeSet;
|
| ... | ... | @@ -645,4 +647,24 @@ public class ObserveSwingDataSource extends AbstractJavaBean implements ObserveS |
| 645 | 647 | }
|
| 646 | 648 | }
|
| 647 | 649 | |
| 650 | + public String getLabelWithUrl() {
|
|
| 651 | + String txt;
|
|
| 652 | + switch (getConfiguration().getConnectMode()) {
|
|
| 653 | + case LOCAL:
|
|
| 654 | + return getLabel();
|
|
| 655 | + case SERVER: {
|
|
| 656 | + txt = getConfiguration().getUrl();
|
|
| 657 | + ObserveDataSourceConfigurationRest configuration = (ObserveDataSourceConfigurationRest) getConfiguration();
|
|
| 658 | + Optional<String> optionalDatabaseName = Optional.ofNullable(configuration.getDatabaseName());
|
|
| 659 | + txt += " - " + t("observe.ui.datasource.storage.server.dataBase.name") + " " + (optionalDatabaseName.orElse(t("observe.ui.datasource.storage.server.default.dataBase")));
|
|
| 660 | + }
|
|
| 661 | + break;
|
|
| 662 | + case REMOTE:
|
|
| 663 | + txt = getConfiguration().getUrl();
|
|
| 664 | + break;
|
|
| 665 | + default:
|
|
| 666 | + throw new IllegalStateException(String.format("Can't have a such mode: %s", getConfiguration().getConnectMode()));
|
|
| 667 | + }
|
|
| 668 | + return String.format("%s (%s)", getLabel(), txt);
|
|
| 669 | + }
|
|
| 648 | 670 | } |
| ... | ... | @@ -23,8 +23,6 @@ observe.ui.action.goto.next.stage |
| 23 | 23 | observe.ui.action.goto.next.stage.tip
|
| 24 | 24 | observe.ui.action.goto.previous.stage
|
| 25 | 25 | observe.ui.action.goto.previous.stage.tip
|
| 26 | -observe.ui.action.info.configure
|
|
| 27 | -observe.ui.action.info.storage
|
|
| 28 | 26 | observe.ui.action.info.storage.tip
|
| 29 | 27 | observe.ui.choice.cancel
|
| 30 | 28 | observe.ui.choice.replace
|
| ... | ... | @@ -179,7 +177,6 @@ observe.ui.title.choose.db.dump.directory |
| 179 | 177 | observe.ui.title.choose.reportFile
|
| 180 | 178 | observe.ui.title.storage.info
|
| 181 | 179 | observe.ui.tree.action.collapseAll.tip
|
| 182 | -observe.ui.tree.action.configure.tip
|
|
| 183 | 180 | observe.ui.tree.action.expandAll.tip
|
| 184 | 181 | observe.ui.tree.action.selectAll.tip
|
| 185 | 182 | observe.ui.tree.action.unselectAll.tip |
| ... | ... | @@ -34,17 +34,9 @@ import javax.swing.KeyStroke; |
| 34 | 34 | */
|
| 35 | 35 | public class ObserveKeyStrokesActions extends ObserveKeyStrokesEditorApi {
|
| 36 | 36 | |
| 37 | - public static final KeyStroke KEY_STROKE_STORAGE_MENU_LEFT = KeyStroke.getKeyStroke("pressed F1");
|
|
| 38 | - public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_LEFT = KeyStroke.getKeyStroke("pressed F2");
|
|
| 39 | - |
|
| 40 | - public static final KeyStroke KEY_STROKE_STORAGE_MENU_RIGHT = KeyStroke.getKeyStroke("pressed F6");
|
|
| 41 | - public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_RIGHT = KeyStroke.getKeyStroke("pressed F7");
|
|
| 42 | - |
|
| 43 | - public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_INFO_LEFT = KeyStroke.getKeyStroke("pressed F3");
|
|
| 44 | 37 | public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_COPY_LEFT = KeyStroke.getKeyStroke("pressed F4");
|
| 45 | 38 | public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_DELETE_LEFT = KeyStroke.getKeyStroke("pressed F5");
|
| 46 | 39 | |
| 47 | - public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_INFO_RIGHT = KeyStroke.getKeyStroke("pressed F8");
|
|
| 48 | 40 | public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_COPY_RIGHT = KeyStroke.getKeyStroke("pressed F9");
|
| 49 | 41 | public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_DELETE_RIGHT = KeyStroke.getKeyStroke("pressed F10");
|
| 50 | 42 |
| ... | ... | @@ -27,6 +27,8 @@ import fr.ird.observe.client.datasource.actions.AdminStep; |
| 27 | 27 | import fr.ird.observe.client.datasource.actions.AdminUIModel;
|
| 28 | 28 | import fr.ird.observe.client.datasource.actions.validate.ValidateModel;
|
| 29 | 29 | import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
|
| 30 | +import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePane;
|
|
| 31 | +import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePaneHandler;
|
|
| 30 | 32 | import fr.ird.observe.navigation.tree.selection.SelectionTreeConfig;
|
| 31 | 33 | import fr.ird.observe.navigation.tree.selection.SelectionTreeModel;
|
| 32 | 34 | import org.apache.logging.log4j.LogManager;
|
| ... | ... | @@ -102,7 +104,7 @@ public class SelectDataModel extends AdminActionModel { |
| 102 | 104 | this.selectionDataModel = selectionDataModel;
|
| 103 | 105 | }
|
| 104 | 106 | |
| 105 | - public boolean initSelectionModel(AdminUIModel uiModel, boolean init) {
|
|
| 107 | + public boolean initSelectionModel(SelectionTreePane selectTreePane, AdminUIModel uiModel, boolean init) {
|
|
| 106 | 108 | boolean selectAllData = true;
|
| 107 | 109 | boolean loadData = true;
|
| 108 | 110 | boolean loadReferential = true;
|
| ... | ... | @@ -162,7 +164,7 @@ public class SelectDataModel extends AdminActionModel { |
| 162 | 164 | config.setLoadReferential(loadReferential);
|
| 163 | 165 | config.setUseOpenData(useOpenData);
|
| 164 | 166 | }
|
| 165 | - |
|
| 167 | + SelectionTreePaneHandler.initDataSource(selectTreePane, dataSource);
|
|
| 166 | 168 | selectionDataModel.populate(dataSource.getNavigationService()::loadSelectionRoot);
|
| 167 | 169 | if (uiModel.containsOperation(AdminStep.EXPORT_DATA)) {
|
| 168 | 170 | ObserveSwingDataSource safeCentralSource = uiModel.getConfigModel().getRightSourceModel().getSafeSource(true);
|
| ... | ... | @@ -27,16 +27,14 @@ import fr.ird.observe.client.datasource.actions.AdminTabUIHandler; |
| 27 | 27 | import fr.ird.observe.client.datasource.actions.AdminUIModel;
|
| 28 | 28 | import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUI;
|
| 29 | 29 | import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUIHandler;
|
| 30 | -import fr.ird.observe.client.datasource.editor.api.config.actions.ApplySelectionConfiguration;
|
|
| 30 | +import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePaneHandler;
|
|
| 31 | 31 | import fr.ird.observe.client.datasource.editor.api.selection.actions.SelectUnselect;
|
| 32 | -import fr.ird.observe.client.datasource.editor.api.selection.actions.ShowConfigurePanel;
|
|
| 33 | 32 | import fr.ird.observe.client.util.UIHelper;
|
| 34 | 33 | import fr.ird.observe.navigation.tree.selection.SelectionTree;
|
| 35 | 34 | import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 36 | 35 | import org.nuiton.jaxx.runtime.swing.SwingUtil;
|
| 37 | 36 | import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| 38 | 37 | |
| 39 | -import javax.swing.JToggleButton;
|
|
| 40 | 38 | import javax.swing.SwingUtilities;
|
| 41 | 39 | import java.awt.GridBagConstraints;
|
| 42 | 40 | import java.awt.Insets;
|
| ... | ... | @@ -62,7 +60,7 @@ public class SelectDataUIHandler extends AdminTabUIHandler<SelectDataUI> impleme |
| 62 | 60 | SelectionTree selectTree = ui.getSelectTreePane().getTree();
|
| 63 | 61 | selectTree.clearSelection();
|
| 64 | 62 | }
|
| 65 | - boolean isLocal = ui.getModel().getSelectDataModel().initSelectionModel(model, init);
|
|
| 63 | + boolean isLocal = ui.getModel().getSelectDataModel().initSelectionModel(ui.getSelectTreePane(),model, init);
|
|
| 66 | 64 | SelectionTree tree = ui.getSelectTreePane().getTree();
|
| 67 | 65 | if (tree.getModel().isNotEmpty()) {
|
| 68 | 66 | tree.setSelectionRow(0);
|
| ... | ... | @@ -76,7 +74,7 @@ public class SelectDataUIHandler extends AdminTabUIHandler<SelectDataUI> impleme |
| 76 | 74 | @Override
|
| 77 | 75 | public void registerActions(SelectDataUI ui) {
|
| 78 | 76 | SelectUnselect.installUI(ui.getSelectTreePane());
|
| 79 | - Consumer<TreeConfigUI> consumer = u -> {
|
|
| 77 | + Consumer<TreeConfigUI> init = u -> {
|
|
| 80 | 78 | if (u.getBean().isLoadData()) {
|
| 81 | 79 | TreeConfigUIHandler.hideOptions(u);
|
| 82 | 80 | } else {
|
| ... | ... | @@ -85,10 +83,7 @@ public class SelectDataUIHandler extends AdminTabUIHandler<SelectDataUI> impleme |
| 85 | 83 | }
|
| 86 | 84 | };
|
| 87 | 85 | Consumer<TreeConfigUI> apply = u -> loadSelectData(ui);
|
| 88 | - JToggleButton showConfigure = ui.getSelectTreePane().getShowConfigure();
|
|
| 89 | - showConfigure.putClientProperty(ShowConfigurePanel.UI_CONSUMER, consumer);
|
|
| 90 | - showConfigure.putClientProperty(ApplySelectionConfiguration.APPLY_CONSUMER, apply);
|
|
| 91 | - ShowConfigurePanel.init(ui.getSelectTreePane(), showConfigure, new ShowConfigurePanel());
|
|
| 86 | + SelectionTreePaneHandler.init(ui.getSelectTreePane(), init, apply);
|
|
| 92 | 87 | }
|
| 93 | 88 | |
| 94 | 89 | @Override
|
| ... | ... | @@ -17,12 +17,12 @@ |
| 17 | 17 | <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 18 | 18 | #L%
|
| 19 | 19 | -->
|
| 20 | -<org.jdesktop.swingx.JXTitledPanel id='topPanel' contentContainer='{tree}' leftDecoration='{dataSourceToolbar}'>
|
|
| 21 | - <!-- rightDecoration='{middleActions}' decorator='boxed'>-->
|
|
| 22 | - <import>
|
|
| 23 | - fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePane
|
|
| 24 | - </import>
|
|
| 25 | - <script><![CDATA[
|
|
| 20 | +<JPanel id='topPanel' layout="{new BorderLayout()}">
|
|
| 21 | + <import>
|
|
| 22 | + fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePane
|
|
| 23 | + </import>
|
|
| 24 | + <script><![CDATA[
|
|
| 25 | + |
|
| 26 | 26 | public boolean isLeft() {
|
| 27 | 27 | return !isRight();
|
| 28 | 28 | }
|
| ... | ... | @@ -30,20 +30,11 @@ public boolean isRight() { |
| 30 | 30 | return Boolean.TRUE.equals(getOpposite());
|
| 31 | 31 | }
|
| 32 | 32 | ]]>
|
| 33 | - </script>
|
|
| 34 | - <Boolean id='opposite' initializer='getContextValue(Boolean.class)'/>
|
|
| 35 | - <JPopupMenu id='menuPopup'>
|
|
| 36 | - <JMenuItem id='showConfigure'/>
|
|
| 37 | - <JMenuItem id='showInformation'/>
|
|
| 38 | - </JPopupMenu>
|
|
| 39 | - <JToolBar id='dataSourceToolbar'>
|
|
| 40 | - <JToggleButton id='toggleMenu'/>
|
|
| 41 | - <JLabel id="label"/>
|
|
| 42 | - </JToolBar>
|
|
| 43 | - <SelectionTreePane id='tree' constructorParams="isRight()"/>
|
|
| 44 | - <JToolBar id="middleActions">
|
|
| 45 | - <JButton id="copy" enabled="false"/>
|
|
| 46 | - <JButton id="delete" enabled="false"/>
|
|
| 47 | - </JToolBar>
|
|
| 48 | - |
|
| 49 | -</org.jdesktop.swingx.JXTitledPanel> |
|
| 33 | + </script>
|
|
| 34 | + <Boolean id='opposite' initializer='getContextValue(Boolean.class)'/>
|
|
| 35 | + <JToolBar id="toolbar">
|
|
| 36 | + <JButton id="copy" enabled="false"/>
|
|
| 37 | + <JButton id="delete" enabled="false"/>
|
|
| 38 | + </JToolBar>
|
|
| 39 | + <SelectionTreePane id='tree' constructorParams="isRight()" constraints='BorderLayout.CENTER'/>
|
|
| 40 | +</JPanel> |
| ... | ... | @@ -30,9 +30,8 @@ import fr.ird.observe.client.datasource.actions.synchronize.data.tree.actions.Re |
| 30 | 30 | import fr.ird.observe.client.datasource.api.data.TaskSide;
|
| 31 | 31 | import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUI;
|
| 32 | 32 | import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUIHandler;
|
| 33 | -import fr.ird.observe.client.datasource.editor.api.config.actions.ApplySelectionConfiguration;
|
|
| 34 | 33 | import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePane;
|
| 35 | -import fr.ird.observe.client.datasource.editor.api.selection.actions.ShowConfigurePanel;
|
|
| 34 | +import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePaneHandler;
|
|
| 36 | 35 | import fr.ird.observe.client.datasource.editor.api.wizard.connexion.DataSourceSelectorModel;
|
| 37 | 36 | import fr.ird.observe.client.util.init.UIInitHelper;
|
| 38 | 37 | import fr.ird.observe.navigation.tree.selection.SelectionTree;
|
| ... | ... | @@ -88,13 +87,14 @@ public class DataSelectionTreePaneHandler implements UIHandler<DataSelectionTree |
| 88 | 87 | |
| 89 | 88 | ui.getDelete().setEnabled(canWriteData);
|
| 90 | 89 | ui.getCopy().setEnabled(oppositeCanWriteData);
|
| 91 | - |
|
| 92 | - String label = sourceModel.getLabel();
|
|
| 93 | - String labelWithUrl = sourceModel.getLabelWithUrl().substring(label.length() + 1);
|
|
| 94 | - JLabel dataSourceInformation = ui.getLabel();
|
|
| 95 | - dataSourceInformation.setIcon(sourceModel.getSource().getIcon());
|
|
| 96 | - dataSourceInformation.setText(sourceModel.getSource().getLabel() + " " + labelWithUrl);
|
|
| 90 | + SelectionTreePaneHandler.initDataSource(ui.getTree(), sourceModel.getSource());
|
|
| 91 | +// String label = sourceModel.getLabel();
|
|
| 92 | +// String labelWithUrl = sourceModel.getLabelWithUrl().substring(label.length() + 1);
|
|
| 93 | + JLabel dataSourceInformation = ui.getTree().getLabel();
|
|
| 94 | +// dataSourceInformation.setIcon(sourceModel.getSource().getIcon());
|
|
| 95 | +// dataSourceInformation.setText(sourceModel.getSource().getLabel() + " " + labelWithUrl);
|
|
| 97 | 96 | dataSourceInformation.setForeground(color);
|
| 97 | +// ui.putClientProperty("$$Label", dataSourceInformation);
|
|
| 98 | 98 | }
|
| 99 | 99 | |
| 100 | 100 | public static void init(DataSelectionTreePane ui) {
|
| ... | ... | @@ -108,7 +108,8 @@ public class DataSelectionTreePaneHandler implements UIHandler<DataSelectionTree |
| 108 | 108 | DataSynchroUI parent = ui.getContextValue(DataSynchroUI.class, AdminTabUIHandler.ADMIN_TAB_UI);
|
| 109 | 109 | DataSynchroModel stepModel = parent.getStepModel();
|
| 110 | 110 | SelectionTreeModel treeModel = tree.getModel();
|
| 111 | - treePane.getRightToolbar().remove(treePane.getShowConfigure());
|
|
| 111 | +// ui.setLeftDecoration(treePane.getRightToolbar());
|
|
| 112 | +// treePane.getRightToolbar().remove(treePane.getShowConfigure());
|
|
| 112 | 113 | treePane.getCollapseAll().setText(null);
|
| 113 | 114 | treePane.getExpandAll().setText(null);
|
| 114 | 115 | treePane.getSelectAll().setText(null);
|
| ... | ... | @@ -119,8 +120,8 @@ public class DataSelectionTreePaneHandler implements UIHandler<DataSelectionTree |
| 119 | 120 | |
| 120 | 121 | Consumer<TreeConfigUI> consumer = TreeConfigUIHandler::hideOptions;
|
| 121 | 122 | Consumer<TreeConfigUI> apply = u -> initPanel(parent, ui);
|
| 122 | - ui.getShowConfigure().putClientProperty(ShowConfigurePanel.UI_CONSUMER, consumer);
|
|
| 123 | - ui.getShowConfigure().putClientProperty(ApplySelectionConfiguration.APPLY_CONSUMER, apply);
|
|
| 123 | + SelectionTreePaneHandler.init(treePane, consumer, apply);
|
|
| 124 | + |
|
| 124 | 125 | if (isLeft) {
|
| 125 | 126 | stepModel.setLeftSelectionDataModel(treeModel);
|
| 126 | 127 | } else {
|
| ... | ... | @@ -155,12 +155,14 @@ public class DataSourceEditorHandler implements UIHandler<DataSourceEditor>, Wit |
| 155 | 155 | public void loadNavigationUI(ProgressionModel progressModel, NavigationNode previousNode) {
|
| 156 | 156 | NavigationUI navigationUI = ui.getNavigationUI();
|
| 157 | 157 | NavigationTree tree = navigationUI.getTree();
|
| 158 | + // need to keep paths now, after populate previous node may be altered
|
|
| 159 | + String[] previousPaths = previousNode == null ? null : previousNode.toPaths();
|
|
| 158 | 160 | tree.populate(null);
|
| 159 | 161 | progressModel.increments();
|
| 160 | 162 | // select initial node
|
| 161 | 163 | if (previousNode != null) {
|
| 162 | 164 | try {
|
| 163 | - tree.reselectInitialNode(previousNode);
|
|
| 165 | + tree.reselectInitialNode(previousPaths);
|
|
| 164 | 166 | } catch (Exception e) {
|
| 165 | 167 | log.error("Could not load previous node", e);
|
| 166 | 168 | previousNode = null;
|
| ... | ... | @@ -34,14 +34,24 @@ import javax.swing.KeyStroke; |
| 34 | 34 | */
|
| 35 | 35 | public class ObserveKeyStrokesEditorApi extends ObserveKeyStrokesSupport {
|
| 36 | 36 | |
| 37 | - //FIXME Let's design a nice new API to register KeyStroke (a new annotation, processed to generate KeyStroke ressource)
|
|
| 37 | + //FIXME Let's design a nice new API to register KeyStroke (a new annotation, processed to generate KeyStroke resources)
|
|
| 38 | 38 | // Navigation
|
| 39 | 39 | |
| 40 | 40 | public static final KeyStroke KEY_STROKE_MAP_CONFIGURE = KeyStroke.getKeyStroke("alt pressed F2");
|
| 41 | 41 | public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE = KeyStroke.getKeyStroke("pressed F12");
|
| 42 | 42 | |
| 43 | - public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_LEFT = KeyStroke.getKeyStroke("pressed F1");
|
|
| 44 | - public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_RIGHT = KeyStroke.getKeyStroke("pressed F10");
|
|
| 43 | +// public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_LEFT = KeyStroke.getKeyStroke("pressed F1");
|
|
| 44 | +// public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_RIGHT = KeyStroke.getKeyStroke("pressed F10");
|
|
| 45 | + |
|
| 46 | + |
|
| 47 | + public static final KeyStroke KEY_STROKE_STORAGE_MENU_LEFT = KeyStroke.getKeyStroke("pressed F1");
|
|
| 48 | + public static final KeyStroke KEY_STROKE_STORAGE_MENU_RIGHT = KeyStroke.getKeyStroke("pressed F6");
|
|
| 49 | + |
|
| 50 | + public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_LEFT = KeyStroke.getKeyStroke("pressed F2");
|
|
| 51 | + public static final KeyStroke KEY_STROKE_NAVIGATION_CONFIGURE_RIGHT = KeyStroke.getKeyStroke("pressed F7");
|
|
| 52 | + |
|
| 53 | + public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_INFO_LEFT = KeyStroke.getKeyStroke("pressed F3");
|
|
| 54 | + public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_INFO_RIGHT = KeyStroke.getKeyStroke("pressed F8");
|
|
| 45 | 55 | |
| 46 | 56 | public static final KeyStroke KEY_STROKE_TOGGLE_LEGEND = KeyStroke.getKeyStroke("pressed F11");
|
| 47 | 57 |
| ... | ... | @@ -91,8 +91,7 @@ public class TreeConfigUIHandler implements UIHandler<TreeConfigUI>, PropertyCha |
| 91 | 91 | }
|
| 92 | 92 | |
| 93 | 93 | public static void showPanel(JComponent editor, TreeConfigUI configUI) {
|
| 94 | - JPopupMenu popup = editor.getComponentPopupMenu();
|
|
| 95 | - configUI.setComponentPopupMenu(popup);
|
|
| 94 | + JPopupMenu popup = Objects.requireNonNull(configUI.getComponentPopupMenu());
|
|
| 96 | 95 | Dimension preferredSize = configUI.getPreferredSize();
|
| 97 | 96 | popup.setMinimumSize(preferredSize);
|
| 98 | 97 | popup.removeAll();
|
| ... | ... | @@ -86,10 +86,11 @@ public class ApplyNavigationConfiguration extends ApplyConfigurationSupport { |
| 86 | 86 | protected void applyConsumer(TreeConfigUI ui) {
|
| 87 | 87 | NavigationTree tree = tree(ui);
|
| 88 | 88 | NavigationNode selectedNode = selectedNode(ui);
|
| 89 | + String[] paths = selectedNode.toPaths();
|
|
| 89 | 90 | try {
|
| 90 | 91 | tree.populate(null);
|
| 91 | 92 | } finally {
|
| 92 | - SwingUtilities.invokeLater(() -> tree.reselectInitialNode(selectedNode));
|
|
| 93 | + SwingUtilities.invokeLater(() -> tree.reselectInitialNode(paths));
|
|
| 93 | 94 | }
|
| 94 | 95 | }
|
| 95 | 96 | } |
| ... | ... | @@ -77,7 +77,7 @@ public class ChangeModeExecutor<U extends ContentUI> { |
| 77 | 77 | String id = request.getSelectedId(ui, selectedNode);
|
| 78 | 78 | log.info(String.format("Will open: %s → (select: %s - edit: %s)", id, selectedNode, editNode));
|
| 79 | 79 | NavigationTree tree = dataSourceEditor.getNavigationUI().getTree();
|
| 80 | - NavigationNode previousOpenedNode = editNode.isEnabled() ? tree.getModel().getNodeFromModelNode(editNode, false) : null;
|
|
| 80 | + NavigationNode previousOpenedNode = editNode.isEnabled() ? tree.getModel().getNodeFromModelNode(editNode) : null;
|
|
| 81 | 81 | ChangeMode.openData(ui.getHandler(), editNode, selectedNode, id);
|
| 82 | 82 | afterOpen(ui, dataSourceEditor, previousOpenedNode, id);
|
| 83 | 83 | } catch (CloseNodeVetoException e1) {
|
| ... | ... | @@ -203,7 +203,7 @@ public class NavigationTree extends JXTree implements WithClientUIContextApi { |
| 203 | 203 | * @param editNode the node to select
|
| 204 | 204 | */
|
| 205 | 205 | public void selectNode(IdNode<?> editNode) {
|
| 206 | - NavigationNode node = getModel().getNodeFromModelNode(editNode, false);
|
|
| 206 | + NavigationNode node = getModel().getNodeFromModelNode(editNode);
|
|
| 207 | 207 | selectNode(node);
|
| 208 | 208 | }
|
| 209 | 209 | |
| ... | ... | @@ -222,10 +222,8 @@ public class NavigationTree extends JXTree implements WithClientUIContextApi { |
| 222 | 222 | /**
|
| 223 | 223 | * Select initial node when data source just opened.
|
| 224 | 224 | */
|
| 225 | - public void reselectInitialNode(NavigationNode selectedNode) {
|
|
| 226 | - //FIXME If on data Find out new groupBy value, go to this node, then do normal search
|
|
| 227 | - //FIXME Otherwise tree will be loaded until matching groupBy value is found
|
|
| 228 | - NavigationNode node = getModel().getNodeFromPath(selectedNode.toPaths(), true);
|
|
| 225 | + public void reselectInitialNode(String[] paths) {
|
|
| 226 | + NavigationNode node = getModel().getNodeFromPath(paths, true);
|
|
| 229 | 227 | if (node == null) {
|
| 230 | 228 | selectInitialNode();
|
| 231 | 229 | } else {
|
| ... | ... | @@ -131,8 +131,8 @@ public class NavigationTreeModel extends DefaultTreeModel implements WithClientU |
| 131 | 131 | return node.orElse(null);
|
| 132 | 132 | }
|
| 133 | 133 | |
| 134 | - public NavigationNode getNodeFromModelNode(IdNode<?> model, boolean checkGroupBy) {
|
|
| 135 | - Optional<NavigationNode> node = new SelectNodesByModelNode(model, checkGroupBy).apply(getRoot());
|
|
| 134 | + public NavigationNode getNodeFromModelNode(IdNode<?> model) {
|
|
| 135 | + Optional<NavigationNode> node = new SelectNodesByModelNode(model).apply(getRoot());
|
|
| 136 | 136 | return node.orElse(null);
|
| 137 | 137 | }
|
| 138 | 138 |
| ... | ... | @@ -59,6 +59,7 @@ public class ShowConfigure extends MenuActionSupport { |
| 59 | 59 | ui.getTree().getModel().getGroupByHelper(),
|
| 60 | 60 | new ApplyNavigationConfiguration(),
|
| 61 | 61 | ui.getTree());
|
| 62 | + configUI.setComponentPopupMenu(ui.getComponentPopupMenu());
|
|
| 62 | 63 | TreeConfigUIHandler.showPanel(ui, configUI);
|
| 63 | 64 | });
|
| 64 | 65 | }
|
| ... | ... | @@ -55,7 +55,7 @@ public class SelectNodesByModel implements SelectNodeStrategy { |
| 55 | 55 | // get all ids from model
|
| 56 | 56 | List<IdNode<?>> nodesWithIds = model.getNodesWithIds();
|
| 57 | 57 | IdNode<?> modelNodeToFind = nodesWithIds.get(nodesWithIds.size() - 1);
|
| 58 | - result = SelectNodesByModelNode.findNode(rootNode, modelNodeToFind, checkGroupBy);
|
|
| 58 | + result = SelectNodesByModelNode.findNode(rootNode, modelNodeToFind);
|
|
| 59 | 59 | }
|
| 60 | 60 | return Optional.ofNullable(result);
|
| 61 | 61 | }
|
| ... | ... | @@ -43,21 +43,17 @@ import java.util.Optional; |
| 43 | 43 | public class SelectNodesByModelNode implements SelectNodeStrategy {
|
| 44 | 44 | |
| 45 | 45 | private final IdNode<?> model;
|
| 46 | - private final boolean checkGroupBy;
|
|
| 47 | 46 | |
| 48 | - public static NavigationNode findNode(RootNavigationNode rootNode, IdNode<?> editNode, boolean checkGroupBy) {
|
|
| 49 | - if (checkGroupBy) {
|
|
| 50 | - // get root edit node
|
|
| 51 | - IdNode<?> root = editNode.getRoot();
|
|
| 52 | - String groupByValue = rootNode.computeGroupByValue(root.getId());
|
|
| 53 | - NavigationNode groupByNode = rootNode.findChildById(groupByValue);
|
|
| 54 | - if (root.equals(editNode)) {
|
|
| 55 | - return groupByNode;
|
|
| 56 | - }
|
|
| 57 | - // start normal search from groupBy node
|
|
| 58 | - return findNode(groupByNode, editNode);
|
|
| 47 | + public static NavigationNode findNode(RootNavigationNode rootNode, IdNode<?> editNode) {
|
|
| 48 | + // get root edit node
|
|
| 49 | + IdNode<?> root = editNode.getRoot();
|
|
| 50 | + String groupByValue = rootNode.computeGroupByValue(root.getId());
|
|
| 51 | + NavigationNode groupByNode = rootNode.findChildById(groupByValue);
|
|
| 52 | + if (root.equals(editNode)) {
|
|
| 53 | + return groupByNode;
|
|
| 59 | 54 | }
|
| 60 | - return findNode(rootNode, editNode);
|
|
| 55 | + // start normal search from groupBy node
|
|
| 56 | + return findNode(groupByNode, editNode);
|
|
| 61 | 57 | }
|
| 62 | 58 | |
| 63 | 59 | public static NavigationNode findNode(NavigationNode source, IdNode<?> editNode) {
|
| ... | ... | @@ -99,16 +95,15 @@ public class SelectNodesByModelNode implements SelectNodeStrategy { |
| 99 | 95 | return null;
|
| 100 | 96 | }
|
| 101 | 97 | |
| 102 | - public SelectNodesByModelNode(IdNode<?> model, boolean checkGroupBy) {
|
|
| 98 | + public SelectNodesByModelNode(IdNode<?> model) {
|
|
| 103 | 99 | this.model = model;
|
| 104 | - this.checkGroupBy = checkGroupBy;
|
|
| 105 | 100 | }
|
| 106 | 101 | |
| 107 | 102 | @Override
|
| 108 | 103 | public Optional<NavigationNode> apply(RootNavigationNode rootNode) {
|
| 109 | 104 | NavigationNode result = null;
|
| 110 | 105 | if (model.isEnabled()) {
|
| 111 | - result = findNode(rootNode, model, checkGroupBy);
|
|
| 106 | + result = findNode(rootNode, model);
|
|
| 112 | 107 | }
|
| 113 | 108 | return Optional.ofNullable(result);
|
| 114 | 109 | }
|
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 18 | 18 | #L%
|
| 19 | 19 | -->
|
| 20 | -<JScrollPane id='treePane' columnHeaderView='{treeHeader}' viewportView="{tree}">
|
|
| 20 | +<org.jdesktop.swingx.JXTitledPanel id='topPanel' contentContainer='{rootTreePane}' leftDecoration="{rightToolbar}" rightDecoration="{toolbar}" >
|
|
| 21 | 21 | <import>
|
| 22 | 22 | fr.ird.observe.client.util.UIHelper
|
| 23 | 23 | fr.ird.observe.navigation.tree.selection.SelectionTree
|
| ... | ... | @@ -37,19 +37,29 @@ public SelectionTreePane(boolean opposite) { |
| 37 | 37 | public boolean isOpposite() { return opposite; }
|
| 38 | 38 | ]]>
|
| 39 | 39 | </script>
|
| 40 | + <JPopupMenu id='menuPopup'>
|
|
| 41 | + <JMenuItem id='showConfigure'/>
|
|
| 42 | + <JMenuItem id='showInformation'/>
|
|
| 43 | + </JPopupMenu>
|
|
| 40 | 44 | <String id='labelText' javaBean='null'/>
|
| 41 | - <SelectionTree id='tree'/>
|
|
| 42 | - <JPanel id="treeHeader" layout='{new BorderLayout()}'>
|
|
| 43 | - <JToolBar id='rightToolbar' constraints='BorderLayout.CENTER'>
|
|
| 44 | - <JToggleButton id='showConfigure'/>
|
|
| 45 | - <JSeparator/>
|
|
| 46 | - <JLabel id="label"/>
|
|
| 47 | - </JToolBar>
|
|
| 48 | - <JToolBar id='toolbar' constraints='BorderLayout.EAST'>
|
|
| 49 | - <JButton id='collapseAll'/>
|
|
| 50 | - <JButton id='expandAll'/>
|
|
| 51 | - <JButton id='selectAll'/>
|
|
| 52 | - <JButton id='unselectAll'/>
|
|
| 53 | - </JToolBar>
|
|
| 45 | + <JToolBar id='rightToolbar'>
|
|
| 46 | + <JToggleButton id='toggleMenu'/>
|
|
| 47 | + <JSeparator orientation='{JSeparator.VERTICAL}'/>
|
|
| 48 | + <JLabel id="label"/>
|
|
| 49 | + </JToolBar>
|
|
| 50 | + <JToolBar id='toolbar'>
|
|
| 51 | + <JSeparator orientation='{JSeparator.VERTICAL}'/>
|
|
| 52 | + <JButton id='collapseAll'/>
|
|
| 53 | + <JButton id='expandAll'/>
|
|
| 54 | + <JButton id='selectAll'/>
|
|
| 55 | + <JButton id='unselectAll'/>
|
|
| 56 | + </JToolBar>
|
|
| 57 | + <JPanel id="rootTreePane" layout="{new BorderLayout()}">
|
|
| 58 | + <JScrollPane id='treePane' viewportView="{tree}" constraints='BorderLayout.CENTER'>
|
|
| 59 | + <SelectionTree id='tree'/>
|
|
| 60 | + </JScrollPane>
|
|
| 61 | + <JPanel id="statusPanel" constraints='BorderLayout.SOUTH'>
|
|
| 62 | + <JLabel id="statusLabel"/>
|
|
| 63 | + </JPanel>
|
|
| 54 | 64 | </JPanel>
|
| 55 | -</JScrollPane> |
|
| 65 | +</org.jdesktop.swingx.JXTitledPanel> |
|
| \ No newline at end of file |
| ... | ... | @@ -24,11 +24,15 @@ |
| 24 | 24 | font-size:11;
|
| 25 | 25 | }
|
| 26 | 26 | |
| 27 | +#toggleMenu {
|
|
| 28 | + inheritsPopupMenu:true;
|
|
| 29 | +}
|
|
| 30 | + |
|
| 27 | 31 | #treePane {
|
| 28 | 32 | verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
|
| 29 | 33 | }
|
| 30 | 34 | |
| 31 | -#label {
|
|
| 35 | +#statusLabel {
|
|
| 32 | 36 | text:{getLabelText()};
|
| 33 | 37 | }
|
| 34 | 38 |
| ... | ... | @@ -22,14 +22,23 @@ package fr.ird.observe.client.datasource.editor.api.selection; |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | +import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
|
|
| 26 | +import fr.ird.observe.client.datasource.api.ObserveSwingDataSourceTemplate;
|
|
| 27 | +import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUI;
|
|
| 28 | +import fr.ird.observe.client.datasource.editor.api.config.actions.ApplySelectionConfiguration;
|
|
| 29 | +import fr.ird.observe.client.datasource.editor.api.selection.actions.ShowConfigurePanel;
|
|
| 30 | +import fr.ird.observe.client.datasource.editor.api.selection.actions.ShowInformationPanel;
|
|
| 25 | 31 | import fr.ird.observe.client.util.init.UIInitHelper;
|
| 26 | 32 | import fr.ird.observe.navigation.tree.selection.SelectionTree;
|
| 27 | 33 | import fr.ird.observe.navigation.tree.selection.SelectionTreeModel;
|
| 28 | 34 | import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 29 | 35 | |
| 36 | +import javax.swing.JLabel;
|
|
| 37 | +import javax.swing.JMenuItem;
|
|
| 30 | 38 | import javax.swing.JPopupMenu;
|
| 31 | 39 | import java.beans.PropertyChangeEvent;
|
| 32 | 40 | import java.beans.PropertyChangeListener;
|
| 41 | +import java.util.function.Consumer;
|
|
| 33 | 42 | |
| 34 | 43 | import static io.ultreia.java4all.i18n.I18n.t;
|
| 35 | 44 | |
| ... | ... | @@ -40,6 +49,21 @@ import static io.ultreia.java4all.i18n.I18n.t; |
| 40 | 49 | public class SelectionTreePaneHandler implements UIHandler<SelectionTreePane>, PropertyChangeListener {
|
| 41 | 50 | private SelectionTreePane ui;
|
| 42 | 51 | |
| 52 | + public static void init(SelectionTreePane ui, Consumer<TreeConfigUI> consumer, Consumer<TreeConfigUI> apply) {
|
|
| 53 | + JMenuItem showConfigure = ui.getShowConfigure();
|
|
| 54 | + showConfigure.putClientProperty(ShowConfigurePanel.UI_CONSUMER, consumer);
|
|
| 55 | + showConfigure.putClientProperty(ApplySelectionConfiguration.APPLY_CONSUMER, apply);
|
|
| 56 | + ShowConfigurePanel.init(ui, showConfigure, new ShowConfigurePanel());
|
|
| 57 | + }
|
|
| 58 | + |
|
| 59 | + public static void initDataSource(SelectionTreePane ui, ObserveSwingDataSource dataSource) {
|
|
| 60 | + String labelWithUrl = dataSource.getLabelWithUrl();
|
|
| 61 | + JLabel dataSourceInformation = ui.getLabel();
|
|
| 62 | + dataSourceInformation.setIcon(dataSource.getIcon());
|
|
| 63 | + dataSourceInformation.setText(labelWithUrl);
|
|
| 64 | + ShowInformationPanel.init(ui, ui.getShowInformation(), new ShowInformationPanel(() -> ObserveSwingDataSourceTemplate.generate(dataSource)));
|
|
| 65 | + }
|
|
| 66 | + |
|
| 43 | 67 | @Override
|
| 44 | 68 | public void beforeInit(SelectionTreePane ui) {
|
| 45 | 69 | this.ui = ui;
|
| ... | ... | @@ -49,7 +73,7 @@ public class SelectionTreePaneHandler implements UIHandler<SelectionTreePane>, P |
| 49 | 73 | @Override
|
| 50 | 74 | public void afterInit(SelectionTreePane ui) {
|
| 51 | 75 | SelectionTree tree = ui.getTree();
|
| 52 | - UIInitHelper.init(ui);
|
|
| 76 | + UIInitHelper.init(ui.getTreePane());
|
|
| 53 | 77 | UIInitHelper.init(tree);
|
| 54 | 78 | tree.getModel().addPropertyChangeListener(SelectionTreeModel.SELECTED_COUNT, this);
|
| 55 | 79 | onSelectedCountChanged(tree.getModel().getSelectedCount());
|
| ... | ... | @@ -28,16 +28,15 @@ import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUIHandler; |
| 28 | 28 | import fr.ird.observe.client.datasource.editor.api.config.actions.ApplySelectionConfiguration;
|
| 29 | 29 | import fr.ird.observe.client.datasource.editor.api.navigation.actions.MenuActionSupport;
|
| 30 | 30 | import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePane;
|
| 31 | -import fr.ird.observe.client.util.UIHelper;
|
|
| 32 | 31 | |
| 33 | 32 | import javax.swing.AbstractButton;
|
| 34 | 33 | import javax.swing.JComponent;
|
| 35 | -import javax.swing.JToggleButton;
|
|
| 36 | 34 | import javax.swing.SwingUtilities;
|
| 37 | 35 | import java.awt.event.ActionEvent;
|
| 38 | 36 | import java.util.function.Consumer;
|
| 39 | 37 | |
| 40 | 38 | import static io.ultreia.java4all.i18n.I18n.n;
|
| 39 | +import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 41 | 40 | |
| 42 | 41 | /**
|
| 43 | 42 | * Created by tchemit on 03/10/2018.
|
| ... | ... | @@ -60,24 +59,24 @@ public class ShowConfigurePanel extends SelectionTreePaneActionSupport { |
| 60 | 59 | if (uiConsumer != null) {
|
| 61 | 60 | uiConsumer.accept(configUI);
|
| 62 | 61 | }
|
| 63 | - TreeConfigUIHandler.showPanel(viewPort, configUI);
|
|
| 62 | + configUI.setComponentPopupMenu(ui.getComponentPopupMenu());
|
|
| 63 | + TreeConfigUIHandler.showPanel(ui.getTree(), configUI);
|
|
| 64 | 64 | });
|
| 65 | 65 | }
|
| 66 | 66 | |
| 67 | 67 | public ShowConfigurePanel() {
|
| 68 | - super(""/*t("observe.ui.action.info.configure")*/, n("observe.ui.tree.action.configure.tip"), UIHelper.getContentActionIconKey("menu")/*UIHelper.getContentActionIconKey("configure")*/, ObserveKeyStrokesEditorApi.KEY_STROKE_NAVIGATION_CONFIGURE_LEFT, ObserveKeyStrokesEditorApi.KEY_STROKE_NAVIGATION_CONFIGURE_RIGHT);
|
|
| 68 | + super(t("observe.ui.action.info.configure"), n("observe.ui.tree.action.configure.tip"), "generate"/*UIHelper.getContentActionIconKey("configure")*/, ObserveKeyStrokesEditorApi.KEY_STROKE_NAVIGATION_CONFIGURE_LEFT, ObserveKeyStrokesEditorApi.KEY_STROKE_NAVIGATION_CONFIGURE_RIGHT);
|
|
| 69 | 69 | setCheckMenuItemIsArmed(false);
|
| 70 | 70 | }
|
| 71 | 71 | |
| 72 | 72 | @Override
|
| 73 | 73 | public void init() {
|
| 74 | 74 | super.init();
|
| 75 | - MenuActionSupport.toggle((JToggleButton) editor, ui.getComponentPopupMenu());
|
|
| 75 | + MenuActionSupport.toggle(ui.getToggleMenu(), ui.getComponentPopupMenu());
|
|
| 76 | 76 | }
|
| 77 | 77 | |
| 78 | 78 | @Override
|
| 79 | 79 | protected void doActionPerformed(ActionEvent e, SelectionTreePane ui) {
|
| 80 | - showConfig(ui, editor, ui.getViewport());
|
|
| 80 | + showConfig(ui, editor, ui.getToggleMenu());
|
|
| 81 | 81 | }
|
| 82 | - |
|
| 83 | 82 | } |
| 1 | -package fr.ird.observe.client.datasource.actions.synchronize.data.tree.actions;
|
|
| 1 | +package fr.ird.observe.client.datasource.editor.api.selection.actions;
|
|
| 2 | 2 | |
| 3 | 3 | /*-
|
| 4 | 4 | * #%L
|
| 5 | - * ObServe Client :: DataSource :: Actions
|
|
| 5 | + * ObServe Client :: DataSource :: Editor :: API
|
|
| 6 | 6 | * %%
|
| 7 | 7 | * Copyright (C) 2008 - 2022 IRD, Code Lutin, Ultreia.io
|
| 8 | 8 | * %%
|
| ... | ... | @@ -22,11 +22,9 @@ package fr.ird.observe.client.datasource.actions.synchronize.data.tree.actions; |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | -import fr.ird.observe.client.datasource.actions.ObserveKeyStrokesActions;
|
|
| 26 | -import fr.ird.observe.client.datasource.actions.synchronize.data.tree.DataSelectionTreePane;
|
|
| 27 | -import fr.ird.observe.client.datasource.api.ObserveSwingDataSourceTemplate;
|
|
| 25 | +import fr.ird.observe.client.datasource.editor.api.ObserveKeyStrokesEditorApi;
|
|
| 28 | 26 | import fr.ird.observe.client.datasource.editor.api.navigation.actions.MenuActionSupport;
|
| 29 | -import fr.ird.observe.client.datasource.editor.api.wizard.connexion.DataSourceSelectorModel;
|
|
| 27 | +import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePane;
|
|
| 30 | 28 | |
| 31 | 29 | import javax.swing.JLabel;
|
| 32 | 30 | import javax.swing.JPanel;
|
| ... | ... | @@ -34,6 +32,7 @@ import javax.swing.JPopupMenu; |
| 34 | 32 | import javax.swing.border.TitledBorder;
|
| 35 | 33 | import java.awt.BorderLayout;
|
| 36 | 34 | import java.awt.event.ActionEvent;
|
| 35 | +import java.util.function.Supplier;
|
|
| 37 | 36 | |
| 38 | 37 | import static io.ultreia.java4all.i18n.I18n.t;
|
| 39 | 38 | |
| ... | ... | @@ -41,10 +40,13 @@ import static io.ultreia.java4all.i18n.I18n.t; |
| 41 | 40 | * @author Tony Chemit - dev@tchemit.fr
|
| 42 | 41 | * @since 8.0
|
| 43 | 42 | */
|
| 44 | -public class ShowInformation extends DataSelectionTreePaneActionSupport {
|
|
| 43 | +public class ShowInformationPanel extends SelectionTreePaneActionSupport {
|
|
| 45 | 44 | |
| 46 | - public ShowInformation() {
|
|
| 47 | - super(t("observe.ui.action.info.storage"), t("observe.ui.action.info.storage.tip"), "information", ObserveKeyStrokesActions.KEY_STROKE_DATA_SYNCHRO_INFO_LEFT, ObserveKeyStrokesActions.KEY_STROKE_DATA_SYNCHRO_INFO_RIGHT);
|
|
| 45 | + private final Supplier<String> informationTextSupplier;
|
|
| 46 | + |
|
| 47 | + public ShowInformationPanel(Supplier<String> informationTextSupplier) {
|
|
| 48 | + super(t("observe.ui.action.info.storage"), t("observe.ui.action.info.storage.tip"), "information", ObserveKeyStrokesEditorApi.KEY_STROKE_DATA_SYNCHRO_INFO_LEFT, ObserveKeyStrokesEditorApi.KEY_STROKE_DATA_SYNCHRO_INFO_RIGHT);
|
|
| 49 | + this.informationTextSupplier = informationTextSupplier;
|
|
| 48 | 50 | setCheckMenuItemIsArmed(false);
|
| 49 | 51 | }
|
| 50 | 52 | |
| ... | ... | @@ -55,25 +57,19 @@ public class ShowInformation extends DataSelectionTreePaneActionSupport { |
| 55 | 57 | }
|
| 56 | 58 | |
| 57 | 59 | @Override
|
| 58 | - protected void doActionPerformed(ActionEvent e, DataSelectionTreePane ui) {
|
|
| 59 | - editor.setSelected(true);
|
|
| 60 | - try {
|
|
| 61 | - DataSourceSelectorModel dataSourceSelectorModel = ui.getContextValue(DataSourceSelectorModel.class);
|
|
| 62 | - String text = ObserveSwingDataSourceTemplate.generate(dataSourceSelectorModel.getSource());
|
|
| 63 | - JPanel content = new JPanel(new BorderLayout());
|
|
| 64 | - content.add(new JLabel(text), BorderLayout.CENTER);
|
|
| 65 | - String title = t("observe.ui.title.storage.info");
|
|
| 66 | - content.setBorder(new TitledBorder(title + " "));
|
|
| 67 | - JPopupMenu popup = ui.getComponentPopupMenu();
|
|
| 68 | - popup.removeAll();
|
|
| 69 | - popup.add(content);
|
|
| 70 | - content.setBorder(new TitledBorder(title + " "));
|
|
| 71 | - popup.removeAll();
|
|
| 72 | - popup.add(content);
|
|
| 73 | - popup.pack();
|
|
| 74 | - popup.show(ui.getTree(), 0, 0);
|
|
| 75 | - } finally {
|
|
| 76 | - editor.setSelected(false);
|
|
| 77 | - }
|
|
| 60 | + protected void doActionPerformed(ActionEvent e, SelectionTreePane ui) {
|
|
| 61 | + String text = informationTextSupplier.get();
|
|
| 62 | + JPanel content = new JPanel(new BorderLayout());
|
|
| 63 | + content.add(new JLabel(text), BorderLayout.CENTER);
|
|
| 64 | + String title = t("observe.ui.title.storage.info");
|
|
| 65 | + content.setBorder(new TitledBorder(title + " "));
|
|
| 66 | + JPopupMenu popup = ui.getComponentPopupMenu();
|
|
| 67 | + popup.removeAll();
|
|
| 68 | + popup.add(content);
|
|
| 69 | + content.setBorder(new TitledBorder(title + " "));
|
|
| 70 | + popup.removeAll();
|
|
| 71 | + popup.add(content);
|
|
| 72 | + popup.pack();
|
|
| 73 | + popup.show(ui.getTree(), 0, 0);
|
|
| 78 | 74 | }
|
| 79 | 75 | } |
| 1 | -package fr.ird.observe.client.datasource.actions.synchronize.data.tree.actions;
|
|
| 1 | +package fr.ird.observe.client.datasource.editor.api.selection.actions;
|
|
| 2 | 2 | |
| 3 | 3 | /*-
|
| 4 | 4 | * #%L
|
| ... | ... | @@ -22,9 +22,9 @@ package fr.ird.observe.client.datasource.actions.synchronize.data.tree.actions; |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | -import fr.ird.observe.client.datasource.actions.ObserveKeyStrokesActions;
|
|
| 26 | -import fr.ird.observe.client.datasource.actions.synchronize.data.tree.DataSelectionTreePane;
|
|
| 25 | +import fr.ird.observe.client.datasource.editor.api.ObserveKeyStrokesEditorApi;
|
|
| 27 | 26 | import fr.ird.observe.client.datasource.editor.api.navigation.actions.MenuActionSupport;
|
| 27 | +import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePane;
|
|
| 28 | 28 | import fr.ird.observe.client.util.UIHelper;
|
| 29 | 29 | import org.nuiton.jaxx.runtime.swing.action.MenuAction;
|
| 30 | 30 | |
| ... | ... | @@ -37,10 +37,10 @@ import java.awt.event.ActionEvent; |
| 37 | 37 | * @author Tony Chemit - dev@tchemit.fr
|
| 38 | 38 | * @since 8
|
| 39 | 39 | */
|
| 40 | -public class ToggleMenu extends DataSelectionTreePaneActionSupport {
|
|
| 40 | +public class ToggleMenu extends SelectionTreePaneActionSupport {
|
|
| 41 | 41 | |
| 42 | 42 | public ToggleMenu() {
|
| 43 | - super("", "", UIHelper.getContentActionIconKey("menu"), ObserveKeyStrokesActions.KEY_STROKE_STORAGE_MENU_LEFT, ObserveKeyStrokesActions.KEY_STROKE_STORAGE_MENU_RIGHT);
|
|
| 43 | + super("", "", UIHelper.getContentActionIconKey("menu"), ObserveKeyStrokesEditorApi.KEY_STROKE_STORAGE_MENU_LEFT, ObserveKeyStrokesEditorApi.KEY_STROKE_STORAGE_MENU_RIGHT);
|
|
| 44 | 44 | }
|
| 45 | 45 | |
| 46 | 46 | @Override
|
| ... | ... | @@ -50,7 +50,7 @@ public class ToggleMenu extends DataSelectionTreePaneActionSupport { |
| 50 | 50 | }
|
| 51 | 51 | |
| 52 | 52 | @Override
|
| 53 | - protected void doActionPerformed(ActionEvent e, DataSelectionTreePane ui) {
|
|
| 53 | + protected void doActionPerformed(ActionEvent e, SelectionTreePane ui) {
|
|
| 54 | 54 | SwingUtilities.invokeLater(() -> {
|
| 55 | 55 | JPopupMenu p = ui.getMenuPopup();
|
| 56 | 56 | p.show(ui.getTree(), 0, 0);
|
| ... | ... | @@ -38,7 +38,7 @@ public class Cancel extends StorageUIActionSupport { |
| 38 | 38 | private static final Logger log = LogManager.getLogger(Cancel.class);
|
| 39 | 39 | |
| 40 | 40 | public Cancel() {
|
| 41 | - super(t("observe.ui.action.cancel"), t("observe.ui.datasource.storage.action.cancel.tip"), "cancel", ObserveKeyStrokesEditorApi.KEY_STROKE_ESCAPE);
|
|
| 41 | + super(t("observe.ui.action.cancel"), t("observe.ui.datasource.storage.action.cancel.tip"), "cancel", ObserveKeyStrokesEditorApi.KEY_STROKE_CANCEL);
|
|
| 42 | 42 | }
|
| 43 | 43 | |
| 44 | 44 | @Override
|
| ... | ... | @@ -26,9 +26,8 @@ import fr.ird.observe.client.WithClientUIContextApi; |
| 26 | 26 | import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
|
| 27 | 27 | import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUI;
|
| 28 | 28 | import fr.ird.observe.client.datasource.editor.api.config.TreeConfigUIHandler;
|
| 29 | -import fr.ird.observe.client.datasource.editor.api.config.actions.ApplySelectionConfiguration;
|
|
| 29 | +import fr.ird.observe.client.datasource.editor.api.selection.SelectionTreePaneHandler;
|
|
| 30 | 30 | import fr.ird.observe.client.datasource.editor.api.selection.actions.SelectUnselect;
|
| 31 | -import fr.ird.observe.client.datasource.editor.api.selection.actions.ShowConfigurePanel;
|
|
| 32 | 31 | import fr.ird.observe.client.datasource.editor.api.wizard.DataSourceHelper;
|
| 33 | 32 | import fr.ird.observe.client.datasource.editor.api.wizard.ObstunaAdminAction;
|
| 34 | 33 | import fr.ird.observe.client.datasource.editor.api.wizard.StorageUIModel;
|
| ... | ... | @@ -39,7 +38,6 @@ import fr.ird.observe.navigation.tree.selection.SelectionTreeConfig; |
| 39 | 38 | import fr.ird.observe.navigation.tree.selection.SelectionTreeModel;
|
| 40 | 39 | import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 41 | 40 | |
| 42 | -import javax.swing.JToggleButton;
|
|
| 43 | 41 | import javax.swing.SwingUtilities;
|
| 44 | 42 | import java.util.List;
|
| 45 | 43 | import java.util.function.Consumer;
|
| ... | ... | @@ -72,6 +70,7 @@ public class SelectDataUIHandler extends StorageTabUIHandler<SelectDataUI> imple |
| 72 | 70 | if (createDataSource) {
|
| 73 | 71 | // create temporary data source
|
| 74 | 72 | try (ObserveSwingDataSource dataSource = DataSourceHelper.toImportDataSourceConfig(model)) {
|
| 73 | + SelectionTreePaneHandler.initDataSource(ui.getSelectedTreePane(), dataSource);
|
|
| 75 | 74 | dataSource.open();
|
| 76 | 75 | if (init) {
|
| 77 | 76 | doInit(treeModel.getConfig(), dataSource);
|
| ... | ... | @@ -81,6 +80,7 @@ public class SelectDataUIHandler extends StorageTabUIHandler<SelectDataUI> imple |
| 81 | 80 | } else {
|
| 82 | 81 | // use main data source
|
| 83 | 82 | ObserveSwingDataSource dataSource = context.getDataSourcesManager().getMainDataSource();
|
| 83 | + SelectionTreePaneHandler.initDataSource(ui.getSelectedTreePane(), dataSource);
|
|
| 84 | 84 | if (init) {
|
| 85 | 85 | doInit(treeModel.getConfig(), dataSource);
|
| 86 | 86 | }
|
| ... | ... | @@ -125,10 +125,7 @@ public class SelectDataUIHandler extends StorageTabUIHandler<SelectDataUI> imple |
| 125 | 125 | SelectUnselect.installUI(ui.getSelectedTreePane());
|
| 126 | 126 | Consumer<TreeConfigUI> consumer = TreeConfigUIHandler::hideOptions;
|
| 127 | 127 | Consumer<TreeConfigUI> apply = u -> loadSelectData(this, ui);
|
| 128 | - JToggleButton showConfigure = ui.getSelectedTreePane().getShowConfigure();
|
|
| 129 | - showConfigure.putClientProperty(ShowConfigurePanel.UI_CONSUMER, consumer);
|
|
| 130 | - showConfigure.putClientProperty(ApplySelectionConfiguration.APPLY_CONSUMER, apply);
|
|
| 131 | - ShowConfigurePanel.init(ui.getSelectedTreePane(), showConfigure, new ShowConfigurePanel());
|
|
| 128 | + SelectionTreePaneHandler.init(ui.getSelectedTreePane(), consumer, apply);
|
|
| 132 | 129 | }
|
| 133 | 130 | |
| 134 | 131 | @Override
|
| ... | ... | @@ -132,7 +132,7 @@ public class RouteCloseCallback implements CloseNodeCallback, WithClientUIContex |
| 132 | 132 | DataSourceEditor dataSourceEditor = (DataSourceEditor) getMainUI().getMainUIBodyContentManager().getCurrentBody().get();
|
| 133 | 133 | NavigationTree tree = dataSourceEditor.getNavigationUI().getTree();
|
| 134 | 134 | |
| 135 | - RouteUINavigationNode routeNode = (RouteUINavigationNode) tree.getModel().getNodeFromModelNode(node, false);
|
|
| 135 | + RouteUINavigationNode routeNode = (RouteUINavigationNode) tree.getModel().getNodeFromModelNode(node);
|
|
| 136 | 136 | |
| 137 | 137 | ActivityListUINavigationNode parentNode = Objects.requireNonNull(routeNode).getActivityListUINavigationNode();
|
| 138 | 138 | tree.selectSafeNode(parentNode);
|
| 1 | -package fr.ird.observe.client.datasource.actions.synchronize.data.tree.actions;
|
|
| 1 | +package fr.ird.observe.entities;
|
|
| 2 | 2 | |
| 3 | 3 | /*-
|
| 4 | 4 | * #%L
|
| 5 | - * ObServe Client :: DataSource :: Actions
|
|
| 5 | + * ObServe Core :: Persistence :: Java
|
|
| 6 | 6 | * %%
|
| 7 | 7 | * Copyright (C) 2008 - 2022 IRD, Code Lutin, Ultreia.io
|
| 8 | 8 | * %%
|
| ... | ... | @@ -22,35 +22,5 @@ package fr.ird.observe.client.datasource.actions.synchronize.data.tree.actions; |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | -import fr.ird.observe.client.datasource.actions.ObserveKeyStrokesActions;
|
|
| 26 | -import fr.ird.observe.client.datasource.actions.synchronize.data.tree.DataSelectionTreePane;
|
|
| 27 | -import fr.ird.observe.client.datasource.editor.api.navigation.actions.MenuActionSupport;
|
|
| 28 | -import fr.ird.observe.client.datasource.editor.api.selection.actions.ShowConfigurePanel;
|
|
| 29 | - |
|
| 30 | -import java.awt.event.ActionEvent;
|
|
| 31 | - |
|
| 32 | -import static io.ultreia.java4all.i18n.I18n.n;
|
|
| 33 | -import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 34 | - |
|
| 35 | -/**
|
|
| 36 | - * @author Tony Chemit - dev@tchemit.fr
|
|
| 37 | - * @since 8.0
|
|
| 38 | - */
|
|
| 39 | -public class ShowConfigure extends DataSelectionTreePaneActionSupport {
|
|
| 40 | - |
|
| 41 | - public ShowConfigure() {
|
|
| 42 | - super(t("observe.ui.action.info.configure"), n("observe.ui.tree.action.configure.tip"), "generate"/*UIHelper.getContentActionIconKey("configure")*/, ObserveKeyStrokesActions.KEY_STROKE_NAVIGATION_CONFIGURE_LEFT, ObserveKeyStrokesActions.KEY_STROKE_NAVIGATION_CONFIGURE_RIGHT);
|
|
| 43 | - setCheckMenuItemIsArmed(false);
|
|
| 44 | - }
|
|
| 45 | - |
|
| 46 | - @Override
|
|
| 47 | - public void init() {
|
|
| 48 | - super.init();
|
|
| 49 | - MenuActionSupport.toggle(ui.getToggleMenu(), ui.getComponentPopupMenu());
|
|
| 50 | - }
|
|
| 51 | - |
|
| 52 | - @Override
|
|
| 53 | - protected void doActionPerformed(ActionEvent e, DataSelectionTreePane ui) {
|
|
| 54 | - ShowConfigurePanel.showConfig(ui.getTree(), editor, ui.getTree());
|
|
| 55 | - }
|
|
| 25 | +public abstract class AbstractObserveTopiaDao<E extends Entity> extends ToolkitTopiaDaoSupport<E> {
|
|
| 56 | 26 | } |
| 1 | 1 | model @model.name@ | generatePropertyChangeSupport
|
| 2 | 2 | model @model.name@ | generateForeignKeyNames
|
| 3 | 3 | model @model.name@ | notGenerateToString
|
| 4 | -model @model.name@ | generateOperatorForDAOHelper
|
|
| 5 | 4 | model @model.name@ | indexForeignKeys
|
| 6 | 5 | model @model.name@ | useEnumerationName=false
|
| 7 | 6 | model @model.name@ | attributeType.Boolean=java.lang.Boolean
|
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | <parent>
|
| 24 | 24 | <groupId>io.ultreia.maven</groupId>
|
| 25 | 25 | <artifactId>pom</artifactId>
|
| 26 | - <version>2022.20</version>
|
|
| 26 | + <version>2022.21</version>
|
|
| 27 | 27 | </parent>
|
| 28 | 28 | <groupId>fr.ird.observe</groupId>
|
| 29 | 29 | <artifactId>ird-observe</artifactId>
|
| ... | ... | @@ -155,7 +155,7 @@ |
| 155 | 155 | <!-- build timestamp configuration -->
|
| 156 | 156 | <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
|
| 157 | 157 | <buildDate>${maven.build.timestamp}</buildDate>
|
| 158 | - <lib.version.toolkit>6.0.0-SNAPSHOT</lib.version.toolkit>
|
|
| 158 | + <lib.version.toolkit>6.0.1</lib.version.toolkit>
|
|
| 159 | 159 | <lib.version.ognl>3.1.29</lib.version.ognl>
|
| 160 | 160 | <!--can't use 1.4.197 (date has changed + blob also)-->
|
| 161 | 161 | <lib.version.h2>1.4.196</lib.version.h2>
|