How to define more than one stylesheet in adf framework - stylesheet

I am facing a problem with adf skining. My style sheet crossed 1800 classes. IE has a limitation of 4000 style classes. While rendering, ADF adds its own classes. So it crosses 4000 and the styles I am referring at the last of my sheet are not working in IE alone. I need to define a new style sheet for same application.
I have tried adding one more skin-family in adf-faces-config.xml. Did not work.
Please help.
Thanks in advance.

I am not 100% sure if creating a separate CSS will resolve your issue, and I do agree that after being used to multiple css definition and only loading a css for a particular page has its own advantages.
One thing that you can do though is organize the CSS, having 1800 classes might not be the appropriate way to go in a WebApp since a webapp should promote consistency in look and feel.
There is a good discussion in oracle forums that might help you on this, especially on the use of an el expression check on your current view to switch your skin on the fly.
Multiple Skin in the same application
I also mentioned in that forum about using skin-addition as well as my reason on taking up skin addition for our app, even though we didn't get to the number of styleClasses that you have, our css is already hitting 3k lines with only 600 lines for component specific and everything else is styleClass. We've also dramatically used the "inhertance" which trinidad skin offers -tr-inherit this really saved us in a lot of coding.

Use of extends property you can use multiple style sheet for same application.
trinidad-skins.xml
<id>skin_1.desktop</id>
<family>skin_1</family>
<extends>simple.desktop</extends>
<render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
<style-sheet-name>css/stylesheet_1.css</style-sheet-name>
</skin>
<skin>
<id>skin_2.desktop</id>
<family>skin_2</family>
<extends>skin_1.desktop</extends>
<render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
<style-sheet-name>css/stylesheet_2.css</style-sheet-name>
</skin>
in trinidad-config.xml
<trinidad-config xmlns="http://myfaces.apache.org/trinidad/config">
<skin-family>skyros</skin-family>
<skin-version>v1</skin-version>
<skin-family>skin_2</skin-family>
</trinidad-config>

Related

Intellij IDEA SDK - How can I programmatically handle spellcheck 'typos'?

