stephenh / tessell Goto Github PK
View Code? Open in Web Editor NEWGWT model, presenter, view framework
Home Page: http://www.tessell.org
License: Other
GWT model, presenter, view framework
Home Page: http://www.tessell.org
License: Other
Hey! I really like the looks of this library and would like to try it out in our GWT-project. However, I'm having some problems getting started. I have a few questions:
Invalid class file: org/tessell/model/dsl/AttachBinder.class
Invalid class file: org/tessell/model/dsl/Binder.class
Any help on this is much appreciated!
EDIT: See answers below
I want to write a custom binding to a Widget I've created. I'm not sure if I've got it right. Do you mind taking a look? The question I have is whether I need to call binder.Add() -- I can't in this code since the method is protected.
private <T> void bind(final ListProperty<String> property, final IsMultiselectListBox listbox, Iterable<T> options, Func<T, String> nameConverter, Func<T, String> valueConverter) {
listbox.clear();
for(T item : options) {
String name = nameConverter.call(item);
String val = valueConverter.call(item);
listbox.addItem(name, val);
}
final BooleanWrapper isFiring = new BooleanWrapper(false);
binder.onChange(property).execute(new UiCommand() {
@Override
protected void doExecute() {
if (!isFiring.get()) {
isFiring.set(true);
for(int i = 0; i < listbox.getItemCount(); i++) {
if (property.contains(listbox.getValue(i)).isTrue()) {
listbox.setItemSelected(i, true);
} else {
listbox.setItemSelected(i, false);
}
}
isFiring.set(false);
}
}
});
// Can I call binder.Add() here?
listbox.addChangeHandler(new ChangedEventHandler() {
@Override
public void onChanged(ChangedEvent event) {
if (!isFiring.get()) {
isFiring.set(true);
List<String> vals = new ArrayList<String>();
for(int i = 0; i < listbox.getItemCount(); i++) {
if (listbox.isItemSelected(i)) {
vals.add(listbox.getValue(i));
}
}
property.set(vals);
isFiring.set(false);
}
}
});
}
Exploring using ANTLR to look at DTO .java files instead of relying on dtonator.
I use Tessell via Maven, and I'm not familiar with Ivy! Otherwise I would do it myself and create a pull request … I'm not sure if it's as simple as altering the gwt version in your top-level ivysettings.xml to be 2.6.1, or if more is required!
Thanks …
When compiling Tessell GWT apps with -strict, it errors saying the Stub* super class can't be found. (StubView for example)
One option is to generate the stubs in another folder so that GWT compiler can ignore them.
When generating views using tessell, we always get atleast 4 files (in addition to all generated view-files):
In one way, I like these classes. Easy to stub the views in unit tests, etc. But personally, I rather bind the views in a IOC-container, such as GIN, to inject the "real" views into my presenters (constructor injection). And in my unit tests, I would manually mock the view.
Could we have some setting to the generator that determines if these classes should be generated or not?
The main page link to 'http://tessell.org/stubs.html' does not work.
I may well be doing something wrong (this is likely :)
At the moment when building some GWT client code in a very simple test project, in which I've added to the module, using maven, I see the following error:
[INFO] Validating units:
[INFO] [ERROR] Errors in 'jar:file:/Users/williamg/.m2/repository/org/tessell/tessell-user/2.16.1/tessell-user-2.16.1.jar!/org/tessell/gwt/user/client/ui/FlowPanel.java'
[INFO] [ERROR] Line 15: The constructor FlowPanel(String) is undefined
[INFO] [ERROR] Aborting compile due to errors in some input files
On that source line, we call super(tag)
where tag is a String … but com.google.gwt.user.client.ui.FlowPanel has no constructor taking a string, as far as I can see: http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/FlowPanel.html
What am I doing wrong, I wonder … or is this a bug in Tessell?
http://repo.tessell.org/org/tessell/tessell-dev/2.0.0/tessell-dev-2.0.0.pom references
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>0.0.10435</version>
<scope>compile</scope>
</dependency>
This seems like an error.
Not sure how to handle this nicely; e.g. if you have subA/foo.png and subB/foo.png, then generating:
interface AppResource {
subAFoo();
subBFoo();
}
Is not to bad, but only because subA/subB are short names. If the directory was someLongerName/andThenAnotherLongName/foo.png, then:
interface AppResources {
someLongerNameAndThenAnotherLongNameFoo();
theOtherFoo();
}
Would be less than great.
Something shorter would be:
interface AppResoruces {
foo1();
foo2();
}
But the "1" and "2" are arbitrary and could actually change if the directories were renamed/moved, and you'd have old callers to "foo2" now actually pulling in foo1 (if it were to suddenly be resolved as "the new foo2").
When we put fontawesome, http://fortawesome.github.io/Font-Awesome/, in our resources folder, the @source() attributes are incorrect: @source("css\font-awesome.gen.css") for example -- ie the backslash is not escaped.
Even if this were correct, you get the following error when running the app (super dev mode)
[ERROR] Could not find no-arg method named fontawesomeWebfontEotV43Data in type project.client.resources.AppResources
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.