Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Colin Alworth
    @niloc132
    a generic arg that is left raw and leads to a generic field means any possible type, you're back where you started
    Bellski
    @Bellski
    @niloc132 so only one way ?
    public class Asdasd {
        public abstract static class TypeWrapper implements Serializable {
            public abstract Object getValue();
        }
    
        public static class StringType extends TypeWrapper {
            private String value;
    
            public StringType() {
            }
    
            public StringType(String value) {
                this.value = value;
            }
    
            @Override
            public Object getValue() {
                return value;
            }
        }
    
        public static void main(String[] args) {
            final Map<String, TypeWrapper> aa = new HashMap<>();
            aa.put("param1", new StringType("hello"));
        }
    }
    Colin Alworth
    @niloc132
    i believe you can change StringType.getValue() to return String, no? even if not, that is still roughly what your old code was doing, making you cast the contents of the map
    Bellski
    @Bellski
    yes i can make String getValue()
    Colin Alworth
    @niloc132
    i'm still not sure it really helps, since you could either say map.get("key") instanceof StringType or map.get("key").getValue() instanceof String
    the second one is probably a better drop-in replacement in your code
    Lorenzo Vannucchi
    @poldinik
    Hi guys, I'm using jsinterop in order to implement a simple js object. This is the definition
    Schermata 2019-09-13 alle 14.40.02.png
    In my code, I istantiate an object of this type. This is the returned object using console.log in dev mode
    Schermata 2019-09-13 alle 14.49.24.png
    But when I deploy my code on the server, the same object is empty
    Schermata 2019-09-13 alle 14.48.57.png
    Colin Alworth
    @niloc132
    any chance you forgot to enable jsinterop exports?
    -generateJsInteropExports, or a flag in your maven/gradle plugin
    Lorenzo Vannucchi
    @poldinik
    <configuration>
    <launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
    <codeserverArgs>
    <arg>-generateJsInteropExports</arg>
    </codeserverArgs>
    </configuration>
    yes I have enabled yet
    Colin Alworth
    @niloc132
    right, but don't just pass to codeserver ;)
    pass it to your prod compile too
    otherwise of course it will only generate in dev mode
    Lorenzo Vannucchi
    @poldinik
    <compilerArgs>
    <arg>-generateJsInteropExports</arg>
    </compilerArgs>
    this is the right config?
    @niloc132 u r right, unfortunately I'm still inexperienced
    thanks for the advice
    Colin Alworth
    @niloc132
    @poldinik at a glance, yes that is correct - but since you always want it enabled, i would see if there is a way you can globally pass it in
    Lorenzo Vannucchi
    @poldinik
    thank u very much
    Josh B
    @JoshIsOnIt
    Hi guys, a relatively complex JsInterop question for the group. We are trying to integrate JointJs. In Javascript, it allows us to define new 'elements' by calling a method which returns a variable which can then be invoked as a constructor. How on earth can this be represented in JsInterop?
    for example, var x = Element.define( "nameOfElement", Object args); var x1 = x();
    Slava P.
    @slavap
    @JoshIsOnIt
    @JsFunction public static interface DefineFn {
            void invoke(Object... args);
        }
    
        @JsMethod(namespace = JsPackage.GLOBAL)
        public static DefineFn define(String name, Object args);
    Colin Alworth
    @niloc132
    beware of Object... and non-double/boolean primitives, but yeah
    also you need a namespace of "Element" i think, or tack that on to the name
    Josh B
    @JoshIsOnIt
    @slavap @niloc132 awesome guys...will give it a shot
    @slavap stupid question (perhaps), when I call define(name,args), I get back a DefineFn. Now I want to replicate the constructor, which I would do by calling invoke (in this case it is zero-arg). Now for the stupid part. invoice returns void
    Slava P.
    @slavap
    @JoshIsOnIt change void to any type you need, Element I think in your case
    Josh B
    @JoshIsOnIt
    ahhh (and duh...brain isn't thinking on a monday)
    DavidWilla
    @DavidWilla
    I am assigned to develop BPM designer. I like to use GWT to achieve it. But I can not find good GWT library to achieve it. I like to hear your recommendation.
    Ahmad K. Bawaneh
    @vegegoku
    we also have other libs and tools
    https://github.com/DominoKit/domino-rest
    and we also have https://github.com/DominoKit/domino-mvp which combine them all .. it has some documentation but still missing some parts
    DavidWilla
    @DavidWilla
    I like to achieve something like https://bpmn.io/
    Ahmad K. Bawaneh
    @vegegoku
    then you should check https://github.com/Axellience
    Slava P.
    @slavap
    @DavidWilla Why not just to use bpmn-js with jsinterop?
    Ahmad K. Bawaneh
    @vegegoku
    @adrienbaron
    @DavidWilla it is up to you
    DavidWilla
    @DavidWilla
    Do we have bpmn-js isinterop?
    Slava P.
    @slavap
    @DavidWilla have no idea :-) But even if not, it's not that hard to cover it, in any case much easier than developing from "scratch"
    Frank Hossfeld
    @FrankHossfeld
    @davidwilla I know there is dmn.js
    Adrien Baron
    @adrienbaron
    @davidwilla hi! I don’t work there anymore but Axellience my previous company uses GWT to provide a BPMN editor in the cloud. They also support quite a lot of meta models (like a good chunk of UML). To achieve this they use a version of EMF that can clone compiled with GWT. It allows them to read EMF models in the browser. You can contact them through the support form on genmymodel.com to enquiry about for example using their engine unbranded (not sure if they still do that).
    DavidWilla
    @DavidWilla
    @adrienbaron Thank you so much! I will do it.