String cls;
Vector<String> result;
Vector<String> list;
int i;
int index;
Trie tmpTrie;
HashSet set;
String tmpStr;
pkg = getPackage(partial);
cls = getClassname(partial);
if (getDebug())
System.out.println(
Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetClassMatches_Text_First") + partial + Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetClassMatches_Text_Second") + pkg + Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetClassMatches_Text_Third") + cls);
result = new Vector<String>();
// find all packages that start with that string
if (cls.length() == 0) {
list = m_Trie.getWithPrefix(pkg);
set = new HashSet();
for (i = 0; i < list.size(); i++) {
tmpStr = list.get(i);
if (tmpStr.length() < partial.length())
continue;
if (tmpStr.equals(partial))
continue;
index = tmpStr.indexOf('.', partial.length() + 1);
if (index > -1)
set.add(tmpStr.substring(0, index));
else
set.add(tmpStr);
}
result.addAll(set);
if (result.size() > 1)
Collections.sort(result);
}
// find all classes that start with that string
list = ClassDiscovery.find(Object.class, pkg);
tmpTrie = new Trie();
tmpTrie.addAll(list);
list = tmpTrie.getWithPrefix(partial);
result.addAll(list);
// sort the result
if (result.size() > 1)
Collections.sort(result);