Giter VIP home page Giter VIP logo

gwt-editor's Introduction

GWT Editor

GWT3/J2CL compatible License Chat on Gitter CI

A future-proof port of the com.google.gwt.editor.Editor GWT module, with no dependency on gwt-user (besides the Java Runtime Emulation), to prepare for GWT 3 / J2Cl.

Migrating from com.google.gwt.editor.Editor

  1. Add the dependency to your build.

    For Maven:

    <dependency>
      <groupId>org.gwtproject.editor</groupId>
      <artifactId>gwt-editor</artifactId>
      <version>HEAD-SNAPSHOT</version>
    </dependency>

    and the processor:

    <dependency>
      <groupId>org.gwtproject.editor</groupId>
      <artifactId>gwt-editor-processor</artifactId>
      <version>HEAD-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>

    For Gradle:

    implementation("org.gwtproject.editor:gwt-editor:HEAD-SNAPSHOT")

    and the processor:

    ToDo ... 
    <dependency>
      <groupId>org.gwtproject.editor</groupId>
      <artifactId>gwt-editor-processor</artifactId>
      <version>HEAD-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
  2. Update your GWT module to use

    <inherits name="org.gwtproject.editor.Editor" />
  3. Change the imports in your Java source files:

    import org.gwtproject.editor.client.xxx;

Instructions

To build gwt-event:

  • run mvn clean verify

on the parent directory. This will build the artifact and run tests against GWT2. The J2CL test need to be executed with mvn j2cl:clean an mvn j2cl:test due to a problem with modules that use processors. See: https://github.com/Vertispan/j2clmavenplugin/issues/14

System Requirements

GWT Editor requires GWT 2.9.0 or newer!

Dependencies

GWT Editor depends on the following module:

  • GWT Event.

Example usage

the bean

public class Person {

    private int id;
    private String name;
    private boolean active;

    public Person() {
    }

    public Person(int id, String name, boolean active) {
        this.id = id;
        this.name = name;
        this.active = active;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }
}

The component

this component uses domino-ui

public class PersonComponent implements IsElement<HTMLDivElement>, Editor<Person> {

    @IsDriver
    interface Driver extends SimpleBeanEditorDriver<Person, PersonComponent> {
    }

    private DominoElement<HTMLDivElement> root = DominoElement.of(div());

    IntegerBox id;
    TextBox name;
    CheckBox active;

    private final Driver driver;

    public PersonComponent() {
        driver = new PersonComponent_Driver_Impl();

        id = IntegerBox.create("id");
        name = TextBox.create("name");
        active = CheckBox.create("Is active");

        root.appendChild(Row.create()
                .appendChild(Column.span12()
                        .appendChild(id))
                .appendChild(Column.span12()
                        .appendChild(name))
                .appendChild(Column.span12()
                        .appendChild(active))
        );

        driver.initialize(this);
    }

    public void edit(Person person){
        driver.edit(person);
    }

    public Person save(){
        return driver.flush();
    }

    @Override
    public HTMLDivElement asElement() {
        return root.asElement();
    }
}

And use it like this

PersonComponent personComponent = new PersonComponent();

        Person person = new Person(10, "Ahmad", false);

        DomGlobal.document.body.appendChild(Card.create()
                .appendChild(personComponent)
                .asElement());

        personComponent.edit(person);
        

gwt-editor's People

Contributors

dependabot[bot] avatar frankhossfeld avatar manfredtremmel avatar niloc132 avatar vegegoku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gwt-editor's Issues

Fix Javadoc so that mvn -Prelease verify passes

There are errors presently in the javax.validation javadoc - this should probably be removed or excluded anyway? Long term (before stable release?) the validation should probably be moved out of gwt-editor as it is.

gwt-editor-processor requires gwt-editor-parent

The deployed pom of the gwt-editor-processor is not flatttened. The reference of the parent pom remains and will cause an exception if the processor dependency is referenced.

The problem is related to the fact that the shade plugin is executed after the flatten plugin.

By changing the order fo the plugins, the problem shpuld be fixed.

Cohabitation with gwt-user : errors with javax.validation

When gwt-editor is used with gwt-user in the same project, and gwt-editor is before gwt-user in the classpath, compilation fails with many errors similar to :

Tracing compile failure path for type 'com.google.gwt.validation.client.constraints.SizeValidatorForString'
[ERROR] Errors in 'com/google/gwt/validation/client/constraints/SizeValidatorForString.java' [ERROR] Line 27: No source code is available for type javax.validation.ConstraintValidatorContext; did you forget to inherit a required module?

