import org.eclipse.jface.viewers.ViewerCell;
/** Default basic label provider for a given JCR Node's properties */
-public class PropertyLabelProvider extends ColumnLabelProvider implements
- WorkbenchConstants {
+public class PropertyLabelProvider extends ColumnLabelProvider implements WorkbenchConstants {
private static final long serialVersionUID = -5405794508731390147L;
// To be able to change column order easily
public static final int COLUMN_PROPERTY = 0;
public static final int COLUMN_VALUE = 1;
- public static final int COLUMN_ATTRIBUTES = 2;
+ public static final int COLUMN_TYPE = 2;
+ public static final int COLUMN_ATTRIBUTES = 3;
// Utils
protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
case COLUMN_VALUE:
// Corresponding values are listed on children
return "";
+ case COLUMN_TYPE:
+ return JcrBrowserUtils.getPropertyTypeAsString(prop);
case COLUMN_ATTRIBUTES:
return JcrUtils.getPropertyDefinitionAsString(prop);
}
return prop.getName();
case COLUMN_VALUE:
return formatValueAsString(prop.getValue());
+ case COLUMN_TYPE:
+ return JcrBrowserUtils.getPropertyTypeAsString(prop);
case COLUMN_ATTRIBUTES:
return JcrUtils.getPropertyDefinitionAsString(prop);
}
}
} else if (element instanceof Value) {
Value val = (Value) element;
-
switch (columnIndex) {
case COLUMN_PROPERTY:
// Nothing to show
return "";
case COLUMN_VALUE:
return formatValueAsString(val);
+ case COLUMN_TYPE:
+ // listed on the parent
+ return "";
case COLUMN_ATTRIBUTES:
// Corresponding attributes are listed on the parent
return "";
}
}
-
} catch (RepositoryException re) {
- throw new EclipseUiException(
- "Unexepected error while getting property values", re);
+ throw new EclipseUiException("Cannot retrieve prop value on "+element, re);
}
return null;
}
strValue = value.getString();
return strValue;
} catch (RepositoryException e) {
- throw new EclipseUiException("unexpected error while formatting value",
- e);
+ throw new EclipseUiException("unexpected error while formatting value", e);
}
}
}