GWT Editor Processor

Parent POM containing the gwt-event module, gwt-event-processor module and the test modules (gwt2-tests and j2cl-tests)

License

License

Categories

Categories

GWT (Google Web Toolkit) User Interface Web Frameworks
GroupId

GroupId

org.gwtproject.editor
ArtifactId

ArtifactId

gwt-editor-processor
Last Version

Last Version

1.0.0-RC1
Release Date

Release Date

Type

Type

jar
Description

Description

GWT Editor Processor
Parent POM containing the gwt-event module, gwt-event-processor module and the test modules (gwt2-tests and j2cl-tests)
Project URL

Project URL

https://github.com/gwtproject/gwt-editor
Project Organization

Project Organization

The GWT Project Authors
Source Code Management

Source Code Management

https://github.com/gwtproject/gwt-editor/tree/master

Download gwt-editor-processor

How to add to project

<!-- https://jarcasting.com/artifacts/org.gwtproject.editor/gwt-editor-processor/ -->
<dependency>
    <groupId>org.gwtproject.editor</groupId>
    <artifactId>gwt-editor-processor</artifactId>
    <version>1.0.0-RC1</version>
</dependency>
// https://jarcasting.com/artifacts/org.gwtproject.editor/gwt-editor-processor/
implementation 'org.gwtproject.editor:gwt-editor-processor:1.0.0-RC1'
// https://jarcasting.com/artifacts/org.gwtproject.editor/gwt-editor-processor/
implementation ("org.gwtproject.editor:gwt-editor-processor:1.0.0-RC1")
'org.gwtproject.editor:gwt-editor-processor:jar:1.0.0-RC1'
<dependency org="org.gwtproject.editor" name="gwt-editor-processor" rev="1.0.0-RC1">
  <artifact name="gwt-editor-processor" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.gwtproject.editor', module='gwt-editor-processor', version='1.0.0-RC1')
)
libraryDependencies += "org.gwtproject.editor" % "gwt-editor-processor" % "1.0.0-RC1"
[org.gwtproject.editor/gwt-editor-processor "1.0.0-RC1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.gwtproject.editor : gwt-editor jar 1.0.0-RC1
javax.validation : validation-api jar 1.0.0.GA
com.google.auto.service : auto-service Optional jar 1.0-rc6

Project Modules

There are no modules declared in this project.

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);
        
org.gwtproject.editor

GWT

Versions

Version
1.0.0-RC1