Wrote a plugin to handle some custom format stuff in yaml files that I've written for a huge project. It's a chat bot that can respond in a huge number of ways. There is a lot of slang and non-standard words in the yaml.
I don't want to disable spellchecking as I want to fix legitimate speeling errors. But the annotations under the "misspelled" slang words are conflicting with the annotations in my plugin, and causing issue.
One yaml file has 349 "typos". 10% or so are legit. The rest are slang and custom words.
I need to do one of two things. Either add those words to the dictionary (I've found the method to do that - SpellCheckManager.getInstance(project).acceptWordAsCorrect()) OR get a list of the words and create a custom dictionary from them. Both approaches require me to grab a list of all typos in the document/editor/project.
That's the part I can't find. Looked everywhere. (List of current Annotations? List of current Problems?) Googled my fingers off. Anyone able to point me in the right direction?
This is not the IDEAL solution, but it worked for my means, and I'm leaving the answer in case this is googled.
In DaemonCodeAnalyzerImpl, there is a method:
DaemonCodeAnalyzerImpl.getHighlights(Document document, HighlightSeverity minSeverity, Project project);
This returns a list of all highlights in the document. The method is Annotated with #TestOnly, and docs state that it should only be used in Test code because it breaks/shortcuts the normal way to access that. It still works in non-test code however.
Since the only thing I wanted was the strings of the typos, I pulled the list, then looped through the HighlightInfo's in the list, and pulled the .getText()s.
No danger of screwing anything up.
Then pushed all those strings into:
SpellCheckerManager.getInstance(project).acceptWordAsCorrect(word, project);
Viola! All current highlighted typos are now added to the dictionary.
Proper solution? No. Good enough for what I needed to accomplish? Yup.

How to open multiple file trees in IDEA (WebStorm)

Goal: View multiple scopes(file tree) at once.
I'm modifying a little old web node application, the view folder and logic handling are written in different places, but I need to see each other.
So, I would like to have multiple file trees in the same project for easy navigation.
However, since the folders are so far apart from each other, I set up a scope and try to switch between them each time.
Sorry, my English is not very good, so I use a little translation. I'm attaching a picture just in case.
Thank you.
I was able to find a few solutions.
It is the Favorites window.
Maybe the scope is not available, but I was able to increase the number of project views to two.
I can't open more than three of them, so if there is a convenient way to do this, please let me know.
Thank you.
screenshot

silverstripe dynamic backend for flexible frontend

I'm searching for a while, but didn't find a practical answer for the following problem:
An Articlepage in the Frontend can contain different types of sections. For example a block text section and than a text section with left photo an at the end an wallpaper photo.
Now I want to implement this in my backend dynamically, so that I can choose, which type of section and -even more important- how many sections my article should contain.
In my recent project I've solved the problem as an Articlesection with a Dropdown, wich contains the different section styles. And one article hat xy Artilesections as childpages. In the frontend I included all Childpages of the Article - so to speak the Articlesections, where I've checked with if conditions, which sectionsystyle I have in this Section and here I styled the section as I want.
For example Artilce1 has 2 Childpages: Articlesection1 and Artilcesection2.
In AS1 I have choose in the dropdown: right text with left photo and check with if conditions, to style the section. The same with AS2, that is for example a wallpaper photo.
This semiprofessional solution worked, but there are some bugs with displaying the Article correct in the backend, because I have to declare the Articlesections as Includes and not native childpages. And in generell this don't seems like the developers of silverstripe want the users to do it this way..
Are there better ways to implement a dynamically changing backend, so I can decide, which and how much sections I have in the frontend.
Take a look at https://github.com/sheadawson/silverstripe-blocks. There's quite a few addons that offer similar functionality as Blocks such as Elemental. The following blog post might also be useful too - https://www.silverstripe.org/blog/silverstripe-strips/.
Thank you for your reply, but there is a problem, because I don't work a lot with the terminal and the composer. In principle I want to install sheadawsons silverstripe-block. I have installed the composer and run the command:
"composer require sheadawson/silverstripe-blocks" it seems like it installed that correctly, because I became no errors, but what then? With dev/build -to refresh the database- happened nothing and the following instructions in the readmy chanced nothing. Should I copy any files in my Sivlerstripe web folder or what else..? I'm a bit desperate, because there is such a poor documentation.
Tank you

Access closure property names in the content block at runtime

I want to evaluate my content blocks before running my test suite but the closures' property names is in bytecode already. I'm ooking for the cleanest solution (compared with parsing source manually).
Already tried solution outlined in this post (and I'd still wind up doing some RegEx/parsing) but could only get it to work via script execution engine. It failed in IDE and GroovyConsole. Rather than embedding a Groovy script in project's code, I thought I'd try using Geb's native classes.
Is building on the suggestion about extending Geb Navigators here viable for Geb's PageContentSupport class whose contentTemplates contain a LinkedHashMap of exactly what I need? If yes, would someone provide guidance? If no, any suggestions?
It is currently not possible to get hold of all content elements for a given page/module. Feel free to create an issue for this in Geb's bug tracker, but remember that all that Geb can provide is either a list of content element names or a map from these names to closures that create these elements.
Having that information isn't a generic solution to your problem because it's possible for content elements to take parameters and there are situations where your content elements will be available on the page only after some other actions are performed (for example you have to click on button to reveal a section of a page that uses ajax to retrieve it's content). So I'm afraid that simply going over all elements and checking if they don't throw any errors will not cut it.
I'm still struggling to see what would "evaluating" all content elements prior to running the suite buy you. Are you after verifying that your content elements still work to get a faster feedback than running the whole suite? I'm pretty sure that you won't be able to fully automate detection of content definitions that don't work anymore. In my view it will be more effort than it's worth.

Accessing model attribute from css/less file with Rails 3

The project I'm working on requires me to adapt the size of the elements on screen according to per-user setting. We're using Twitter bootstrap, so my first idea was to toy with the #basefont value, and it seems to do the trick.
However, I don't know how to access the user setting from the .less file. I tried using erb with .less.erb, but it looks like I don't have access to any code in my application.
Is there a way to get the value I'm looking for from the .less file, or - even better - a proper way to do this ?
Thanks for your time.
EDIT
Since I need to get the value at runtime, the way I tried won't work anyway, though I'm still interested on an answer. The only way I see to do what I want is to add a class according to the user setting. Again, I'd be glad to have alternatives.
I opted for css3 transform (and vendors implementation) property. It does the job, but seems to hit the GPU quite a lot. So still open to other answers. :)