Skip to content

Instantly share code, notes, and snippets.

@Pacane
Pacane / Hacker creation
Last active August 29, 2015 14:21
Hacker creation
// in the RootPresenter's OnBind method
HackerPresenter acidBurn = widgetsFactory.createHacker("AcidBurn");
addToSlot(SLOT_HACKERS, acidBurn);
ask_before_copy=TRUE
ask_before_delete=TRUE
ask_before_move=TRUE
ask_before_remove=TRUE
bauhaus/scale=1.4
brush_smoothing=medium
cache_compression=off
cache_memory=536870912
capture/camera/import/jobcode=noname
capture/camera/storage/basedirectory=$(PICTURES_FOLDER)/Darktable

Events

There are several ways of writing events but this is the preferred way for GWTP's team.

Example of an event and its handler

Simple event

public class SimpleEvent extends GwtEvent<SimpleEvent.SimpleHandler> {
@RunWith(JukitoRunner.class)
public class EndpointTest {
public static class Module extends JukitoModule {
@Override
protected void configureTest() {
install(new FactoryModuleBuilder().build(ResponseFactory.class));
}
}
private final String A_USERNAME = "Bobby";
@Pacane
Pacane / keybase.md
Last active November 4, 2015 01:50

Keybase proof

I hereby claim:

  • I am pacane on github.
  • I am pacane (https://keybase.io/pacane) on keybase.
  • I have a public key whose fingerprint is 9C7D A16F 05A7 DA03 74B4 C5B5 F56C DC7D 33F1 D634

To claim this, I am signing this object:

@RunWith(JukitoRunner.class)
public class EndpointTestWithJukito {
private final String A_USERNAME = "Bobby";
private final int USER_ID = 1337;
@Inject
private UserInformationService userInformationService;
@Inject
private ResponseFactory responseFactory;
@Inject
@RunWith(MockitoJUnitRunner.class)
public class EndpointTestWithMockito {
private final String A_USERNAME = "Bobby";
private final int USER_ID = 1337;
@Mock
private UserInformationService userInformationService;
@Mock
private ResponseFactory responseFactory;
private Endpoint endpoint;
using System;
using System.IO;
using System.Media;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
using AzgalorStatusCheckerWinform.Properties;
using ServerStatusCrawler;
using Timer = System.Threading.Timer;
@Pacane
Pacane / ApplicationPresenter.java
Last active February 3, 2016 16:29
GWTP Test example - First pattern
package com.arcbees.client.application;
import com.arcbees.client.application.services.UserService;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.presenter.slots.NestedSlot;
import com.gwtplatform.mvp.client.proxy.Proxy;
public class ApplicationPresenter
extends Presenter<ApplicationPresenter.MyView, ApplicationPresenter.MyProxy> {
interface MyView extends View {
void displayUsername(String username);
}
@ProxyStandard
@NameToken(NameTokens.HOME)
interface MyProxy extends ProxyPlace<ApplicationPresenter> {
}