Skip to Content
0
Former Member
Feb 05, 2007 at 11:16 AM

Sort a Node in descending order

132 Views

Hi,

how is it possible to sort a Node in descending order. Until now I can only sort my node in ascending order by the following code below.

	if (wdContext.nodeAction().getLeadSelection() == DocPreAppView.DDBI_DOCTYP ){
		
		wdContext.nodeGlob_Struc_Sort().sortElements( new Comparator(){
				public int compare( Object o1, Object o2 ){
					int i = 0;
					IPrivateDocPreAppView.IGlob_Struc_SortElement e1 = 
						((IPrivateDocPreAppView.IGlob_Struc_SortElement)o1);
					IPrivateDocPreAppView.IGlob_Struc_SortElement e2 = 
						((IPrivateDocPreAppView.IGlob_Struc_SortElement)o2);
	
					i = e1.getDoc_Type().compareTo( e2.getDoc_Type() );
					return i;
				}
			}
		);
	}

regards,

Sharam