Java Code Examples for javafx.concurrent.Worker#State

The following examples show how to use javafx.concurrent.Worker#State . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TwitterWebEngineListener.java    From yfiton with Apache License 2.0 6 votes vote down vote up
@Override
public void doAction(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
    if (newValue == Worker.State.SUCCEEDED) {
        NodeList nodeList = webEngine.getDocument().getElementsByTagName("code");

        if (nodeList != null) {
            HTMLElementImpl htmlNode = (HTMLElementImpl) nodeList.item(0);

            if (htmlNode != null) {
                String authorizationCode = htmlNode.getInnerText();

                save(new AuthorizationData(authorizationCode));
            }
        }
    }
}
 
Example 2
Source File: TwitterWebEngineListener.java    From yfiton with Apache License 2.0 6 votes vote down vote up
@Override
public void doAction(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
    if (newValue == Worker.State.SUCCEEDED) {
        NodeList nodeList = webEngine.getDocument().getElementsByTagName("code");

        if (nodeList != null) {
            HTMLElementImpl htmlNode = (HTMLElementImpl) nodeList.item(0);

            if (htmlNode != null) {
                String authorizationCode = htmlNode.getInnerText();

                save(new AuthorizationData(authorizationCode));
            }
        }
    }
}
 
Example 3
Source File: WebEngineListener.java    From yfiton with Apache License 2.0 5 votes vote down vote up
@Override
public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
    if (!firstPageLoaded) {
        firstPageLoaded = true;
        return;
    }

    doAction(observable, oldValue, newValue);
}
 
Example 4
Source File: YfitonWebEngineListener.java    From yfiton with Apache License 2.0 5 votes vote down vote up
@Override
public void doAction(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
    String location = webEngine.getLocation();

    if (newValue == Worker.State.SUCCEEDED
            && location.startsWith(OAuthNotifier.YFITON_OAUTH_CALLBACK_URL)) {

        AuthorizationData transformed = getParameters(location);

        save(transformed);
    }
}
 
Example 5
Source File: WebEngineListener.java    From yfiton with Apache License 2.0 5 votes vote down vote up
@Override
public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
    if (!firstPageLoaded) {
        firstPageLoaded = true;
        return;
    }

    doAction(observable, oldValue, newValue);
}
 
Example 6
Source File: YfitonWebEngineListener.java    From yfiton with Apache License 2.0 5 votes vote down vote up
@Override
public void doAction(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
    String location = webEngine.getLocation();

    if (newValue == Worker.State.SUCCEEDED
            && location.startsWith(OAuthNotifier.YFITON_OAUTH_CALLBACK_URL)) {

        AuthorizationData transformed = getParameters(location);

        save(transformed);
    }
}
 
Example 7
Source File: SlidePane.java    From AsciidocFX with Apache License 2.0 5 votes vote down vote up
private void stateListener(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
    if (newValue == Worker.State.SUCCEEDED) {
        getWindow().setMember("afx", controller);
        if ("revealjs".equals(backend))
            this.loadJs("/afx/worker/js/?p=js/jquery.js", "/afx/worker/js/?p=js/reveal-extensions.js");
        if ("deckjs".equals(backend))
            this.loadJs("/afx/worker/js/?p=js/deck-extensions.js");
    }
}
 
Example 8
Source File: ServiceTestResults.java    From updatefx with MIT License 4 votes vote down vote up
public ServiceTestResults(Worker.State state, T serviceResult, Throwable exception) {
	this.state = state;
	this.serviceResult = serviceResult;
	this.exception = exception;
}
 
Example 9
Source File: WebEngineListener.java    From yfiton with Apache License 2.0 votes vote down vote up
public abstract void doAction(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue); 
Example 10
Source File: WebEngineListener.java    From yfiton with Apache License 2.0 votes vote down vote up
public abstract void doAction(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue);