Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/123887/#msg_123887
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;
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]]>Andreas Maier2009-03-06T19:14:00-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/123901/#msg_123901
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
>
>]]>2009-03-09T08:15:48-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/123913/#msg_123913
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
>
>]]>Stefan 2009-03-09T08:25:06-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/123940/#msg_123940
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.]]>rollo2009-03-09T08:54:36-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/123966/#msg_123966
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.
>]]>Ralf Sternberg2009-03-09T09:33:54-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/123991/#msg_123991
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.]]>rollo2009-03-09T14:23:34-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/124081/#msg_124081
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.]]>Ralf Sternberg2009-03-09T18:15:06-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/124208/#msg_124208
I filed a bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=267831
In the meantime I wrote my own ExternalBrowser.
Because of the different behavior of the browsers I want to find out
which browser is used. Can I do this with the RAP-API?
Roland]]>rollo2009-03-10T12:02:29-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/124222/#msg_124222
ContextProvider.getBrowser();
Roland
Roland Siebert schrieb:
> Hi,
> I filed a bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=267831
>
> In the meantime I wrote my own ExternalBrowser.
> Because of the different behavior of the browsers I want to find out
> which browser is used. Can I do this with the RAP-API?
>
> Roland]]>rollo2009-03-10T12:53:21-00:00Re: How to open a new tab in the same browser RAP is running in?
https://www.eclipse.org/forums/index.php/mv/msg/38108/999310/#msg_999310
Posting to this outdated thread in a hope someone would still need a solution like me today...
ExternalBrowser (of RWT 1.5) does open a URL in a new window. But the code below opens it in a new tab (on my remote Firefox 18.0/Win32 XP at least):