Custom tag-colors for imported tag library tags in Eclipse - eclipse

Is it somehow possible to change the tag-colors (not one-by-one, but for all of them... or else one-by-one would also be okay) of imported tag library tags (like e.g. jstl-tags: <c:if>, <c:forEach>, or <my:tag>, etc.)? Just to make some visual difference within a JSP-code between usual HTML-tags and all the rest.

Other than Preferences > Java > Editor > Syntax Coloring, I'm pretty sure you can't change tag colors for custom tags.

Related

How to set eclipse preferences use plugin?

Now I'm using python to change settings files under .metadata/ in my workspace.I need find every line needed in these files beacuase I don't want any unnecessary content.
For example , if I want set tab's width be 4. I need change the file
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs
in workspace and add a line following in it , not simply copy the settings file:
tabWidth=4
So I want to know : Can I set this value by java code in eclipse plugin? If it can, please give me related classes :-)
And, does it more complex than python's method?
In a plugin you can use:
IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.ui.editors");
store.setValue("tabWidth", 4);

Eclipse Kepler Content Assist Customization

Is it possible to customize how it searches for methods and fields, for example:
JFileChooser j = new JFileChooser();
j. //I begin to type here and then it lists all the different methods and fields
Now lets say for example I begin to type Dialogue, the Content Assist will show DIALOG_TITLE_CHANGED_PROPERTY but it will not show ShowOpenDialog is there a way to customize the Content Assist so that it will more liberally search the middle and end of the words rather than just the beginning?
There is an open bug/feature request in the eclipse bug tracker for that: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350000
It is mentioned that this feature is included in the Code Recommenders plug-in.

Netbeans Code Templates Formatting syntax

I'd like to know what's the syntax or the language used to format the code templates in netbeans ide. I mean, in the default templates I can see things like;
while (${EXP default="exp"})
{
${selection line}${cursor}
}
And:
// <editor-fold defaultstate="collapsed" desc="${comment}">
${selection}${cursor}// </editor-fold>
And I experimented and did this:
int ${IDX newVarName default="loop"};
for (${IDX} = 0; ${IDX} < ${SIZE int default="size"}; ${IDX}++)
{
${cursor}
}
And it works but I don't really know where the "${IDX}" or the "${SIZE int default="size"}" or the "${selection}${cursor}" comes from and what other statements can I use to format my templates.
Is this some scripting or programming language?
Where can I find this information?
I think Netbeans uses the template engine Freemarker for this. So all variables (= ${...}) are filled in by Netbeans at the time you use the template.
Unfortunately I don't have a full list of all default variables / methods you can use, but here are two of them listed:
${cursor}:
defines a position where the caret will be located after the editing
of the code template values finishes.
${selection}:
defines a position for pasting the content of the editor selection.
This is used by so-called 'selection templates' that appear as hints
whenever the user selects some text in the editor.
See here: http://wiki.netbeans.org/Java_EditorUsersGuide#How_to_use_Code_Templates
${IDX} looks like a custom variable you use.
See also:
- Code Assistance in the NetBeans IDE Java Editor: A Reference Guide (Code Template)
- Code Templates in NetBeans IDE for PHP
How_to_use_Code_Templates pretty much covers everything there is.
Looking at CodeTemplateParameter.java shows there is another hint called "completionInvoke" which requests showing of the code completion popup for the currently focused text component, but that is all.

Task Tags in XSP sources

In Java sources one can use (by default) //TODO, //FIXME and //XXX comments to add that part of source to Tasks view in Eclipse/Domino Designer.
I would like to use it in SSJS too, but I can't make it work. In Designer preferences General/Editors/Structured Text Editors/Task Tags, Filters tab, you can eneable "Enable searching for Task Tags" checkbox and tick XML type. Affected content types section contains "xsp" that is file extension of XP/CC sources.
But any tag in SSJS source (property of XML tag, actually) does not appear in Tasks view.
How to write such task tag into XP/CC source to make it work?
In Domino Designer, searching for Task Tags can be enabled for most editors via the Preferences.
i.e. (General -> Editors -> Structured Text Editors -> Task Tags)
However, the reported behaviour occurs because the Task Tags are added to a CDATA section.
CDATA sections are basically the wild wild west of XML.
For reference, see http://www.w3.org/TR/REC-xml/#sec-cdata-sect specifically:
"Within a CDATA section, only the ]]> string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using < and &"
Therefore, for this reason, the contents of CDATA sections are generally ignored by Eclipse XML parsing and validating. So if <!-- TODO --> or //TODO (or any tag) is put into a CDATA section it is not picked up as such.
So as a consequence, any annotated Server-Side JavaScript in XSP source does not appear in the Tasks View.
Using this sample code as an example, the Tasks View displays as follows.

Highlighting Flex 3.5 CDATA component in Eclipse

Is there any way to highlight the CDATA component in a .mxml file?
I have Eclipse and Flash Builder 3.5 and the flex components are highlighted, but the CDATA isn't. It contains action script.
Sorry, I meant syntax highlighting. For example:
<mx:Canvas ... >
<mx:Script>
<![CDATA[
private function foo():void {}
]]>
</mx:Script>
I don't think so, but your Outline View should allow you to click on any script tags to highlight them. Unfortunately you can't give them different ID's, so splitting your code among different blocks doesn't help much.