use of org.eclipse.ui.texteditor.HyperlinkDetectorTargetDescriptor in project eclipse.platform.text by eclipse.
the class HyperlinkDetectorsConfigurationBlock method createListModel.
private ListItem[] createListModel() {
ArrayList<ListItem> listModelItems = new ArrayList<>();
for (int i = 0; i < fHyperlinkDetectorDescriptors.length; i++) {
HyperlinkDetectorDescriptor desc = fHyperlinkDetectorDescriptors[i];
HyperlinkDetectorTargetDescriptor target = desc.getTarget();
int stateMask = fStore.getInt(desc.getId() + HyperlinkDetectorDescriptor.STATE_MASK_POSTFIX);
String modifierKeys = getModifierString(stateMask);
listModelItems.add(new ListItem(desc.getId(), desc.getName(), target.getName(), modifierKeys));
}
Comparator<ListItem> comparator = new Comparator<ListItem>() {
@Override
public int compare(ListItem o1, ListItem o2) {
String label1 = o1.name;
String label2 = o2.name;
return Collator.getInstance().compare(label1, label2);
}
};
Collections.sort(listModelItems, comparator);
ListItem[] items = new ListItem[listModelItems.size()];
listModelItems.toArray(items);
return items;
}
Aggregations