Hi Mathias,
There's a 4th suggestion. You could implement your own password tunable in your App.
You would have to do the following:
Create a wrapper class for the password string.
public class PasswordString {
private String password;
public void setPassword(String password) { ... }
public String getPassword() { ... }
}
For the command side create a PasswordTunableHandler that extends AbstractStringTunableHandler. Here's an example for the File tunable, just return a new PasswordString(arg) instead:
Register the handler in your CyActivator like this:
StringTunableHandlerFactory<PasswordTunableHandler> passwordHandler = new SimpleStringTunableHandlerFactory<>(PasswordTunableHandler.class, PasswordString.class);
For the GUI side create a PasswordStringGUIHander that extends AbstractGUITunableHandler. Take a look at the implementation of StringHandler in cytoscape to see how this works. You would have to figure out how to do the asterisk thing, and the calls to getValue() and setValue() would need to use instances of the PasswordString class.
Register the handler in your CyActivator, something like this:
SimpleGUITunableHandlerFactory<PasswordStringGUIHandler> passwordHandlerFactory = new SimpleGUITunableHandlerFactory<>(
PasswordStringGUIHandler.class, PasswordString.class);
registerService(bc, passwordHandlerFactory, GUITunableHandlerFactory.class);
And then you should be able to use the tunable like this:
@Tunable
public PasswordString password;
And if it works, you can always contribute the implementation back to Cytoscape so that others can use it in the future.
Thanks.
Mike.