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

JavaFX: parse command line arguments #2222

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

JavaFX: parse command line arguments #2222

wants to merge 3 commits into from

Conversation

plata
Copy link
Collaborator

@plata plata commented Jun 12, 2020

The CLIController is more or less copy+paste from phoenicis-cli.
Running an app works, installation not.
We need a way to integrate this in the design of the JavaFX application. One possibility could be that MainController offers a method installApp. @madoar any suggestions (feel free to edit in the PR directly)?

@madoar
Copy link
Collaborator

madoar commented Jun 13, 2020

I think it would be cool if it becomes possible to use the same Phoenicis application both from the terminal and as an UI application. I think essentially we will need to add a wrapper around our current JavaFX UI application that decides whether the UI should be started or the application should be run in terminal mode.

@plata
Copy link
Collaborator Author

plata commented Jun 13, 2020

I have no idea how this could be implemented.

@plata
Copy link
Collaborator Author

plata commented Jun 14, 2020

When trying to install an app, you just get a white window. Not really sure why this behaves differently than ApplicationInformationPanelSkin.

@madoar
Copy link
Collaborator

madoar commented Jun 17, 2020

Essentially I am suggesting to change main method in JavaFXApplication to something similar to:

public class JavaFXApplication extends Application {
    public static void main(String[] args) {
        if (args.length == 0 || args[0] == "gui") {
            try {
                Application.launch(args);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (args[0] == "cli") {
            // execute phoenicis in CLI mode
        }
    }
}

@plata
Copy link
Collaborator Author

plata commented Jun 17, 2020

Wouldn't that imply that phoenicis-cli is a JavaFX application?

@madoar
Copy link
Collaborator

madoar commented Jun 17, 2020

Wouldn't that imply that phoenicis-cli is a JavaFX application?

What do you mean by a JavaFX application?
If you mean that it would include the JavaFX dependencies, then yes.
If you mean that it would automatically open a JavaFX window when starting the application, then no.

@plata
Copy link
Collaborator Author

plata commented Jun 17, 2020

If you mean that it would include the JavaFX dependencies, then yes.

This is what I meant. Do we want this?

@madoar
Copy link
Collaborator

madoar commented Jun 17, 2020

I do not know how others think about this, but in my opinion it is not a huge problem adding the JavaFX dependencies to the applications. I mean Java itself is normally bundled with a lot of "unnecessary" libraries (including Swing). I don't think that it is a big issue to add another library if it benefits us. In the scope of this PR I would say that adding JavaFX as a dependency to phoenicis-cli makes it much easier to maintain both applications. In addition it allows us distributing both the cli and the JavaFX client as a single application, which is also a huge benefit.

@plata
Copy link
Collaborator Author

plata commented Jun 17, 2020

This is definitely something where I would like @qparis opinion.

@madoar madoar requested a review from qparis July 8, 2020 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants