Examples of App


Examples of com.eclipsesource.tabris.app.App

    assertEquals( JsonValue.valueOf( "bar" ), captor.getValue().getProperty( "foo" ) );
  }

  @Test
  public void testAddBackNavigationListensTransportsListenOperation() {
    App app = new AppImpl();
    BackNavigationListener listener = mock( BackNavigationListener.class );

    app.addBackNavigationListener( listener );

    verify( environment.getServiceObject() ).listen( "BackNavigation", true );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.app.App

    verify( environment.getServiceObject() ).listen( "BackNavigation", true );
  }

  @Test
  public void testAddBackNavigationListenersTransportsListenOperationOnce() {
    App app = new AppImpl();
    BackNavigationListener listener = mock( BackNavigationListener.class );
    BackNavigationListener listener2 = mock( BackNavigationListener.class );

    app.addBackNavigationListener( listener );
    app.addBackNavigationListener( listener2 );

    verify( environment.getServiceObject(), times( 1 ) ).listen( "BackNavigation", true );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.app.App

    verify( environment.getServiceObject(), times( 1 ) ).listen( "BackNavigation", true );
  }

  @Test
  public void testRemoveBackNavigationListensTransportsListenOperation() {
    App app = new AppImpl();
    BackNavigationListener listener = mock( BackNavigationListener.class );
    app.addBackNavigationListener( listener );

    app.removeBackNavigationListener( listener );

    RemoteObject remoteObject = environment.getServiceObject();
    InOrder order = inOrder( remoteObject );
    order.verify( remoteObject ).listen( "BackNavigation", true );
    order.verify( remoteObject ).listen( "BackNavigation", false );
View Full Code Here

Examples of com.eclipsesource.tabris.app.App

    order.verify( remoteObject ).listen( "BackNavigation", false );
  }

  @Test
  public void testRemoveBackNavigationListenersTransportsListenOperationOnce() {
    App app = new AppImpl();
    BackNavigationListener listener = mock( BackNavigationListener.class );
    BackNavigationListener listener2 = mock( BackNavigationListener.class );
    app.addBackNavigationListener( listener );
    app.addBackNavigationListener( listener2 );

    app.removeBackNavigationListener( listener );
    app.removeBackNavigationListener( listener2 );

    RemoteObject remoteObject = environment.getServiceObject();
    InOrder order = inOrder( remoteObject );
    order.verify( remoteObject, times( 1 ) ).listen( "BackNavigation", true );
    order.verify( remoteObject, times( 1 ) ).listen( "BackNavigation", false );
View Full Code Here

Examples of com.eclipsesource.tabris.app.App

    order.verify( remoteObject, times( 1 ) ).listen( "BackNavigation", false );
  }

  @Test
  public void testRemoveOneBackNavigationListenerDoesNotTransportsListenOperation() {
    App app = new AppImpl();
    BackNavigationListener listener = mock( BackNavigationListener.class );
    BackNavigationListener listener2 = mock( BackNavigationListener.class );
    app.addBackNavigationListener( listener );
    app.addBackNavigationListener( listener2 );

    app.removeBackNavigationListener( listener );

    RemoteObject remoteObject = environment.getServiceObject();
    InOrder order = inOrder( remoteObject );
    order.verify( remoteObject, times( 1 ) ).listen( "BackNavigation", true );
    order.verify( remoteObject, never() ).listen( "BackNavigation", false );
View Full Code Here

Examples of com.eclipsesource.tabris.app.App

    shell.open();
    return 0;
  }

  private void registerAppStateListener() {
    final App app = RWT.getClient().getService( App.class );
    if( app != null ) {
      app.addEventListener( EventType.PAUSE, new AppListener() {

        public void handleEvent( AppEvent event ) {
          System.out.println("Paused");
          Label output = hal.getText();
          output.setText( "I am going to sleep now.\n" );
          output.getParent().layout( true, true );
          sleepMillis = System.currentTimeMillis();
        }
      } );
      app.addEventListener( EventType.RESUME, new AppListener() {

        public void handleEvent( AppEvent event ) {
          System.out.println("Resumed");
          long slept = ( System.currentTimeMillis() - sleepMillis ) / 1000;
          Label output = hal.getText();
          output.setText( "Good morning Dave!\n\nThank for waking me up again. I was sleeping for "
                          + slept
                          + " seconds.\n" );
          output.getParent().layout( true, true );
        }
      } );
      app.addEventListener( EventType.INACTIVE, new AppListener() {

        public void handleEvent( AppEvent event ) {
          System.out.println("Inactive");
          Label output = hal.getText();
          output.setText( "Dave, did you fall asleep?\nYou haven't touched the screen for over 10 seconds.\n" );
          output.getParent().layout( true, true );
        }
      } );
      app.startInactivityTimer( 10000 );
      app.setScreenProtection( true );
    }
  }
