Home » Eclipse Projects » Remote Application Platform (RAP) » How to open a new tab in the same browser RAP is running in?
|
Re: How to open a new tab in the same browser RAP is running in? [message #123901 is a reply to message #123887] |
Mon, 09 March 2009 08:15 |
Eclipse User |
|
|
|
Originally posted by: bjoern.bjoernfischer.de
Hi Andreas,
I don't know for sure, but IMHO it is a browser option if a new web page
with target _blank is opened in a new window or in a new tab (Firefox at
least has this option). Could be that you can not force the browser to
choose the one or the other way of opening.
Regards,
Björn
Andreas Maier schrieb:
> Hello,
>
> my RAP application has some external links, which are opened each in a new
> external browser window. Is it possible to open them in a separate tab of
> the same browser instance where the RAP application is running in, instead?
> (Of course the browser must support tabbed-browsing.) Here is my code:
> int style = IWorkbenchBrowserSupport.AS_EXTERNAL |
> IWorkbenchBrowserSupport.LOCATION_BAR |
> IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS;
>
> String browserId = String.valueOf(new Random().nextInt(10000));
>
> PlatformUI.getWorkbench().getBrowserSupport()..createBrowser (style,
> browserId , "", "").openURL(new URL("http://..."));
>
> Generating a new browserId is required, as applying a constant browserId
> just opens one new browser instance and each loaded URLlink gets replaced
> there by the next one. But I want all URLs left open.
> In HTML <a href="..." target="_blank"> does the job.
>
>
> Thanks in advance,
> Andreas
>
>
|
|
|
Re: How to open a new tab in the same browser RAP is running in? [message #123913 is a reply to message #123887] |
Mon, 09 March 2009 08:25 |
Stefan Messages: 316 Registered: July 2009 |
Senior Member |
|
|
Hi Andreas,
the RWT-specific class org.eclipse.rwt.widgets.ExternalBrowser does this
job.
Regards,
Stefan.
Andreas Maier schrieb:
> Hello,
>
> my RAP application has some external links, which are opened each in a new
> external browser window. Is it possible to open them in a separate tab of
> the same browser instance where the RAP application is running in, instead?
> (Of course the browser must support tabbed-browsing.) Here is my code:
> int style = IWorkbenchBrowserSupport.AS_EXTERNAL |
> IWorkbenchBrowserSupport.LOCATION_BAR |
> IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS;
>
> String browserId = String.valueOf(new Random().nextInt(10000));
>
> PlatformUI.getWorkbench().getBrowserSupport()..createBrowser (style,
> browserId , "", "").openURL(new URL("http://..."));
>
> Generating a new browserId is required, as applying a constant browserId
> just opens one new browser instance and each loaded URLlink gets replaced
> there by the next one. But I want all URLs left open.
> In HTML <a href="..." target="_blank"> does the job.
>
>
> Thanks in advance,
> Andreas
>
>
|
|
| |
Re: How to open a new tab in the same browser RAP is running in? [message #123966 is a reply to message #123940] |
Mon, 09 March 2009 09:33 |
|
Hi Roland,
this problem is not RAP specific. The ExternalBrowser#open parameters
are passed to the Javascript function window.open. Instead of "test",
you could experiment with the id's "_blank", "_parent", etc. But it's
still up to the browser to decide whether to open up a new tab or a new
window. There are a many forum threads out there discussing this problem
- maybe you can find anything there.
Best regards,
Ralf
Roland Siebert wrote:
> And how I can open a new tab instead of a new window?
>
> ExternalBrowser.open( "test", "http://www.eclipse.org",
> ExternalBrowser.LOCATION_BAR | ExternalBrowser.NAVIGATION_BAR |
> ExternalBrowser.STATUS );
>
> This opens a new window.
>
> Roland
>
> Stefan Roeck schrieb:
>> Hi Andreas,
>>
>> the RWT-specific class org.eclipse.rwt.widgets.ExternalBrowser does
>> this job.
>>
>> Regards,
>> Stefan.
>
|
|
|
Re: How to open a new tab in the same browser RAP is running in? [message #123991 is a reply to message #123966] |
Mon, 09 March 2009 14:23 |
rollo Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Hi,
I found out that I need this code to open in a new tab:
org.eclipse.rwt.widgets.ExternalBrowser.open( "_blank",
"http://www.eclipse.org", "" );
But ExternalBrowser.open( "_blank", "http://www.eclipse.org", 0 );
generates this code:
org.eclipse.rwt.widgets.ExternalBrowser.open( "_0blank",
"http://www.eclipse.org",
" dependent=1,scrollbars=1,resizable=1,status=1,location=1,too lbar=1,menubar=1 "
);
The method static String escapeId( final String id ) does not accept
"_blank" and replace it with "_0blank".
And the method private static String getFeatures( final int style ) is
setting by default some features.
Can this be fixed?
Roland
Ralf Sternberg schrieb:
> Hi Roland,
>
> this problem is not RAP specific. The ExternalBrowser#open parameters
> are passed to the Javascript function window.open. Instead of "test",
> you could experiment with the id's "_blank", "_parent", etc. But it's
> still up to the browser to decide whether to open up a new tab or a new
> window. There are a many forum threads out there discussing this problem
> - maybe you can find anything there.
>
> Best regards,
> Ralf
>
>
> Roland Siebert wrote:
>> And how I can open a new tab instead of a new window?
>>
>> ExternalBrowser.open( "test", "http://www.eclipse.org",
>> ExternalBrowser.LOCATION_BAR | ExternalBrowser.NAVIGATION_BAR |
>> ExternalBrowser.STATUS );
>>
>> This opens a new window.
>>
>> Roland
>>
>> Stefan Roeck schrieb:
>>> Hi Andreas,
>>>
>>> the RWT-specific class org.eclipse.rwt.widgets.ExternalBrowser does
>>> this job.
>>>
>>> Regards,
>>> Stefan.
|
|
|
Re: How to open a new tab in the same browser RAP is running in? [message #124081 is a reply to message #123991] |
Mon, 09 March 2009 18:15 |
|
Hi Roland,
thanks for pointing this out. Indeed, this escaping of periods seems to
be a problem with _xxx ids. Could you file a bug report for this issue?
Thank you,
Ralf
Roland Siebert wrote:
> Hi,
>
> I found out that I need this code to open in a new tab:
> org.eclipse.rwt.widgets.ExternalBrowser.open( "_blank",
> "http://www.eclipse.org", "" );
>
> But ExternalBrowser.open( "_blank", "http://www.eclipse.org", 0 );
> generates this code:
> org.eclipse.rwt.widgets.ExternalBrowser.open( "_0blank",
> "http://www.eclipse.org",
> " dependent=1,scrollbars=1,resizable=1,status=1,location=1,too lbar=1,menubar=1 "
> );
>
> The method static String escapeId( final String id ) does not accept
> "_blank" and replace it with "_0blank".
>
> And the method private static String getFeatures( final int style ) is
> setting by default some features.
>
> Can this be fixed?
> Roland
>
> Ralf Sternberg schrieb:
>> Hi Roland,
>>
>> this problem is not RAP specific. The ExternalBrowser#open parameters
>> are passed to the Javascript function window.open. Instead of "test",
>> you could experiment with the id's "_blank", "_parent", etc. But it's
>> still up to the browser to decide whether to open up a new tab or a new
>> window. There are a many forum threads out there discussing this problem
>> - maybe you can find anything there.
>>
>> Best regards,
>> Ralf
>>
>>
>> Roland Siebert wrote:
>>> And how I can open a new tab instead of a new window?
>>>
>>> ExternalBrowser.open( "test", "http://www.eclipse.org",
>>> ExternalBrowser.LOCATION_BAR | ExternalBrowser.NAVIGATION_BAR |
>>> ExternalBrowser.STATUS );
>>>
>>> This opens a new window.
>>>
>>> Roland
>>>
>>> Stefan Roeck schrieb:
>>>> Hi Andreas,
>>>>
>>>> the RWT-specific class org.eclipse.rwt.widgets.ExternalBrowser does
>>>> this job.
>>>>
>>>> Regards,
>>>> Stefan.
|
|
| | | |
Goto Forum:
Current Time: Thu Sep 26 05:38:36 GMT 2024
Powered by FUDForum. Page generated in 0.04154 seconds
|