{
new Thread()
{
+ @Override
public void run()
{
lbl_loading.setVisible(false);
{
tbl_summary.setModel(PDBRestResponse.getTableModel(request,
resultList.getSearchSummary()));
+ // request.ge
+ // TableRowSorter<TableModel> sorter = new TableRowSorter<>(
+ // tbl_pdbDocFieldConfig.getModel());
}
long endTime = System.currentTimeMillis();
mainFrame.dispose();
}
+ @Override
public void transferToSequenceFetcher(String ids)
{
// mainFrame.dispose();
{
new Thread()
{
+ @Override
public void run()
{
try
/**
* Populates search target combo-box options
*/
+ @Override
public void populateCmbSearchTargetOptions()
{
List<PDBDocField> searchableTargets = new ArrayList<PDBDocField>();
package jalview.jbgui;
import jalview.ws.dbsources.PDBRestClient.PDBDocField;
+import jalview.ws.dbsources.PDBRestClient.PDBDocField.Group;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
+
@SuppressWarnings("serial")
public class PDBDocFieldPreferences extends JScrollPane
{
columnNames = new String[] { "", "Display", "Group" };
break;
case STRUCTURE_CHOOSER:
- columnNames = new String[] { " ", "Display", "Group" };
+ columnNames = new String[] { "", "Display", "Group" };
break;
case PREFERENCES:
columnNames = new String[] { "PDB Field", "Show in search summary",
sortKeys.add(new RowSorter.SortKey(columnIndexToSort,
SortOrder.ASCENDING));
sorter.setSortKeys(sortKeys);
+ sorter.setComparator(
+ columnIndexToSort,
+ new Comparator<jalview.ws.dbsources.PDBRestClient.PDBDocField.Group>()
+ {
+ @Override
+ public int compare(Group o1, Group o2)
+ {
+ return o1.getSortOrder() - o2.getSortOrder();
+ }
+ });
sorter.sort();
break;
case PREFERENCES:
"Version", "_version_", Group.MISCELLENOUS), ALL("ALL", "text",
Group.MISCELLENOUS);
- private enum Group
+ public enum Group
{
- DATE_OF("Date Of"), NAMES_AND_TAXONOMY("Names & Taxonomy"), MISCELLENOUS(
- "Miscellenous"), QUALITY_MEASURES("Quality Measures"), CROSS_REFS(
- "Cross References"), PROCEDURE_AND_SOFTWARE(
- "Procedures & Softwares");
+ DATE_OF("Date Of", 5), NAMES_AND_TAXONOMY("Names & Taxonomy", 3),
+ MISCELLENOUS("Miscellenous", 6), QUALITY_MEASURES("Quality Measures",
+ 1), CROSS_REFS("Cross References", 2),
+ PROCEDURE_AND_SOFTWARE("Procedures & Softwares", 4);
- Group(String name)
+ Group(String name, int sortOrder)
{
this.name = name;
+ this.sortOrder = sortOrder;
}
private String name;
+ private int sortOrder;
+
public String getName()
{
return this.name;
}
+
+ public int getSortOrder()
+ {
+ return sortOrder;
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.name;
+ }
};
private String name;
return code;
}
- public String getGroup()
+ public Group getGroup()
{
- return group.getName();
+ return group;
}
@Override