Can Emmet Be Used to Create FXML? - scala

I have a scalaFX app that currently has its views created programmatically. I am wondering if I can use the Emmet tool to create FXML (particularly ScalaFXML) because I want to recreate my views in ScalaFXML to separate my views from my controllers more effectively. I have searched the internet and cannot find out if this is possible. So far I have only used Emmet for HTML. Thanks in advance for the help!

I have been looking around for something for PrimeFaces; I had trouble finding anything. I guess maybe it's because people who are using it are actually writing "normal" HTML with JS frameworks.
The good news is, it's completely (and easily!) customizable: just find the installation directory, and edit the "snippets.json" file, or create a new one called (for example) snippets-scalaFX.json. Mine on a Windows 10 machine, installed as a plugin for NPP, was C:\Program Files (x86)\Notepad++\plugins\EmmetNPP\emmet\snippets.json.
It's pretty obvious once you get in there, but inside the "snippets" object just add some more fields for yourself. For example, to make a PrimeFaces commandButton tag I added:
"pc": "p:commandButton"
You can use $0 or ${<placeholder text>} to define tabstops for expanded snippets, and | to define the caret starting point.
Full docs on editing snippets are here.

Related

Missing captioned images feature in TinyMCE and Plone5

I'm missing the function to enable captioned images in TinyMCE/Plone5. It was possible to enable that in the control panel with Plone4 (https://plone.org/documentation/manual/plone-4-user-manual/using-tinymce-as-visual-editor/images).
Now I'm using the new Plone5rc3 with TinyMCE 1.4.3, but the properties of TinyMCE in the control panel don't have the needed checkbox.
Does anybody know how to get that?
Thanks a lot!
So here's an answer in parts: you need several things for the captions to work:
Your <img> tags need to have the class captioned. I still need to find a good way to do that. The image picker will remove all other classes everytime you open it, so I guess a good way would be to change the classes that are added by the inline/left/right selection, but I've not easily found where those are defined.
You need the output filter, but fortunately, that is still there. However, the filter wants to see an IImageCaptioningEnabler, which is essentially a flag to turn the captioning mechanism on, and the old editors used to have that and currently, nothing in standard Plone does provide such a beast. If you're comfortable with add-on development, the class you want is
from plone.outputfilters.filters.resolveuid_and_caption import IImageCaptioningEnabler
from zope.interface import implements
class CaptioningAlwaysEnabled(object):
implements(IImageCaptioningEnabler)
available = True
with corresponding configure.zcml stanza
<utility factory=".resolveuid_and_caption.CaptioningAlwaysEnabled"
name="plone5-captions-always-enabled"
zcml:condition="have plone-5" />
(you can tell I patched buildout-cache/plone.outputfilters-2.1-py2.7.egg/plone/outputfilters/filters/configure.zcml and resolveuid_and_caption.py to include that, but of course, you shouldn't do that.)
If you're not comfortable with add-on development, you could, bizarrely enough, see if another editor provides that global switch, you don't need to have it set as your editor or the default editor. (Products.kupu would, but it doesn't install in 5.0. collective.ckeditor might, I can't try that right now due to missing dependencies.)
So, summary: no, you can't easily turn it on; you can turn it on with a bit of hacking; and if you file it as a feature request, it's the kind of thing that takes about fifteen minutes to fix for somebody who knows their way around the code.

Which eclipse listener should I use to add annotations to a text editor

I am an eclipse newbie. I have a long term goal which is to add my own annotations to the java editor: a bit like FindBugs. I want my own static code analysers, and to be able to add markers/annotations to resources.
So I have read a lot of excellent documentation, and undertaken a load of tutorials. The most helpful was probably http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-commplgin2/section9.html. A lot of the Lars Vogel documents have been useful too. I can now make TextEditors with syntax highlighters. I am however struggling with the best approach for adding annotations.
I understand roughly how to do this: the text editor has a DocumentProvider. The DocumentProvider has an AnnotationModel. It is possible to add annotations to the annotation model.
My question is "where do I put this code" specifically the code that scans the text in the editor and updates the annotation model. It seems clear that this should be in response to a listener...but which one?
I have tried a ResourceChangeListener. This seems to only fire on a save option, rather than when text is typed. In addition I don't know how to get the editor from the resource. ("The" editor is probably a misnomer as presumably the resource can be open in multiple editors). I can find the current editor via IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor(), but this seems the wrong approach, as I want to update all relevant annotation models.
I have tried adding an ElementStateListener to the text editor. None of the events seem to be the one I want.
I've looked at DamageRepairers...these seem to nearly be what I want, except that long term I want to tie into the JavaEditor, so I don't want to change the default DamageRepair.
Thanks for all the help
I found that this question can be answered, by mentioning the following resource: www.ibm.com/developerworks/opensource/tutorials/os-eclipse-plugin-guide/index.html
The question author also mentions here:
I add the annotations to the resource, and the annotations are
auto-magically added to the editor.
So when my plugin starts I run through the active resources, add
annotations to them if needed, then add a resource changed listener
which adds them as the resource is opened.

apply template in LibreOffice Writer to existing document

is there a way to apply a template to an existing document?
It only seems to work when I create a completely new document, and i don't want to copy&paste everything.
I'm searching for the same solution. The only thing I've found is a LibreOffice extension to do it. I just tested it and it worked, only I had to add the .oxt extension after downloading it.
Template Changer
p.s. As this was not a programming question, it may not be appropriate for this site.
Simple solution without installing an extension:
Create a new document in the desired template.
From the menu, choose Insert -> Text from file ... and select the document you would like to transfer to the new template.
Then the old document appears in the new template.
The answer from LaTechneuse no longer seems to apply (2020-08-09, v. 5.4.4.2). There is no such option under "Insert"...
However there is an option Insert --> Document. This seems to do the same thing. No doubt the menu command's name was changed because it was felt that LibreOffice users were having it too easy. Never waste an opportunity to confuse people needlessly and cause them to waste their time.
Neither template changer worked nor could I find one of the options that should reside in Insert->...
However, I used manage templates to import the new template and then in the presentation to change, in the sidebar the master slide view.
And it worked!

How to extend Alfresco Share existing activity list dashlet with my own activity type?

In Community 4.0.a, I'm posting my custom activities in the repo following this: http://wiki.alfresco.com/wiki/3.0_Activities_Developer_Guide
I have defined my own activity type, with custom bundles and pagelink to display custom needs in the activity dashlet.
But I face an issue, I need to specialize the output based on the activity-type in a similar way of what is done already in activity-list.get.js in the specialize() function.
I can't hack the js cause I'm packaging things in my own amp for Share.
What is the best way to do it? Is there some kind of extension point or do I need to override completely the dashlet?
The old way (3.x) to change the behaviour of a webscript controller is to copy the code and overwrite the Javascript by placing it under web-extension: alfresco/web-extension/site-webscripts/org/alfresco/components/dashlets/activity-list.get.js. There you can modify the specialize() function or whatever you need to do.
All files you place in the alfresco/web-extension/site-webscripts folder will replace original files in the share.war WEB-INF/classes/alfresco/site-webscripts classpath. Best practice is to place your customizations in the tomcat/shared/classes/alfresco/web-extension folder so you don't need to modify the WAR file.
Alfresco 4.0 provides a new way to change the javascript controllers of a webscript. You can add additional Javascript code that will run after the original code. This is preferable because you don't need to change original code and you can upgrade more easily later. To use it you need to get familiar with the new Share extension modules concept. See David Draper's Blog for more info on that.

How to create custom pages in dasBlog?

I know I've seen this in the past, but I can't seem to find it now.
Basically I want to create a page that I can host on a dasBlog instance that contains the layout from my theme, but the content of the page I control.
Ideally the content is a user control or ASPX that I write. Anybody know how I can accomplish this?
The easist way to do this is to "hijack" the FormatPage functionality.
First add the following to your web.config in the newtelligence.DasBlog.UrlMapper section:
<add matchExpression="(?<basedir>.*?)/Static\.aspx\?=(?<value>.+)" mapTo="{basedir}/FormatPage.aspx?path=content/static/{value}.format.html" />
Now you can create a directory in your content directory called static. From there, you can create html files and the file name will map to the url like this:
http://BASEURL/Static.aspx?=FILENAME
will map to a file called:
/content/static/FILENAME.format.html
You can place anything in that file that you would normally place in itemTemplate.blogtemplate, except it obviously won't have any post data. But you can essentially use this to put other macros, and still have it use the hometemplate.blogtemplate to keep the rest of your theme wrapped around the page.
I did something similar setting up a handler to stream video files from the blog on my home server. I ended up ditching it because it killed my bandwidth whenever someone would view a video, but I did have it up and working for a while.
To get it to work I had to check dasBlog out from source control and open it in visual studio. I had VS2008 and it was built using VS2005, so it took some work to get everything to build. Once I could get the unaltered solution to build I added a new class library project to hold my code. This is to make sure my code stays separate across dasBlog updates.
I don't have access to the code here at work so I can't tell you exact names right now, but if you want your pages to be able to use the themes then they need to inherit from a class in the newtelligence.dasBlog.Web namespace, and I believe also implement an interface. A good place to look is in FormatPage and FormatControl.