Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » FormText in standalone RWT
FormText in standalone RWT [message #130256] Sun, 26 April 2009 15:32 Go to next message
Eclipse UserFriend
Originally posted by: peterka.jiri.gmail.com

Hi,

I would like to use FormText widget available in M6
(org.eclipse.ui.forms.widgets) but an exception is always thrown. It
seems it depends on RAP platform and can't be used separated.

There is always this error:
Could not evaluate javascript response
TypeError: org.eclipse.ui is undefined
org.eclipse.swt.EventUtil.suspendEventHandling()...
The server session timed out
....

Is there any way howto use it in RWT application? And if so, how and
which additional libraries must be included except ui.forms?

Best regards

Jiri
Re: FormText in standalone RWT [message #130269 is a reply to message #130256] Sun, 26 April 2009 17:58 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Jiri,

look at the org.eclipse.rap.ui.forms\META-INF\MANIFEST.MF for the plugin
dependencies. You need:
org.eclipse.core.runtime,
org.eclipse.rap.jface,
org.eclipse.rap.ui
and these packages too:
com.ibm.icu.text,
javax.xml.parsers,
org.w3c.dom,
org.xml.sax

Best,
Ivan

Jiri Peterka wrote:
> Hi,
>
> I would like to use FormText widget available in M6
> (org.eclipse.ui.forms.widgets) but an exception is always thrown. It
> seems it depends on RAP platform and can't be used separated.
>
> There is always this error:
> Could not evaluate javascript response
> TypeError: org.eclipse.ui is undefined
> org.eclipse.swt.EventUtil.suspendEventHandling()...
> The server session timed out
> ...
>
> Is there any way howto use it in RWT application? And if so, how and
> which additional libraries must be included except ui.forms?
>
> Best regards
>
> Jiri
Re: FormText in standalone RWT [message #130434 is a reply to message #130269] Mon, 27 April 2009 18:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peterka.jiri.gmail.com

Hi Ivan,

I've added all of those jars, but still have problem to add hyperlink
into a form (see this snippet)

This works:

FormToolkit toolkit = new FormToolkit(composite.getDisplay());
Form form = toolkit.createForm(composite);
form.setText("Snippet2");
TableWrapLayout layout = new TableWrapLayout();
form.getBody().setLayout(layout);
toolkit.createLabel(form.getBody(), "Snippet2");

This doesn't:

Hyperlink link = toolkit.createHyperlink(form.getBody(),
"Click", SWT.NONE);


It threw this error:

TypeError: org.eclipse.ui is undefined

org.eclipse.swt.EventUtil.suspendEventHandling();var req =
org.eclipse.swt.Request.getInstance();req.setRequestCounter( "0"
);qx.theme.manager.Meta.getInstance().setTheme(
org.eclipse.swt.theme.Custom_1
);org.eclipse.swt.Request.getInstance().setTimeoutPage( "

The server session timed out.

If it's possible could you direct me direct to the working piece of code
with hyperlink, <li> tags, etc.

I was trying samples from this article -
http://www.ibm.com/developerworks/opensource/library/os-ecli pse-forms/
but I was almost always unsuccessful.


Best regards

Jiri


Ivan Furnadjiev wrote:
> Hi Jiri,
>
> look at the org.eclipse.rap.ui.forms\META-INF\MANIFEST.MF for the plugin
> dependencies. You need:
> org.eclipse.core.runtime,
> org.eclipse.rap.jface,
> org.eclipse.rap.ui
> and these packages too:
> com.ibm.icu.text,
> javax.xml.parsers,
> org.w3c.dom,
> org.xml.sax
>
> Best,
> Ivan
>
> Jiri Peterka wrote:
>> Hi,
>>
>> I would like to use FormText widget available in M6
>> (org.eclipse.ui.forms.widgets) but an exception is always thrown. It
>> seems it depends on RAP platform and can't be used separated.
>>
>> There is always this error:
>> Could not evaluate javascript response
>> TypeError: org.eclipse.ui is undefined
>> org.eclipse.swt.EventUtil.suspendEventHandling()...
>> The server session timed out
>> ...
>>
>> Is there any way howto use it in RWT application? And if so, how and
>> which additional libraries must be included except ui.forms?
>>
>> Best regards
>>
>> Jiri
Re: FormText in standalone RWT [message #130447 is a reply to message #130434] Mon, 27 April 2009 18:58 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Jiri,

as forms plug-in is intended to work with RAP, but not RWT
standalone, it makes use of the resource extension point.
You could try to register these resources manually. Have a look at
the resources extensions in the plugin.xml.

HTH
Rüdiger

Jiri Peterka wrote:
> Hi Ivan,
>
> I've added all of those jars, but still have problem to add hyperlink
> into a form (see this snippet)
>
> This works:
>
> FormToolkit toolkit = new FormToolkit(composite.getDisplay());
> Form form = toolkit.createForm(composite);
> form.setText("Snippet2");
> TableWrapLayout layout = new TableWrapLayout();
> form.getBody().setLayout(layout);
> toolkit.createLabel(form.getBody(), "Snippet2");
>
> This doesn't:
>
> Hyperlink link = toolkit.createHyperlink(form.getBody(),
> "Click", SWT.NONE);
>
>
> It threw this error:
>
> TypeError: org.eclipse.ui is undefined
>
> org.eclipse.swt.EventUtil.suspendEventHandling();var req =
> org.eclipse.swt.Request.getInstance();req.setRequestCounter( "0"
> );qx.theme.manager.Meta.getInstance().setTheme(
> org.eclipse.swt.theme.Custom_1
> );org.eclipse.swt.Request.getInstance().setTimeoutPage( "
>
> The server session timed out.
>
> If it's possible could you direct me direct to the working piece of code
> with hyperlink, <li> tags, etc.
>
> I was trying samples from this article -
> http://www.ibm.com/developerworks/opensource/library/os-ecli pse-forms/
> but I was almost always unsuccessful.
>
>
> Best regards
>
> Jiri
>
>
> Ivan Furnadjiev wrote:
>> Hi Jiri,
>>
>> look at the org.eclipse.rap.ui.forms\META-INF\MANIFEST.MF for the
>> plugin dependencies. You need:
>> org.eclipse.core.runtime,
>> org.eclipse.rap.jface,
>> org.eclipse.rap.ui
>> and these packages too:
>> com.ibm.icu.text,
>> javax.xml.parsers,
>> org.w3c.dom,
>> org.xml.sax
>>
>> Best,
>> Ivan
>>
>> Jiri Peterka wrote:
>>> Hi,
>>>
>>> I would like to use FormText widget available in M6
>>> (org.eclipse.ui.forms.widgets) but an exception is always thrown. It
>>> seems it depends on RAP platform and can't be used separated.
>>>
>>> There is always this error:
>>> Could not evaluate javascript response
>>> TypeError: org.eclipse.ui is undefined
>>> org.eclipse.swt.EventUtil.suspendEventHandling()...
>>> The server session timed out
>>> ...
>>>
>>> Is there any way howto use it in RWT application? And if so, how and
>>> which additional libraries must be included except ui.forms?
>>>
>>> Best regards
>>>
>>> Jiri
Re: FormText in standalone RWT [message #130485 is a reply to message #130447] Tue, 28 April 2009 10:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: markus.wolf.nmmn.com

Hi Jiri,

you could setup the forms plugin with this code in a
ServletContextListener on application startup:

final ResourceLoader rl = new ResourceLoader() {
public InputStream getResourceAsStream(final String resourceName)
throws IOException {
return getClass().getClassLoader().getResourceAsStream(
resourceName);
}
};
final ThemeManager tm = ThemeManager.getInstance();
tm.addThemeableWidget(Hyperlink.class, rl);
tm.addThemeableWidget(FormText.class, rl);


Regards
Markus Wolf


> Jiri,
>
> as forms plug-in is intended to work with RAP, but not RWT standalone,
> it makes use of the resource extension point.
> You could try to register these resources manually. Have a look at the
> resources extensions in the plugin.xml.
>
> HTH
> Rüdiger
>
> Jiri Peterka wrote:
>> Hi Ivan,
>>
>> I've added all of those jars, but still have problem to add hyperlink
>> into a form (see this snippet)
>>
>> This works:
>>
>> FormToolkit toolkit = new FormToolkit(composite.getDisplay());
>> Form form = toolkit.createForm(composite);
>> form.setText("Snippet2");
>> TableWrapLayout layout = new TableWrapLayout();
>> form.getBody().setLayout(layout);
>> toolkit.createLabel(form.getBody(), "Snippet2");
>>
>> This doesn't:
>>
>> Hyperlink link = toolkit.createHyperlink(form.getBody(),
>> "Click", SWT.NONE);
>>
>>
>> It threw this error:
>>
>> TypeError: org.eclipse.ui is undefined
>>
>> org.eclipse.swt.EventUtil.suspendEventHandling();var req =
>> org.eclipse.swt.Request.getInstance();req.setRequestCounter( "0"
>> );qx.theme.manager.Meta.getInstance().setTheme(
>> org.eclipse.swt.theme.Custom_1
>> );org.eclipse.swt.Request.getInstance().setTimeoutPage( "
>>
>> The server session timed out.
>>
>> If it's possible could you direct me direct to the working piece of
>> code with hyperlink, <li> tags, etc.
>>
>> I was trying samples from this article -
>> http://www.ibm.com/developerworks/opensource/library/os-ecli pse-forms/
>> but I was almost always unsuccessful.
>>
>>
>> Best regards
>>
>> Jiri
>>
>>
>> Ivan Furnadjiev wrote:
>>> Hi Jiri,
>>>
>>> look at the org.eclipse.rap.ui.forms\META-INF\MANIFEST.MF for the
>>> plugin dependencies. You need:
>>> org.eclipse.core.runtime,
>>> org.eclipse.rap.jface,
>>> org.eclipse.rap.ui
>>> and these packages too:
>>> com.ibm.icu.text,
>>> javax.xml.parsers,
>>> org.w3c.dom,
>>> org.xml.sax
>>>
>>> Best,
>>> Ivan
>>>
>>> Jiri Peterka wrote:
>>>> Hi,
>>>>
>>>> I would like to use FormText widget available in M6
>>>> (org.eclipse.ui.forms.widgets) but an exception is always thrown. It
>>>> seems it depends on RAP platform and can't be used separated.
>>>>
>>>> There is always this error:
>>>> Could not evaluate javascript response
>>>> TypeError: org.eclipse.ui is undefined
>>>> org.eclipse.swt.EventUtil.suspendEventHandling()...
>>>> The server session timed out
>>>> ...
>>>>
>>>> Is there any way howto use it in RWT application? And if so, how and
>>>> which additional libraries must be included except ui.forms?
>>>>
>>>> Best regards
>>>>
>>>> Jiri


--
NMMN - New Media Markets & Networks GmbH
Geschäftsführung: Kfm. Michael Schütt
Finanzamt HH-Altona UStID DE 812 699 852 HRB 71102 Hamburg
HypoVereinsbank - BLZ 200 300 00 - Konto-Nr. 156 29 82

http://www.nmmn.com Tel.: +49 40 284 118 -0
Langbehnstrasse 6 Entwicklung: -720
22761 Hamburg Fax: -999
Re: FormText in standalone RWT [message #1744565 is a reply to message #130485] Wed, 28 September 2016 11:15 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi,

I have the same problem and I'm building standalone apps using RAP 3.1.0, I've tried your suggestions, but did not work.

public class SpringRWTServletContextListener implements ServletContextListener
{
	@Override
	public void contextInitialized(ServletContextEvent event)
	{
		final ResourceLoader loader = new ResourceLoader()
		{
			@Override
			public InputStream getResourceAsStream(String resourceName) throws IOException
			{
				return getClass().getClassLoader().getResourceAsStream(resourceName);
			}
		};
		
		final ThemeManager themeManager = new ThemeManager();
		themeManager.addThemeableWidget(Hyperlink.class.getName(), loader);
	}
	
	@Override
	public void contextDestroyed(ServletContextEvent event){}
}


Thanks & Regards,
SetNug
Re: FormText in standalone RWT [message #1744910 is a reply to message #1744565] Sun, 02 October 2016 12:45 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi Team,

Any help on this topic ?

Regards,
Setya
Re: FormText in standalone RWT [message #1744961 is a reply to message #1744910] Mon, 03 October 2016 12:40 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
when using the Workbench, the forms widget resources are registering with extension pont (see org.eclipse.rap.ui.forms/plugin.xml). The corresponding Java code that deals with these extension points is in WorkbenchApplicationConfiguration.
You have to do the same in your application configuration:
1. Register manually all the JS files defined in "org.eclipse.rap.ui.resources" extension pont
2. Add all these widgets as themeable widgets
Check WorkbenchApplicationConfiguration#registerResources and WorkbenchApplicationConfiguration#registerThemeableWidgets as a code example.
HTH,
Ivan
Previous Topic:Error 500 when defining a favicon
Next Topic:RAP architectural question
Goto Forum:
  


Current Time: Tue Apr 23 17:55:04 GMT 2024

Powered by FUDForum. Page generated in 0.03515 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top