Skip to content

Commit c284c86

Browse files
author
Wenjun Che
committed
RUN-1077: add example for setting RVM installer arguments
1 parent d0561be commit c284c86

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

src/main/java/com/openfin/desktop/demo/OpenFinDesktopDemo.java

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,27 @@
1717
import java.awt.event.WindowListener;
1818
import java.util.ArrayList;
1919
import java.util.HashMap;
20-
import java.util.Random;
2120
import java.util.logging.Logger;
2221

2322
/**
2423
*
2524
* GUI example that allows for instantiating and controlling
2625
*
26+
* Supported system properties by this demo:
27+
*
28+
* 1. to specify security realm for OpenFin Runtime
29+
* -Dcom.openfin.demo.security.realm=SampleRealm
30+
*
31+
* 2. to specify version of OpenFin Runtime
32+
* -Dcom.openfin.demo.version=5.44.8.56
33+
*
34+
* 3. to specify arguments to be passed to RVM installer
35+
* -Dcom.openfin.demo.rvm.arguments="--assetsUrl=https://myServer/release --rvm-config=https://myServer/rvm.json"
36+
*
37+
* 4. to connect to a port of a running instance of OpenFin Runtime (this is a deprecated use of OpenFin API
38+
* -Dcom.openfin.demo.port=9000
39+
*
40+
*
2741
* Created by wche on 2/28/15.
2842
*
2943
*/
@@ -454,6 +468,11 @@ public void onOutgoingMessage(String message) {
454468
if (desktopVersion == null) {
455469
desktopVersion = "stable";
456470
}
471+
String rvmArgs = java.lang.System.getProperty("com.openfin.demo.rvm.arguments");
472+
if (rvmArgs != null) {
473+
updateMessagePanel("Additional RVM arguments: " + rvmArgs);
474+
desktopConnection.setAdditionalRvmArguments(rvmArgs);
475+
}
457476
updateMessagePanel("Connecting to version " + desktopVersion);
458477
desktopConnection.connectToVersion(desktopVersion, listener, 10000);
459478
}
@@ -585,27 +604,6 @@ public void onSuccess(WindowBounds result) {
585604
}, null);
586605
}
587606

588-
final static public String ISSUER = "issuer";
589-
final static public String MATURITY = "maturity";
590-
final static public String COUPON = "coupon";
591-
final static public String SIZE = "size";
592-
final static public String CCY = "ccy";
593-
final static public String ACCOUNT = "account";
594-
final static public String PLATFORM = "platform";
595-
final static public String MARKET_DATA = "marketData";
596-
final static public String TYPE = "type";
597-
final static public String STATUS = "status";
598-
final static public String EXPIRATION_TIME = "expirationTime";
599-
final static public String ID = "id";
600-
final static public String PRICE = "price";
601-
602-
private Random random = new Random();
603-
private static final String[] issuers = {"GS", "JPM", "UBS", "MS", "DB", "BC", "BA"};
604-
private static final String[] ccys = {"USD", "JPY", "GBP", "EUR", "CHF", "CAD"};
605-
private static final String[] accounts = {"ABC Capital", "DEF Capital", "GHI Capital"};
606-
private static final String[] platforms = {"Trade Desk"};
607-
private static final String[] types = {"ASK", "BID"};
608-
609607
private void setMainButtonsEnabled(boolean enabled) {
610608
java.lang.System.out.println("setMainButtonsEnabled " + enabled);
611609
launch.setEnabled(!enabled);

0 commit comments

Comments
 (0)