public class NodeViewerComparator
extends org.eclipse.jface.viewers.ViewerComparator
// IMPORTANT: initialize comparator before setting it
JcrColumnDefinition firstCol = colDefs.get(0);
comparator.setColumn(firstCol.getPropertyType(),
firstCol.getPropertyName());
viewer.setComparator(comparator);
Modifier and Type | Field and Description |
---|---|
static int |
ASCENDING |
static int |
DESCENDING |
protected int |
direction |
protected java.lang.String |
propertyName |
protected int |
propertyType |
Constructor and Description |
---|
NodeViewerComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(org.eclipse.jface.viewers.Viewer viewer,
java.lang.Object e1,
java.lang.Object e2)
e1 and e2 must both be Jcr nodes.
|
protected int |
getDirection() |
protected java.lang.String |
getPropertyName() |
protected int |
getPropertyType() |
void |
setColumn(int propertyType,
java.lang.String propertyName) |
protected void |
setDirection(int direction) |
protected void |
setPropertyName(java.lang.String propertyName) |
protected void |
setPropertyType(int propertyType) |
protected java.lang.String propertyName
protected int propertyType
public static final int ASCENDING
public static final int DESCENDING
protected int direction
public int compare(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object e1, java.lang.Object e2)
compare
in class org.eclipse.jface.viewers.ViewerComparator
viewer
- e1
- e2
- public void setColumn(int propertyType, java.lang.String propertyName)
propertyType
- Corresponding JCR typepropertyName
- name of the property to use.protected java.lang.String getPropertyName()
protected void setPropertyName(java.lang.String propertyName)
protected int getPropertyType()
protected void setPropertyType(int propertyType)
protected int getDirection()
protected void setDirection(int direction)
Copyright © 2007–2020. All rights reserved.