From 15c6c6724878a5445e9f5bc6594719dbe81c1735 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 10 Nov 2017 13:45:50 +0000 Subject: [PATCH] JAL-2791 tailored message if find fails on selection region --- resources/lang/Messages.properties | 3 ++- resources/lang/Messages_es.properties | 3 ++- src/jalview/controller/AlignViewController.java | 14 ++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index a400afe..d2a9bb7 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -997,7 +997,8 @@ label.toggled = Toggled label.marked = Marked label.containing = containing label.not_containing = not containing -label.no_feature_of_type_found = No features of type {0} found. +label.no_feature_of_type_found = No features of type {0} found +label.no_feature_found_selection = No features of type {0} found in selection label.submission_params = Submission {0} label.empty_alignment_job = Empty Alignment Job label.add_new_sbrs_service = Add a new Simple Bioinformatics Rest Service diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index 08373ba..7e69016 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -922,7 +922,8 @@ label.toggled = Invertida label.marked = Marcada label.containing = conteniendo label.not_containing = no conteniendo -label.no_feature_of_type_found = No se han encontrado características del tipo {0}. +label.no_feature_of_type_found = No se han encontrado características del tipo {0} +label.no_feature_found_selection = No se han encontrado características del tipo {0} en la región seleccionada label.submission_params = Envío {0} label.empty_alignment_job = Trabajo de alineamiento vacío label.add_new_sbrs_service = Añadir un nuevo SBRS diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index a82b98d..f45afa5 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -166,9 +166,10 @@ public class AlignViewController implements AlignViewControllerI // JBPNote this routine could also mark rows, not just columns. // need a decent query structure to allow all types of feature searches BitSet bs = new BitSet(); - SequenceCollectionI sqcol = (viewport.getSelectionGroup() == null - || extendCurrent) ? viewport.getAlignment() - : viewport.getSelectionGroup(); + boolean searchSelection = viewport.getSelectionGroup() != null + && !extendCurrent; + SequenceCollectionI sqcol = searchSelection ? viewport + .getSelectionGroup() : viewport.getAlignment(); int nseq = findColumnsWithFeature(featureType, sqcol, bs); @@ -204,9 +205,10 @@ public class AlignViewController implements AlignViewControllerI } else { - avcg.setStatus(MessageManager - .formatMessage("label.no_feature_of_type_found", new String[] - { featureType })); + String key = searchSelection ? "label.no_feature_found_selection" + : "label.no_feature_of_type_found"; + avcg.setStatus(MessageManager.formatMessage(key, + new String[] { featureType })); if (!extendCurrent) { cs.clear(); -- 1.7.10.2