View Full Code Here

Examples of com.eclipsesource.tabris.app.App

    Display display = new Display();
    Shell shell = new Shell( display, SWT.NO_TRIM );
    shell.setMaximized( true );
    shell.setLayout( new FillLayout() );
    ClientDevice clientDevice = RWT.getClient().getService( ClientDevice.class );
    App app = RWT.getClient().getService( App.class );
    ScrollingComposite scrollingComposite = new ScrollingComposite( shell, SWT.V_SCROLL );
    scrollingComposite.setLayout( new FillLayout() );
    createContent( clientDevice, app, scrollingComposite );
    shell.open();
    return 0;
View Full Code Here

Examples of com.erudika.para.core.App

            (d.getTime() + (Config.REQUEST_EXPIRES_AFTER_SEC * 1000)));

        if (!StringUtils.isBlank(appid)) {
          if (!StringUtils.isBlank(date)) {
            if (!requestExpired) {
              App app = new App();
              app.setId(appid);
              app = app.getDao().read(appid);

              if (app != null) {
                if (signer.isValidSignature(request, app.getSecret())) {
                  SecurityContextHolder.getContext().setAuthentication(new AppAuthentication(app));
                } else {
                  RestUtils.returnStatusResponse(response, HttpServletResponse.SC_FORBIDDEN,
                      "Request signature is invalid.");
                  return;
View Full Code Here

Examples of com.erudika.para.core.App

  private Inflector<ContainerRequestContext, Response> typeCrudHandler() {
    return new Inflector<ContainerRequestContext, Response>() {
      public Response apply(ContainerRequestContext ctx) {
        String typePlural = ctx.getUriInfo().getPathParameters().getFirst(Config._TYPE);
        App app = RestUtils.getPrincipalApp();
        if (app != null) {
          if (!StringUtils.isBlank(typePlural)) {
            String type = RestUtils.getAllTypes(app).get(typePlural);
            if (type == null) {
              type = typePlural;
View Full Code Here

Examples of com.erudika.para.core.App

        MultivaluedMap<String, String> pathp = ctx.getUriInfo().getPathParameters();
        String id = pathp.getFirst(Config._ID);
        String type = pathp.getFirst(Config._TYPE);
        String id2 = pathp.getFirst("id2");
        String type2 = pathp.getFirst("type2");
        App app = RestUtils.getPrincipalApp();

        String typeSingular = (type == null) ? null : RestUtils.getAllTypes(app).get(type);
        type = (typeSingular == null) ? type : typeSingular;

        id2 = StringUtils.isBlank(id2) ? params.getFirst(Config._ID) : id2;
        type2 = StringUtils.isBlank(type2) ? params.getFirst(Config._TYPE) : type2;

        ParaObject pobj = Utils.toObject(type);
        pobj.setId(id);
        pobj = dao.read(app.getAppIdentifier(), pobj.getId());

        Pager pager = new Pager();
        pager.setPage(NumberUtils.toLong(params.getFirst("page"), 0));
        pager.setSortby(params.getFirst("sort"));
        pager.setDesc(Boolean.parseBoolean(params.containsKey("desc") ? params.getFirst("desc") : "true"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.