@Override
public Node.PropertySet[] getPropertySets()
{
Sheet.Set set = Sheet.createPropertiesSet();
set.put(new PropertySupport.ReadOnly<Integer>(
"position", Integer.class, "Position", null)
{
@Override
public Integer getValue() throws IllegalAccessException,
InvocationTargetException
{
FileObject fileEntry =
getLookup().lookup(FileObject.class);
Integer posValue =
(Integer)fileEntry.getAttribute("position");
return posValue != null ? posValue : Integer.valueOf(0);
}
});
set.put(new PropertySupport.ReadOnly<String>(
"ext", String.class, "Extension", null)
{
@Override
public String getValue() throws IllegalAccessException,
InvocationTargetException
{
FileObject fileEntry =
getLookup().lookup(FileObject.class);
return fileEntry.getExt();
}
});
Node.PropertySet[] original = super.getPropertySets();
Node.PropertySet[] withLayer =
new Node.PropertySet[original.length + 1];
System.arraycopy(original, 0, withLayer, 0, original.length);
withLayer[withLayer.length - 1] = set;
return withLayer;
}