@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Phase {
int index();
String displayName() default "";
}
public interface Phased {
}
public interface PhasedMask extends Phased {
@Phase(index=0)
public void constrUCt();
@Phase(index=1)
public void initialize();
@Phase(index=2,displayName="Activating...")
public void activate();
}
public class MyMask implements PhasedMask {
@Phase(index = 0)
public void construct() {
// Do the layout
}
@Phase(index = 1)
public void initialize() {
// Fill the mask with data
}
@Phase(index = 2)
public void activate() {
// Activate the listeners and allow the user to interact with the mask
}
// Business code
}
新闻热点
疑难解答