Package org.apache.pivot.wtkx

Examples of org.apache.pivot.wtkx.WTKXSerializer


    private Window window = null;

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "hello_javascript.wtkx");
        window.open(display);
    }
View Full Code Here


    private PushButton executeSynchronousButton = null;
    private PushButton executeAsynchronousButton = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "background_tasks.wtkx");

        activityIndicator = (ActivityIndicator)wtkxSerializer.get("activityIndicator");

        executeSynchronousButton = (PushButton)wtkxSerializer.get("executeSynchronousButton");
        executeSynchronousButton.getButtonPressListeners().add(new ButtonPressListener() {
            @Override
            public void buttonPressed(Button button) {
                activityIndicator.setActive(true);

                System.out.println("Starting synchronous task execution.");

                SleepTask sleepTask = new SleepTask();

                String result = null;
                try {
                    result = sleepTask.execute();
                } catch (TaskExecutionException exception) {
                    System.err.println(exception);
                }

                System.out.println("Synchronous task execution complete: \"" + result + "\"");

                activityIndicator.setActive(false);
            }
        });

        executeAsynchronousButton = (PushButton)wtkxSerializer.get("executeAsynchronousButton");
        executeAsynchronousButton.getButtonPressListeners().add(new ButtonPressListener() {
            @Override
            public void buttonPressed(Button button) {
                activityIndicator.setActive(true);
                window.setEnabled(false);
View Full Code Here

    private Label statusLabel = null;

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "rss_feed_demo.wtkx");
        feedListView = (ListView)wtkxSerializer.get("feedListView");
        cardPane = (CardPane)wtkxSerializer.get("cardPane");
        statusLabel = (Label)wtkxSerializer.get("statusLabel");

        feedListView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener.Adapter() {
            private int index = -1;

            @Override
View Full Code Here

        basePath = properties.get(BASE_PATH_KEY);
        if (basePath == null) {
            throw new IllegalArgumentException(BASE_PATH_KEY + " is required.");
        }

        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "large_data.wtkx");
        fileListButton = (ListButton)wtkxSerializer.get("fileListButton");
        loadDataButton = (PushButton)wtkxSerializer.get("loadDataButton");
        cancelButton = (PushButton)wtkxSerializer.get("cancelButton");
        statusLabel = (Label)wtkxSerializer.get("statusLabel");
        tableView = (TableView)wtkxSerializer.get("tableView");

        loadDataButton.getButtonPressListeners().add(new ButtonPressListener() {
            @Override
            public void buttonPressed(Button button) {
                loadDataButton.setEnabled(false);
View Full Code Here

    private Calendar calendar = Calendar.getInstance();
    private WTKXSerializer wtkxSerializer;
    private Image image = null;

    public Clock() {
        wtkxSerializer = new WTKXSerializer();
        try {
            image = (Image)wtkxSerializer.readObject(getClass().getResource("clock.wtkd"));
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
View Full Code Here

        border.getStyles().put("backgroundColor", 3);
        mainWindow = new Window(border);
        mainWindow.setMaximized(true);
        mainWindow.open(display);

        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        reflectionWindow = (Window)wtkxSerializer.readObject(this, "reflection.wtkx");
        translucentFrame = (Frame)wtkxSerializer.readObject(this, "translucent.wtkx");

        final FadeDecorator fadeDecorator = new FadeDecorator();
        translucentFrame.getDecorators().insert(fadeDecorator, 0);

        translucentFrame.getComponentMouseListeners().add(new ComponentMouseListener.Adapter() {
View Full Code Here

    private SuggestionPopup suggestionPopup = new SuggestionPopup();
    private GetQuery suggestionQuery = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "suggestion_demo.wtkx");
        textInput = (TextInput)wtkxSerializer.get("textInput");
        activityIndicator = (ActivityIndicator)wtkxSerializer.get("activityIndicator");

        textInput.getTextInputCharacterListeners().add(new TextInputCharacterListener() {
            @Override
            public void charactersInserted(TextInput textInput, int index, int count) {
                getSuggestions();
View Full Code Here

    private ListView selectionListView = null;

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "multi_select.wtkx");

        dataListView = (ListView)wtkxSerializer.get("dataListView");
        selectionListView = (ListView)wtkxSerializer.get("selectionListView");

        dataListView.getListViewSelectionListeners().add(new ListViewSelectionListener() {
            @Override
            public void selectedRangeAdded(ListView listView, int rangeStart, int rangeEnd) {
                refreshSelectionListData();
View Full Code Here

    public static final String WINDOW_TITLE = "JSON Viewer";

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        wtkxSerializer.put(APPLICATION_KEY, this);

        window = (Window)wtkxSerializer.readObject(this, "json_viewer.wtkx");
        wtkxSerializer.bind(this);

        Label prompt = new Label("Drag or paste JSON here");
        prompt.getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER);
        prompt.getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
        promptDecorator.setOverlay(prompt);
View Full Code Here

    private boolean synchronizingSelection = false;

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "fixed_column_table.wtkx");
        primaryTableView = (TableView)wtkxSerializer.get("primaryTableView");
        fixedTableView = (TableView)wtkxSerializer.get("fixedTableView");

        // Keep selection state in sync
        primaryTableView.getTableViewSelectionListeners().add(new TableViewSelectionListener() {
            @Override
            public void selectedRangeAdded(TableView tableView, int rangeStart, int rangeEnd) {
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtkx.WTKXSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.