@Override public String getCategory(IHelpResource topic) { if (context instanceof IContext2) { return ((IContext2)context).getCategory(topic); } return null; }
public int category(Object element) { if (element instanceof IHelpResource) { IHelpResource r = (IHelpResource)element; String c = context.getCategory(r); if (c!=null) { return -5; } } return super.category(element); }
public int compare(Viewer viewer, Object e1, Object e2) { int cat1 = category(e1); int cat2 = category(e2); if (cat1 != cat2) return cat1 - cat2; IHelpResource r1 = (IHelpResource) e1; IHelpResource r2 = (IHelpResource) e2; String c1 = context.getCategory(r1); String c2 = context.getCategory(r2); if (c1!=null && c2!=null) { int cat = super.compare(viewer, c1, c2); if (cat!=0) return cat; } return 0; } }
String cat = null; if (context instanceof IContext2) { cat = ((IContext2)context).getCategory(link);