Package org.jboss.forge.addon.ui.context

Examples of org.jboss.forge.addon.ui.context.UIContext


   private FieldOperations persistenceOperations;

   @Override
   public void initializeUI(UIBuilder builder) throws Exception
   {
      UIContext context = builder.getUIContext();
      Map<Object, Object> attributeMap = context.getAttributeMap();
      RelationshipType relationship = RelationshipType.valueOf(attributeMap.get(RelationshipType.class).toString());
      cascadeType.setValueChoices(EnumSet.range(CascadeType.PERSIST, CascadeType.DETACH));
      boolean shouldAddRequired = false;
      switch (relationship)
      {
View Full Code Here


   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Map<Object, Object> attributeMap = uiContext.getAttributeMap();

      JavaResource entity = (JavaResource) attributeMap.get(JavaResource.class);
      String fieldName = (String) attributeMap.get("fieldName");
      String fieldType = (String) attributeMap.get("fieldType");
View Full Code Here

   }

   @Override
   public void initializeUI(UIBuilder builder) throws Exception
   {
      UIContext context = builder.getUIContext();
      ConstraintType constraintType = (ConstraintType) context.getAttributeMap().get(ConstraintType.class);
      generateConstraintInputs(builder, constraintType.getConstraint());
   }
View Full Code Here

   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Map<Object, Object> attributeMap = uiContext.getAttributeMap();
      Property property = (Property) attributeMap.get(Property.class);
      ConstraintType constraintType = (ConstraintType) attributeMap.get(ConstraintType.class);
      Boolean onAccessor = (Boolean) attributeMap.get("onAccessor");
      final AnnotationTarget<JavaClass, ?> annotationTarget;
      if (onAccessor)
View Full Code Here

   public Result execute(UIExecutionContext context) throws Exception
   {
      String entityName = named.getValue();
      String entityPackage = targetPackage.getValue();
      DirectoryResource targetDir = targetLocation.getValue();
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JavaResource javaResource;
      if (project == null)
      {
         javaResource = facesOperations.newValidator(targetDir, entityName, entityPackage);
      }
      else
      {
         javaResource = facesOperations.newValidator(project, entityName, entityPackage);
      }
      uiContext.setSelection(javaResource);
      return Results.success("Validator " + javaResource + " created");
   }
View Full Code Here

   }

   @Override
   public void initializeUI(UIBuilder builder) throws Exception
   {
      UIContext uiContext = builder.getUIContext();
      PersistenceContainer pc = (PersistenceContainer) uiContext.getAttributeMap().get(PersistenceContainer.class);
      initDBType(uiContext);
      initDatasourceName(uiContext);
      initPersistenceUnitName(builder);
      builder.add(dbType);
      if (pc.isDataSourceRequired())
View Full Code Here

   }

   @Override
   public void validate(UIValidationContext validator)
   {
      UIContext uiContext = validator.getUIContext();
      JPADataSource ds = getDataSource(uiContext);
      try
      {
         ds.validate();
      }
View Full Code Here

   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JPADataSource dataSource = getDataSource(uiContext);
      Boolean configureMetadata = (Boolean) uiContext.getAttributeMap().get("ConfigureMetadata");
      String puName = persistenceUnitName.getValue();
      persistenceOperations.setup(puName, project, dataSource, configureMetadata);
      return Results.success("Persistence (JPA) is installed.");
   }
View Full Code Here

   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      JavaResource resource = (JavaResource) uiContext.getInitialSelection().get();
      String name = named.getValue();
      String fieldName = conversationFieldName.getValue();
      String beginName = beginMethodName.getValue();
      String endName = endMethodName.getValue();
      Boolean overwriteValue = overwrite.getValue();
      UIOutput output = uiContext.getProvider().getOutput();
      if (resource.exists())
      {
         if (resource.getJavaSource().isClass())
         {
            JavaClass javaClass = (JavaClass) resource.getJavaSource();
View Full Code Here

   public Result execute(UIExecutionContext context) throws Exception
   {
      String entityName = named.getValue();
      String entityPackage = targetPackage.getValue();
      DirectoryResource targetDir = targetLocation.getValue();
      UIContext uiContext = context.getUIContext();
      Project project = getSelectedProject(uiContext);
      JavaResource javaResource;
      if (project == null)
      {
         javaResource = facesOperations.newConverter(targetDir, entityName, entityPackage);
      }
      else
      {
         javaResource = facesOperations.newConverter(project, entityName, entityPackage);
      }
      uiContext.setSelection(javaResource);
      return Results.success("Converter " + javaResource + " created");
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.ui.context.UIContext

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.