/** * Display the current instance of LieuDit in editor * * @param entity the LieuDitProxy to be displayed */ private void viewLieuDit(LieuDitProxy entity) { /* display instance information */ setTitle(NLS.constants().lieuDit_name() + ": " + EpicamRenderer.get().getDisplayValue(entity)); setMetaData((ImogBeanProxy) entity); /* push the instance to the editor in view mode */ request = requestFactory.lieuDitRequest(); current = request.edit(entity); if (current.getDescription() == null) { LocalizedTextProxy newDescription = request.create(LocalizedTextProxy.class); current.setDescription(newDescription); } if (current.getCoordonnees() == null) { GeoFieldProxy newCoordonnees = request.create(GeoFieldProxy.class); current.setCoordonnees(newCoordonnees); } editor.setEditedValue(current); /* set request context for list editor operations */ editor.setRequestContextForListEditors(request); editorDriver.edit(current, request); editor.setEdited(false); /* update field widgets in editor */ editor.computeVisibility(null, true); /* display edit button */ if (AccessManager.canEditLieuDit()) setModifiable(true); showGlassPanel = false; EpicamEntryPoint.GP.hide(); }
/** * Get an existing instance of LieuDit * * @param entityId the id of the LieuDitProxy to be fetched */ private void fetchLieuDit(String entityId) { LieuDitRequest request = requestFactory.lieuDitRequest(); /* get the LieuDit instance from database */ Request<LieuDitProxy> fetchRequest = request.findById(entityId); fetchRequest.with("description"); fetchRequest.with("coordonnees"); fetchRequest .to( new Receiver<LieuDitProxy>() { @Override public void onSuccess(LieuDitProxy entity) { viewLieuDit(entity); } }) .fire(); }
/** Create a new instance of LieuDit */ private void createNewLieuDit() { request = requestFactory.lieuDitRequest(); /* create a new intance of LieuDit */ LieuDitProxy newLieuDit = request.create(LieuDitProxy.class); newLieuDit.setId(ImogKeyGenerator.generateKeyId("LD")); LocalizedTextProxy newDescription = request.create(LocalizedTextProxy.class); newLieuDit.setDescription(newDescription); GeoFieldProxy newCoordonnees = request.create(GeoFieldProxy.class); newLieuDit.setCoordonnees(newCoordonnees); /* push the instance to the editor */ current = newLieuDit; editorDriver.edit(current, request); /* set request context for list editor operations */ editor.setRequestContextForListEditors(request); /* update field widgets in editor */ editor.computeVisibility(null, true); editor.setEdited(true); }