public Error (Exception error) { super(RFuture.<Sound>failure(error)); } }
public Error (Exception error) { super(RFuture.<Sound>failure(error)); } }
protected RFuture<Response> execute(Builder req) { return RFuture.failure(new UnsupportedOperationException()); }
protected RFuture<Response> execute(Builder req) { return RFuture.failure(new UnsupportedOperationException()); }
/** * Requests a line of text from the user. On platforms that have only a virtual keyboard, this * will display a text entry interface, obtain the line of text, and dismiss the text entry * interface when finished. * * @param textType the expected type of text. On mobile devices this hint may be used to display a * keyboard customized to the particular type of text. * @param label a label to display over the text entry interface, may be null. * @param initialValue the initial value to display in the text input field, may be null. * * @return a future which provides the text when it becomes available. If the user cancels the * text entry process, null is supplied. Otherwise the entered text is supplied. */ public RFuture<String> getText (Keyboard.TextType textType, String label, String initialValue) { return RFuture.failure(new Exception("getText not supported")); }
/** * Requests a line of text from the user. On platforms that have only a virtual keyboard, this * will display a text entry interface, obtain the line of text, and dismiss the text entry * interface when finished. * * @param textType the expected type of text. On mobile devices this hint may be used to display a * keyboard customized to the particular type of text. * @param label a label to display over the text entry interface, may be null. * @param initialValue the initial value to display in the text input field, may be null. * * @return a future which provides the text when it becomes available. If the user cancels the * text entry process, null is supplied. Otherwise the entered text is supplied. */ public RFuture<String> getText (Keyboard.TextType textType, String label, String initialValue) { return RFuture.failure(new Exception("getText not supported")); }
/** * Displays a system dialog with the specified title and text, an OK button and optionally a * Cancel button. * * @param title the title for the dialog window. Note: some platforms (mainly mobile) do not * display the title, so be sure your dialog makes sense if only {@code text} is showing. * @param text the text of the dialog. The text will be wrapped by the underlying platform, but * PlayN will do its utmost to ensure that newlines are honored by the platform in question so * that hard line breaks and blank lines are reproduced correctly. * @param ok the text of the button which will deliver a {@code true} result and be placed in * "OK" position for the platform. Note: the HTML platform does not support customizing this * label, so on that platform the label will be "OK". Yay for HTML5. * @param cancel the text of the button that will deliver a {@code false} result and be placed in * "Cancel" position. If {@code null} is supplied, the dialog will only have an OK button. Note: * the HTML platform does not support customizing this label, so on that platform a non-null * cancel string will result in the button reading "Cancel". Yay for HTML5. * * @return a future which delivers {@code true} or {@code false} when the user clicks the OK or * cancel buttons respectively. If some unexpected error occurs displaying the dialog (unlikley), * it will be reported by failing the future. */ public RFuture<Boolean> sysDialog (String title, String text, String ok, String cancel) { return RFuture.failure(new Exception("sysDialog not supported")); }
/** * Displays a system dialog with the specified title and text, an OK button and optionally a * Cancel button. * * @param title the title for the dialog window. Note: some platforms (mainly mobile) do not * display the title, so be sure your dialog makes sense if only {@code text} is showing. * @param text the text of the dialog. The text will be wrapped by the underlying platform, but * PlayN will do its utmost to ensure that newlines are honored by the platform in question so * that hard line breaks and blank lines are reproduced correctly. * @param ok the text of the button which will deliver a {@code true} result and be placed in * "OK" position for the platform. Note: the HTML platform does not support customizing this * label, so on that platform the label will be "OK". Yay for HTML5. * @param cancel the text of the button that will deliver a {@code false} result and be placed in * "Cancel" position. If {@code null} is supplied, the dialog will only have an OK button. Note: * the HTML platform does not support customizing this label, so on that platform a non-null * cancel string will result in the button reading "Cancel". Yay for HTML5. * * @return a future which delivers {@code true} or {@code false} when the user clicks the OK or * cancel buttons respectively. If some unexpected error occurs displaying the dialog (unlikley), * it will be reported by failing the future. */ public RFuture<Boolean> sysDialog (String title, String text, String ok, String cancel) { return RFuture.failure(new Exception("sysDialog not supported")); }
public HtmlImage (Graphics gfx, Throwable error) { super(gfx, RFuture.<Image>failure(error), Scale.ONE, 50, 50, "<error>"); setBitmap(createErrorBitmap(pixelWidth, pixelHeight)); }
public HtmlImage (Graphics gfx, Throwable error) { super(gfx, RFuture.<Image>failure(error), Scale.ONE, 50, 50, "<error>"); setBitmap(createErrorBitmap(pixelWidth, pixelHeight)); }
@Override public RFuture<ByteBuffer> getBytes(final String path) { if (!TypedArrays.isSupported()) return RFuture.failure( new UnsupportedOperationException("TypedArrays not supported by this browser.")); return doXhr(pathPrefix + path, XMLHttpRequest.ResponseType.ArrayBuffer). map(new Function<XMLHttpRequest,ByteBuffer>() { public ByteBuffer apply (XMLHttpRequest xhr) { return TypedArrayHelper.wrap(xhr.getResponseArrayBuffer()); } }); }
@Override public RFuture<ByteBuffer> getBytes(final String path) { if (!TypedArrays.isSupported()) return RFuture.failure( new UnsupportedOperationException("TypedArrays not supported by this browser.")); return doXhr(pathPrefix + path, XMLHttpRequest.ResponseType.ArrayBuffer). map(new Function<XMLHttpRequest,ByteBuffer>() { public ByteBuffer apply (XMLHttpRequest xhr) { return TypedArrayHelper.wrap(xhr.getResponseArrayBuffer()); } }); }