i've started developing in IntelliJ in Java, created a new gradle project, added a few libraries but encountered a problem that a string is not being filled with cyrillic symbols - instead i get incorrect symbols (screenshot attached). How can i fix it? It has something to do with encodings - I tried a lot of suggestions on the web but nothing helped. Cheers!
Just change all encodings into UTF-8 (or other preferable encoding) and reload all java files into UTF-8.
You must know how to do first part (if you don't: File(top left corner of your window)>Settings>Editor>File Encodings).
The second part is also easy: just click on encoding in bottom right corner of the window and choose UTF-8 (or other preferable encoding).
Then you will have window like shown below. Choose "Reload" and enjoy. If you still have questions you are free to ask.
Here better description: https://www.jetbrains.com/help/idea/encoding.html
I'm working with RAP and want to add something look like this image into my view. But I have no idea to call this thing to search on internet.
So sorry for unspecific question.
The picture you show is part of a FormEditor.
The top line ('Extensions') is a FormPage title.
The 'All Extensions' part is a SectionPart containing a filtered tree and button.
All these are part of the org.eclipse.ui.forms plugin Eclipse Forms
I think what you are looking for is a multipage-editor.
You can have a look at the code of the Extensions View by using the Plugin spy (select the View -> Alt+Shift+F1) to get the containing plugin and then import the plugin into your workspace.
Or you can try to work yourself into using a framework like Sapphire. Take a look at their page. The example looks like the editor you are looking for.
I have a RCP app which I want to "brand", i.e. create a proper text for the about box with build id. Simple stuff. Unfortunately this wasn't as easy as I had hoped, and now I am stuck.
My RCP project is launched from a project configuration and is not deployed as plugins through features.
I have tried entering stuff directly in the product configuration -> branding tab, but when I do, the input isn't formatted, meaning I have no newlines and no possibility to externalize strings like I want to. I have also tried creating about.ini, about.properties and about.mappings in an attempt to use the %< property >, but still no luck. The about box is a standard org.eclipse.ui.help.aboutAction.
Every tutorial on the net says different things, so now I feel pretty confused. I have also tried to replicate what is done with branding in the Eclipse repos, without any luck.
Does anyone know what I'm doing wrong?
What is needed is this line in the MANIFEST.MF file:
Bundle-Localization: plugin
guido's comment on my question sheds some light on what the different files are for as well.
I'm trying to set up vim to work nicely with Java. I've set up eclim, which seems to work great for letting me know when something is wrong, but I'd really like to get vim to do two things to make my code easier to read.
Have brackets and braces show up with a different colour from the main font.
Get classes to highlight as a different colour.
I haven't come up with anything good for the first point, but it seems like the second should be doable with ctags. I found a plugin called TagHilight that should do this but I can't seem to get it to work.
I also found a file called javaid.vim that is supposed to do this, but again I've had no luck with that.
For your first requirement of highlighting braces and brackets, there is no default highlight group for braces. You need to create one for yourself. Here is how you do it!
For your second requirement of how to highlight classes, you should be using this TagHighlight plugin. And this page explains in detail about the plugin and how to get it working. It also shows you snapshots where your exact requirement is met! :)
Hope somebody could help me, giving a hint and way out.
Right now I'm involved in a ambitious project trying to create mixed math and programming IDE.
After a huge prestudy we decided to use eclipse as a base, and somehow add Mathematica,maple functionality.
Generally speaking we want to make entering math expressions (a = sin(Pi)+10^2) into java code possible. Also those expressions should be showed in LaTex view, right in the code to make it more readable for engineers, to illustrate the code we want to implement insertion images in comments.
As we need all th java editor functionality, in my opinion it's correct to use standart eclipse java editor, and learn it to behave with other objects, e. g. images.
So my questions are:
- Could somebody share experience developing similar products?
- May be there are something like we are going to develop?
Probably I'll write more questions, especially tighter ones.
That is certainly an interesting sounding project. As Gilbert Le Blanc mentions, the Java Editor is highly optimized to edit Java code and is not meant to be extensible.
That being said, I can recommend two options (one that plays by the rules, and one that goes against them).
Instead of embedding your images directly in the Java editor, you could implement your own hover, through the org.eclipse.jdt.ui.JavaEditorTextHovers extension point (so it would work like JavaDoc hovers), or in a separate view that sits beside the editor (so it would work like the JavaDoc view). (This is playing by the rules.)
A while ago, I implemented a prototype editor that allows you to edit Java code with snippets of CAL (a functional JVM language) embedded inside of it. The snippets were stored in there own little window inside the editor. This was a prototype and not everything worked smoothly and it was also using Eclipse 3.2, but this is exactly the kind of thing that you want to do. It won't be easy to compile and run the code, but you can have a look at it....well, maybe. I have to find an EPL variant of the source code. Until then, just realize that hacking the Java Editor like this requires some specialized knowledge about the JDT and you need to be careful about how you do it so that you do inadvertently break other things.
Edit
Here is a zip of the project I described. It will not compile as it is, but you can look at the source code:
Try this link. It should be viewable by the world.
The essential thing to realize is that swt StyledText widgets can themselves contain other widgets. This project leverages that in Java editors.
In particular, look at the class org.openquark.cal.eclipse.embedded.containing.ContainingEditor, which is a sub-class of CompilaitonUnitEditor. This particular class embeds a second text editor (the contained editor) inside of another editor (the containing editor).
Also, take a look at org.openquark.cal.eclipse.embedded.containing.ControlManager. This class manages the different controls inside of a styled text of the containing CompilationUnitEditor.
What this project does is creates a Java-like editor, and allows users to embed editors for another language inside of the Java editor. These editors are actually backed by text in the containing Java editor, but the text is covered by the contained editor.
The contained editors move up and down as text is entered into containing editor. Also, you can use the keyboard to gain/lose focus in a contained editor.
It's been several years since I looked at this code, but if you have any questions, drop me a line or add to this question.
The Eclipse Java Editor is made up of hundreds of Java classes. There's an implicit assumption in those hundreds of Java classes that the editor view is just for code.
In my opinion, you'll find it much easier to develop a Mathematica-type editor for your math images, and leave the Java editor alone. Your engineers can open two editors in Eclipse.
If my comments haven't dissuaded you, here's the Eclipse documentation for Eclipse Helios, otherwise known as Eclipse 3.6
The section you'd start with is called the JDT Plug-in Developer Guide.
The Eclipse web site is responding slowly as I'm typing this. You can also access the Help from inside of Eclipse Helios.
Help -> Help Contents
I know exactly what you can do. First, you can turn-on the unicode character set. This will allow you to have variables such as greeks, which makes the code much more readable. [General->WorkSpace->Text Encoding = UTF-8].
// Apply spring soft constraint using Erin Catto's method with Semi-Implicit Euler :
// Figure out (ω,ζ) from node sizes, then k=mEff.ω², c=2.mEff.ω.ζ
double ω = 2.0*π*f; // ω (angular frequency)
double k = meff * ω*ω; // spring stiffness
double ζ = (b1.ζ + b2.ζ)/2; // Average out the damping coefficients
double d = 2.0 * meff * ω * ζ; // damping coefficient
double γ=h*(d+h*k); // CFM (Constraint Force Mixing)
Second, your suggestion to have a LaTeX formula visible within the code is also the next best thing. I know it's possible because I wrote one 3 years ago, but I can't find the code anywhere. I had posted it on a forum for eclipse plug-ins but it's gone now.
The good news is that I'm writing it again, because I need it - that's how I found your post . This time I'm using jlatexmath which is better than what I used last time.
The idea was/is that you can embed a formula in a comment as LaTeX, and the plug-in renders the LaTeX in a tooltip when you hover on it.
I'll post a link or code here when I'm done. Most of the work is figuring out how to make eclipse accept the new hover control.
J.D.
Ok, as a follow-up to my post above, here is the Eclipse Plug-In Development Environment (PDE) project I developed for this. The Plug-in is named LaTeXHover and will pop-up a tooltip whenever you hover on top of a comment line that contains LaTeX such as:
// $latex i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>$
// $latex x=\frac{-b \pm \sqrt{b^2-4ac}}{2a}$
The LaTeX must be delimited using $latex and $ with no extra spaces.
It uses jlatexmath for rendering.
I'll try to package the plug-in better and add that to the Git repo, and maybe contribute it to one of the Eclipse Plug-In projects. As last time, I don't have time now to do this, but at least it's out there now. Anyone wishing to continue the project from here is welcome to do so.
J.D.
git://github.com/jdbertron/latexhover.git