Home » Eclipse Projects » Standard Widget Toolkit (SWT) » differences between browser.setText and browser.setUrl behavior
differences between browser.setText and browser.setUrl behavior [message #488237] |
Sat, 26 September 2009 14:53 |
Mauro Condarelli Messages: 428 Registered: September 2009 |
Senior Member |
|
|
Hi,
I'm trying to use the browser widget to do non-standard work, so I'm in a mess
I'm basically trying to use the browser to display a Timeline and thus I am interested in building the pages dynamically in memory and then feed them to the browser.
Problem is the "page" uses heavily javascript to display the Timeline.
I did a lot of trials using a "local" timeline provided in the site and modifying it.
My current stumbling block is the browser.setText() and browser.setUrl() methods seem to behave in a somewhat different way.
My current test code includes this method:
private void reload() {
if (true) {
String s = "local_example.html";
File f = new File(s);
try {
URL u = f.toURI().toURL();
s = u.toString();
try {
br.setUrl(s);
} catch (Exception e) {
e.printStackTrace();
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
} else if (true) {
String s = "local_example.html";
File f = new File(s);
StringBuilder sb = new StringBuilder();
BufferedReader r;
try {
r = new BufferedReader(new FileReader(f));
while (true) {
String l;
try {
l = r.readLine();
if (l == null) break;
sb.append(l);
sb.append('\n');
} catch (IOException e) {
e.printStackTrace();
}
}
try {
r.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String page = sb.toString();
br.setText(page);
} else {
String page =
"<html>\n"
+"<head>\n"
+" <script>\n"
+" Timeline_ajax_url=\"timeline_2.3.0/timeline_ajax/simile-ajax-api.js\";\n"
+" Timeline_urlPrefix='timeline_2.3.0/timeline_js/';\n"
+" Timeline_parameters='bundle=true';\n"
+" </script>\n"
+" <script src=\"timeline_2.3.0/timeline_js/timeline-api.js?bundle=true\" type=\"text/javascript\"></script>\n"
+"\n"
+" <!-- Since we don't have our own server, we do something tricky and load our data here as if it were a library file -->\n"
+" <!--\n"
+" <script src=\"local_data.js\" type=\"text/javascript\"></script>\n"
+" -->\n"
+" <script>\n"
+" var tl;\n"
+"\n"
+"var timeline_data = { // save as a global variable\n"
+"'dateTimeFormat': 'iso8601',\n"
+"'wikiURL': \"http://simile.mit.edu/shelf/\",\n"
+"'wikiSection': \"Simile Cubism Timeline\",\n"
+"\n"
+"'events' : [\n"
+" {'start': '1924',\n"
+" 'title': 'Barfusserkirche',\n"
+" 'description': 'by Lyonel Feininger, American/German Painter, 1871-1956',\n"
+" 'image': 'http://images.allposters.com/images/AWI/NR096_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Barfusserkirche-1924-Posters_i1116895_.htm'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '2013',\n"
+" 'end': '2029',\n"
+" 'title': 'Three Figures',\n"
+" 'description': 'by Kasimir Malevich, Ukrainian Painter, 1878-1935',\n"
+" 'image': 'http://images.allposters.com/images/BRGPOD/75857_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Three-Figures-1913-28-Posters_i1349989_.htm'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '2081',\n"
+" 'end': '2153',\n"
+" 'title': 'Landschaft bei Montreuil',\n"
+" 'description': 'by Albert Gleizes, French Painter, 1881-1953',\n"
+" 'image': 'http://images.allposters.com/images/mer/1336_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Landschaft-bei-Montreuil-Posters_i339007_.htm',\n"
+" 'isDuration' : true,\n"
+" 'icon' : \"dark-red-circle.png\", \n"
+" 'color' : 'red',\n"
+" 'textColor' : 'green'},\n"
+"\n"
+"\n"
+" {'start': '2020',\n"
+" 'title': 'Femme au Miroir',\n"
+" 'description': 'by Fernand Leger, French Painter, 1881-1955',\n"
+" 'image': 'http://images.allposters.com/images/AWI/GMR117_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Femme-au-Miroir-1920-Posters_i141266_.htm'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '2003',\n"
+" 'title': 'The Old Guitarist',\n"
+" 'description': 'by Pablo Picasso, Spanish Painter/Sculptor, 1881-1973',\n"
+" 'image': 'http://images.allposters.com/images/ESC/AP599_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/The-Old-Guitarist-c-1903-Posters_i328746_.htm'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '2082',\n"
+" 'end': '2164',\n"
+" 'title': 'Jour',\n"
+" 'description': 'by Georges Braque, French Painter, 1882-1963',\n"
+" 'image': 'http://images.allposters.com/images/SHD/S1041_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Jour-Posters_i126663_.htm',\n"
+" 'color': 'green'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '1916',\n"
+" 'title': 'Still Life with a White Dish',\n"
+" 'description': 'by Gino Severini, Italian Painter, 1883-1966',\n"
+" 'image': 'http://images.allposters.com/images/MCG/FS1254_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Still-Life-with-a-White-Dish-1916-Posters_i366823_.htm'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '2085',\n"
+" 'end': '2141',\n"
+" 'title': 'Rhythm, Joie de Vivre',\n"
+" 'description': 'by Robert Delaunay, French Painter, 1885-1941',\n"
+" 'image': 'http://imagecache2.allposters.com/images/pic/adc/10053983a_b~Rhythm-Joie-de-Vivre-Posters.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Rhythm-Joie-de-Vivre-Posters_i1250641_.htm'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '2085',\n"
+" 'end': '2125',\n"
+" 'title': 'Castor Et Pollux',\n"
+" 'description': 'by Roger de la Fresnaye, French Painter, 1885-1925',\n"
+" 'image': 'http://images.allposters.com/images/CORPOD/IX001463_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Castor-Et-Pollux-Posters_i831718_.htm',\n"
+" 'tapeImage': 'blue_stripes.png',\n"
+" 'tapeRepeat': 'repeat-x',\n"
+" 'caption': \"This is the event's caption attribute.\",\n"
+" 'classname': 'hot_event' \n"
+" },\n"
+"\n"
+"\n"
+" {'start': '1912',\n"
+" 'title': 'Portrait of Pablo Picasso',\n"
+" 'description': 'by Juan Gris, Spanish Painter/Sculptor, 1887-1927',\n"
+" 'image': 'http://images.allposters.com/images/BRGPOD/156514_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Portrait-of-Pablo-Picasso-1881-1973-1912-Posters_i1344154_.htm'\n"
+" },\n"
+"\n"
+"\n"
+" {'start': '2091',\n"
+" 'end': '2115',\n"
+" 'title': 'Portrait of Horace Brodsky',\n"
+" 'description': 'by Henri Gaudier-Brzeska, French Sculptor, 1891-1915',\n"
+" 'image': 'http://imagecache2.allposters.com/images/BRGPOD/102770_b.jpg',\n"
+" 'link': 'http://www.allposters.com/-sp/Portrait-of-Horace-Brodsky-Posters_i1584413_.htm'\n"
+" }\n"
+"]\n"
+"}\n"
+" \n"
+" function onLoad() {\n"
+" var tl_el = document.getElementById(\"tl\");\n"
+" var eventSource1 = new Timeline.DefaultEventSource();\n"
+"\n"
+" var theme1 = Timeline.ClassicTheme.create();\n"
+" theme1.autoWidth = true; // Set the Timeline's \"width\" automatically.\n"
+" // Set autoWidth on the Timeline's first band's theme,\n"
+" // will affect all bands.\n"
+" theme1.timeline_start = new Date(Date.UTC(1890, 0, 1));\n"
+" theme1.timeline_stop = new Date(Date.UTC(2160, 0, 1));\n"
+"\n"
+" var d = Timeline.DateTime.parseGregorianDateTime(\"1900\")\n"
+" var bandInfos = [\n"
+" Timeline.createBandInfo({\n"
+" width: 45, // set to a minimum, autoWidth will then adjust\n"
+" intervalUnit: Timeline.DateTime.DECADE, \n"
+" intervalPixels: 200,\n"
+" eventSource: eventSource1,\n"
+" date: d,\n"
+" theme: theme1,\n"
+" layout: 'original' // original, overview, detailed\n"
+" })\n"
+" ];\n"
+"\n"
+" // create the Timeline\n"
+" tl = Timeline.create(tl_el, bandInfos, Timeline.HORIZONTAL);\n"
+"\n"
+" var url = '.'; // The base url for image, icon and background image\n"
+" // references in the data\n"
+" eventSource1.loadJSON(timeline_data, url); // The data was stored into the \n"
+" // timeline_data variable.\n"
+" tl.layout(); // display the Timeline\n"
+" }\n"
+"\n"
+" var resizeTimerID = null;\n"
+" function onResize() {\n"
+" if (resizeTimerID == null) {\n"
+" resizeTimerID = window.setTimeout(function() {\n"
+" resizeTimerID = null;\n"
+" tl.layout();\n"
+" }, 500);\n"
+" }\n"
+" }\n"
+" </script>\n"
+"\n"
+"</head>\n"
+"<body onload=\"onLoad();\" onresize=\"onResize();\">\n"
+" <div id='tl'/>\n"
+"</body>\n"
+"</html>\n"
;
br.setText(page);
}
}
Obviously only one of the three methods to load a page can be used.
Only the first (the currently enabled one, using setUrl()) works ok; the other two (using setText()) display an empty page.
A bit of further investigation shows the browser is unable to find the javascript libraries (if I add something else, in pure HTML, to the page it is shown!).
Can someone shed light on what's going on here?
Two side issues:
- is it possible to have a javascript console showing the errors somehow?
- is there a better way to chose alternate "compile time" code variants than using plain "if(true)"; eclipse complains about dead code (rightly!).
Many Thanks in advance
Mauro
|
|
|
Re: differences between browser.setText and browser.setUrl behavior [message #488664 is a reply to message #488237] |
Tue, 29 September 2009 16:33 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi Mauro,
I don't read javascript too often, but it looks like your library paths are
not absolute. A first experiment to try is to hard-code their absolute
values, and if this works then see if relative paths can be made to work by
specifying a "base" value like in
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet137.java?view=co .
> is it possible to have a javascript console showing the errors somehow?
In theory yes, but I don't know of any real-world cases to suggest. A
plug-in like Firebug depends on Firefox xpcom components that are not part
of the core embeddable browser, so it would not work in our case. I think
"try{...}catch(e){alert(e);}" is still your friend here ;-).
> is there a better way to chose alternate "compile time" code variants
than using plain "if(true)"; eclipse complains about dead code (rightly!).
I don't think so, the compiler's getting smarter. The old stand-bys like
"if (1 == 2-1)" don't fool it either.
HTH,
Grant
"Mauro Condarelli" <mc5686@mclink.it> wrote in message
news:h9l9u1$90c$1@build.eclipse.org...
> Hi,
> I'm trying to use the browser widget to do non-standard work, so I'm in a
mess :)
>
> I'm basically trying to use the browser to display a
http://www.simile-widgets.org/timeline/ and thus I am interested in building
the pages dynamically in memory and then feed them to the browser.
>
> Problem is the "page" uses heavily javascript to display the Timeline.
>
> I did a lot of trials using a "local" timeline provided in the site and
modifying it.
>
> My current stumbling block is the browser.setText() and browser.setUrl()
methods seem to behave in a somewhat different way.
>
> My current test code includes this method:
> private void reload() {
> if (true) {
> String s = "local_example.html";
> File f = new File(s);
> try {
> URL u = f.toURI().toURL();
> s = u.toString();
> try {
> br.setUrl(s);
> } catch (Exception e) {
> e.printStackTrace();
> }
> } catch (MalformedURLException e) {
> e.printStackTrace();
> }
> } else if (true) {
> String s = "local_example.html";
> File f = new File(s);
> StringBuilder sb = new StringBuilder();
> BufferedReader r;
> try {
> r = new BufferedReader(new FileReader(f));
> while (true) {
> String l;
> try {
> l = r.readLine();
> if (l == null) break;
> sb.append(l);
> sb.append('\n');
> } catch (IOException e) {
> e.printStackTrace();
> }
> }
> try {
> r.close();
> } catch (IOException e) {
> e.printStackTrace();
> }
> } catch (FileNotFoundException e) {
> e.printStackTrace();
> }
> String page = sb.toString();
> br.setText(page);
> } else {
> String page =
> "<html>\n"
> +"<head>\n"
> +" <script>\n"
> +"
Timeline_ajax_url=\"timeline_2.3.0/timeline_ajax/simile-ajax-api.js\ ";\n"
> +" Timeline_urlPrefix='timeline_2.3.0/timeline_js/';\n"
> +" Timeline_parameters='bundle=true';\n"
> +" </script>\n"
> +" <script
src=\"timeline_2.3.0/timeline_js/timeline-api.js?bundle=true\ "
type=\"text/javascript\"></script>\n"
> +"\n"
> +" <!-- Since we don't have our own server, we do something tricky and
load our data here as if it were a library file -->\n"
> +" <!--\n"
> +" <script src=\"local_data.js\" type=\"text/javascript\"></script>\n"
> +" -->\n"
> +" <script>\n"
> +" var tl;\n"
> +"\n"
> +"var timeline_data = { // save as a global variable\n"
> +"'dateTimeFormat': 'iso8601',\n"
> +"'wikiURL': \"http://simile.mit.edu/shelf/\",\n"
> +"'wikiSection': \"Simile Cubism Timeline\",\n"
> +"\n"
> +"'events' : [\n"
> +" {'start': '1924',\n"
> +" 'title': 'Barfusserkirche',\n"
> +" 'description': 'by Lyonel Feininger, American/German Painter,
1871-1956',\n"
> +" 'image':
'http://images.allposters.com/images/AWI/NR096_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Barfusserkirche-1924-Posters_i 1116895_.htm'\n
"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '2013',\n"
> +" 'end': '2029',\n"
> +" 'title': 'Three Figures',\n"
> +" 'description': 'by Kasimir Malevich, Ukrainian Painter,
1878-1935',\n"
> +" 'image':
'http://images.allposters.com/images/BRGPOD/75857_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Three-Figures-1913-28-Posters_ i1349989_.htm'\
n"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '2081',\n"
> +" 'end': '2153',\n"
> +" 'title': 'Landschaft bei Montreuil',\n"
> +" 'description': 'by Albert Gleizes, French Painter,
1881-1953',\n"
> +" 'image':
'http://images.allposters.com/images/mer/1336_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Landschaft-bei-Montreuil-Poste rs_i339007_.htm
',\n"
> +" 'isDuration' : true,\n"
> +" 'icon' : \"dark-red-circle.png\", \n"
> +" 'color' : 'red',\n"
> +" 'textColor' : 'green'},\n"
> +"\n"
> +"\n"
> +" {'start': '2020',\n"
> +" 'title': 'Femme au Miroir',\n"
> +" 'description': 'by Fernand Leger, French Painter, 1881-1955',\n"
> +" 'image':
'http://images.allposters.com/images/AWI/GMR117_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Femme-au-Miroir-1920-Posters_i 141266_.htm'\n"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '2003',\n"
> +" 'title': 'The Old Guitarist',\n"
> +" 'description': 'by Pablo Picasso, Spanish Painter/Sculptor,
1881-1973',\n"
> +" 'image':
'http://images.allposters.com/images/ESC/AP599_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/The-Old-Guitarist-c-1903-Poste rs_i328746_.htm
'\n"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '2082',\n"
> +" 'end': '2164',\n"
> +" 'title': 'Jour',\n"
> +" 'description': 'by Georges Braque, French Painter,
1882-1963',\n"
> +" 'image':
'http://images.allposters.com/images/SHD/S1041_b.jpg',\n"
> +" 'link':
'http://www.allposters.com/-sp/Jour-Posters_i126663_.htm',\n"
> +" 'color': 'green'\n"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '1916',\n"
> +" 'title': 'Still Life with a White Dish',\n"
> +" 'description': 'by Gino Severini, Italian Painter,
1883-1966',\n"
> +" 'image':
'http://images.allposters.com/images/MCG/FS1254_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Still-Life-with-a-White-Dish-1 916-Posters_i36
6823_.htm'\n"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '2085',\n"
> +" 'end': '2141',\n"
> +" 'title': 'Rhythm, Joie de Vivre',\n"
> +" 'description': 'by Robert Delaunay, French Painter,
1885-1941',\n"
> +" 'image':
' http://imagecache2.allposters.com/images/pic/adc/10053983a_b ~Rhythm-Joie-de
-Vivre-Posters.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Rhythm-Joie-de-Vivre-Posters_i 1250641_.htm'\n
"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '2085',\n"
> +" 'end': '2125',\n"
> +" 'title': 'Castor Et Pollux',\n"
> +" 'description': 'by Roger de la Fresnaye, French Painter,
1885-1925',\n"
> +" 'image':
'http://images.allposters.com/images/CORPOD/IX001463_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Castor-Et-Pollux-Posters_i8317 18_.htm',\n"
> +" 'tapeImage': 'blue_stripes.png',\n"
> +" 'tapeRepeat': 'repeat-x',\n"
> +" 'caption': \"This is the event's caption attribute.\",\n"
> +" 'classname': 'hot_event' \n"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '1912',\n"
> +" 'title': 'Portrait of Pablo Picasso',\n"
> +" 'description': 'by Juan Gris, Spanish Painter/Sculptor,
1887-1927',\n"
> +" 'image':
'http://images.allposters.com/images/BRGPOD/156514_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Portrait-of-Pablo-Picasso-1881 -1973-1912-Post
ers_i1344154_.htm'\n"
> +" },\n"
> +"\n"
> +"\n"
> +" {'start': '2091',\n"
> +" 'end': '2115',\n"
> +" 'title': 'Portrait of Horace Brodsky',\n"
> +" 'description': 'by Henri Gaudier-Brzeska, French Sculptor,
1891-1915',\n"
> +" 'image':
' http://imagecache2.allposters.com/images/BRGPOD/102770_b.jpg',\n"
> +" 'link':
' http://www.allposters.com/-sp/Portrait-of-Horace-Brodsky-Pos ters_i1584413_.
htm'\n"
> +" }\n"
> +"]\n"
> +"}\n"
> +" \n"
> +" function onLoad() {\n"
> +" var tl_el = document.getElementById(\"tl\");\n"
> +" var eventSource1 = new Timeline.DefaultEventSource();\n"
> +"\n"
> +" var theme1 = Timeline.ClassicTheme.create();\n"
> +" theme1.autoWidth = true; // Set the Timeline's \"width\"
automatically.\n"
> +" // Set autoWidth on the Timeline's
first band's theme,\n"
> +" // will affect all bands.\n"
> +" theme1.timeline_start = new Date(Date.UTC(1890, 0, 1));\n"
> +" theme1.timeline_stop = new Date(Date.UTC(2160, 0, 1));\n"
> +"\n"
> +" var d =
Timeline.DateTime.parseGregorianDateTime(\"1900\")\n"
> +" var bandInfos = [\n"
> +" Timeline.createBandInfo({\n"
> +" width: 45, // set to a minimum, autoWidth
will then adjust\n"
> +" intervalUnit: Timeline.DateTime.DECADE, \n"
> +" intervalPixels: 200,\n"
> +" eventSource: eventSource1,\n"
> +" date: d,\n"
> +" theme: theme1,\n"
> +" layout: 'original' // original, overview,
detailed\n"
> +" })\n"
> +" ];\n"
> +"\n"
> +" // create the Timeline\n"
> +" tl = Timeline.create(tl_el, bandInfos,
Timeline.HORIZONTAL);\n"
> +"\n"
> +" var url = '.'; // The base url for image, icon and
background image\n"
> +" // references in the data\n"
> +" eventSource1.loadJSON(timeline_data, url); // The data was
stored into the \n"
> +" // timeline_data
variable.\n"
> +" tl.layout(); // display the Timeline\n"
> +" }\n"
> +"\n"
> +" var resizeTimerID = null;\n"
> +" function onResize() {\n"
> +" if (resizeTimerID == null) {\n"
> +" resizeTimerID = window.setTimeout(function() {\n"
> +" resizeTimerID = null;\n"
> +" tl.layout();\n"
> +" }, 500);\n"
> +" }\n"
> +" }\n"
> +" </script>\n"
> +"\n"
> +"</head>\n"
> +"<body onload=\"onLoad();\" onresize=\"onResize();\">\n"
> +" <div id='tl'/>\n"
> +"</body>\n"
> +"</html>\n"
> ;
> br.setText(page);
> }
> }
>
> Obviously only one of the three methods to load a page can be used.
> Only the first (the currently enabled one, using setUrl()) works ok; the
other two (using setText()) display an empty page.
> A bit of further investigation shows the browser is unable to find the
javascript libraries (if I add something else, in pure HTML, to the page it
is shown!).
>
> Can someone shed light on what's going on here?
>
> Two side issues:
> is it possible to have a javascript console showing the errors somehow?
> is there a better way to chose alternate "compile time" code variants
than using plain "if(true)"; eclipse complains about dead code (rightly!).
>
>
> Many Thanks in advance
> Mauro
>
|
|
|
Re: differences between browser.setText and browser.setUrl behavior [message #488682 is a reply to message #488664] |
Tue, 29 September 2009 17:45 |
Mauro Condarelli Messages: 428 Registered: September 2009 |
Senior Member |
|
|
Quote: | Hi Mauro,
I don't read javascript too often, but it looks like your library paths are
not absolute. A first experiment to try is to hard-code their absolute
values, and if this works then see if relative paths can be made to work by
specifying a "base" value like in
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet137.java?view=co .
|
Thanks Grant.
First test was *not* successful.
IE is now complaining about "out of memory in line xxxx".
I will dig further, probably I did some stupid mistake.
Question is: I would like, if at all possible, to pack the whole bunch of javascript in the same jarfile with the product (RCP app),
Is there any chance to convince the browser to search for resources in the jar?
If so, can You give me some pointer to docs?
I do not have a real web server, all pages should be rendered from the local filesystem (file:///...)
Thanks again
Mauro
|
|
|
Re: differences between browser.setText and browser.setUrl behavior [message #488853 is a reply to message #488682] |
Wed, 30 September 2009 13:49 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
The Browser will not look for resources in a jar. However if they are in
your plug-in jar then I think the eclipse RCP platform will auto-extract
them somewhere, and you can then point at them there. For an example of
something like this (just solving a different problem) see the code snippet
that's part of http://www.eclipse.org/swt/faq.php#specifyxulrunner .
Grant
"Mauro Condarelli" <mc5686@mclink.it> wrote in message
news:h9th39$1m2$1@build.eclipse.org...
> Quote:
> > Hi Mauro,
> >
> > I don't read javascript too often, but it looks like your library paths
are
> > not absolute. A first experiment to try is to hard-code their absolute
> > values, and if this works then see if relative paths can be made to work
by
> > specifying a "base" value like in
> > http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni
ppets/src/org/eclipse/swt/snippets/Snippet137.java?view=co .
>
>
> Thanks Grant.
>
> First test was *not* successful.
> IE is now complaining about "out of memory in line xxxx".
> I will dig further, probably I did some stupid mistake.
>
> Question is: I would like, if at all possible, to pack the whole bunch of
javascript in the same jarfile with the product (RCP app),
> Is there any chance to convince the browser to search for resources in the
jar?
> If so, can You give me some pointer to docs?
>
> I do not have a real web server, all pages should be rendered from the
local filesystem (file:///...)
>
> Thanks again
> Mauro
|
|
| |
Goto Forum:
Current Time: Mon Apr 29 15:22:36 GMT 2024
Powered by FUDForum. Page generated in 0.03424 seconds
|