Example #1
0
  private void setLinkText() {
    PropertyList propList = entity.getProperties(type.getId());
    savedProp = propList != null ? propList.getProperty(0) : null;

    if (savedProp == null) {
      savedProp = entity.createNewProperty(type, ""); // $NON-NLS-1$
    }
    if (savedProp.getPropertyValue() != null) {
      link.setText(savedProp.getPropertyValue());
    }
    link.pack();
  }
Example #2
0
  public static void hydrateEntity(IBaseDao dao, Entity entity) {
    if (dao == null) {
      Logger.getLogger(HydratorUtil.class).error("Missing DAO, cannot hydrate.");
      return;
    }
    if (entity == null) return;

    Map<String, PropertyList> lists = entity.getTypedPropertyLists();
    Set<Entry<String, PropertyList>> entrySet = lists.entrySet();
    for (Entry<String, PropertyList> entry : entrySet) {
      PropertyList list = entry.getValue();
      List<Property> propertyList = list.getProperties();
      dao.initialize(propertyList);
      // set the parent in the property since it is not mapped by hibernate anymore
      for (Property property : propertyList) {
        property.setParent(entity);
      }
    }
  }
Example #3
0
 public void update() {
   PropertyList propList = entity.getProperties(type.getId());
   Property entityProp;
   entityProp = propList != null ? propList.getProperty(0) : null;
   if (entityProp != null && !link.getText().equals(entityProp.getPropertyValue())) {
     savedProp = entityProp;
     if (Display.getCurrent() != null) {
       setLinkText();
     } else {
       Display.getDefault()
           .asyncExec(
               new Runnable() {
                 public void run() {
                   setLinkText();
                 }
               });
     }
   }
 }