Examples of CreateContext


Examples of com.googlecode.objectify.impl.translate.CreateContext

      // Special case entity pojos that become keys
      if (value.getClass().isAnnotationPresent(Entity.class)) {
        return factory().keys().getMetadataSafe(value).getRawKey(value);
      } else {
        // Run it through a translator
        Translator<Object, Object> translator = factory().getTranslators().get(new TypeKey<>(value.getClass()), new CreateContext(factory()), Path.root());
        return translator.save(value, false, new SaveContext(), Path.root());
      }
    }
  }
View Full Code Here

Examples of com.googlecode.objectify.impl.translate.CreateContext

  /**
   */
  @Test
  public void simplePojoEntityTranslates() throws Exception {
    CreateContext createCtx = new CreateContext(fact());
    ClassTranslator<SimpleEntityPOJO> translator = ClassTranslatorFactory.createEntityClassTranslator(SimpleEntityPOJO.class, createCtx, Path.root());

    SimpleEntityPOJO pojo = new SimpleEntityPOJO();
    pojo.id = 123L;
    pojo.foo = "bar";
View Full Code Here

Examples of com.googlecode.objectify.impl.translate.CreateContext

   */
  @Test
  public void simplePOJOTranslates() throws Exception {
    Path thingPath = Path.root().extend("somewhere");

    CreateContext createCtx = new CreateContext(fact());
    ClassTranslator<Thing> translator = ClassTranslatorFactory.createEmbeddedClassTranslator(Thing.class, createCtx, thingPath);

    Thing thing = new Thing();
    thing.foo = "bar";

View Full Code Here

Examples of org.eclipse.graphiti.features.context.impl.CreateContext

                  if (ic instanceof CreatePEFeature) {
                    peFeat = (CreatePEFeature) ic;
                  }
                }
                assertNotNull(peFeat);
                CreateContext cc = new CreateContext();
                cc.setTargetContainer(d);
               
                assertTrue(peFeat.canCreate(cc));
                peFeat.execute(cc);
              }
            });
View Full Code Here

Examples of org.eclipse.graphiti.features.context.impl.CreateContext

                    litFeat =
                        (CreateStringLiteralFeature) ic;
                  }
                }
                assertNotNull(litFeat);
                CreateContext cc = new CreateContext();
                cc.setTargetContainer(d);
               
                assertTrue(litFeat.canCreate(cc));
                litFeat.execute(cc);
              }
            });
View Full Code Here

Examples of org.eclipse.graphiti.features.context.impl.CreateContext

                  if (ic instanceof CreateStringLiteralFeature) {
                    litFeat = (CreateStringLiteralFeature) ic;
                  }
                }
                assertNotNull(litFeat);
                CreateContext cc = new CreateContext();
                cc.setTargetContainer(d);
               
                assertTrue(litFeat.canCreate(cc));
                litFeat.execute(cc);
              }
            });
View Full Code Here

Examples of org.eclipse.graphiti.features.context.impl.CreateContext

    Shape element = (Shape) context.getProperty("org.activiti.designer.changetype.pictogram");
    GraphicsAlgorithm elementGraphics = element.getGraphicsAlgorithm();
    int x = elementGraphics.getX();
    int y = elementGraphics.getY();
   
    CreateContext taskContext = new CreateContext();
    ContainerShape targetContainer = (ContainerShape) element.getContainer();
    taskContext.setTargetContainer(targetContainer);
    taskContext.setLocation(x, y);
    taskContext.setHeight(elementGraphics.getHeight());
    taskContext.setWidth(elementGraphics.getWidth());
   
    FlowNode oldObject = (FlowNode) getFeatureProvider().getBusinessObjectForPictogramElement(element);
    if (oldObject instanceof BoundaryEvent) {
      BoundaryEvent boundaryEvent = (BoundaryEvent) oldObject;
      ContainerShape parentShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(boundaryEvent.getAttachedToRef());
      taskContext.setTargetContainer(parentShape);
      taskContext.setLocation(x - parentShape.getGraphicsAlgorithm().getX(), y - parentShape.getGraphicsAlgorithm().getY());
    }
   
    List<SequenceFlow> sourceList = oldObject.getOutgoingFlows();
    List<SequenceFlow> targetList = oldObject.getIncomingFlows();
   
    taskContext.putProperty("org.activiti.designer.changetype.sourceflows", sourceList);
    taskContext.putProperty("org.activiti.designer.changetype.targetflows", targetList);
    taskContext.putProperty("org.activiti.designer.changetype.name", oldObject.getName());
   
    targetContainer.getChildren().remove(element);
    List<Process> processes = ModelHandler.getModel(EcoreUtil.getURI(getDiagram())).getBpmnModel().getProcesses();
    for (Process process : processes) {
      process.removeFlowElement(oldObject.getId());
View Full Code Here

Examples of org.eclipse.graphiti.features.context.impl.CreateContext

    if (pe.eContainer() instanceof ContainerShape == false) {
      return data;
    }

    CreateContext taskContext = new CreateContext();
    taskContext.setTargetContainer((ContainerShape) pe.eContainer());
    taskContext.putProperty("org.activiti.designer.connectionContext", connectionContext);

    if (bo instanceof StartEvent || bo instanceof Task || bo instanceof CallActivity || bo instanceof Gateway) {

      CreateUserTaskFeature userTaskfeature = new CreateUserTaskFeature(getFeatureProvider());
      ContextButtonEntry newUserTaskButton = new ContextButtonEntry(userTaskfeature, taskContext);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.