Package com.google.gdt.eclipse.designer.gxt.databinding.model.beans

Examples of com.google.gdt.eclipse.designer.gxt.databinding.model.beans.BeanObserveInfo


      Expression[] arguments,
      IModelResolver resolver,
      IDatabindingsProvider provider) throws Exception {
    if (BIND.equals(signature)) {
      BeansObserveTypeContainer container = DatabindingsProvider.cast(provider).getBeansContainer();
      BeanObserveInfo beanObserveObject = container.getBeanObserveObject(arguments[0]);
      setModel(
          beanObserveObject,
          beanObserveObject.resolvePropertyReference(m_parsedProperty, null));
      //
      provider.getBindings().add(this);
    } else if (signature.startsWith(SET_STORE_START)) {
      m_storeReference = CoreUtils.getNodeReference(arguments[0]);
    } else if (SET_CONVERTER.equals(signature)) {
View Full Code Here


        //
        providers.add(new ChooseClassAndPropertiesUiContentProvider(configuration,
            provider.getBeansContainer().getBeanSupport()) {
          public void updateFromObject() throws Exception {
            if (m_modelProperty == null) {
              BeanObserveInfo model = getLocalModel();
              if (model == null) {
                calculateFinish();
              } else {
                setClassName(model.getObjectType().getName());
              }
            } else {
              BeanPropertyObserveInfo modelProperty = (BeanPropertyObserveInfo) m_modelProperty;
              setClassNameAndProperty(
                  getLocalModel().getObjectType().getName(),
View Full Code Here

  }

  protected void finishBinding(Expression[] arguments, IDatabindingsProvider provider)
      throws Exception {
    BeansObserveTypeContainer container = DatabindingsProvider.cast(provider).getBeansContainer();
    BeanObserveInfo beanObserveObject = container.getBeanObserveObject(arguments[0]);
    m_model = beanObserveObject;
    m_modelProperty = beanObserveObject.getSelfProperty();
    //
    for (FieldBindingInfo binding : m_fieldBindings) {
      binding.setModel(
          beanObserveObject,
          beanObserveObject.resolvePropertyReference(binding.getParsedProperty(), null));
    }
    //
    int index = provider.getBindings().indexOf(this);
    provider.getBindings().addAll(index + 1, m_fieldBindings);
  }
View Full Code Here

      }
      //
      return false;
    }
    if (model instanceof BeanObserveInfo) {
      BeanObserveInfo beanObserve = (BeanObserveInfo) model;
      if (modelProperty == beanObserve.getSelfProperty()) {
        WidgetObserveInfo widgetObserve = (WidgetObserveInfo) target;
        if ((!widgetObserve.isFormPanel() || !(widgetObserve instanceof BindingsWidgetObserveInfo))
            && targetProperty != widgetObserve.getSelfProperty()) {
          return false;
        }
      }
    }
    if (target instanceof BeanObserveInfo) {
      BeanObserveInfo beanObserve = (BeanObserveInfo) target;
      if (targetProperty == beanObserve.getSelfProperty()) {
        WidgetObserveInfo widgetObserve = (WidgetObserveInfo) model;
        if ((!widgetObserve.isFormPanel() || !(widgetObserve instanceof BindingsWidgetObserveInfo))
            && modelProperty != widgetObserve.getSelfProperty()) {
          return false;
        }
      }
    }
    if (model instanceof WidgetObserveInfo) {
      WidgetObserveInfo widgetObserve = (WidgetObserveInfo) model;
      if (widgetObserve.isGrid()) {
        return false;
      }
      if ((widgetObserve.isFormPanel() || widgetObserve instanceof BindingsWidgetObserveInfo)
          && modelProperty == widgetObserve.getSelfProperty()) {
        BeanObserveInfo beanObserve = (BeanObserveInfo) target;
        if (targetProperty != beanObserve.getSelfProperty()) {
          return false;
        }
      }
    }
    if (target instanceof WidgetObserveInfo) {
      WidgetObserveInfo widgetObserve = (WidgetObserveInfo) target;
      if (widgetObserve.isGrid()) {
        return false;
      }
      if ((widgetObserve.isFormPanel() || widgetObserve instanceof BindingsWidgetObserveInfo)
          && targetProperty == widgetObserve.getSelfProperty()) {
        BeanObserveInfo beanObserve = (BeanObserveInfo) model;
        if (modelProperty != beanObserve.getSelfProperty()) {
          return false;
        }
      }
    }
    return true;
View Full Code Here

  public IBindingInfo createBinding(IObserveInfo target,
      IObserveInfo itargetProperty,
      IObserveInfo model,
      IObserveInfo imodelProperty) throws Exception {
    BeanObserveInfo beanObserve = null;
    ObserveInfo modelProperty = null;
    WidgetObserveInfo widgetObserve = null;
    ObserveInfo targetProperty = null;
    //
    if (target instanceof WidgetObserveInfo && model instanceof WidgetObserveInfo) {
      ObserveInfo gridObserve = null;
      //
      if (((WidgetObserveInfo) target).isFormPanel()) {
        widgetObserve = (WidgetObserveInfo) target;
        targetProperty = (ObserveInfo) itargetProperty;
        //
        gridObserve = (ObserveInfo) model;
        modelProperty = (ObserveInfo) imodelProperty;
      } else {
        widgetObserve = (WidgetObserveInfo) model;
        targetProperty = (ObserveInfo) imodelProperty;
        //
        gridObserve = (ObserveInfo) target;
        modelProperty = (ObserveInfo) itargetProperty;
      }
      //
      FormBindingInfo formBinding = new FormBindingInfo(widgetObserve, targetProperty);
      formBinding.setModel(gridObserve, modelProperty);
      return formBinding;
    }
    //
    if (target instanceof WidgetObserveInfo) {
      beanObserve = (BeanObserveInfo) model;
      modelProperty = (ObserveInfo) imodelProperty;
      //
      widgetObserve = (WidgetObserveInfo) target;
      targetProperty = (ObserveInfo) itargetProperty;
    } else {
      beanObserve = (BeanObserveInfo) target;
      modelProperty = (ObserveInfo) itargetProperty;
      //
      widgetObserve = (WidgetObserveInfo) model;
      targetProperty = (ObserveInfo) imodelProperty;
    }
    //
    if (modelProperty == beanObserve.getSelfProperty()) {
      if (widgetObserve.isFormPanel()) {
        FormBindingInfo formBinding = new FormBindingInfo(widgetObserve, targetProperty);
        formBinding.setModel(beanObserve, modelProperty);
        return formBinding;
      }
View Full Code Here

    ClassLoader classLoader = CoreUtils.classLoader(provider.getJavaInfoRoot());
    String bindingElementClassName = AstNodeUtils.getFullyQualifiedName(bindingElement, true);
    Class<?> bindingElementClass = classLoader.loadClass(bindingElementClassName);
    //
    m_gridSelectionModel =
        new BeanObserveInfo(beansContainer.getBeanSupport(), m_modelProperty, bindingElementClass);
    gridWidget.getSelfProperty().setProperties(
        m_gridSelectionModel.getChildren(ChildrenContext.ChildrenForPropertiesTable));
    //
    for (FieldBindingInfo binding : m_fieldBindings) {
      binding.setModel(
View Full Code Here

  public void createAutobindings(List<FieldBindingInfo> bindings) throws Exception {
    createAutobindings(bindings, true);
  }

  private void createAutobindings(List<FieldBindingInfo> bindings, boolean full) throws Exception {
    BeanObserveInfo beanObserveObject = null;
    if (full) {
      if (m_gridSelectionModel == null) {
        if (m_model instanceof BeanObserveInfo) {
          beanObserveObject = (BeanObserveInfo) m_model;
        }
      } else {
        beanObserveObject = m_gridSelectionModel;
      }
    }
    WidgetObserveInfo formPanel = (WidgetObserveInfo) m_target;
    for (WidgetObserveInfo field : formPanel.getChildren()) {
      Property property = field.getJavaInfo().getPropertyByTitle("name");
      if (property != null) {
        Object nameValue = property.getValue();
        if (nameValue instanceof String && !StringUtils.isEmpty(nameValue.toString())) {
          FieldBindingInfo binding =
              field.createFieldBinding(field.getSelfProperty(), "\"" + nameValue.toString() + "\"");
          if (full) {
            if (beanObserveObject == null) {
              binding.setModel(m_model, null);
            } else {
              binding.setModel(
                  beanObserveObject,
                  beanObserveObject.resolvePropertyReference(binding.getParsedProperty(), null));
            }
          }
          binding.setAutobind(true);
          binding.setParentBinding(this);
          bindings.add(binding);
View Full Code Here

                }
              }

              public void saveToObject() throws Exception {
                m_gridSelectionModel =
                    new BeanObserveInfo(provider.getBeansContainer().getBeanSupport(),
                        m_modelProperty,
                        getChoosenClass());
                ((WidgetObserveInfo) m_model).getSelfProperty().setProperties(
                    m_gridSelectionModel.getChildren(ChildrenContext.ChildrenForPropertiesTable));
              }
View Full Code Here

  }

  @Override
  @SuppressWarnings("unchecked")
  public void saveToObject() throws Exception {
    BeanObserveInfo gridSelectionModel = ((FormBindingInfo) m_binding).getGridSelectionModel();
    for (IUiContentProvider provider : getProviders()) {
      UIContentContainer<FieldBindingInfo> fieldProvider =
          (UIContentContainer<FieldBindingInfo>) provider;
      fieldProvider.getBinding().setGridSelectionModel(gridSelectionModel);
      fieldProvider.getBinding().updateGridSelectionModel();
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gxt.databinding.model.beans.BeanObserveInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.