The issue is solved by swapping the two artifacts in maven : gwt-user first, then gwt-editor

Getter/Setters on UI Fields in the Editor (PersonComponent) Fail Build

From the example in the Readme.md on https://github.com/gwtproject/gwt-editor

Copy the Person.java, PersonComponent.java

Add getter/setter for id, name and active UI fields in the PersonComponent editor
PersonComponent.java
...
public IntegerBox getId() {
return id;
}

public void setId(IntegerBox id) {
	this.id = id;
}

public TextBox getName() {
	return name;
}

public void setName(TextBox name) {
	this.name = name;
}

public CheckBox getActive() {
	return active;
}

public void setActive(CheckBox active) {
	this.active = active;
}

....

mvn -e compile

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project YZZ-client: Fatal error compiling: java.lang.IllegalStateException: generation aborted! No getter exists for >>getId<< -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project cris-client: Fatal error compiling
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1143)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.codehaus.plexus.compiler.CompilerException: java.lang.IllegalStateException: generation aborted! No getter exists for >>getId<<
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:198)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:183)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1140)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: generation aborted! No getter exists for >>getId<<
at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper (JavacTaskImpl.java:168)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:94)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:136)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:183)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1140)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: generation aborted! No getter exists for >>getId<<
at org.gwtproject.editor.processor.model.EditorProperty$Builder.findBeanPropertyMethods (EditorProperty.java:240)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.access (EditorProperty.java:149)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.access (EditorProperty.java:68)
at org.gwtproject.editor.processor.model.EditorModel.calculateEditorData (EditorModel.java:149)
at org.gwtproject.editor.processor.model.EditorModel. (EditorModel.java:68)
at org.gwtproject.editor.processor.DriverProcessor.process (DriverProcessor.java:110)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor (JavacProcessingEnvironment.java:1018)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:934)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1262)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1377)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1248)
at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:930)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:104)
at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper (JavacTaskImpl.java:152)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:94)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:136)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:183)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1140)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

[WARNING] /path/to/SomeType.java found raw type: org.gwtproject.editor.client.adapters.SimpleEditor missing type arguments...

This set of warnings can be seen when running the tests for gwt-editor-processor.

[WARNING] /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java:[686,19] found raw type: org.gwtproject.editor.client.adapters.SimpleEditor
  missing type arguments for generic class org.gwtproject.editor.client.adapters.SimpleEditor<T>
[WARNING] /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java:[743,7] found raw type: org.gwtproject.editor.client.adapters.SimpleEditor
  missing type arguments for generic class org.gwtproject.editor.client.adapters.SimpleEditor<T>
[WARNING] /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java:[576,49] found raw type: org.gwtproject.editor.client.adapters.SimpleEditor
  missing type arguments for generic class org.gwtproject.editor.client.adapters.SimpleEditor<T>
[WARNING] /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/target/generated-test-sources/test-annotations/org/gwtproject/editor/client/adapters/SimpleEditor_String_SimpleBeanEditorDelegate.java:[10,67] found raw type: org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate
  missing type arguments for generic class org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate<T,E>
[WARNING] /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/target/generated-test-sources/test-annotations/org/gwtproject/editor/client/adapters/SimpleEditor_String_SimpleBeanEditorDelegate.java:[11,11] found raw type: org.gwtproject.editor.client.adapters.SimpleEditor
  missing type arguments for generic class org.gwtproject.editor.client.adapters.SimpleEditor<T>
[WARNING] /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/target/generated-test-sources/test-annotations/org/gwtproject/editor/client/adapters/SimpleEditor_String_SimpleBeanEditorDelegate.java:[16,13] found raw type: org.gwtproject.editor.client.adapters.SimpleEditor
  missing type arguments for generic class org.gwtproject.editor.client.adapters.SimpleEditor<T>
[WARNING] /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/target/generated-test-sources/test-annotations/org/gwtproject/editor/client/adapters/SimpleEditor_String_SimpleBeanEditorDelegate.java:[21,28] found raw type: org.gwtproject.editor.client.Editor
  missing type arguments for generic class org.gwtproject.editor.client.Editor<T>

Failed to compile project that depends on gwt-editor with j2cl

Compiling gwt-editors with j2cl will throw a lot of errors related to javax.validation

