Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing access methods in JFXApp #218

Closed
benedictleejh opened this issue Oct 22, 2015 · 1 comment
Closed

Missing access methods in JFXApp #218

benedictleejh opened this issue Oct 22, 2015 · 1 comment
Labels
Milestone

Comments

@benedictleejh
Copy link

@benedictleejh benedictleejh commented Oct 22, 2015

In JavaFX, when extending the abstract class Application, the user has access to the following methods that have no equivalent in ScalaFX:

HostServices getHostServices()
static String getUserAgentStylesheet()
static void setUserAgentStylesheet(String url)

HostServices provides a bunch of useful things like "code base and document base for an Application, show a web page in a browser, and communicate with the enclosing web page using JavaScript if the Application is running in a browser" (quoted from https://docs.oracle.com/javase/8/javafx/api/javafx/application/HostServices.html).

The user agent stylesheet allows the user to set up a quick way to theme a whole JavaFX application without too much trouble using CSS. I understand that there are classes that expose a user agent stylesheet method, if those are equivalent to the application-level user agent stylesheet, please disregard the relevant methods.

I'm not sure how difficult it would be to incorporate these methods in JFXApp given the indirect call to javafx.application.Application, but a quick stopgap measure would be to expose the underlying JavaFX Application, so that we can have access to these methods.

@jpsacha jpsacha added this to the 8.0.*-R10 milestone Oct 24, 2015
@jpsacha jpsacha added the enhancement label Oct 24, 2015
@jpsacha
Copy link
Member

@jpsacha jpsacha commented Oct 24, 2015

getUserAgentStylesheet/setUserAgentStylesheet are static so require minimal changes.

getHostServices will require reference to running JavaFX Application it can be done through scalafx.application.AppHelper

jpsacha added a commit that referenced this issue Oct 26, 2015
Also add simple usage example and deprecate methods using Java naming convention.
@jpsacha jpsacha closed this Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants