Skip to content

Instantly share code, notes, and snippets.

View jumperchen's full-sized avatar

Jumper Chen jumperchen

View GitHub Profile
public class TestComposer extends GenericForwardComposer {
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
System.out.println("Init");
}
protected void finalize() throws Throwable {
super.finalize();
System.out.println("Finalize");
}
@jumperchen
jumperchen / Menu-Navigation.zul
Created September 23, 2011 08:04
An example of Menu's navigation
<?page title="ZK Menu's Navigation Demo" ?>
<window ctrlKeys="@k" onCtrlKey='menubar.firstChild.open();'>
The short cut to open menu is ALT + K
<separator />
<menubar id="menubar" hflex="min">
<menu id="m1" label="Project"
image="/img/Centigrade-Widget-Icons/Briefcase-16x16.png">
<menupopup id="pp1">
<menuitem
image="/img/Centigrade-Widget-Icons/BriefcaseSpark-16x16.png"
@jumperchen
jumperchen / ExampleTest.scala
Created October 7, 2011 10:40
an example of ZTL Scala test case
@Tags(tags = "Example")
class ExampleTest extends ZTL4ScalaTestCase {
def testClick() = {
val zscript = {
<vbox>
Click "hello world", if you see the message change, it is ok.
<zscript><![CDATA[
public void doCreate(Event evt) {
evt.target.setValue(" hello,\\n world");
@jumperchen
jumperchen / t.zul
Created December 4, 2012 06:56
Global Monitor
<script><![CDATA[
zk.afterMount(function () {
zk.Desktop._dt.firstChild.appendChild(new GlobalResizeMonitor());
});
GlobalResizeMonitor = zk.$extends(zk.Widget, {
bind_: function () {
this.$supers('bind_', arguments);
zWatch.listen({onSize: this});
},
unbind_: function () {
@jumperchen
jumperchen / ForEachVM.java
Created May 6, 2015 05:01
ZK 8-RC Performance Testing
package org.zkoss.test;
import java.util.Collections;
import java.util.List;
public class ForEachVM {
private List<Integer> array = Collections.nCopies(30, 30);
public void setArray(List<Integer> array) {}
public List<Integer> getArray() {
return array;
@jumperchen
jumperchen / Serialization.java
Created May 29, 2015 09:59
Javassist with JDK 8 serialization issue
package issue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Method;
import javassist.util.proxy.MethodFilter;
@jumperchen
jumperchen / Todo.java
Last active November 18, 2015 04:21
ZK Spring MVC Example
public class Todo {
private String message;
private boolean done;
public Todo() {}
public Todo(String message) {
this.message = message;
}
@jumperchen
jumperchen / Book.java
Last active October 31, 2023 04:32
ZK MVVM with Spring MVC Example
public class Book {
private Set<Category> categories = new LinkedHashSet<Category>();
private String author;
private String name;
public Book() {}
public void setCategories(Set<Category> categories) {
this.categories = categories;
}
public Set<Category> getCategories() {
@jumperchen
jumperchen / Dockerfile
Created December 15, 2015 06:10
ZKSandbox's Dockerfile
FROM java:8-jdk
MAINTAINER Jumper Chen <jumperchen@potix.com>
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
# Config to get to install git, maven, and tomcat7
RUN apt-get update && apt-get install -y --force-yes git maven tomcat7
VOLUME /zksandbox
# copy your zksandbox (depends on where the Dockerfile located) folder
@jumperchen
jumperchen / README.md
Created April 29, 2016 01:56 — forked from digulla/README.md
Make ZK play nice with Fediz SSO