Error:Validation.java:20: The import java.io.BufferedReader cannot be resolved
Error:Validation.java:23: The import java.io.InputStreamReader cannot be resolved
Error:Validation.java:24: The import java.net cannot be resolved
Error:Validation.java:25: The import java.security.AccessController cannot be resolved
Error:Validation.java:26: The import java.security.PrivilegedAction cannot be resolved
Error:Validation.java:31: The import java.util.WeakHashMap cannot be resolved
Error:Validation.java:217: The method isAssignableFrom(Class<capture#1-of ? extends ValidationProvider>) is undefined for the type Class<U>
Error:Validation.java:218: The method cast(ValidationProvider) is undefined for the type Class<U>
Error:Validation.java:297: ClassLoader cannot be resolved to a type
Error:Validation.java:298: WeakHashMap cannot be resolved to a type
Error:Validation.java:298: ClassLoader cannot be resolved to a type
Error:Validation.java:303: ClassLoader cannot be resolved to a type
Error:Validation.java:303: The method fromContext() from the type Validation.GetClassLoader refers to the missing type ClassLoader
Error:Validation.java:305: The method fromClass(Class<?>) from the type Validation.GetClassLoader refers to the missing type ClassLoader
Error:Validation.java:309: ClassLoader cannot be resolved to a type
Error:Validation.java:310: ClassLoader cannot be resolved to a type
Error:Validation.java:317: URL cannot be resolved to a type
Error:Validation.java:319: URL cannot be resolved to a type
Error:Validation.java:322: BufferedReader cannot be resolved to a type
Error:Validation.java:322: InputStreamReader cannot be resolved to a type
Error:Validation.java:327: The method loadClass(String, Class<?>) from the type Validation.DefaultValidationProviderResolver refers to the missing type ClassNotFoundException
Error:Validation.java:333: The method newInstance() is undefined for the type Class<capture#7-of ?>
Error:Validation.java:347: ClassNotFoundException cannot be resolved to a type
Error:Validation.java:351: IllegalAccessException cannot be resolved to a type
Error:Validation.java:354: InstantiationException cannot be resolved to a type
Error:Validation.java:358: ClassLoader cannot be resolved to a type
Error:Validation.java:359: ClassLoader cannot be resolved to a type
Error:Validation.java:366: ClassNotFoundException cannot be resolved to a type
Error:Validation.java:369: ClassLoader cannot be resolved to a type
Error:Validation.java:369: The method fromContext() from the type Validation.GetClassLoader refers to the missing type ClassLoader
Error:Validation.java:374: ClassNotFoundException cannot be resolved to a type
Error:Validation.java:380: The method fromClass(Class<?>) from the type Validation.GetClassLoader refers to the missing type ClassLoader
Error:Validation.java:384: PrivilegedAction cannot be resolved to a type
Error:Validation.java:384: ClassLoader cannot be resolved to a type
Error:Validation.java:387: ClassLoader cannot be resolved to a type
Error:Validation.java:389: The method getSecurityManager() is undefined for the type System
Error:Validation.java:390: AccessController cannot be resolved
Error:Validation.java:393: The method run() from the type Validation.GetClassLoader refers to the missing type ClassLoader
Error:Validation.java:397: ClassLoader cannot be resolved to a type
Error:Validation.java:402: The method getSecurityManager() is undefined for the type System
Error:Validation.java:403: AccessController cannot be resolved
Error:Validation.java:406: The method run() from the type Validation.GetClassLoader refers to the missing type ClassLoader
Error:Validation.java:414: ClassLoader cannot be resolved to a type
Error:Validation.java:416: The method getClassLoader() is undefined for the type Class<capture#15-of ?>
Error:Validation.java:419: Thread cannot be resolved
Error:Pattern.java:77: java.util.regex cannot be resolved to a variable
Error:Pattern.java:83: java.util.regex cannot be resolved to a variable
Error:Pattern.java:89: java.util.regex cannot be resolved to a variable
Error:Pattern.java:95: java.util.regex cannot be resolved to a variable
Error:Pattern.java:101: java.util.regex cannot be resolved to a variable
Error:Pattern.java:107: java.util.regex cannot be resolved to a variable
Error:Pattern.java:113: java.util.regex cannot be resolved to a variable

The respository here has a sample to reproduce the issue.

[WARNING] Attempt to create a file for type 'package.to.MyEditor_field_Context' multiple times when running tests

Actual warning can be seen by running the gwt-editor-processor project tests:

[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ gwt-editor-processor ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /home/colin/workspace/gwt-editor-apt/gwt-editor-processor/target/test-classes
[INFO] GWT-Editor-Processor (version: HEAD-SNAPSHOT) started ...
[WARNING] Attempt to create a file for type 'org.gwtproject.editor.client.impl.DelegateMapTest_1PersonEditorWithCoAddressEditorView_address_Context' multiple times
[WARNING] Exception: type >>org.gwtproject.editor.client.impl.DelegateMapTest.PersonEditorWithCoAddressEditorView << - trying to write: >>org.gwtproject.editor.client.impl.DelegateMapTest_1PersonEditorWithCoAddressEditorView_address_Context<< -> message >>Attempt to recreate a file for type org.gwtproject.editor.client.impl.DelegateMapTest_1PersonEditorWithCoAddressEditorView_address_Context<< multiple times
[WARNING] Attempt to create a file for type 'org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithAliasedSubEditors__Context' multiple times
[WARNING] Exception: type >>org.gwtproject.editor.client.SimpleBeanEditorTest.PersonEditorWithAliasedSubEditors << - trying to write: >>org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithAliasedSubEditors__Context<< -> message >>Attempt to recreate a file for type org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithAliasedSubEditors__Context<< multiple times
[WARNING] Attempt to create a file for type 'org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithCoAddressEditorView_address_Context' multiple times
[WARNING] Exception: type >>org.gwtproject.editor.client.SimpleBeanEditorTest.PersonEditorWithCoAddressEditorView << - trying to write: >>org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithCoAddressEditorView_address_Context<< -> message >>Attempt to recreate a file for type org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithCoAddressEditorView_address_Context<< multiple times
[WARNING] Attempt to create a file for type 'org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithMultipleBindings_address_Context' multiple times
[WARNING] Exception: type >>org.gwtproject.editor.client.SimpleBeanEditorTest.PersonEditorWithMultipleBindings << - trying to write: >>org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithMultipleBindings_address_Context<< -> message >>Attempt to recreate a file for type org.gwtproject.editor.client.SimpleBeanEditorTest_1PersonEditorWithMultipleBindings_address_Context<< multiple times

gwt-editor-processor fails when the Driver has to edit JavaScriptObject

Simple example :


import com.google.gwt.core.client.JavaScriptObject;

public class Pojo extends JavaScriptObject {

    protected Pojo(){}

    public final native String getTest() /*-{ return this.test; }-*/;
    public final native void setTest(String value) /*-{ this.test = value; }-*/;
    
}
import org.dominokit.domino.ui.forms.TextBox;
import org.gwtproject.editor.client.Editor;
import org.gwtproject.editor.client.SimpleBeanEditorDriver;
import org.gwtproject.editor.client.annotation.IsDriver;


public class TestEditor implements  Editor<Pojo> {

    @IsDriver
    interface EditorDriver extends SimpleBeanEditorDriver<Pojo, TestEditor> {
    }

    TextBox test;
    
}

Here is the produced stacktrace :

Caused by: java.lang.ClassCastException: class com.sun.tools.javac.code.Type$TypeVar cannot be cast to class javax.lang.model.type.DeclaredType (com.sun.tools.javac.code.Type$TypeVar is in module jdk.compiler of loader 'app'; javax.lang.model.type.DeclaredType is in module java.compiler of loader 'platform')
at org.gwtproject.editor.processor.model.BeanMethod.deepCompare (BeanMethod.java:169)
at org.gwtproject.editor.processor.model.BeanMethod.isReturnTypeEnclosingElement (BeanMethod.java:162)
at org.gwtproject.editor.processor.model.BeanMethod.access$100 (BeanMethod.java:25)
at org.gwtproject.editor.processor.model.BeanMethod$3.matches (BeanMethod.java:82)
at org.gwtproject.editor.processor.model.BeanMethod.which (BeanMethod.java:114)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.findBeanPropertyMethods (EditorProperty.java:176)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.access (EditorProperty.java:149)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.access (EditorProperty.java:60)
at org.gwtproject.editor.processor.model.EditorModel.calculateEditorData (EditorModel.java:115)
at org.gwtproject.editor.processor.model.EditorModel. (EditorModel.java:68)
at org.gwtproject.editor.processor.DriverProcessor.process (DriverProcessor.java:110)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor (JavacProcessingEnvironment.java:985)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:901)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1227)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1340)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1258)
at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:936)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:104)
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:147)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:94)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:136)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:182)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1209)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:198)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.