+ attachReferenceAnnotations(seqs, false, false);
+
+ testee.configureReferenceAnnotationsMenu(menu, seqs);
+ assertTrue(menu.isEnabled());
+ String s = MessageManager.getString("label.add_annotations_for");
+ String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
+ + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+ assertEquals(expected, menu.getToolTipText());
+ }
+
+ /**
+ * Test building the 'add reference annotations' menu for the case where
+ * several reference annotations are on the dataset and the sequences but not
+ * on the alignment. The menu item should be enabled, and acquire a tooltip
+ * which lists the annotation sources (calcIds) and type (labels).
+ */
+ @Test(groups = { "Functional" })
+ public void testConfigureReferenceAnnotationsMenu_notOnAlignment()
+ {
+ JMenuItem menu = new JMenuItem();
+ List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
+
+ // make up new annotations and add to dataset sequences and sequences
+ attachReferenceAnnotations(seqs, true, false);
+
+ testee.configureReferenceAnnotationsMenu(menu, seqs);
+ assertTrue(menu.isEnabled());
+ String s = MessageManager.getString("label.add_annotations_for");
+ String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
+ + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+ assertEquals(expected, menu.getToolTipText());
+ }