Skip to content
Snippets Groups Projects
Commit 5e67ae84 authored by tjc's avatar tjc
Browse files

provide uniquename based on srcfeature name and base range

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@10966 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 223d1bb8
No related branches found
No related tags found
No related merge requests found
...@@ -831,6 +831,56 @@ public class GeneUtils ...@@ -831,6 +831,56 @@ public class GeneUtils
return id; return id;
} }
/**
* Prompt the user for an ID and provide a default automated ID
* based on the range.
* @param entry_group
* @param is_forward
* @param range
* @return
*/
public static String promptForUniquename(final EntryGroup entry_group,
final boolean is_forward,
final Range range)
{
final Entry default_entry = entry_group.getDefaultEntry ();
String id = null;
if(default_entry.getEMBLEntry() instanceof
uk.ac.sanger.artemis.io.DatabaseDocumentEntry)
{
while(id == null ||
id.equals("") ||
id.equals("to_be_set"))
{
String msg = "Provide a unique ID ";
if(!is_forward)
msg = msg + "for reverse strand : ";
else
msg = msg + ": ";
id = JOptionPane.showInputDialog(null, msg,
default_entry.getName()+":"+
range.getStart()+".."+
range.getEnd());
if(!isUniqueID(entry_group, id))
{
JOptionPane.showMessageDialog(null,
"ID "+id+" not unique.\nEnter a unique ID.",
"ID Not Unique",
JOptionPane.WARNING_MESSAGE);
id = null;
}
}
}
return id;
}
/** /**
* Test to ensure ID (chado uniquename) is unique. * Test to ensure ID (chado uniquename) is unique.
* @param entry_group * @param entry_group
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment