@Override
 public void storeToXml(Element x) {
   super.storeToXml(x);
   if (getInnerForm() != null) {
     getInnerForm().storeToXml(x);
   }
 }
 @Override
 public void loadFromXml(Element x) {
   super.loadFromXml(x);
   if (getInnerForm() != null) {
     getInnerForm().loadFromXml(x);
   }
 }
 @Override
 public void setEnabled(boolean b) {
   super.setEnabled(b);
   if (getInnerForm() != null) {
     getInnerForm().setAllEnabled(b);
   }
 }
Exemplo n.º 4
0
  @Override
  protected void initConfig() {
    m_uiFacade = new P_UIFacade();
    super.initConfig();
    setImageTransform(new AffineTransformSpec());
    setAutoFit(getConfiguredAutoFit());
    setImageId(getConfiguredImageId());
    setPanDelta(getConfiguredPanDelta());
    setRotateDelta(getConfiguredRotateDelta());
    setZoomDelta(getConfiguredZoomDelta());
    setDragType(getConfiguredDragType());
    setDropType(getConfiguredDropType());
    setScrollBarEnabled(getConfiguredScrollBarEnabled());

    // menus
    List<Class<? extends IMenu>> declaredMenus = getDeclaredMenus();
    List<IMenu> contributedMenus = m_contributionHolder.getContributionsByClass(IMenu.class);
    OrderedCollection<IMenu> menus = new OrderedCollection<IMenu>();
    for (Class<? extends IMenu> menuClazz : declaredMenus) {
      try {
        menus.addOrdered(ConfigurationUtility.newInnerInstance(this, menuClazz));
      } catch (Exception e) {
        SERVICES
            .getService(IExceptionHandlerService.class)
            .handleException(
                new ProcessingException(
                    "error creating instance of class '" + menuClazz.getName() + "'.", e));
      }
    }
    menus.addAllOrdered(contributedMenus);

    try {
      injectMenusInternal(menus);
    } catch (Exception e) {
      LOG.error("error occured while dynamically contributing menus.", e);
    }
    new MoveActionNodesHandler<IMenu>(menus).moveModelObjects();
    m_contextMenu = new FormFieldContextMenu<IImageField>(this, menus.getOrderedList());
    m_contextMenu.setContainerInternal(this);
  }
 @SuppressWarnings("unchecked")
 @Override
 protected void initConfig() {
   super.initConfig();
   m_innerFormPropertyListener = new P_InnerFormPropertyChangeListener();
   m_innerFormSubtreePropertyListener = new P_InnerFormSubtreePropertyChangeListener();
   m_innerFormListener = new P_InnerFormListener();
   if (getConfiguredInnerForm() != null) {
     try {
       setInnerForm((FORM) getConfiguredInnerForm().newInstance(), true);
     } catch (Exception e) {
       BEANS
           .get(ExceptionHandler.class)
           .handle(
               new ProcessingException(
                   "error creating instance of class '"
                       + getConfiguredInnerForm().getName()
                       + "'.",
                   e));
     }
   }
 }
Exemplo n.º 6
0
 @Override
 protected void initFieldInternal() throws ProcessingException {
   super.initFieldInternal();
   // init actions
   ActionUtility.initActions(getMenus());
 }
 @Override
 protected void disposeFieldInternal() {
   super.disposeFieldInternal();
   // Remove listeners, close the form if life cycle is not externally managed
   uninstallInnerForm();
 }