@Override
@SuppressWarnings("unchecked")
protected Sheet createSheet() {
Sheet sheet = Sheet.createDefault();
Sheet.Set set = Sheet.createPropertiesSet();
Sheet.Set set2 = sheet.createPropertiesSet();
set2.setDisplayName("Other");
set2.setName("other");
set2.setValue("tabName", "Other Tab");
SimpleNode nd = this.getSimpleNode();
// Element obj = getLookup().lookup(Element.class);
// ElementEditor objEditor = ElementEditor.create(obj);
// objEditor.element = obj;
try {
@SuppressWarnings(value = "unchecked")
Property indexProp = new PropertySupport.ReadOnly<Double>("beatTime", Double.class, "beatTime", "beatTime") {
@Override
public Double getValue() throws IllegalAccessException, InvocationTargetException {
return getSimpleNode().getBeattime();
}
};
set.put(indexProp);
/* PropertySupport.Reflection typeProp = new PropertySupport.Reflection(objEditor, String.class, "type");
typeProp.setName("Type");
typeProp.setPropertyEditorClass(ElementTypePropertyEditor.class);
*/
if (nd.id == ParserTreeConstants.JJTPITCH) {
addPitchProps((ASTPitch) nd, set, set2);
}
/*
if (nd.jjtGetFirstToken()!= null) {
Property indexPropLen = new PropertySupport.Reflection(nd.jjtGetFirstToken(), int.class, "beginLine", null);
indexPropLen.setName("len");
set2.put(indexPropLen);
Property indexPropOff = new PropertySupport.Reflection(nd.jjtGetFirstToken(), double.class, "beginColumn", null);
indexPropOff.setName("column");
set2.put(indexPropOff);
Property indexPropEnd = new PropertySupport.Reflection(nd.jjtGetLastToken(), double.class, "endColumn", null);
indexPropOff.setName("end");
set2.put(indexPropEnd);
}*/
/* if (obj.getEnv() != null) {
Property indexPropClef = new PropertySupport.Reflection(obj.getEnv().getClef(), String.class, "getString", null);
indexPropClef.setName("clef");
set2.put(indexPropClef);
Property indexPropTime = new PropertySupport.Reflection(obj.getEnv().getTime(), String.class, "toString", null);
indexPropTime.setName("time");
set2.put(indexPropTime);
Property indexPropKey = new PropertySupport.Reflection(obj.getEnv().getKey(), String.class, "toString", null);
indexPropKey.setName("key");
set2.put(indexPropKey);
Property indexPropStaff = new PropertySupport.Reflection(obj.getEnv(), int.class, "getStaffNr", null);
indexPropStaff.setName("staff");
set2.put(indexPropStaff);
Property indexPropLine = new PropertySupport.Reflection(obj.getEnv(), int.class, "getLineNr", null);
indexPropLine.setName("line");
set2.put(indexPropLine);
}*/
/* ElementGroup gr=obj.getParent();
if(obj instanceof ElementGroup)
gr=(ElementGroup)obj;
Property indexPropStaff = new PropertySupport.Reflection(gr, String.class, "getString", null);
indexPropStaff.setName("clef");
set2.put(indexPropStaff);*/
} catch (NoSuchMethodException ex) {
ErrorManager.getDefault();
}
sheet.put(set);
sheet.put(set2);
return sheet;
}