Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ExpandableComposite Twistie style not rendering
ExpandableComposite Twistie style not rendering [message #1783026] Tue, 06 March 2018 18:51 Go to next message
Anthony Quintero is currently offline Anthony QuinteroFriend
Messages: 1
Registered: March 2018
Junior Member
I am trying to run SWT code in a RAP application. Currently, I am trying to get the ExpandableComposite form control to function correctly, but for some reason I cannot get the Twistie (or TreeNode) expandable button to render next to the title of the control. I have verified that my code works in SWT and renders the Twistie image, however this isn't the case for RAP. Is there something that I am missing here?

ExpandableComposite expandableComposite = new ExpandableComposite(parent, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
expandableComposite.setText("Title");
Color titleBarColor = expandableComposite.getDisplay().getSystemColor(SWT.COLOR_BLUE);
expandableComposite.setTitleBarForeground(titleBarColor);
expandableComposite.setActiveToggleColor(titleBarColor);
Re: ExpandableComposite Twistie style not rendering [message #1783439 is a reply to message #1783026] Tue, 13 March 2018 07:46 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2285
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
as I already answered in your bugzilla entry, using "forms" bundle outside workbench-based application needs forms custom widget resources (client-side JS files) to be registered manually. In workbench-based application this is done by extension point.
This topic has been discussed alot in the NG. Just search for an answer how to do it.
Regards,
Ivan
Re: ExpandableComposite Twistie style not rendering [message #1791721 is a reply to message #1783026] Wed, 04 July 2018 13:18 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi,

This is what I do in my ApplicationConfiguration to make things work:

		
final ContentBuffer concatenatedScript = new ContentBuffer();
		
try
{
	concatenatedScript.append(ToggleHyperlinkResource.class.getClassLoader().getResourceAsStream("org/eclipse/ui/forms/widgets/ToggleHyperlink.js"));
	concatenatedScript.append(ToggleHyperlinkAdapterResource.class.getClassLoader().getResourceAsStream("org/eclipse/ui/forms/widgets/ToggleHyperlinkAdapter.js"));
	concatenatedScript.append(HyperlinkResource.class.getClassLoader().getResourceAsStream("org/eclipse/ui/forms/widgets/Hyperlink.js"));
	concatenatedScript.append(HyperlinkAdapterResource.class.getClassLoader().getResourceAsStream("org/eclipse/ui/forms/widgets/HyperlinkAdapter.js"));
}
catch (IOException e)
{
	e.printStackTrace();
}

application.addResource(SWT.getVersion() + "/resources.js", new ResourceLoader()
{
	@Override
	public InputStream getResourceAsStream(String resourceName) throws IOException
	{
		return concatenatedScript.getContentAsStream();
	}
});
		
((ApplicationImpl)application).getApplicationContext().getStartupPage().addJsLibrary("rwt-resources/" + SWT.getVersion() + "/resources.js");
		
application.addThemeableWidget(Hyperlink.class);


Thanks & Regards,
SetNug
Re: ExpandableComposite Twistie style not rendering [message #1793316 is a reply to message #1783439] Fri, 03 August 2018 18:37 Go to previous message
Matthew Janssen is currently offline Matthew JanssenFriend
Messages: 5
Registered: June 2018
Junior Member
Quote:

Hi,
as I already answered in your bugzilla entry, using "forms" bundle outside workbench-based application needs forms custom widget resources (client-side JS files) to be registered manually. In workbench-based application this is done by extension point.
This topic has been discussed alot in the NG. Just search for an answer how to do it.
Regards,
Ivan


Can you explain how to register these resources via the extension point? Is there some documentation you can point me to? We have all of our entry points and branding configured via extension points and would like to add this as well.

I tried something like this but it didn't seem to work with errors that it couldn't find the resources.
   <extension point="org.eclipse.rap.ui.resources">
      <resource
            class="org.eclipse.ui.forms.internal.widgets.formtextkit.FormTextAdapterResource">
      </resource>
      <resource
            class="org.eclipse.ui.forms.internal.widgets.formtextkit.FormTextResource">
      </resource>
      <resource
            class="org.eclipse.ui.forms.internal.widgets.hyperlinkkit.HyperlinkAdapterResource">
      </resource>
      <resource
            class="org.eclipse.ui.forms.internal.widgets.hyperlinkkit.HyperlinkResource">
      </resource>
      <resource
            class="org.eclipse.ui.forms.internal.widgets.togglehyperlinkkit.ToggleHyperlinkAdapterResource">
      </resource>
      <resource
            class="org.eclipse.ui.forms.internal.widgets.togglehyperlinkkit.ToggleHyperlinkResource">
      </resource>
   </extension>


You mentioned in your post that this has been answered in the Newsgroups. I'm happy to search through those as well if you could just point me to where those are.

Much appreciated.

[Updated on: Fri, 03 August 2018 19:30]

Report message to a moderator

Previous Topic:Unresolved requirements issue since upgrade to RAP 3.5
Next Topic:SUGGEST FOR WAR PRODUCT TOOL
Goto Forum:
  


Current Time: Mon Sep 24 01:27:36 GMT 2018

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

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

Back to the top