use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.
the class SearchDemo method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
bxmlSerializer.getNamespace().put(APPLICATION_KEY, this);
window = (Window) bxmlSerializer.readObject(SearchDemo.class, "search_demo.bxml");
bxmlSerializer.bind(this, SearchDemo.class);
searchButton.setButtonData(searchImage);
window.open(display);
termTextInput.requestFocus();
}
use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.
the class ApplicationHandlerTest method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
window = (Window) bxmlSerializer.readObject(ApplicationHandlerTest.class, "application_handler_test.bxml");
window.open(display);
}
use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.
the class BXMLDictionaryTest method main.
public static void main(String[] args) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
@SuppressWarnings("unchecked") HashMap<String, Object> hashMap = (HashMap<String, Object>) bxmlSerializer.readObject(BXMLDictionaryTest.class.getResource("bxml_dictionary_test.bxml"));
System.out.println(JSONSerializer.toString(hashMap));
}
use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.
the class BorderTest method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
frame = new Frame((Component) bxmlSerializer.readObject(getClass().getResource("border_test.bxml")));
frame.setTitle("Border Test");
frame.setPreferredSize(480, 360);
frame.open(display);
}
use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.
the class CalendarTest method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
window = (Window) bxmlSerializer.readObject(CalendarTest.class, "calendar_test.bxml");
bxmlSerializer.bind(this, CalendarTest.class);
Filter<CalendarDate> todayFilter = new Filter<CalendarDate>() {
@Override
public boolean include(CalendarDate date) {
CalendarDate today = new CalendarDate();
return (!date.equals(today));
}
};
calendar.setDisabledDateFilter(todayFilter);
calendarButton.getCalendarButtonListeners().add(new CalendarButtonListener() {
@Override
public void yearChanged(CalendarButton calendarButtonArgument, int previousYear) {
disable();
}
@Override
public void monthChanged(CalendarButton calendarButtonArgument, int previousMonth) {
disable();
}
private void disable() {
calendarButton.setDisabledDateFilter(new Filter<CalendarDate>() {
@Override
public boolean include(CalendarDate date) {
return true;
}
});
Task<Void> task = new Task<Void>() {
@Override
public Void execute() {
try {
Thread.sleep(500);
} catch (InterruptedException exception) {
// ignore exception
}
return null;
}
};
System.out.println("STARTING TASK");
task.execute(new TaskAdapter<>(new TaskListener<Void>() {
@Override
public void taskExecuted(Task<Void> taskArgument) {
System.out.println("EXECUTED");
calendarButton.setDisabledDateFilter(null);
}
@Override
public void executeFailed(Task<Void> taskArgument) {
System.out.println("FAILED");
calendarButton.setDisabledDateFilter(null);
}
}));
}
});
window.open(display);
}
Aggregations