Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
72663de4
by tchemit at 2019-12-16T11:44:48+01:00
27 changed files:
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/AdminUIBodyContent.java
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/AdminUIHandler.java
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/AdminUIModel.java
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/config/SelectDataModel.java
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/config/SelectDataUI.jaxx
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/config/SelectDataUIHandler.java
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/menu/actions/LaunchAdminActionSupport.java
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/synchronize/data/DataSynchroUI.jaxx
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/synchronize/data/DataSynchroUI.jcss
- client-api-admin/src/main/java/fr/ird/observe/client/ui/admin/synchronize/data/DataSynchroUIHandler.java
- client-api-util/src/main/java/fr/ird/observe/client/api/util/ObserveKeyStrokesSupport.java
- client-datasource-editor/src/main/java/fr/ird/observe/client/datasource/editor/DataSourceEditorBodyContent.java
- client-datasource-editor/src/main/java/fr/ird/observe/client/datasource/editor/wizard/tabs/SelectDataUIHandler.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/SelectionTree.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/SelectionTreeCellRenderer.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/SelectionTreeModel.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/SelectionTreePane.jaxx
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/SelectionTreePane.jcss
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/SelectionTreePaneHandler.java
- + client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/actions/SelectUnselect.java
- + client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/actions/SelectUnselectWithOpposite.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/nodes/ProgramSelectionTreeNode.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/nodes/ReferenceSelectionTreeNodeSupport.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/nodes/ReferentialsSelectionTreeNode.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/nodes/RootSelectionTreeNode.java
- client-datasource-tree-selection/src/main/java/fr/ird/observe/client/datasource/tree/selection/nodes/SelectionTreeNodeSupport.java
- pom.xml
Changes:
| ... | ... | @@ -63,9 +63,6 @@ public class AdminUIBodyContent extends MainUIBodyContent<AdminUI> implements Wi |
| 63 | 63 |
/** the jaxx context entry to store the cancel action */
|
| 64 | 64 |
public static final JAXXContextEntryDef<Runnable> CANCEL_DEF = JAXXUtil.newContextEntryDef("cancel", Runnable.class);
|
| 65 | 65 |
|
| 66 |
- private AdminUIMenu menu;
|
|
| 67 |
- |
|
| 68 |
- |
|
| 69 | 66 |
public AdminUIBodyContent() {
|
| 70 | 67 |
super(3, AdminUI.class);
|
| 71 | 68 |
setSupplier(SingletonSupplier.of(createSupplier()));
|
| ... | ... | @@ -74,7 +71,7 @@ public class AdminUIBodyContent extends MainUIBodyContent<AdminUI> implements Wi |
| 74 | 71 |
@Override
|
| 75 | 72 |
public void install(MainUI mainUI) {
|
| 76 | 73 |
super.install(mainUI);
|
| 77 |
- menu = new AdminUIMenu(UIHelperSupport.initialContext((JAXXObject) mainUI, mainUI.getModel()));
|
|
| 74 |
+ AdminUIMenu menu = new AdminUIMenu(UIHelperSupport.initialContext((JAXXObject) mainUI, mainUI.getModel()));
|
|
| 78 | 75 |
JMenuBar menuBar = mainUI.getMenu();
|
| 79 | 76 |
menuBar.add(menu, 2);
|
| 80 | 77 |
}
|
| ... | ... | @@ -82,12 +79,53 @@ public class AdminUIBodyContent extends MainUIBodyContent<AdminUI> implements Wi |
| 82 | 79 |
@Override
|
| 83 | 80 |
public void show(MainUI mainUI) {
|
| 84 | 81 |
super.show(mainUI);
|
| 82 |
+ |
|
| 83 |
+ AdminUI ui = get();
|
|
| 84 |
+ |
|
| 85 |
+ AdminUIModel adminUIModel = ui.getModel();
|
|
| 86 |
+ mainUI.setContextValue(adminUIModel);
|
|
| 87 |
+ |
|
| 88 |
+ adminUIModel.addOperation(adminUIModel.getAdminStep());
|
|
| 89 |
+ adminUIModel.updateStepUniverse();
|
|
| 90 |
+ |
|
| 91 |
+ ui.start();
|
|
| 92 |
+ // refresh selected tab (otherwise it does NOT display (white screen...)
|
|
| 93 |
+ SwingUtilities.invokeLater(() -> {
|
|
| 94 |
+ ui.getTabs().getSelectedComponent().validate();
|
|
| 95 |
+ ui.getTabs().getSelectedComponent().requestFocusInWindow();
|
|
| 96 |
+ });
|
|
| 85 | 97 |
}
|
| 86 | 98 |
|
| 87 | 99 |
@Override
|
| 88 | 100 |
public void hide(MainUI mainUI) throws HideBodyContentNotAcceptedException {
|
| 101 |
+ |
|
| 102 |
+ AdminUI ui = get();
|
|
| 103 |
+ AdminUIModel model = ui.getModel();
|
|
| 104 |
+ |
|
| 105 |
+ ConfigModel.doCloseSource(model.getConfigModel().getCentralSourceModel().getSource());
|
|
| 106 |
+ ConfigModel.doCloseSource(model.getConfigModel().getLocalSourceModel().getSource());
|
|
| 107 |
+ |
|
| 108 |
+ model.destroy();
|
|
| 109 |
+ |
|
| 110 |
+ ui.destroy();
|
|
| 111 |
+ ui.dispose();
|
|
| 112 |
+ |
|
| 113 |
+ //FIXME:BodyContent find a way to start mainUIBodyContent in a simplified ui JDialog
|
|
| 114 |
+// if (!(parent instanceof MainUI)) {
|
|
| 115 |
+// JDialog dialog = (JDialog) parent;
|
|
| 116 |
+// log.info("dispose ui!");
|
|
| 117 |
+// dialog.setVisible(false);
|
|
| 118 |
+// dialog.dispose();
|
|
| 119 |
+// log.info("After dispose.");
|
|
| 120 |
+// ApplicationContext.get().releaseLock();
|
|
| 121 |
+// return;
|
|
| 122 |
+// }
|
|
| 123 |
+ |
|
| 124 |
+ mainUI.removeContextValue(model.getClass());
|
|
| 125 |
+ |
|
| 126 |
+ ObserveUtil.cleanMemory();
|
|
| 127 |
+ |
|
| 89 | 128 |
super.hide(mainUI);
|
| 90 |
- doClose(get().getModel().isWasCanceled());
|
|
| 91 | 129 |
}
|
| 92 | 130 |
|
| 93 | 131 |
private Supplier<AdminUI> createSupplier() {
|
| ... | ... | @@ -95,27 +133,16 @@ public class AdminUIBodyContent extends MainUIBodyContent<AdminUI> implements Wi |
| 95 | 133 |
MainUI mainUI = getClientUIContext().getMainUI();
|
| 96 | 134 |
AdminStep adminStep = mainUI.getContextValue(AdminStep.class);
|
| 97 | 135 |
AdminUIModel model = new AdminUIModel(Objects.requireNonNull(adminStep));
|
| 98 |
- JAXXInitialContext uiContext = new JAXXInitialContext();
|
|
| 99 |
- uiContext.add(mainUI);
|
|
| 100 |
- // parent context model
|
|
| 101 |
- uiContext.add(model);
|
|
| 136 |
+ JAXXInitialContext uiContext = UIHelperSupport.initialContext((JAXXObject) mainUI, model);
|
|
| 102 | 137 |
|
| 103 | 138 |
//FIXME:BodyContent Review jaxx to remove this...
|
| 104 | 139 |
// apply action
|
| 105 | 140 |
uiContext.add(APPLY_DEF, () -> {
|
| 106 |
-// try {
|
|
| 107 |
-// doAction(ui);
|
|
| 108 |
-// } finally {
|
|
| 109 | 141 |
doClose(false);
|
| 110 |
-// }
|
|
| 111 | 142 |
});
|
| 112 | 143 |
// cancel action
|
| 113 | 144 |
uiContext.add(CANCEL_DEF, () -> {
|
| 114 |
-// try {
|
|
| 115 |
-// doCancel(ui);
|
|
| 116 |
-// } finally {
|
|
| 117 | 145 |
doClose(true);
|
| 118 |
-// }
|
|
| 119 | 146 |
});
|
| 120 | 147 |
return new AdminUI(uiContext);
|
| 121 | 148 |
};
|
| ... | ... | @@ -127,35 +154,11 @@ public class AdminUIBodyContent extends MainUIBodyContent<AdminUI> implements Wi |
| 127 | 154 |
AdminUI ui = get();
|
| 128 | 155 |
AdminUIModel model = ui.getModel();
|
| 129 | 156 |
|
| 130 |
- ConfigModel.doCloseSource(model.getConfigModel().getCentralSourceModel().getSource());
|
|
| 131 |
- ConfigModel.doCloseSource(model.getConfigModel().getLocalSourceModel().getSource());
|
|
| 132 |
- |
|
| 133 |
- model.destroy();
|
|
| 134 |
- ui.dispose();
|
|
| 135 |
- |
|
| 136 |
-// if (!(parent instanceof MainUI)) {
|
|
| 137 |
-// JDialog dialog = (JDialog) parent;
|
|
| 138 |
-// log.info("dispose ui!");
|
|
| 139 |
-// dialog.setVisible(false);
|
|
| 140 |
-// dialog.dispose();
|
|
| 141 |
-// log.info("After dispose.");
|
|
| 142 |
-// ApplicationContext.get().releaseLock();
|
|
| 143 |
-// return;
|
|
| 144 |
-// }
|
|
| 145 |
- |
|
| 146 | 157 |
MainUI mainUI = getClientUIContext().getMainUI();
|
| 147 |
- mainUI.removeContextValue(model.getClass());
|
|
| 148 |
- |
|
| 149 |
- //FIXME:BodyContent
|
|
| 150 |
-// mainUI.getSynchroWizard().remove(ui);
|
|
| 151 |
- |
|
| 152 |
- ObserveUtil.cleanMemory();
|
|
| 153 | 158 |
|
| 154 | 159 |
ObserveSwingDataSource source = model.getConfigModel().getPreviousSource();
|
| 155 | 160 |
|
| 156 |
- //FIXME:BodyContent
|
|
| 157 | 161 |
if (source == null) {
|
| 158 |
- |
|
| 159 | 162 |
// pas de service auparavant
|
| 160 | 163 |
mainUI.changeBodyContent(NoBodyContent.NoBodyContentComponent.class);
|
| 161 | 164 |
return;
|
| ... | ... | @@ -163,6 +166,7 @@ public class AdminUIBodyContent extends MainUIBodyContent<AdminUI> implements Wi |
| 163 | 166 |
|
| 164 | 167 |
try {
|
| 165 | 168 |
|
| 169 |
+ //FIXME:BodyContent now source is not linked to ui, maybe we could be able to do this in a better way
|
|
| 166 | 170 |
ConfigModel.doCloseSource(source);
|
| 167 | 171 |
|
| 168 | 172 |
// on attache la source a l'ui
|
| ... | ... | @@ -181,42 +185,4 @@ public class AdminUIBodyContent extends MainUIBodyContent<AdminUI> implements Wi |
| 181 | 185 |
}
|
| 182 | 186 |
}
|
| 183 | 187 |
|
| 184 |
- protected void start() {
|
|
| 185 |
- AdminUI ui = get();
|
|
| 186 |
- |
|
| 187 |
- MainUI mainUI = getClientUIContext().getMainUI();
|
|
| 188 |
- |
|
| 189 |
- String title = (String) ui.getClientProperty("title");
|
|
| 190 |
- |
|
| 191 |
-// if (mainUI == null) {
|
|
| 192 |
-//
|
|
| 193 |
-// // pas de fenetre detectee
|
|
| 194 |
-// // on encapsule l'ui dans un dialog
|
|
| 195 |
-//
|
|
| 196 |
-// JDialog dialog = (JDialog) parent;
|
|
| 197 |
-// dialog.setTitle(t(title));
|
|
| 198 |
-// dialog.setContentPane(ui);
|
|
| 199 |
-//// dialog.pack();
|
|
| 200 |
-// dialog.setVisible(true);
|
|
| 201 |
-// log.debug("After dispay dialog");
|
|
| 202 |
-// } else {
|
|
| 203 |
- |
|
| 204 |
- // on attache dans la fenetre principale
|
|
| 205 |
- String tip = (String) ui.getClientProperty("tip");
|
|
| 206 |
- |
|
| 207 |
- //FIXME:BodyContent Hum use neutral mainUI body content
|
|
| 208 |
-// JXTitledPanel panel = mainUI.getSynchroWizard();
|
|
| 209 |
-// panel.setTitle(t(title));
|
|
| 210 |
-// panel.setToolTipText(t(tip));
|
|
| 211 |
-// panel.setContentContainer(ui);
|
|
| 212 |
- mainUI.setContextValue(ui.getModel());
|
|
| 213 |
-// mainUI.getModel().setMode(ObserveUIMode.SYNCHRO);
|
|
| 214 |
- |
|
| 215 |
- // refresh selected tab (otherwise it does NOT display (white screen...)
|
|
| 216 |
- SwingUtilities.invokeLater(() -> {
|
|
| 217 |
- ui.getTabs().getSelectedComponent().validate();
|
|
| 218 |
- ui.getTabs().getSelectedComponent().requestFocusInWindow();
|
|
| 219 |
- });
|
|
| 220 |
-// }
|
|
| 221 |
- }
|
|
| 222 | 188 |
}
|
| ... | ... | @@ -189,7 +189,7 @@ public class AdminUIHandler implements UIHandler<AdminUI>, WithClientUIContext { |
| 189 | 189 |
String title = I18nEnumHelper.getLabel(step);
|
| 190 | 190 |
String tip = I18nEnumHelper.getDescription(step);
|
| 191 | 191 |
ui.tabs.addTab(title, null, c, tip);
|
| 192 |
- c.setEnabled(i == 0);
|
|
| 192 |
+// c.setEnabled(i == 0);
|
|
| 193 | 193 |
}
|
| 194 | 194 |
|
| 195 | 195 |
ui.getModel().setValueAdjusting(false);
|
| ... | ... | @@ -77,9 +77,6 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { |
| 77 | 77 |
this.adminStep = Objects.requireNonNull(adminStep);
|
| 78 | 78 |
this.availableIncomingModes = EnumSet.noneOf(DbMode.class);
|
| 79 | 79 |
this.listenStepChanged = this::onStepChanged;
|
| 80 |
- addOperation(adminStep);
|
|
| 81 |
- updateStepUniverse();
|
|
| 82 |
- |
|
| 83 | 80 |
log.debug(String.format("model [%s] is instantiated.", this));
|
| 84 | 81 |
}
|
| 85 | 82 |
|
| ... | ... | @@ -81,10 +81,9 @@ public class SelectDataModel extends AdminActionModel { |
| 81 | 81 |
// on remplit le modèle de sélection uniquement avec le bon type de marées
|
| 82 | 82 |
ReportModel reportModel = uiModel.getReportModel();
|
| 83 | 83 |
ObserveModelType reportType = reportModel.getModelType();
|
| 84 |
- boolean loadSeineTrip = ObserveModelType.PS == reportType;
|
|
| 85 | 84 |
|
| 86 |
- selectionDataModel.setLoadLongline(!loadSeineTrip);
|
|
| 87 |
- selectionDataModel.setLoadSeine(loadSeineTrip);
|
|
| 85 |
+ selectionDataModel.setLoadLongline(ObserveModelType.LL == reportType);
|
|
| 86 |
+ selectionDataModel.setLoadSeine(ObserveModelType.PS == reportType);
|
|
| 88 | 87 |
|
| 89 | 88 |
selectAllTrips = false;
|
| 90 | 89 |
|
| ... | ... | @@ -208,14 +207,9 @@ public class SelectDataModel extends AdminActionModel { |
| 208 | 207 |
|
| 209 | 208 |
selectionModel.addPropertyChangeListener(SelectionTreeModel.SELECTED_COUNT, evt -> {
|
| 210 | 209 |
SelectionTreeModel source = (SelectionTreeModel) evt.getSource();
|
| 211 |
- if (log.isDebugEnabled()) {
|
|
| 212 |
- log.debug(String.format("selection data model [%s] changed on %s, new value = %s",
|
|
| 213 |
- source, evt.getPropertyName(), evt.getNewValue()));
|
|
| 214 |
- }
|
|
| 210 |
+ log.debug(String.format("selection data model [%s] changed on %s, new value = %s", source, evt.getPropertyName(), evt.getNewValue()));
|
|
| 215 | 211 |
uiModel.validate();
|
| 216 |
- if (log.isDebugEnabled()) {
|
|
| 217 |
- log.debug("nb selected export datas = " + source.getSelectedCount());
|
|
| 218 |
- }
|
|
| 212 |
+ log.debug("nb selected export datas = " + source.getSelectedCount());
|
|
| 219 | 213 |
});
|
| 220 | 214 |
}
|
| 221 | 215 |
|
| ... | ... | @@ -27,6 +27,6 @@ |
| 27 | 27 |
</import>
|
| 28 | 28 |
<SelectDataModel id='stepModel' initializer='getModel().getSelectDataModel()'/>
|
| 29 | 29 |
<JPanel id='PENDING_content' layout="{new BorderLayout()}">
|
| 30 |
- <SelectionTreePane id='selectTreePane'/>
|
|
| 30 |
+ <SelectionTreePane id='selectTreePane' decorator='boxed' constraints='BorderLayout.CENTER'/>
|
|
| 31 | 31 |
</JPanel>
|
| 32 | 32 |
</fr.ird.observe.client.ui.admin.AdminTabUI>
|
| ... | ... | @@ -37,7 +37,7 @@ public class SelectDataUIHandler extends AdminTabUIHandler<SelectDataUI> impleme |
| 37 | 37 |
|
| 38 | 38 |
@Override
|
| 39 | 39 |
public void afterInit(SelectDataUI ui) {
|
| 40 |
- super.afterInit(this.ui);
|
|
| 40 |
+ super.afterInit(ui);
|
|
| 41 | 41 |
|
| 42 | 42 |
UIHelperSupport.setLayerUI(ui.getContent(), null);
|
| 43 | 43 |
UIHelperSupport.setLayerUI(ui.getSelectTreePane(), parentUI.getConfigBlockLayerUI());
|
| ... | ... | @@ -45,9 +45,9 @@ public class SelectDataUIHandler extends AdminTabUIHandler<SelectDataUI> impleme |
| 45 | 45 |
SelectionTree tree = ui.getSelectTreePane().getTree();
|
| 46 | 46 |
getModel().getSelectDataModel().setSelectionDataModel(tree.getTreeModel());
|
| 47 | 47 |
|
| 48 |
- tree.installUI();
|
|
| 48 |
+ tree.installUI(ui.getSelectTreePane());
|
|
| 49 | 49 |
//FIXME Init tree ?
|
| 50 |
-// UIHelperSupport.initUI(tabUI.getSelectTreePane(), tree);
|
|
| 50 |
+// UIHelperSupport.initUI(ui.getSelectTreePane(), tree);
|
|
| 51 | 51 |
}
|
| 52 | 52 |
|
| 53 | 53 |
}
|
| ... | ... | @@ -68,7 +68,7 @@ public abstract class LaunchAdminActionSupport extends AdminUIMenuActionSupport |
| 68 | 68 |
MainUI mainUI = getClientUIContext().getMainUI();
|
| 69 | 69 |
mainUI.setContextValue(action);
|
| 70 | 70 |
try {
|
| 71 |
- mainUI.getMainUIBodyContentManager().changeCurrentBody(AdminUI.class);
|
|
| 71 |
+ mainUI.changeBodyContent(AdminUI.class);
|
|
| 72 | 72 |
} finally {
|
| 73 | 73 |
mainUI.removeContextValue(AdminStep.class);
|
| 74 | 74 |
}
|
| ... | ... | @@ -54,15 +54,15 @@ |
| 54 | 54 |
<cell weightx="0.1">
|
| 55 | 55 |
<JPanel layout="{new BorderLayout()}" border='{new TitledBorder(" ")}'>
|
| 56 | 56 |
<JPanel id="middleActions" layout="{new GridLayout(0, 2)}" constraints='BorderLayout.CENTER'>
|
| 57 |
- <JButton id="copyFromLeft"/>
|
|
| 58 |
- <JButton id="copyFromRight"/>
|
|
| 59 |
- <JButton id="deleteFromLeft"/>
|
|
| 60 |
- <JButton id="deleteFromRight"/>
|
|
| 57 |
+ <JButton id="copyFromLeft" styleClass="disabled"/>
|
|
| 58 |
+ <JButton id="copyFromRight" styleClass="disabled"/>
|
|
| 59 |
+ <JButton id="deleteFromLeft" styleClass="disabled"/>
|
|
| 60 |
+ <JButton id="deleteFromRight" styleClass="disabled"/>
|
|
| 61 | 61 |
</JPanel>
|
| 62 | 62 |
</JPanel>
|
| 63 | 63 |
</cell>
|
| 64 | 64 |
<cell weightx="0.45">
|
| 65 |
- <SelectionTreePane id="rightTreePane"/>
|
|
| 65 |
+ <SelectionTreePane id="rightTreePane" constructorParams="true"/>
|
|
| 66 | 66 |
</cell>
|
| 67 | 67 |
</row>
|
| 68 | 68 |
</Table>
|
| ... | ... | @@ -33,24 +33,6 @@ |
| 33 | 33 |
resizeWeight: 0.8;
|
| 34 | 34 |
}
|
| 35 | 35 |
|
| 36 |
-#leftTree {
|
|
| 37 |
- minimumSize:{UIHelperSupport.newMinDimension()};
|
|
| 38 |
- font-size:11;
|
|
| 39 |
-}
|
|
| 40 |
- |
|
| 41 |
-#leftTreePane {
|
|
| 42 |
- verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
|
|
| 43 |
-}
|
|
| 44 |
- |
|
| 45 |
-#rightTree {
|
|
| 46 |
- minimumSize:{UIHelperSupport.newMinDimension()};
|
|
| 47 |
- font-size:11;
|
|
| 48 |
-}
|
|
| 49 |
- |
|
| 50 |
-#rightTreePane {
|
|
| 51 |
- verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
|
|
| 52 |
-}
|
|
| 53 |
- |
|
| 54 | 36 |
#copyToLeft {
|
| 55 | 37 |
enabled:false;
|
| 56 | 38 |
}
|
| ... | ... | @@ -53,7 +53,6 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 53 | 53 |
leftSelectionDataModel.setLoadReferential(false);
|
| 54 | 54 |
leftSelectionDataModel.setShowEmptyTrips(false);
|
| 55 | 55 |
|
| 56 |
- |
|
| 57 | 56 |
SelectionTree rightTree = ui.getRightTreePane().getTree();
|
| 58 | 57 |
SelectionTreeModel rightSelectionDataModel = rightTree.getTreeModel();
|
| 59 | 58 |
stepModel.setRightSelectionDataModel(rightSelectionDataModel);
|
| ... | ... | @@ -62,26 +61,22 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 62 | 61 |
rightSelectionDataModel.setLoadReferential(false);
|
| 63 | 62 |
rightSelectionDataModel.setShowEmptyTrips(false);
|
| 64 | 63 |
|
| 64 |
+ //FIXME:BodyContent verifier que cela fonctionne bien...
|
|
| 65 | 65 |
// on n'installe qu'une seule fois l'ui
|
| 66 |
- leftTree.installUI2(rightTree);
|
|
| 66 |
+ leftTree.installUI2(ui.getLeftTreePane(), ui.getRightTreePane());
|
|
| 67 | 67 |
|
| 68 | 68 |
stepModel.getLeftSelectionDataModel().addPropertyChangeListener(evt -> {
|
| 69 |
- |
|
| 70 | 69 |
SelectionTreeModel model = (SelectionTreeModel) evt.getSource();
|
| 71 | 70 |
boolean withDataSelected = !model.isSelectionEmpty();
|
| 72 |
- |
|
| 73 | 71 |
ui.getCopyFromLeft().setEnabled(withDataSelected);
|
| 74 | 72 |
ui.getDeleteFromLeft().setEnabled(withDataSelected);
|
| 75 | 73 |
|
| 76 | 74 |
});
|
| 77 | 75 |
stepModel.getRightSelectionDataModel().addPropertyChangeListener(evt -> {
|
| 78 |
- |
|
| 79 | 76 |
SelectionTreeModel model = (SelectionTreeModel) evt.getSource();
|
| 80 | 77 |
boolean withDataSelected = !model.isSelectionEmpty();
|
| 81 |
- |
|
| 82 | 78 |
ui.getCopyFromRight().setEnabled(withDataSelected);
|
| 83 | 79 |
ui.getDeleteFromRight().setEnabled(withDataSelected);
|
| 84 |
- |
|
| 85 | 80 |
});
|
| 86 | 81 |
|
| 87 | 82 |
stepModel.getProgressModel().installUI(ui.getProgressBar());
|
| ... | ... | @@ -59,10 +59,10 @@ public abstract class ObserveKeyStrokesSupport { |
| 59 | 59 |
|
| 60 | 60 |
public static final KeyStroke KEY_STROKE_CANCEL = KeyStroke.getKeyStroke("alt pressed A");
|
| 61 | 61 |
public static final KeyStroke KEY_STROKE_EXIT = KeyStroke.getKeyStroke("alt pressed F");
|
| 62 |
- public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_COPY_FROM_LEFT = KeyStroke.getKeyStroke("alt pressed C");
|
|
| 63 |
- public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_LEFT = KeyStroke.getKeyStroke("alt pressed D");
|
|
| 64 |
- public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_COPY_FROM_RIGHT = KeyStroke.getKeyStroke("shift alt pressed C");
|
|
| 65 |
- public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_RIGHT = KeyStroke.getKeyStroke("shift alt pressed D");
|
|
| 62 |
+ public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_COPY_FROM_LEFT = KeyStroke.getKeyStroke("ctrl pressed C");
|
|
| 63 |
+ public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_LEFT = KeyStroke.getKeyStroke("ctrl pressed D");
|
|
| 64 |
+ public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_COPY_FROM_RIGHT = KeyStroke.getKeyStroke("shift ctrl pressed C");
|
|
| 65 |
+ public static final KeyStroke KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_RIGHT = KeyStroke.getKeyStroke("shift ctrl pressed D");
|
|
| 66 | 66 |
|
| 67 | 67 |
public static final KeyStroke KEY_STROKE_STORAGE_DO_CONFIGURE_REMOTE = KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_MASK);
|
| 68 | 68 |
public static final KeyStroke KEY_STROKE_STORAGE_DO_CONFIGURE_SERVER = KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK);
|
| ... | ... | @@ -122,7 +122,7 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi |
| 122 | 122 |
try {
|
| 123 | 123 |
dataSource.close();
|
| 124 | 124 |
} finally {
|
| 125 |
- getClientUIContext().getMainUI().changeBodyContent(NoBodyContent.NoBodyContentComponent.class);
|
|
| 125 |
+ mainUI.changeBodyContent(NoBodyContent.NoBodyContentComponent.class);
|
|
| 126 | 126 |
}
|
| 127 | 127 |
|
| 128 | 128 |
}
|
| ... | ... | @@ -180,7 +180,6 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi |
| 180 | 180 |
ObserveEditModelApplicationComponent.value().load(navigationEditModel);
|
| 181 | 181 |
}
|
| 182 | 182 |
|
| 183 |
-// navigationMenu.getUiModel().setConfig(null);
|
|
| 184 | 183 |
navigationMenu.getUiModel().setConfig(get().getNavigationUI().getNavigationConfig());
|
| 185 | 184 |
|
| 186 | 185 |
get().getHandler().loadNavigationUI(dataSource, progressModel);
|
| ... | ... | @@ -42,6 +42,6 @@ class SelectDataUIHandler extends StorageTabUIHandler<SelectDataUI> implements U |
| 42 | 42 |
description = ObserveKeyStrokesSupport.suffixTextWithKeyStroke(description, ObserveKeyStrokesSupport.KEY_STROKE_ENTER);
|
| 43 | 43 |
ui.setDescriptionText(description);
|
| 44 | 44 |
}
|
| 45 |
- ui.getSelectedTreePane().getTree().installUI();
|
|
| 45 |
+ ui.getSelectedTreePane().getTree().installUI(ui.getSelectedTreePane());
|
|
| 46 | 46 |
}
|
| 47 | 47 |
}
|
| ... | ... | @@ -10,30 +10,24 @@ package fr.ird.observe.client.datasource.tree.selection; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 22 | 22 |
* #L%
|
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 |
-import fr.ird.observe.client.api.util.ObserveKeyStrokesSupport;
|
|
| 26 | 25 |
import fr.ird.observe.client.api.util.UIHelperSupport;
|
| 27 |
-import fr.ird.observe.client.datasource.tree.selection.nodes.SelectionTreeNodeSupport;
|
|
| 26 |
+import fr.ird.observe.client.datasource.tree.selection.actions.SelectUnselect;
|
|
| 27 |
+import fr.ird.observe.client.datasource.tree.selection.actions.SelectUnselectWithOpposite;
|
|
| 28 | 28 |
import org.jdesktop.swingx.JXTree;
|
| 29 | 29 |
|
| 30 |
-import javax.swing.AbstractAction;
|
|
| 31 |
-import javax.swing.ActionMap;
|
|
| 32 |
-import javax.swing.InputMap;
|
|
| 33 | 30 |
import javax.swing.tree.TreeSelectionModel;
|
| 34 |
-import java.awt.event.ActionEvent;
|
|
| 35 |
-import java.awt.event.MouseAdapter;
|
|
| 36 |
-import java.awt.event.MouseEvent;
|
|
| 37 | 31 |
|
| 38 | 32 |
/**
|
| 39 | 33 |
* Created on 14/11/16.
|
| ... | ... | @@ -54,90 +48,54 @@ public class SelectionTree extends JXTree { |
| 54 | 48 |
setToggleClickCount(100);
|
| 55 | 49 |
}
|
| 56 | 50 |
|
| 57 |
- public void installUI() {
|
|
| 51 |
+ public void installUI(SelectionTreePane parent) {
|
|
| 52 |
+ SelectUnselect.init(parent, null, SelectUnselect.class);
|
|
| 53 |
+ }
|
|
| 58 | 54 |
|
| 59 |
- getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 60 |
-// getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SELECT_ALL_TREE, "none");
|
|
| 61 |
-// getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_UNSELECT_ALL_TREE, "none");
|
|
| 62 |
- InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW);
|
|
| 63 |
- ActionMap actionMap = getActionMap();
|
|
| 64 |
- inputMap.put(ObserveKeyStrokesSupport.KEY_STROKE_ENTER, "select/unselect");
|
|
| 65 |
- inputMap.put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "select/unselect");
|
|
| 66 |
- actionMap.put("select/unselect", new AbstractAction() {
|
|
| 67 |
- @Override
|
|
| 68 |
- public void actionPerformed(ActionEvent e) {
|
|
| 69 |
- selectUnSelect(SelectionTree.this);
|
|
| 70 |
- }
|
|
| 71 |
- });
|
|
| 55 |
+ public void installUI2(SelectionTreePane parent, SelectionTreePane oppositeTree) {
|
|
| 72 | 56 |
|
| 73 |
- addMouseListener(new MouseAdapter() {
|
|
| 74 |
- @Override
|
|
| 75 |
- public void mouseClicked(MouseEvent e) {
|
|
| 76 |
- if (e.getClickCount() == 2) {
|
|
| 77 |
- selectUnSelect(SelectionTree.this);
|
|
| 78 |
- }
|
|
| 79 |
- }
|
|
| 80 |
- });
|
|
| 81 |
- }
|
|
| 57 |
+ SelectUnselectWithOpposite.init(parent, null, new SelectUnselectWithOpposite(oppositeTree));
|
|
| 82 | 58 |
|
| 83 |
- public void installUI2(SelectionTree oppositeTree) {
|
|
| 59 |
+// InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW);
|
|
| 60 |
+// ActionMap actionMap = getActionMap();
|
|
| 61 |
+// getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 62 |
+// oppositeTree.getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 84 | 63 |
|
| 85 |
- InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW);
|
|
| 86 |
- ActionMap actionMap = getActionMap();
|
|
| 87 |
- getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 88 | 64 |
// getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SELECT_ALL_TREE, "none");
|
| 89 | 65 |
// getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_UNSELECT_ALL_TREE, "none");
|
| 90 | 66 |
|
| 91 |
- oppositeTree.getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 92 | 67 |
// oppositeTree.getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SELECT_ALL_TREE, "none");
|
| 93 | 68 |
// oppositeTree.getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_UNSELECT_ALL_TREE, "none");
|
| 94 | 69 |
|
| 95 |
- inputMap.put(ObserveKeyStrokesSupport.KEY_STROKE_ENTER, "select/unselect");
|
|
| 96 |
- inputMap.put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "select/unselect");
|
|
| 97 |
- actionMap.put("select/unselect", new AbstractAction() {
|
|
| 98 |
- |
|
| 99 |
- @Override
|
|
| 100 |
- public void actionPerformed(ActionEvent e) {
|
|
| 101 |
- selectUnSelectWithOpposite(oppositeTree);
|
|
| 102 |
- }
|
|
| 103 |
- });
|
|
| 104 |
- addMouseListener(new MouseAdapter() {
|
|
| 105 |
- @Override
|
|
| 106 |
- public void mouseClicked(MouseEvent e) {
|
|
| 107 |
- if (e.getClickCount() == 2) {
|
|
| 108 |
- selectUnSelectWithOpposite(oppositeTree);
|
|
| 109 |
- }
|
|
| 110 |
- }
|
|
| 111 |
- });
|
|
| 112 |
- oppositeTree.addMouseListener(new MouseAdapter() {
|
|
| 113 |
- @Override
|
|
| 114 |
- public void mouseClicked(MouseEvent e) {
|
|
| 115 |
- if (e.getClickCount() == 2) {
|
|
| 116 |
- oppositeTree.selectUnSelectWithOpposite(SelectionTree.this);
|
|
| 117 |
- }
|
|
| 118 |
- }
|
|
| 119 |
- });
|
|
| 120 |
- }
|
|
| 121 |
- |
|
| 122 |
- private void selectUnSelectWithOpposite(SelectionTree oppositeTree) {
|
|
| 123 |
- if (isFocusOwner()) {
|
|
| 124 |
- selectUnSelect(SelectionTree.this);
|
|
| 125 |
- } else {
|
|
| 126 |
- selectUnSelect(oppositeTree);
|
|
| 127 |
- }
|
|
| 70 |
+// inputMap.put(ObserveKeyStrokesSupport.KEY_STROKE_ENTER, "select/unselect");
|
|
| 71 |
+// inputMap.put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "select/unselect");
|
|
| 72 |
+// actionMap.put("select/unselect", new AbstractAction() {
|
|
| 73 |
+//
|
|
| 74 |
+// @Override
|
|
| 75 |
+// public void actionPerformed(ActionEvent e) {
|
|
| 76 |
+// selectUnSelectWithOpposite(oppositeTree);
|
|
| 77 |
+// }
|
|
| 78 |
+// });
|
|
| 79 |
+// addMouseListener(new MouseAdapter() {
|
|
| 80 |
+// @Override
|
|
| 81 |
+// public void mouseClicked(MouseEvent e) {
|
|
| 82 |
+// if (e.getClickCount() == 2) {
|
|
| 83 |
+// selectUnSelectWithOpposite(oppositeTree);
|
|
| 84 |
+// }
|
|
| 85 |
+// }
|
|
| 86 |
+// });
|
|
| 87 |
+// oppositeTree.addMouseListener(new MouseAdapter() {
|
|
| 88 |
+// @Override
|
|
| 89 |
+// public void mouseClicked(MouseEvent e) {
|
|
| 90 |
+// if (e.getClickCount() == 2) {
|
|
| 91 |
+// oppositeTree.selectUnSelectWithOpposite(SelectionTree.this);
|
|
| 92 |
+// }
|
|
| 93 |
+// }
|
|
| 94 |
+// });
|
|
| 128 | 95 |
}
|
| 129 | 96 |
|
| 130 | 97 |
public SelectionTreeModel getTreeModel() {
|
| 131 | 98 |
return (SelectionTreeModel) getModel();
|
| 132 | 99 |
}
|
| 133 | 100 |
|
| 134 |
- private void selectUnSelect(SelectionTree tree) {
|
|
| 135 |
- Object selectedRow = tree.getLastSelectedPathComponent();
|
|
| 136 |
- if (selectedRow == null) {
|
|
| 137 |
- return;
|
|
| 138 |
- }
|
|
| 139 |
- |
|
| 140 |
- SelectionTreeNodeSupport<?> node = (SelectionTreeNodeSupport) selectedRow;
|
|
| 141 |
- tree.getTreeModel().setValueAt(node, !node.isSelected());
|
|
| 142 |
- }
|
|
| 143 | 101 |
}
|
| ... | ... | @@ -63,13 +63,13 @@ public class SelectionTreeCellRenderer extends DefaultXTreeCellRenderer { |
| 63 | 63 |
selected.setSelectedIcon(selectedIcon);
|
| 64 | 64 |
}
|
| 65 | 65 |
|
| 66 |
- public Icon getIcon(SelectionTreeNodeSupport node) {
|
|
| 66 |
+ public Icon getIcon(SelectionTreeNodeSupport<?> node) {
|
|
| 67 | 67 |
return node.getIcon();
|
| 68 | 68 |
}
|
| 69 | 69 |
|
| 70 | 70 |
@Override
|
| 71 | 71 |
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
|
| 72 |
- SelectionTreeNodeSupport node = (SelectionTreeNodeSupport) value;
|
|
| 72 |
+ SelectionTreeNodeSupport<?> node = (SelectionTreeNodeSupport<?>) value;
|
|
| 73 | 73 |
Icon icon = getIcon(node);
|
| 74 | 74 |
super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
|
| 75 | 75 |
setIcon(icon);
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.client.datasource.tree.selection; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -238,6 +238,7 @@ public class SelectionTreeModel extends DefaultTreeModel { |
| 238 | 238 |
return builder.build();
|
| 239 | 239 |
}
|
| 240 | 240 |
|
| 241 |
+ @SuppressWarnings({"unchecked", "rawtypes"})
|
|
| 241 | 242 |
public Map<ProgramReference, List<? extends TripReference>> getSelectedDataByProgram() {
|
| 242 | 243 |
ImmutableList.Builder<TripSelectionTreeNodeSupport<?, ?>> builder = ImmutableList.builder();
|
| 243 | 244 |
getRoot().collectSelectedTripNodes(builder);
|
| ... | ... | @@ -251,7 +252,7 @@ public class SelectionTreeModel extends DefaultTreeModel { |
| 251 | 252 |
|
| 252 | 253 |
public void removeProgram(String programId) {
|
| 253 | 254 |
RootSelectionTreeNode rootNode = getRoot();
|
| 254 |
- SelectionTreeNodeSupport result = rootNode.findById(programId);
|
|
| 255 |
+ SelectionTreeNodeSupport<?> result = rootNode.findById(programId);
|
|
| 255 | 256 |
Objects.requireNonNull(result, "Could not find program node with id: " + programId);
|
| 256 | 257 |
removeNodeFromParent(result);
|
| 257 | 258 |
}
|
| ... | ... | @@ -259,9 +260,9 @@ public class SelectionTreeModel extends DefaultTreeModel { |
| 259 | 260 |
public void removeTrip(ProgramReference program, TripReference trip) {
|
| 260 | 261 |
|
| 261 | 262 |
RootSelectionTreeNode rootNode = getRoot();
|
| 262 |
- SelectionTreeNodeSupport programNode = rootNode.findById(program.getId());
|
|
| 263 |
+ SelectionTreeNodeSupport<?> programNode = rootNode.findById(program.getId());
|
|
| 263 | 264 |
Objects.requireNonNull(programNode, "Could not find program node with id: " + program);
|
| 264 |
- SelectionTreeNodeSupport tripNode = programNode.findById(trip.getId());
|
|
| 265 |
+ SelectionTreeNodeSupport<?> tripNode = programNode.findById(trip.getId());
|
|
| 265 | 266 |
Objects.requireNonNull(tripNode, "Could not find program node with id: " + trip);
|
| 266 | 267 |
removeNodeFromParent(tripNode);
|
| 267 | 268 |
|
| ... | ... | @@ -271,7 +272,7 @@ public class SelectionTreeModel extends DefaultTreeModel { |
| 271 | 272 |
}
|
| 272 | 273 |
|
| 273 | 274 |
public boolean containsData(ProgramReference program, TripReference trip) {
|
| 274 |
- ReferenceSelectionTreeNodeSupport programNode = getRoot().findById(program.getId());
|
|
| 275 |
+ ReferenceSelectionTreeNodeSupport<?, ?> programNode = getRoot().findById(program.getId());
|
|
| 275 | 276 |
return programNode != null && programNode.findById(trip.getId()) != null;
|
| 276 | 277 |
}
|
| 277 | 278 |
|
| ... | ... | @@ -280,6 +281,10 @@ public class SelectionTreeModel extends DefaultTreeModel { |
| 280 | 281 |
getRoot().collectSelectedTripNodes(builder);
|
| 281 | 282 |
for (TripSelectionTreeNodeSupport<?, ?> tripNode : builder.build()) {
|
| 282 | 283 |
ProgramSelectionTreeNode programNode = tripNode.getParent();
|
| 284 |
+ if (programNode.getParent() == null) {
|
|
| 285 |
+ // This means that the parent was already removed
|
|
| 286 |
+ continue;
|
|
| 287 |
+ }
|
|
| 283 | 288 |
if (programNode.isSelected()) {
|
| 284 | 289 |
removeProgram(programNode.getId());
|
| 285 | 290 |
} else {
|
| ... | ... | @@ -291,28 +296,28 @@ public class SelectionTreeModel extends DefaultTreeModel { |
| 291 | 296 |
}
|
| 292 | 297 |
|
| 293 | 298 |
public void selectAllTrips() {
|
| 294 |
- Enumeration<SelectionTreeNodeSupport> children = getRoot().children();
|
|
| 299 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = getRoot().children();
|
|
| 295 | 300 |
while (children.hasMoreElements()) {
|
| 296 |
- SelectionTreeNodeSupport selectionTreeNodeSupport = children.nextElement();
|
|
| 301 |
+ SelectionTreeNodeSupport<?> selectionTreeNodeSupport = children.nextElement();
|
|
| 297 | 302 |
selectionTreeNodeSupport.setSelected(true);
|
| 298 | 303 |
}
|
| 299 | 304 |
recomputeSelectedCount();
|
| 300 | 305 |
}
|
| 301 | 306 |
|
| 302 | 307 |
public void unselectAllTrips() {
|
| 303 |
- Enumeration<SelectionTreeNodeSupport> children = getRoot().children();
|
|
| 308 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = getRoot().children();
|
|
| 304 | 309 |
while (children.hasMoreElements()) {
|
| 305 |
- SelectionTreeNodeSupport selectionTreeNodeSupport = children.nextElement();
|
|
| 310 |
+ SelectionTreeNodeSupport<?> selectionTreeNodeSupport = children.nextElement();
|
|
| 306 | 311 |
selectionTreeNodeSupport.setSelected(false);
|
| 307 | 312 |
}
|
| 308 | 313 |
recomputeSelectedCount();
|
| 309 | 314 |
}
|
| 310 | 315 |
|
| 311 | 316 |
public void setExistingTrips(List<? super TripReference> existingTrips) {
|
| 312 |
- Enumeration<SelectionTreeNodeSupport> children = getRoot().children();
|
|
| 317 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = getRoot().children();
|
|
| 313 | 318 |
while (children.hasMoreElements()) {
|
| 314 | 319 |
SelectionTreeNodeSupport<?> programNode = children.nextElement();
|
| 315 |
- Enumeration<SelectionTreeNodeSupport> children1 = programNode.children();
|
|
| 320 |
+ Enumeration<SelectionTreeNodeSupport<?>> children1 = programNode.children();
|
|
| 316 | 321 |
while (children1.hasMoreElements()) {
|
| 317 | 322 |
TripSelectionTreeNodeSupport<?, ?> tripNode = (TripSelectionTreeNodeSupport<?, ?>) children1.nextElement();
|
| 318 | 323 |
DataDtoReference<?, ?> data = tripNode.getData();
|
| ... | ... | @@ -338,7 +343,7 @@ public class SelectionTreeModel extends DefaultTreeModel { |
| 338 | 343 |
}
|
| 339 | 344 |
|
| 340 | 345 |
public boolean isDataFull() {
|
| 341 |
- Enumeration<SelectionTreeNodeSupport> children = getRoot().children();
|
|
| 346 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = getRoot().children();
|
|
| 342 | 347 |
while (children.hasMoreElements()) {
|
| 343 | 348 |
SelectionTreeNodeSupport<?> programNode = children.nextElement();
|
| 344 | 349 |
if (!programNode.isSelected()) {
|
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 |
<http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 |
#L%
|
| 21 | 21 |
-->
|
| 22 |
-<JScrollPane id='treePane' decorator='boxed' columnHeaderView='{treeHeader}'>
|
|
| 22 |
+<JScrollPane id='treePane' columnHeaderView='{treeHeader}'>
|
|
| 23 | 23 |
|
| 24 | 24 |
<import>
|
| 25 | 25 |
fr.ird.observe.client.api.util.UIHelperSupport
|
| ... | ... | @@ -41,20 +41,15 @@ public boolean isOpposite() { return opposite; } |
| 41 | 41 |
]]>
|
| 42 | 42 |
</script>
|
| 43 | 43 |
<String id='labelText' javaBean='null'/>
|
| 44 |
- <SelectionTree id='tree' javaBean="new SelectionTree()"/>
|
|
| 45 |
- |
|
| 44 |
+ <SelectionTree id='tree'/>
|
|
| 46 | 45 |
<JPanel id="treeHeader" layout='{new BorderLayout()}'>
|
| 47 |
- |
|
| 48 |
- |
|
| 49 | 46 |
<JLabel id="label" constraints='BorderLayout.CENTER'/>
|
| 50 |
- |
|
| 51 | 47 |
<JToolBar id='toolbar' constraints='BorderLayout.EAST'>
|
| 52 | 48 |
<JButton id='collapseAll'/>
|
| 53 | 49 |
<JButton id='expandAll'/>
|
| 54 | 50 |
<JButton id='selectAll'/>
|
| 55 | 51 |
<JButton id='unselectAll'/>
|
| 56 | 52 |
</JToolBar>
|
| 57 |
- |
|
| 58 | 53 |
</JPanel>
|
| 59 | 54 |
|
| 60 | 55 |
</JScrollPane>
|
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 |
*/
|
| 22 | 22 |
|
| 23 | 23 |
#tree {
|
| 24 |
- minimumSize:{UIHelperSupport.newMinDimension()};
|
|
| 24 |
+ /*minimumSize:{UIHelperSupport.newMinDimension()};*/
|
|
| 25 | 25 |
font-size:11;
|
| 26 | 26 |
}
|
| 27 | 27 |
|
| ... | ... | @@ -38,11 +38,10 @@ class SelectionTreePaneHandler implements UIHandler<SelectionTreePane> { |
| 38 | 38 |
public void afterInit(SelectionTreePane ui) {
|
| 39 | 39 |
|
| 40 | 40 |
PropertyChangeListener propertyChangeListener = e -> onTripCountChanged(ui, (int) e.getNewValue());
|
| 41 |
- ui.addPropertyChangeListener(SelectionTreePane.PROPERTY_TREE, e -> {
|
|
| 42 |
- SelectionTreeModel newValue = ((SelectionTree) e.getNewValue()).getTreeModel();
|
|
| 43 |
- newValue.removePropertyChangeListener(SelectionTreeModel.SELECTED_COUNT, propertyChangeListener);
|
|
| 44 |
- newValue.addPropertyChangeListener(SelectionTreeModel.SELECTED_COUNT, propertyChangeListener);
|
|
| 45 |
- });
|
|
| 41 |
+ ui.getTree().getTreeModel().addPropertyChangeListener(SelectionTreeModel.SELECTED_COUNT, propertyChangeListener);
|
|
| 42 |
+ onTripCountChanged(ui, ui.getTree().getTreeModel().getSelectedCount());
|
|
| 43 |
+ //FIXME:BodyContent Jaxx should do this for us, instead just call a add method on scrollPane, and tree is not visible
|
|
| 44 |
+ ui.setViewportView(ui.getTree());
|
|
| 46 | 45 |
}
|
| 47 | 46 |
|
| 48 | 47 |
private void onTripCountChanged(SelectionTreePane ui, int newValue) {
|
| 1 |
+package fr.ird.observe.client.datasource.tree.selection.actions;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client DataSource Tree Selection
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import fr.ird.observe.client.api.util.ObserveKeyStrokesSupport;
|
|
| 26 |
+import fr.ird.observe.client.datasource.tree.selection.SelectionTree;
|
|
| 27 |
+import fr.ird.observe.client.datasource.tree.selection.SelectionTreePane;
|
|
| 28 |
+import fr.ird.observe.client.datasource.tree.selection.nodes.SelectionTreeNodeSupport;
|
|
| 29 |
+import org.apache.logging.log4j.LogManager;
|
|
| 30 |
+import org.apache.logging.log4j.Logger;
|
|
| 31 |
+ |
|
| 32 |
+import javax.swing.ActionMap;
|
|
| 33 |
+import javax.swing.InputMap;
|
|
| 34 |
+import java.awt.event.ActionEvent;
|
|
| 35 |
+import java.awt.event.MouseAdapter;
|
|
| 36 |
+import java.awt.event.MouseEvent;
|
|
| 37 |
+ |
|
| 38 |
+/**
|
|
| 39 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 40 |
+ * @since 8
|
|
| 41 |
+ */
|
|
| 42 |
+public class SelectUnselect extends SelectionTreePaneActionSupport {
|
|
| 43 |
+ |
|
| 44 |
+ private static final Logger log = LogManager.getLogger(SelectUnselect.class);
|
|
| 45 |
+ |
|
| 46 |
+ public SelectUnselect() {
|
|
| 47 |
+ super(null, null, null, ObserveKeyStrokesSupport.KEY_STROKE_SPACE);
|
|
| 48 |
+ }
|
|
| 49 |
+ |
|
| 50 |
+ @Override
|
|
| 51 |
+ protected InputMap getInputMap(SelectionTreePane selectionTreePane, int inputMapCondition) {
|
|
| 52 |
+ return selectionTreePane.getTree().getInputMap(inputMapCondition);
|
|
| 53 |
+ }
|
|
| 54 |
+ |
|
| 55 |
+ @Override
|
|
| 56 |
+ protected ActionMap getActionMap(SelectionTreePane selectionTreePane) {
|
|
| 57 |
+ return selectionTreePane.getTree().getActionMap();
|
|
| 58 |
+ }
|
|
| 59 |
+ |
|
| 60 |
+ @Override
|
|
| 61 |
+ protected void defaultInit(InputMap inputMap, ActionMap actionMap) {
|
|
| 62 |
+ super.defaultInit(inputMap, actionMap);
|
|
| 63 |
+ getUi().getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 64 |
+ getUi().getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_COPY_FROM_LEFT, "none");
|
|
| 65 |
+ getUi().getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_LEFT, "none");
|
|
| 66 |
+ getUi().getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_COPY_FROM_RIGHT, "none");
|
|
| 67 |
+ getUi().getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_RIGHT, "none");
|
|
| 68 |
+// oppositeTree.getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 69 |
+ |
|
| 70 |
+ inputMap.put(ObserveKeyStrokesSupport.KEY_STROKE_ENTER, getActionCommandKey());
|
|
| 71 |
+ getUi().getTree().addMouseListener(new MouseAdapter() {
|
|
| 72 |
+ @Override
|
|
| 73 |
+ public void mouseClicked(MouseEvent e) {
|
|
| 74 |
+ if (e.getClickCount() == 2) {
|
|
| 75 |
+ actionPerformed(new ActionEvent(getUi().getTree(), 0, "yo"));
|
|
| 76 |
+ }
|
|
| 77 |
+ }
|
|
| 78 |
+ });
|
|
| 79 |
+ }
|
|
| 80 |
+ |
|
| 81 |
+ @Override
|
|
| 82 |
+ protected boolean canExecuteAction(ActionEvent e) {
|
|
| 83 |
+ boolean result = canExecutionActionFromLayer(getUi(), e);
|
|
| 84 |
+ if (result) {
|
|
| 85 |
+ log.info(String.format("Accept action : %s", getName()));
|
|
| 86 |
+ } else {
|
|
| 87 |
+ log.info(String.format("Reject action : %s", getName()));
|
|
| 88 |
+ }
|
|
| 89 |
+ return result;
|
|
| 90 |
+ }
|
|
| 91 |
+ |
|
| 92 |
+ @Override
|
|
| 93 |
+ protected void doActionPerformed(ActionEvent e, SelectionTreePane ui) {
|
|
| 94 |
+ selectUnSelect(ui.getTree());
|
|
| 95 |
+ }
|
|
| 96 |
+ |
|
| 97 |
+ protected void selectUnSelect(SelectionTree tree) {
|
|
| 98 |
+ Object selectedRow = tree.getLastSelectedPathComponent();
|
|
| 99 |
+ if (selectedRow == null) {
|
|
| 100 |
+ return;
|
|
| 101 |
+ }
|
|
| 102 |
+ |
|
| 103 |
+ SelectionTreeNodeSupport<?> node = (SelectionTreeNodeSupport<?>) selectedRow;
|
|
| 104 |
+ tree.getTreeModel().setValueAt(node, !node.isSelected());
|
|
| 105 |
+ }
|
|
| 106 |
+ |
|
| 107 |
+}
|
| 1 |
+package fr.ird.observe.client.datasource.tree.selection.actions;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client DataSource Tree Selection
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import fr.ird.observe.client.api.util.ObserveKeyStrokesSupport;
|
|
| 26 |
+import fr.ird.observe.client.datasource.tree.selection.SelectionTree;
|
|
| 27 |
+import fr.ird.observe.client.datasource.tree.selection.SelectionTreePane;
|
|
| 28 |
+ |
|
| 29 |
+import java.awt.event.ActionEvent;
|
|
| 30 |
+ |
|
| 31 |
+/**
|
|
| 32 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 33 |
+ * @since 8
|
|
| 34 |
+ */
|
|
| 35 |
+public class SelectUnselectWithOpposite extends SelectUnselect {
|
|
| 36 |
+ |
|
| 37 |
+ private final SelectionTreePane oppositeTreePane;
|
|
| 38 |
+ |
|
| 39 |
+ public SelectUnselectWithOpposite(SelectionTreePane oppositeTreePane) {
|
|
| 40 |
+ this.oppositeTreePane = oppositeTreePane;
|
|
| 41 |
+ }
|
|
| 42 |
+ |
|
| 43 |
+ @Override
|
|
| 44 |
+ public void init() {
|
|
| 45 |
+ oppositeTreePane.getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_SPACE, "none");
|
|
| 46 |
+ oppositeTreePane.getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_COPY_FROM_LEFT, "none");
|
|
| 47 |
+ oppositeTreePane.getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_COPY_FROM_RIGHT, "none");
|
|
| 48 |
+ oppositeTreePane.getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_LEFT, "none");
|
|
| 49 |
+ oppositeTreePane.getTree().getInputMap().put(ObserveKeyStrokesSupport.KEY_STROKE_DATA_SYNCHRO_DELETE_FROM_RIGHT, "none");
|
|
| 50 |
+ defaultInit(getInputMap(ui, getInputMapCondition()), getActionMap(ui));
|
|
| 51 |
+ defaultInit(getInputMap(oppositeTreePane, getInputMapCondition()), getActionMap(oppositeTreePane));
|
|
| 52 |
+ }
|
|
| 53 |
+ |
|
| 54 |
+ @Override
|
|
| 55 |
+ protected void doActionPerformed(ActionEvent e, SelectionTreePane ui) {
|
|
| 56 |
+ SelectionTree tree = ui.getTree();
|
|
| 57 |
+ if (tree.isFocusOwner()) {
|
|
| 58 |
+ selectUnSelect(tree);
|
|
| 59 |
+ } else {
|
|
| 60 |
+ selectUnSelect(oppositeTreePane.getTree());
|
|
| 61 |
+ }
|
|
| 62 |
+ }
|
|
| 63 |
+ |
|
| 64 |
+}
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.client.datasource.tree.selection.nodes; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -84,9 +84,9 @@ public class ProgramSelectionTreeNode extends ReferenceSelectionTreeNodeSupport< |
| 84 | 84 |
|
| 85 | 85 |
@Override
|
| 86 | 86 |
public boolean isSelected() {
|
| 87 |
- Enumeration<SelectionTreeNodeSupport> children = children();
|
|
| 87 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = children();
|
|
| 88 | 88 |
while (children.hasMoreElements()) {
|
| 89 |
- SelectionTreeNodeSupport node = children.nextElement();
|
|
| 89 |
+ SelectionTreeNodeSupport<?> node = children.nextElement();
|
|
| 90 | 90 |
if (!node.isSelected()) {
|
| 91 | 91 |
return false;
|
| 92 | 92 |
}
|
| ... | ... | @@ -96,18 +96,18 @@ public class ProgramSelectionTreeNode extends ReferenceSelectionTreeNodeSupport< |
| 96 | 96 |
|
| 97 | 97 |
@Override
|
| 98 | 98 |
public void setSelected(boolean selected) {
|
| 99 |
- Enumeration<SelectionTreeNodeSupport> children = children();
|
|
| 99 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = children();
|
|
| 100 | 100 |
while (children.hasMoreElements()) {
|
| 101 |
- SelectionTreeNodeSupport node = children.nextElement();
|
|
| 101 |
+ SelectionTreeNodeSupport<?> node = children.nextElement();
|
|
| 102 | 102 |
node.setSelected(selected);
|
| 103 | 103 |
}
|
| 104 | 104 |
}
|
| 105 | 105 |
|
| 106 | 106 |
@Override
|
| 107 | 107 |
public void collectSelectedTripNodes(ImmutableList.Builder<TripSelectionTreeNodeSupport<?, ?>> builder) {
|
| 108 |
- Enumeration<SelectionTreeNodeSupport> children = children();
|
|
| 108 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = children();
|
|
| 109 | 109 |
while (children.hasMoreElements()) {
|
| 110 |
- TripSelectionTreeNodeSupport<?, ?> tripNode = (TripSelectionTreeNodeSupport) children.nextElement();
|
|
| 110 |
+ TripSelectionTreeNodeSupport<?, ?> tripNode = (TripSelectionTreeNodeSupport<?, ?>) children.nextElement();
|
|
| 111 | 111 |
tripNode.collectSelectedTripNodes(builder);
|
| 112 | 112 |
}
|
| 113 | 113 |
}
|
| ... | ... | @@ -56,7 +56,7 @@ public abstract class ReferenceSelectionTreeNodeSupport<D extends IdDto, R exten |
| 56 | 56 |
|
| 57 | 57 |
@Override
|
| 58 | 58 |
public String getText() {
|
| 59 |
- Decorator decorator = DecoratorServiceApplicationComponent.value().getReferenceDecorator(getData().getReferenceType());
|
|
| 59 |
+ Decorator<?> decorator = DecoratorServiceApplicationComponent.value().getReferenceDecorator(getData().getReferenceType());
|
|
| 60 | 60 |
return decorator.toString(getData());
|
| 61 | 61 |
}
|
| 62 | 62 |
|
| ... | ... | @@ -88,9 +88,9 @@ public abstract class ReferenceSelectionTreeNodeSupport<D extends IdDto, R exten |
| 88 | 88 |
if (isLeaf()) {
|
| 89 | 89 |
return false;
|
| 90 | 90 |
}
|
| 91 |
- Enumeration<SelectionTreeNodeSupport> children = children();
|
|
| 91 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = children();
|
|
| 92 | 92 |
while (children.hasMoreElements()) {
|
| 93 |
- SelectionTreeNodeSupport nodeSupport = children.nextElement();
|
|
| 93 |
+ SelectionTreeNodeSupport<?> nodeSupport = children.nextElement();
|
|
| 94 | 94 |
if (nodeSupport.isSelected()) {
|
| 95 | 95 |
return true;
|
| 96 | 96 |
}
|
| ... | ... | @@ -50,7 +50,7 @@ public class ReferentialsSelectionTreeNode extends SelectionTreeNodeSupport<Stri |
| 50 | 50 |
public static ReferentialsSelectionTreeNode of(String name, ImmutableSet<Class<? extends ReferentialDto>> types) {
|
| 51 | 51 |
ReferentialsSelectionTreeNode result = new ReferentialsSelectionTreeNode(t(name));
|
| 52 | 52 |
for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortTypes(types, ClientConfigApplicationComponent.value().getLocale())) {
|
| 53 |
- ReferentialSelectionTreeNode child = new ReferentialSelectionTreeNode<>(aClass);
|
|
| 53 |
+ ReferentialSelectionTreeNode<?> child = new ReferentialSelectionTreeNode<>(aClass);
|
|
| 54 | 54 |
result.add(child);
|
| 55 | 55 |
}
|
| 56 | 56 |
|
| ... | ... | @@ -77,10 +77,10 @@ public class RootSelectionTreeNode extends SelectionTreeNodeSupport<Void> { |
| 77 | 77 |
}
|
| 78 | 78 |
|
| 79 | 79 |
public ReferentialsSelectionTreeNode[] getReferentialNodes() {
|
| 80 |
- Enumeration<SelectionTreeNodeSupport> children = children();
|
|
| 80 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = children();
|
|
| 81 | 81 |
List<ReferentialsSelectionTreeNode> result = new LinkedList<>();
|
| 82 | 82 |
while (children.hasMoreElements()) {
|
| 83 |
- SelectionTreeNodeSupport childNode = children.nextElement();
|
|
| 83 |
+ SelectionTreeNodeSupport<?> childNode = children.nextElement();
|
|
| 84 | 84 |
result.add((ReferentialsSelectionTreeNode) childNode);
|
| 85 | 85 |
}
|
| 86 | 86 |
return result.toArray(new ReferentialsSelectionTreeNode[0]);
|
| ... | ... | @@ -88,9 +88,9 @@ public class RootSelectionTreeNode extends SelectionTreeNodeSupport<Void> { |
| 88 | 88 |
|
| 89 | 89 |
@Override
|
| 90 | 90 |
public void collectSelectedTripNodes(ImmutableList.Builder<TripSelectionTreeNodeSupport<?, ?>> builder) {
|
| 91 |
- Enumeration<SelectionTreeNodeSupport> children = children();
|
|
| 91 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = children();
|
|
| 92 | 92 |
while (children.hasMoreElements()) {
|
| 93 |
- SelectionTreeNodeSupport childNode = children.nextElement();
|
|
| 93 |
+ SelectionTreeNodeSupport<?> childNode = children.nextElement();
|
|
| 94 | 94 |
if (childNode instanceof ProgramSelectionTreeNode) {
|
| 95 | 95 |
ProgramSelectionTreeNode programNode = (ProgramSelectionTreeNode) childNode;
|
| 96 | 96 |
programNode.collectSelectedTripNodes(builder);
|
| ... | ... | @@ -56,6 +56,7 @@ public abstract class SelectionTreeNodeSupport<O> extends DefaultMutableTreeNode |
| 56 | 56 |
return getText();
|
| 57 | 57 |
}
|
| 58 | 58 |
|
| 59 |
+ @SuppressWarnings("unchecked")
|
|
| 59 | 60 |
public O getData() {
|
| 60 | 61 |
return (O) getUserObject();
|
| 61 | 62 |
}
|
| ... | ... | @@ -75,15 +76,16 @@ public abstract class SelectionTreeNodeSupport<O> extends DefaultMutableTreeNode |
| 75 | 76 |
|
| 76 | 77 |
public abstract void setSelected(boolean selected);
|
| 77 | 78 |
|
| 79 |
+ @SuppressWarnings({"unchecked", "rawtypes"})
|
|
| 78 | 80 |
@Override
|
| 79 |
- public Enumeration<SelectionTreeNodeSupport> children() {
|
|
| 81 |
+ public Enumeration<SelectionTreeNodeSupport<?>> children() {
|
|
| 80 | 82 |
return (Enumeration) super.children();
|
| 81 | 83 |
}
|
| 82 | 84 |
|
| 83 |
- public ReferenceSelectionTreeNodeSupport findById(String id) {
|
|
| 84 |
- Enumeration<SelectionTreeNodeSupport> children = children();
|
|
| 85 |
+ public ReferenceSelectionTreeNodeSupport<?,?> findById(String id) {
|
|
| 86 |
+ Enumeration<SelectionTreeNodeSupport<?>> children = children();
|
|
| 85 | 87 |
while (children.hasMoreElements()) {
|
| 86 |
- ReferenceSelectionTreeNodeSupport<?, ?> child = (ReferenceSelectionTreeNodeSupport) children.nextElement();
|
|
| 88 |
+ ReferenceSelectionTreeNodeSupport<?, ?> child = (ReferenceSelectionTreeNodeSupport<?,?>) children.nextElement();
|
|
| 87 | 89 |
if (id.equals(child.getData().getId())) {
|
| 88 | 90 |
return child;
|
| 89 | 91 |
}
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
<parent>
|
| 28 | 28 |
<groupId>io.ultreia.maven</groupId>
|
| 29 | 29 |
<artifactId>pom</artifactId>
|
| 30 |
- <version>2019.8.43</version>
|
|
| 30 |
+ <version>2019.8.44</version>
|
|
| 31 | 31 |
</parent>
|
| 32 | 32 |
|
| 33 | 33 |
<groupId>fr.ird.observe</groupId>
|