// create the view
Object xViewRoot = createUpdatableView(cGridOptionsPath);
// resetting a single nested value
XHierarchicalNameAccess xHierarchicalAccess =
(XHierarchicalNameAccess)UnoRuntime.queryInterface(XHierarchicalNameAccess.class, xViewRoot);
// get using absolute name
Object xOptions = xHierarchicalAccess.getByHierarchicalName(cGridOptionsPath + "/Option");
XPropertyState xOptionState =
(XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xOptions);
xOptionState.setPropertyToDefault("VisibleGrid");
// resetting more deeply nested values
Object xResolutionX = xHierarchicalAccess.getByHierarchicalName("Resolution/XAxis");
Object xResolutionY = xHierarchicalAccess.getByHierarchicalName("Resolution/YAxis");
XPropertyState xResolutionStateX =
(XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xResolutionX);
XPropertyState xResolutionStateY =
(XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xResolutionY);
xResolutionStateX.setPropertyToDefault("Metric");
xResolutionStateY.setPropertyToDefault("Metric");
// resetting multiple sibling values
Object xSubdivision = xHierarchicalAccess.getByHierarchicalName("Subdivision");
XMultiPropertyStates xSubdivisionStates =
(XMultiPropertyStates)UnoRuntime.queryInterface(XMultiPropertyStates.class, xSubdivision);
xSubdivisionStates.setAllPropertiesToDefault();