|
22 | 22 | import java.util.ArrayList; |
23 | 23 | import java.util.HashMap; |
24 | 24 |
|
| 25 | +import jdk.nashorn.internal.scripts.JO; |
| 26 | +import org.json.JSONArray; |
25 | 27 | import org.json.JSONObject; |
26 | 28 | import org.slf4j.Logger; |
27 | 29 | import org.slf4j.LoggerFactory; |
@@ -140,13 +142,50 @@ private void initDesktopConnection() throws DesktopException { |
140 | 142 | } |
141 | 143 | this.runtimeConfiguration.setAdditionalRuntimeArguments("--v=1 "); // enable additional logging |
142 | 144 | this.runtimeConfiguration.setDevToolsPort(9090); |
143 | | - this.runtimeConfiguration.setLicenseKey("my-license-key"); |
| 145 | + |
| 146 | + JSONObject startupApp = new JSONObject(); |
| 147 | + startupApp.put("uuid", "DEMO-JAVA"); |
| 148 | + startupApp.put("name", "DEMO-JAVA"); |
| 149 | + startupApp.put("url", "https://cdn.openfin.co/process-manager/index.html"); |
| 150 | + startupApp.put("autoShow", true); |
| 151 | + |
| 152 | + String licenseKey = java.lang.System.getProperty("com.openfin.demo.licenseKey"); |
| 153 | + if (licenseKey != null) { |
| 154 | + this.runtimeConfiguration.setLicenseKey(licenseKey); |
| 155 | + } |
144 | 156 | JSONObject myconfig = new JSONObject(); |
145 | | - myconfig.put("key1", "value1"); |
146 | | - myconfig.put("PI", 3.14); |
| 157 | +// this.runtimeConfiguration.setManifestLocation("https://cdn.openfin.co/process-manager/app.json"); |
| 158 | +// myconfig.put("key1", "value1"); |
| 159 | +// myconfig.put("PI", 3.14); |
147 | 160 | this.runtimeConfiguration.addConfigurationItem("myconfig", myconfig); |
148 | 161 | } |
149 | 162 |
|
| 163 | + private void addCustomConfig(JSONObject startupApp) { |
| 164 | + JSONObject defaultDomainSettings = new JSONObject(); |
| 165 | + JSONArray rules = new JSONArray(); |
| 166 | + JSONObject rule1 = new JSONObject(); |
| 167 | + JSONArray matchList = new JSONArray(); |
| 168 | + matchList.put("*/*.example.com"); |
| 169 | + rule1.put("match", matchList); |
| 170 | + JSONObject options = new JSONObject(); |
| 171 | + JSONObject downloadSettings = new JSONObject(); |
| 172 | + JSONArray downloadSettingsRules = new JSONArray(); |
| 173 | + JSONObject downloadSettingsRule1 = new JSONObject(); |
| 174 | + JSONArray matchList1 = new JSONArray(); |
| 175 | + matchList1.put("*://*/*.png"); |
| 176 | + matchList1.put("*://*/*.jpg"); |
| 177 | + downloadSettingsRule1.put("match", matchList1); |
| 178 | + downloadSettingsRule1.put("behavior", "no-prompt"); |
| 179 | + downloadSettingsRules.put(downloadSettingsRule1); |
| 180 | + downloadSettings.put("rules", downloadSettingsRules); |
| 181 | + options.put("downloadSettings", downloadSettings); |
| 182 | + rule1.put("options", options); |
| 183 | + rules.put(rule1); |
| 184 | + defaultDomainSettings.put("rules", rules); |
| 185 | + startupApp.put("defaultDomainSettings", defaultDomainSettings); |
| 186 | + this.runtimeConfiguration.setStartupApp(startupApp); |
| 187 | + } |
| 188 | + |
150 | 189 | private JPanel layoutLeftPanel() { |
151 | 190 | JPanel panel = new JPanel(); |
152 | 191 | double size[][] = {{TableLayout.FILL}, {160, 30, TableLayout.FILL}}; |
|
0 commit comments