|
a/tool/src/GUI/StudioUI2.java |
|
b/tool/src/GUI/StudioUI2.java |
|
... |
|
... |
312 |
|
312 |
|
313 |
|
313 |
|
314 |
|
314 |
|
315 |
// set our first product as the default thing when adding
|
315 |
// set our first product as the default thing when adding
|
316 |
// more components from the library
|
316 |
// more components from the library
|
317 |
if(core.products != null)
|
317 |
// if(core.products != null)
|
318 |
if(core.products.isEmpty() == false){
|
318 |
// if(core.products.isEmpty() == false){
|
319 |
productSelected = core.products.get(0);
|
319 |
// productSelected = core.products.get(0);
|
320 |
System.out.println("KH09 - Selecting the first product as default");
|
320 |
// System.out.println("KH09 - Selecting the first product as default");
|
321 |
}
|
321 |
// }
|
322 |
|
322 |
|
323 |
// get the list of RunPlugins going
|
323 |
// get the list of RunPlugins going
|
324 |
RunPlugins.listPlugins();
|
324 |
RunPlugins.listPlugins();
|
325 |
log.write(is.INFO, Messages.ReadyToUse);
|
325 |
log.write(is.INFO, Messages.ReadyToUse);
|
326 |
// log.write(is.INFO, Messages.ReadyToUse);
|
326 |
// log.write(is.INFO, Messages.ReadyToUse);
|
|
... |
|
... |
348 |
button.setEnabled(false);
|
348 |
button.setEnabled(false);
|
349 |
|
349 |
|
350 |
// capture the clicks on HTML content
|
350 |
// capture the clicks on HTML content
|
351 |
doFormInterception();
|
351 |
doFormInterception();
|
352 |
|
352 |
|
353 |
// some experiments to add line-wrapping
|
353 |
// this is needed to ensure we get line-wrapping
|
354 |
jScrollPane2.setViewportView(text);
|
354 |
jScrollPane2.setViewportView(text);
|
355 |
|
355 |
|
356 |
// change our title
|
356 |
// change our title
|
357 |
this.setTitle("TripleCheck");
|
357 |
this.setTitle("TripleCheck");
|
358 |
|
358 |
|
|
|
359 |
doFrontScreen();
|
359 |
}
|
360 |
}
|
360 |
|
361 |
|
361 |
public JTree getTree(){
|
362 |
public JTree getTree(){
|
362 |
return tree;
|
363 |
return tree;
|
363 |
}
|
364 |
}
|
|
... |
|
... |
497 |
|
498 |
|
498 |
// set the new content, first the type and then the text
|
499 |
// set the new content, first the type and then the text
|
499 |
text.setContentType(contentType);
|
500 |
text.setContentType(contentType);
|
500 |
text.setText(content);
|
501 |
text.setText(content);
|
501 |
// disable this box if you don't need to see the output on a file
|
502 |
// disable this box if you don't need to see the output on a file
|
502 |
//utils.files.SaveStringToFile(new File("output.html"), content);
|
503 |
utils.files.SaveStringToFile(new File("output.html"), content);
|
503 |
|
504 |
|
504 |
// should the button enabled?
|
505 |
// should the button enabled?
|
505 |
button.setEnabled(true);
|
506 |
button.setEnabled(true);
|
506 |
|
507 |
|
507 |
// change the cursor position
|
508 |
// change the cursor position
|
|
... |
|
... |
634 |
newRequest.scriptFolder = node.scriptFolder;
|
635 |
newRequest.scriptFolder = node.scriptFolder;
|
635 |
newRequest.scriptMethod = node.scriptMethod;
|
636 |
newRequest.scriptMethod = node.scriptMethod;
|
636 |
//newRequest.addParameter("method", node.scriptMethod);
|
637 |
//newRequest.addParameter("method", node.scriptMethod);
|
637 |
controller.process(newRequest);
|
638 |
controller.process(newRequest);
|
638 |
}
|
639 |
}
|
639 |
|
|
|
640 |
}
|
640 |
}
|
641 |
|
641 |
|
642 |
|
642 |
|
643 |
|
643 |
|
644 |
/**
|
644 |
/**
|
|
... |
|
... |
686 |
if(URL.startsWith("/")){
|
686 |
if(URL.startsWith("/")){
|
687 |
String script;
|
687 |
String script;
|
688 |
String parameters = "";
|
688 |
String parameters = "";
|
689 |
|
689 |
|
690 |
if(URL.contains("?")){
|
690 |
if(URL.contains("?")){
|
691 |
String[] part = URL.split("\\?");
|
691 |
String[] part = text.split("\\?");
|
692 |
script = part[0];
|
692 |
script = part[0];
|
693 |
parameters= part[1];
|
693 |
parameters= part[1];
|
694 |
}else{
|
694 |
}else{
|
695 |
script = URL;
|
695 |
script = text;
|
696 |
}
|
696 |
}
|
697 |
// execute the link request
|
697 |
// execute the link request
|
698 |
processFormSubmit2(request, script, parameters);
|
698 |
processFormSubmit2(request, script, parameters);
|
699 |
return;
|
699 |
return;
|
700 |
}
|
700 |
}
|
|
... |
|
... |
715 |
return;
|
715 |
return;
|
716 |
}
|
716 |
}
|
717 |
|
717 |
|
718 |
// normal web link, open in browser
|
718 |
// normal web link, open in browser
|
719 |
if(URL.startsWith("http://")){
|
719 |
if(URL.startsWith("http://")){
|
720 |
internet.openURL(URL);
|
720 |
internet.openURL(text);
|
721 |
log.write(is.COMMAND, "Opening URL: %1", URL);
|
721 |
log.write(is.COMMAND, "Opening URL: %1", URL);
|
722 |
// nothing else to be done
|
722 |
// nothing else to be done
|
723 |
return;
|
723 |
return;
|
724 |
}
|
724 |
}
|
725 |
|
725 |
|
726 |
// web(secure) link, open in browser
|
726 |
// web(secure) link, open in browser
|
727 |
if(URL.startsWith("https://")){
|
727 |
if(URL.startsWith("https://")){
|
728 |
internet.openURL(URL);
|
728 |
internet.openURL(text);
|
729 |
log.write(is.COMMAND, "Opening secure URL: %1", URL);
|
729 |
log.write(is.COMMAND, "Opening secure URL: %1", URL);
|
730 |
// nothing else to be done
|
730 |
// nothing else to be done
|
731 |
return;
|
731 |
return;
|
732 |
}
|
732 |
}
|
733 |
|
733 |
|
|
... |
|
... |
883 |
// }// for
|
883 |
// }// for
|
884 |
// list all parameters that we have
|
884 |
// list all parameters that we have
|
885 |
// for(String[] parameter : request.parameters){
|
885 |
// for(String[] parameter : request.parameters){
|
886 |
// System.err.println(parameter[0] +"->"+ parameter[1]);
|
886 |
// System.err.println(parameter[0] +"->"+ parameter[1]);
|
887 |
// }
|
887 |
// }
|
|
|
888 |
|
|
|
889 |
/**
|
|
|
890 |
* Add related news to the front screen
|
|
|
891 |
*/
|
|
|
892 |
private void doFrontScreen() {
|
|
|
893 |
|
|
|
894 |
String timeLine = www.twitter.getTimeLine("@triplechecked");
|
|
|
895 |
|
|
|
896 |
// did we got anything from the web?
|
|
|
897 |
if(timeLine == null){
|
|
|
898 |
// nothing, just return without further action
|
|
|
899 |
return;
|
|
|
900 |
}
|
|
|
901 |
|
|
|
902 |
String result = ""
|
|
|
903 |
+ html.div()
|
|
|
904 |
+ html.h2("Recent news "
|
|
|
905 |
+ "@" + html.link("triplechecked", "http://twitter.com/triplechecked")
|
|
|
906 |
+ "")
|
|
|
907 |
+ timeLine
|
|
|
908 |
+ html._div
|
|
|
909 |
;
|
|
|
910 |
this.editorPane(is.contentHTML, false, 0, result);
|
|
|
911 |
}
|
888 |
|
912 |
|
889 |
}
|
913 |
}
|