BLOSUM62Colour.setName(JalviewColourScheme.Blosum62.toString());
BLOSUM62Colour.addItemListener(this);
PIDColour.setLabel(
- MessageManager.getString("label.colourScheme_%_identity"));
+ MessageManager.getString("label.colourScheme_%identity"));
PIDColour.setName(JalviewColourScheme.PID.toString());
PIDColour.addItemListener(this);
zappoColour
.setName(JalviewColourScheme.Hydrophobic.toString());
hydrophobicityColour.addItemListener(this);
helixColour.setLabel(MessageManager
- .getString("label.colourScheme_helix_propensity"));
+ .getString("label.colourScheme_helixpropensity"));
helixColour.setName(JalviewColourScheme.Helix.toString());
helixColour.addItemListener(this);
strandColour.setLabel(MessageManager
- .getString("label.colourScheme_strand_propensity"));
+ .getString("label.colourScheme_strandpropensity"));
strandColour.setName(JalviewColourScheme.Strand.toString());
strandColour.addItemListener(this);
turnColour.setLabel(
- MessageManager.getString("label.colourScheme_turn_propensity"));
+ MessageManager.getString("label.colourScheme_turnpropensity"));
turnColour.setName(JalviewColourScheme.Turn.toString());
turnColour.addItemListener(this);
buriedColour.setLabel(
- MessageManager.getString("label.colourScheme_buried_index"));
+ MessageManager.getString("label.colourScheme_buriedindex"));
buriedColour.setName(JalviewColourScheme.Buried.toString());
buriedColour.addItemListener(this);
nucleotideColour.setLabel(
MessageManager.getString("label.colourScheme_hydrophobic"));
hydrophobicityColour.addActionListener(this);
helixColour.setLabel(MessageManager
- .getString("label.colourScheme_helix_propensity"));
+ .getString("label.colourScheme_helixpropensity"));
helixColour.addActionListener(this);
strandColour.setLabel(MessageManager
- .getString("label.colourScheme_strand_propensity"));
+ .getString("label.colourScheme_strandpropensity"));
strandColour.addActionListener(this);
turnColour.setLabel(
- MessageManager.getString("label.colourScheme_turn_propensity"));
+ MessageManager.getString("label.colourScheme_turnpropensity"));
turnColour.addActionListener(this);
buriedColour.setLabel(
- MessageManager.getString("label.colourScheme_buried_index"));
+ MessageManager.getString("label.colourScheme_buriedindex"));
buriedColour.addActionListener(this);
purinePyrimidineColour.setLabel(MessageManager
.getString("label.colourScheme_purine/pyrimidine"));
// .getString("label.rna_interaction"));
// RNAInteractionColour.addActionListener(this);
RNAHelixColour.setLabel(
- MessageManager.getString("label.colourScheme_rna_helices"));
+ MessageManager.getString("label.colourScheme_rnahelices"));
RNAHelixColour.addActionListener(this);
userDefinedColour
.setLabel(MessageManager.getString("action.user_defined"));
userDefinedColour.addActionListener(this);
PIDColour.setLabel(
- MessageManager.getString("label.colourScheme_%_identity"));
+ MessageManager.getString("label.colourScheme_%identity"));
PIDColour.addActionListener(this);
BLOSUM62Colour.setLabel(
MessageManager.getString("label.colourScheme_blosum62"));
BLOSUM62Colour.addActionListener(this);
tcoffeeColour.setLabel(
- MessageManager.getString("label.colourScheme_t-coffee_scores"));
+ MessageManager.getString("label.colourScheme_t-coffeescores"));
// it will be enabled only if a score file is provided
tcoffeeColour.setEnabled(false);
tcoffeeColour.addActionListener(this);
MessageManager.getString("label.colourScheme_hydrophobic"));
MenuItem helix = new MenuItem(
- MessageManager.getString("label.colourScheme_helix_propensity"));
+ MessageManager.getString("label.colourScheme_helixpropensity"));
MenuItem strand = new MenuItem(
- MessageManager.getString("label.colourScheme_strand_propensity"));
+ MessageManager.getString("label.colourScheme_strandpropensity"));
MenuItem turn = new MenuItem(
- MessageManager.getString("label.colourScheme_turn_propensity"));
+ MessageManager.getString("label.colourScheme_turnpropensity"));
MenuItem buried = new MenuItem(
- MessageManager.getString("label.colourScheme_buried_index"));
+ MessageManager.getString("label.colourScheme_buriedindex"));
MenuItem purinepyrimidine = new MenuItem(
MessageManager.getString("label.colourScheme_purine/pyrimidine"));
taylor.setLabel(MessageManager.getString("label.colourScheme_taylor"));
taylor.addActionListener(this);
helix.setLabel(MessageManager
- .getString("label.colourScheme_helix_propensity"));
+ .getString("label.colourScheme_helixpropensity"));
helix.addActionListener(this);
strand.setLabel(MessageManager
- .getString("label.colourScheme_strand_propensity"));
+ .getString("label.colourScheme_strandpropensity"));
strand.addActionListener(this);
turn.setLabel(
- MessageManager.getString("label.colourScheme_turn_propensity"));
+ MessageManager.getString("label.colourScheme_turnpropensity"));
turn.addActionListener(this);
buried.setLabel(
- MessageManager.getString("label.colourScheme_buried_index"));
+ MessageManager.getString("label.colourScheme_buriedindex"));
buried.addActionListener(this);
user.setLabel(MessageManager.getString("action.user_defined"));
user.addActionListener(this);
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
{
System.out.println(
"Scanning " + srcPath + " for calls to MessageManager\n");
- System.out.println("Please note this is not a perfect check:");
- System.out.println(
- "- message keys constructed dynamically can't be checked");
- System.out
- .println("- message keys passed as variables can't be checked");
- System.out.println(
- "- references in commented out code are not filtered out");
- System.out.println(
- "Verify 'missing' keys manually by a source code search\n");
sourcePath = srcPath;
loadMessages();
*/
private void reportResults()
{
- System.out.println("\nScanned " + javaCount + " source files");
System.out.println(
- "Messages.properties has " + messages.size() + " keys");
+ "\nMessages.properties has " + messages.size() + " keys");
+ System.out.println("Scanned " + javaCount + " source files\n");
+
if (!invalidKeys.isEmpty())
{
System.out.println("Found " + invalidKeys.size()
- + " possibly invalid unmatched keys in source code"
+ + " possibly invalid unmatched key(s) in source code"
+ (invalidKeys.size() > 1 ? "s" : ""));
}
if (dynamicCount < messageKeys.size())
{
System.out.println((messageKeys.size() - dynamicCount)
- + " keys not found, possibly unused, or used indirectly (check code manually!)");
+ + " key(s) not found, possibly unused, or used indirectly (check code manually!)");
for (String key : messageKeys)
{
if (!isDynamic(key))
}
}
System.out
- .println("(Run i18nAnt.xml to compare other message bundles)");
+ .println("\nRun i18nAnt.xml to compare other message bundles");
}
/**
* @param lineNo
* @param line
*/
- private void inspectSourceLines(String path, int lineNo, String line)
+ private void inspectSourceLines(String path, int lineNo,
+ final String line)
{
String lineNos = String.format("%d-%d", lineNo,
lineNo + bufferSize - 1);
String key = messageKey.substring(1, messageKey.length() - 1);
if (!dynamicKeys.contains(key))
{
- System.out.println(String.format(
- "Dynamic key \"" + key + "\" at %s line %s %s",
- path.substring(sourcePath.length()), lineNos, line));
+// System.out.println(String.format(
+// "Dynamic key \"" + key + "\" at %s line %s %s",
+// path.substring(sourcePath.length()), lineNos, line));
dynamicKeys.add(key);
}
continue;
if (!(STRING_PATTERN.matcher(messageKey).matches()))
{
- System.out.println(String.format("Dynamic key at %s line %s %s",
- path.substring(sourcePath.length()), lineNos, line));
+// System.out.println(String.format("Dynamic key at %s line %s %s",
+// path.substring(sourcePath.length()), lineNos, line));
continue;
}
}
messageKeys.remove(messageKey);
}
+
+ /*
+ * and a brute force scan for _any_ as yet unseen message key, to catch the
+ * cases where it is in a variable or a condition
+ */
+ if (line.contains("\""))
+ {
+ Iterator<String> it = messageKeys.iterator();
+ while (it.hasNext())
+ {
+ if (line.contains(it.next()))
+ {
+ it.remove(); // remove as 'seen'
+ }
+ }
+ }
}
/**