@@ -47,8 +47,7 @@ public class HitsListPanel extends VLayout implements SearchObserver, DocumentOb
47
47
public HitsListPanel () {
48
48
try {
49
49
if (CookiesManager .get (CookiesManager .COOKIE_HITSLIST_MODE ) != null ) {
50
- visualizationMode = Integer
51
- .parseInt (CookiesManager .get (CookiesManager .COOKIE_HITSLIST_MODE ));
50
+ visualizationMode = Integer .parseInt (CookiesManager .get (CookiesManager .COOKIE_HITSLIST_MODE ));
52
51
}
53
52
} catch (Exception t ) {
54
53
// Nothing to do
@@ -266,6 +265,10 @@ public void onFolderMoved(GUIFolder folder) {
266
265
267
266
@ Override
268
267
public void onFolderChanged (GUIFolder folder ) {
268
+ // Skip record update if it is not a folder
269
+ if (!isSelectionFolder ())
270
+ return ;
271
+
269
272
GUIDocument doc = grid .getSelectedDocument ();
270
273
if (doc != null ) {
271
274
doc .setFileName (folder .getName ());
@@ -275,6 +278,16 @@ public void onFolderChanged(GUIFolder folder) {
275
278
}
276
279
}
277
280
281
+ /**
282
+ * This panel can show folders and documents depending on the search, so
283
+ * this method check is the currently selected item is a folder
284
+ *
285
+ * @return if the currently selection is a folder
286
+ */
287
+ private boolean isSelectionFolder () {
288
+ return "folder" .equals (grid .getSelectedDocument ().getType ());
289
+ }
290
+
278
291
@ Override
279
292
public void onFolderBeginEditing (GUIFolder folder ) {
280
293
// Nothing to do
@@ -302,6 +315,9 @@ public void onDocumentMoved(GUIDocument document) {
302
315
303
316
@ Override
304
317
public void onDocumentModified (GUIDocument document ) {
318
+ // Skip record update if it is a folder
319
+ if (isSelectionFolder ())
320
+ return ;
305
321
grid .updateDocument (document );
306
322
}
307
323
0 commit comments