Skip to content

Instantly share code, notes, and snippets.

View amischler's full-sized avatar

Antoine Mischler amischler

View GitHub Profile
@Override
public Factory getFactory() {
return new Factory() {
Injector injector = Guice.createInjector(new MyModule());
@Override
public <R extends FacadeReady> R call(Class<R> clazz) throws CoreException {
return injector.getInstance(clazz);
@Max(value = 2013, groups = Warning.class)
.form-editor-invalid {
-fx-text-fill: red;
}
.form-label-invalid {
-fx-font-weight: bold;
}
.form-editor-warning {
-fx-text-fill: orange;
fxForm.setSource(new MultipleBeanSource(new MyBean1(), new MyBean2()));
public class Contact extends AbstractJcrEntity {
@JcrProperty
private StringProperty name = new SimpleStringProperty();
@JcrProperty
private DoubleProperty height = new SimpleDoubleProperty();
@JcrProperty
private ObjectProperty<Date> birthday = new SimpleObjectProperty<Date>();
import org.jcrom.util.NodeFilter;
import org.junit.Assert;
import org.junit.Test;
public class NodeFilterTest {
@Test
public void testNodeFilterDepth() {
NodeFilter nodeFilter = new NodeFilter("b", NodeFilter.DEPTH_INFINITE, 0);
Assert.assertEquals(true, nodeFilter.isIncluded("b", 0)); // OK
@amischler
amischler / gist:3966cdc6410203011f08
Created January 8, 2015 16:10
TestUpdateChildNodePerformance
package org.jcrom.modeshape;
import org.jcrom.Jcrom;
import org.jcrom.entities.Child;
import org.jcrom.entities.Parent;
import org.junit.Test;
import org.modeshape.test.ModeShapeSingleUseTest;
/**
*/
public class TestBigDecimalSerialization extends ModeShapeSingleUseTest {
public static class TestBean extends AbstractJcrEntity {
@JcrSerializedProperty
private BigDecimal bigDecimal;
public BigDecimal getBigDecimal() {
return bigDecimal;
}
@amischler
amischler / BidirectionalBinding.java
Last active October 14, 2021 14:54
RT-18486 Allow bidirectional binding with conversion between arbitrary properties
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@amischler
amischler / BidirectionalBindingTest.java
Created February 12, 2015 10:02
BidirectionalBinding unit test
package com.sun.javafx.binding;
import javafx.beans.property.*;
import org.junit.Assert;
import org.junit.Test;
public class BidirectionalBindingTest {
@Test