I have a question concerning RAP RWT Theming - skining or application style(theming) in Eclipse RAP can be done by extension to branding by applying our own CSS style, defining to which EntryPoint it should be applied.
My question is:
I have main Workbench APP let say in bundle/plugin A. Before Workbench window is populated I am using JAAS Security (to secure access to my App, by puting correct user name+ pass in LoginDialog). JAAS Security is let say bundle/plugin B. When I apply branding to plugin A, this is even applied to plugin B (which has loginDialog window). If I make another branding - lets say i want to have different look for LoginDialog window & different for WorkbenchWindow, I make branding in plugin B (with different CSS style applied).
Behaviour is following: branding of plugin B is applied 1st, because LoginDialog from pluginB is called, then main app start from pluginA - but second branding is never applied (looks that 1st branding from plugin B override also branding from plugin A).
I would really appreciate some help, how to make different RWT theming for different parts of RAP application. Does anybody have some experience with this ?
Thank you in advance
Tomas Kramaric
You can look on this page: RAP Developer Guide
I did another solution:
This Code is in the Plugin.xml of my Theme Plugin:
<extension
point="org.eclipse.rap.ui.themes">
<theme
file="theme/test/test.css"
id="com.yourApplicationName.theme.test"
name="Test Theme">
</theme>
And this Code is in the Plugin.xml of my EntryWindow:
<extension
id="mailapp.entrypoints"
point="org.eclipse.rap.ui.entrypoint">
<entrypoint
applicationId="yourApplicationName"
brandingId="yourApplicationName.testAPP.ui.branding.default"
id="testAPP.entrypoint"
path="/">
</entrypoint>
<entrypoint
applicationId="yourApplicationName.testAPP"
brandingId="yourApplicationName.theme.branding.test"
id="test.entrypoint"
path="/test">
</entrypoint>
</extension>
In Browser you have to type this to open your own theme: http://127.0.0.1:10080/testAPP/test
Related
I've paid attention that some implementations of the UI5-based apps prevent of loading XML-views (templates) and I can't get an XML-view via the DevTools' Network tab, e.g.:
https://discovery-center.cloud.sap
https://openui5nightly.hana.ondemand.com
While other implementations load the XML-view and only after that parses it in a browser:
https://openui5nightly.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/walkthrough/37/webapp/test/mockServer.html
How to protect my UI5-app source code and to prevent from the UI5 app loading the XML-view as it appears in IDE?
Is it a matter of the UI5 Tooling configuration?
I know, there is a dedicated step in UI5 Tooling Builder:
(7/8) Running task uglify...
But it looks like, it doesn't prevent from loading XML-views «as is».
Thanks to #Marc for sharing this knowledge! I arrange his info as the proper answer.
The UI5 Tooling proposes an option to minify a codebase of an UI5 app. However, it's still possible to reverse engineer the minified version and to download the original XML-templates with the help of UI5 Diagnostic Tools:
Press Ctrl + Shift + Alt + S, a UI5 Diagnostic Tools pop up should rise up
Go to Control Tree section
Choose the desired view, on the right side of the popup, click on the Export tab
Choose the desired format for exporting: Export to XML or Export to HTML.
P.S. Perhaps worth pointing out that it's possible to prevent activating UI5 Tooling by setting in the HTML bootstrap script the productive-flag to true:
<script type = "text/javascript">
window["sap-ui-config"] = {
"productive" : true
};
</script>
It might complicate a little reverse engineering of an UI5 application.
I have a DSL written in Xtext. In order to add custom content proposal, I have edited the MyDslProposalProvider class in the ui project. The new proposals are present when I debug the plugin in Eclipse, but not in the web editor, which is ultimately what I want. I want to set the custom proposals at a single place and all generated editors to use them. Is it possible to do that with Xtext?
As I had the same problem and struggled a little bit with the solution (as I would like to use both, Eclipse editor and Web editor) I would like to provide some more detailed feedback on a possible solution here, which worked well for me.
In my solution I did the following steps.
Implement a MyDslIdeContentProposalProvider in my.dsl.ide sub project extending from IdeContentProposalProvider, package my.dsl.ide.contentassistant (newly created); an example of such an implementation may be found here.
The implementation is not such convenient as at the well known UI proposal provider for Eclipse. I had to implement switch cases based on MyDslGrammarAccess elements instead of structural grammar elements like in the UI proposal provider. On the other hand, I have only one proposal implementation for all editor cases that way (DRY principle!).
Register the MyDslIdeContentProposalProvider at MyDslIdeModule in the same project (only with that it works already in the web editor).
def Class<? extends IdeContentProposalProvider> bindIdeContentProposalProvider() {
MyDslIdeContentProposalProvider
}
Register the new MyDslIdeContentProposalProvider and the forwarding class UiToIdeContentProposalProvider at the MyDslUiModule in the my.dsl.ui sub project. (That's what took the longest investigation as it cannot be logically derived.)
override Class<? extends IContentProposalProvider> bindIContentProposalProvider() {
return UiToIdeContentProposalProvider
}
def Class<? extends IdeContentProposalProvider> bindIdeContentProposalProvider() {
return JavaPOSConfigLanguageIdeContentProposalProvider
}
For an full example see here.
As I had implemented the MyDslIdeContentProposalProvider in the newly created package my.dsl.ide.contentassistant, this package has to be exported in the MANIFEST.MF file of the sub project my.dsl.ide (the subsequent 2 exports were already there). Otherwise i would get an an error Access restriction: The type is not accessible due to restriction on required project in the MyDslUiModule.
Export-Package: my.dsl.ide.contentassist,
my.dsl.ide.contentassist.antlr,
my.dsl.ide.contentassist.antlr.internal
That way it worked well for for both editors, Eclipse and web.
Thanks Christian again for the initial hint!
... If I could make a wish, I would like to have the same structural grammar element access in the MyDslIdeContentProposalProvider as we have it today in UI proposal provider.
you need to subclass org.eclipse.xtext.ide.editor.contentassist.IdeContentProposalProvider and bind it in YourDslIdeModule and YourDslUiModule. Then (in Xtext 2.13) you can use org.eclipse.xtext.ui.editor.contentassist.UiToIdeContentProposalProvider bound in YourDslUiModule to delegate to that in eclipse ui.
I want to add the following portlet preference to the Asset Publisher portlet:
<preference>
<name>assetLinkBehavior</name>
<value>viewInPortlet</value>
</preference>
This should default the configuration so that when the user clicks on the title link of a shown asset, it will go directly to that asset in its context (view in context). This is a configuration in the portlet wrench configuration UI. But this is not the default behavior when I first add the Asset Publisher portlet. So I want to add this preference somewhere. Should it be in one of the xml files in a hook?
You may have to override default portlet-custom.xml and provide preferences for asset-publisher
portlet [portlet-name 101] like
<portlet-preferences>
<preference>
<name>name</name>
<value>value</value>
</preference>
</portlet-preferences>
HTH
Is there some way I can suppress or disable the "Installed Software" & "Installation History" tabs on Help | About | Installation Details button in a RCP?
I'm not using P2 for this particular application so there will never be any history and the installed software tab has no content.
If you do not want these do show then make sure that the following plug-ins are not deployed in your application's target platform:
org.eclipse.p2.ui
org.eclipse.p2.ui.discovery
org.eclipse.p2.ui.sdk
org.eclipse.p2.ui.updatechecker
Strictly speaking you only really need to remove the first bundle in the above list as the subsequent bundles depend on the core ui bundle. Typically, if I do not want the user to shcedule updates etc. I'll only inlcude the first bundle above. I then build a custom UI around p2 functionality whilst re-using some of the provided core p2 UI API (but without auto-scheduling UI etc. included).
If you want to remove the preference pages for the p2 sheduling/updates, then in your in your WorkbenchAdvisor you can use write the following in the postStartup() method:
PreferenceManager pm =
PlatformUI.getWorkbench(
).getPreferenceManager();
pm.remove("org.eclipse.equinox.internal.p2.ui.sdk.ProvisioningPreferencePage"); pm.remove("org.eclipse.update.internal.ui.preferences.MainPreferencePage");
I ended up deleting the org.eclipse.p2.ui plugin's & features from my built product.
Not the most elegant solution, but it works.
subclass the AboutDialog class and override the createButtonsForButtonBar(Composite) method :)
and use your own InstallationDialog subclass.
to avoid displaying the tabs you don't want you have to override the createFolderItems method.
give a look the loadElements method to understand how this part of the dialog works.
I have a custom ResourceBundle class org.example.web.UILabels.java which works well in running code but the JSF editor in Eclipse is not finding it, I assume the editor/validator is only looking for properties files by the name. This also means I no longer get type ahead find on the resources which was very nice to have.
Any ideas how this could be rectified?
<f:loadBundle basename="org.example.web.UILabels" var="uiLabels"/>
...
<h:outputText value="#{uiLabels.someTextValue}" />
...
I am getting the error message (in the problems error list)
Resource bundle org.example.web.UILabels cannot be found on classpath
Type=JSF Problem
Eclipse3.4.0 with WebStandardTools Versions
Version:1.4.0.v200802280619-13-7w311917141518
Version:1.5.1.v200802280619-1407w311917141519
Version:3.0.0.v200806092130-7A-8Y8QqN2lf4VSWrI2ek5Pf4k7s
For more about why I am using a ResourceBundle class instead of just a properties file see Question 653682 how-to-override-some-resources-from-a-propertyresourcebundle
Thanks for your time, David Waters
The resource-bundle element is more efficient than the f:loadBundle action since the bundle can be created once for teh entire application. However its a JSF 1.2 feature and if u want to be compatible with JSF 1.1 you must use JSF 1.1. Heres an example if your using JSF 1.2:
Define it in your faces-config.xml like this:
<application>
<resource-bundle>
<base-name>org.example.web.UILabels</basename>
<var>uiLabels</var>
</resource-bundle>
</application>
Sorry for not answering your question, but I dont have first hand experience with Eclipse. I also misunderstood your question first, therefor Ive edited my original answer.
I had the same problem, I finally find this sollution :
Eclipse search only the default properties, your project has to have a properties with no locale, for example, with :
<f:loadBundle basename="i18n.messages" var="msg" />
Eclipse will only search "i18n/messages.properties".