Text coloring on matching words - swt

I am new to Eclipse RCP and I want to create text editor where if i type something like MyString obj the. Typing MyString , text will be coloured. Assuming that I have an array of such words which contains MyString. Kindly suggest me how can I achieve this task other than Xtext framework. If possible, please provide me sample working code.

Related

Tinymce automatically convert alphabet list to numeric list

I am using tinymce editor.I am having issue when I copy alphabet list from word document to tinymce editor it automatically convert alphabet list to numeric list please suggest any solution. Thanks
https://gist.github.com/anonymous/1e8bab3946bcf9f82b5459b77a7af49e
It looks like your init has something in it that's removing type="a" from your pasted list, reverting it to the default numeric style for ordered lists.

Own Emoji Keyboard - Listing all unicode Emojis

i want to create an own emoji-keyboard for an universal app. I need this for the reason of usage on desktop.
So i searched a lot but didnt found something helpfull. I want to show up all possible Emojis.
But i dont really want to use a file or something where i have to manage all the unicodes of the emojis - i want something like an Enumeration (like Symbols in c#)
Is there something like that? I also searched for a method of listing all keys of a font or something what would help.
You can find all official unicode characters in the latest database from unicode.org (http://www.unicode.org/Public/UCD/latest/ucd/). The file UnicodeData.txt contains all unicode characters including their names and properties.
Unfortunately, the file is not an c++ or c# enumeration but only a text file, so you have to write your own parser for this (but the file format can be easily parsed and is documented).

Objective-C/iPhone - Reading a word from text file. Looping through if word exists

I'd like to create a list of explicit words in a text file. I then want to be able to read and loop through this file on the iPhone. What would be the best way to do this?
e.g.,
explicit.txt
hello
world
freddy
jason
foo
bar
Then just before I save the information I'd like to popup a message to notify the user that a particular word is explicit.
If you have too many words, it's better to use a database.
But if they're just some words you can try this idea:
Store the words in explicit.txt file in the following format:
|hello|world|freddy|jason|foo|bar|
Then load the whole text and search for the substring |word|.
If you find it then the given word is explicit:
NSString *explicitWords = [NSString stringWithContentsOfFile:#"explicit.txt"];
if ([explicitWords rangeOfString:#"|word|"].location != NSNotFound) {
// the given word is explicit.
}
You probably want to use a property list, instead of a text file.
Check out the programming guide for lots of info.
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html%23//apple_ref/doc/uid/10000048i

How does "Format editor" for JFormatedTextField in NetBeans work?

I need to edit format for JFormatedTextField in a Java program. NetBeans are "helping" me with something called Format editor. But, I have no clue how the pattern works.
For #,##0.### , it returns 1,234.567, as pictured above. However, I want to change the thousands delimiter to space and decimal separator to comma.
I would guess # ##0,### is the right format, but no, that returns "Malformed pattern # ##0,###".
How can I change the thousand separator to space and decimal to comma? Is that even possible, using Format editor?
It sounds like you're looking for the reference for the java.text.NumberFormat class.
The DecimalFormatSymbols.getGroupingSeparator method looks like it is probably relevant to what you're doing. You will have to choose an appropriate Locale to get the formatting characters you want.
You may need to do something like:
NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH);
with an appropriate parameter to getInstance() for your country and language.

Apostrophe issue in RTF

I have a function within a custom CRM web application (old VB.Net circa 2003) that takes a set of fields from a database and merges them with palceholders in a set of RTF based template documents. These generate merged letters and documentation. The code essentially loops through each line of the RTF template file and replaces any instances of the placeholder values with text from a database record. The issue I'm having is that users have pasted a certain type of apostrophe into the web app (and therefore into the database) that is not rendering correctly in the resulting RTF file. It is rendering like this - ’.
I need a way to spot this invalid apostrophe in the code and replace it with a valid one. Unfortunately when I paste the invalid apostrophe into the Visual Studio editor it gets converted into the correct one. So I need another way to express this invalid apostrophe's value. Unfortunately I do not know a great deal about unicode and other encodings so I'm calling out for help with this.
Any ideas?
If you really just want to figure out what the character is you might want to try and paste it into a text editor like ultraedit. It has a hex mode that you can flip to to see the actual underlying bytes.
In order to do the replace once you've figured out the character you'd do something like this in Vb,
text.Replace(ChrW(2001), "'")
Note that you might not be able to figure it out easily using the text editor because it might also get mangled by paste from the clipboard. You might want to either print some debug of the ascii values from code. You can use the AscW function to do that.
I can't help but think that it may actually simply be a case of specifying the correct encoding to use when you write out the stream though. Assuming you're using a StreamWriter you can specify it on the constructor. I'm guessing you actually want ASCII given your requirement.
oWriter = New System.IO.StreamWriter(path, False, System.Text.Encoding.ASCII)
It looks like you probably want to encode characters out of the 8 bit range (>255).
You can do that using \uNNNN according to the wikipedia article.