ExpandableComposite Twistie style not rendering [message #1783026] |
Tue, 06 March 2018 18:51 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03352 seconds