This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FXMLLoader fxmlLoader = new FXMLLoader(); | |
fxmlLoader.setControllerFactory(c -> { | |
Object controller = CDI.current().select(c).get(); | |
// we don't want a proxy. In case bean is @ApplicationScoped | |
// then we need to extract the real object behind proxy | |
BeanManager bm = CDI.current().getBeanManager(); | |
Context ctx = bm.getContext(ApplicationScoped.class); | |
Set<Bean<?>> beans = bm.getBeans(c); | |
if (!beans.isEmpty()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: Bruno Borges | |
* Twitter: @brunoborges | |
*/ | |
if (arguments.length === 0 || arguments[0] === '-h') { | |
print('Usage:'); | |
print(' $> jjs nato.js -- words'); | |
exit(1); | |
} | |
var Collectors=java.util.stream.Collectors; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (arguments.length != 1) { | |
print("Usage: jjs -cp lib/kvclient.jar oracle-nosql-get.js -- <key>"); | |
exit(1); | |
} | |
var oracle = Packages.oracle; | |
var KVStore = oracle.kv.KVStore; | |
var KVStoreConfig = oracle.kv.KVStoreConfig; | |
var KVStoreFactory = oracle.kv.KVStoreFactory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (arguments.length != 2) { | |
print("Usage: jjs -cp lib/kvclient.jar oracle-nosql-put.js -- <key> <value>"); | |
exit(1); | |
} | |
var oracle = Packages.oracle; | |
var KVStore = oracle.kv.KVStore; | |
var KVStoreConfig = oracle.kv.KVStoreConfig; | |
var KVStoreFactory = oracle.kv.KVStoreFactory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/jjs -J-Djava.class.path=lib/kvclient.jar | |
var oracle = Packages.oracle; | |
var KVStore = oracle.kv.KVStore; | |
var KVStoreConfig = oracle.kv.KVStoreConfig; | |
var KVStoreFactory = oracle.kv.KVStoreFactory; | |
var Direction = oracle.kv.Direction; | |
var store = KVStoreFactory.getStore(new KVStoreConfig("kvstore", "localhost:5000")); | |
var batchSize = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void hackScriptEngine(FXMLLoader loader) { | |
try { | |
Field fse = loader.getClass().getDeclaredField("scriptEngine"); | |
fse.setAccessible(true); | |
scriptEngine = (ScriptEngine) fse.get(loader); | |
} catch (IllegalAccessException | NoSuchFieldException | SecurityException ex) { | |
LOGGER.log(Level.SEVERE, null, ex); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WebViewSample extends Application { | |
@Override public void start(Stage stage) { | |
WebView browser = new WebView(); | |
browser.getEngine().load("http://twitter.com/brunoborges"); | |
StackPane root = new StackPane(); | |
root.getChildren().add(browser); | |
stage.setTitle("WebView"); | |
stage.setScene(new Scene(root, 750, 500)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WebView = javafx.scene.web.WebView; | |
var StackPane = javafx.scene.layout.StackPane; | |
var Scene = javafx.scene.Scene; | |
var url = arguments.join(''); | |
function start(stage) { | |
var browser = new WebView(); | |
var engine = browser.getEngine(); | |
engine.load(url); | |
var root = new StackPane(); | |
root.children.add(browser); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin.sh | |
MAVEN_OPTS=-Xmx1024M -XX:MaxPermSize=512m | |
svn checkout https://svn.java.net/svn/glassfish~svn/trunk/main | |
cd main | |
mvn install -Dmaven.wagon.http.ssl.insecure=true \ | |
-Dmaven.wagon.http.ssl.allowall=true \ | |
-DskipTests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author [email protected] | |
*/ | |
public class FooBar { | |
private final String foobar; | |
public FooBar() { | |
foobar = "foobar"; | |
} |