/** * Gets the componentDescriptor. * * @return the componentDescriptor. */ @SuppressWarnings("unchecked") public IComponentDescriptor<?> getComponentDescriptor() { if (componentDescriptor == null) { if (getProjectedViewDescriptor() != null && getProjectedViewDescriptor().getModelDescriptor() instanceof IComponentDescriptorProvider<?>) { return ((IComponentDescriptorProvider<Object>) getProjectedViewDescriptor() .getModelDescriptor()).getComponentDescriptor(); } } return componentDescriptor; }
/** * Returns the projectedViewDescriptor nested in a "moduleObject" property * view. * <p> * {@inheritDoc} */ @Override public IViewDescriptor getViewDescriptor() { if (getProjectedViewDescriptor() != null) { BeanModuleDescriptor beanModuleDescriptor = getDescriptor(); BasicBorderViewDescriptor nestingViewDescriptor = new BasicBorderViewDescriptor(); nestingViewDescriptor .setCenterViewDescriptor(getProjectedViewDescriptor()); nestingViewDescriptor.setModelDescriptor(beanModuleDescriptor .getPropertyDescriptor(MODULE_OBJECT)); BasicBorderViewDescriptor viewDescriptor = new BasicBorderViewDescriptor(); viewDescriptor.setModelDescriptor(beanModuleDescriptor); viewDescriptor.setCenterViewDescriptor(nestingViewDescriptor); return viewDescriptor; } return null; }
/** * {@inheritDoc} */ @Override public AbstractMobilePageViewDescriptor getProjectedViewDescriptor() { AbstractMobilePageViewDescriptor projectedViewDescriptor = (AbstractMobilePageViewDescriptor) super .getProjectedViewDescriptor(); IComponentDescriptor<?> componentDescriptor = getComponentDescriptor(); if (componentDescriptor != null) { if (projectedViewDescriptor == null) { MobileComponentViewDescriptor beanViewDescriptor = new MobileComponentViewDescriptor(); beanViewDescriptor.setModelDescriptor(componentDescriptor); beanViewDescriptor.setBorderType(EBorderType.TITLED); beanViewDescriptor.setName(componentDescriptor.getName()); projectedViewDescriptor = new MobileCompositePageViewDescriptor(); ((MobileCompositePageViewDescriptor) projectedViewDescriptor).setPageSectionDescriptors( Collections.singletonList((IMobileViewDescriptor) beanViewDescriptor)); setProjectedViewDescriptor(projectedViewDescriptor); } if (projectedViewDescriptor.getModelDescriptor() == null) { projectedViewDescriptor.setModelDescriptor(componentDescriptor); } } projectedViewDescriptor.setI18nName(getI18nName()); projectedViewDescriptor.setI18nDescription(getI18nDescription()); return projectedViewDescriptor; }