Eclipse: Enable Java error markers in standalone SourceViewer widget - java

So I am working with Eclipse, and am trying to enable Java error highlighting inside of a standalone SourceViewer. I have done quite a bit of searching the web, but nothing seems to come up. I have looked into dealing with Annotations, Markers, etc... Everything that comes up seems to be for implementing custom methods.
http://wiki.eclipse.org/Platform_Text
has helped a bit, but seems to be not exactly what I want.
The SourceViewer is going to be a basic Java editor, so it can be assumed that everything will be java code. I would just like the red squiggly lines to appear under syntax errors, maybe also have the red boxes on a ruler on the side. There should be a default easy way to enable this, but I cannot find it.
Thanks in advance!

It is doable, but it can be a bit of work. What makes it difficult is that a standalone SourceViewer widget doesn't support the IDocumentProvider interface that does a lot of the work so you have to do all of that yourself.
I found this post helpful as far as adding the red squiggly lines is concerned:
http://www.eclipsezone.com/eclipse/forums/t30082.html
For the squiggly lines you want to set up an AnnotationPainter.
If you want the red boxes on a ruler, use the SourceViewer constructor that accepts an IOverviewRuler. There's a standard OverviewRuler that should work for you.

+1 for thehiatus.
The annotation stuff is really complicated. I tried to convert an editor to a IViewPart some time back... It took at long time to get it to work... well almost... almost, but quite like the real thing :-) (A bit like Swing and Microsoft Vista).
Also have a look at TextEditor and the the methods createAnnotationAccess() and configureSourceViewerDecorationSupport(...).

Related

How do blind users interact with error indicators in Eclipse?

I am currently helping a blind person to learn Java using Eclipse as their IDE. However, when there are errors, e.g. a typo, the red underlines indicating an error are not useful/apparent.
How can blind users be made aware of errors or other visual indicators within Eclipse?
In eclipse you can use Ctrl+. and Ctrl+, to navigate forwards and backwards through underlined sections.
When the cursor is in an underlined section, the error is shown in the status bar which your screen reader may be able to read (with JAWS use Insert+PgDn or CapsLock+PgDn).
There are some more tips for Eclipse's accessibility features in the Eclipse Help pages.
Jaws normally says "invalid" before each invalid part of code in the code editor as you navigate with arrow keys.
You have nothing specific to configure for this. At least for me, it worked out of the box from day 1.
IN case of doubt or if it doesn't work out of the box, you can customize the way Jaws behaves by going to the setting center.
More specifically, in the speech and sound scheme, you might pick a modern scheme different than classic, or want to customize the way the "invalid" font style is announced.
You will also certainly need to pay triple attention to things that eclipse automatically insert for you as you type, like closing parens and braces, as they aren't announced at all by Jaws when they are automatically inserted. They can easily make you enter unwanted extra characters.
As a blind user I prefer to completely disable all autocompletes like this and only keep it on demand with shortcuts like F2, but that's a personal choice.
Unfortunately, I can't help if you are using NVDA, but there certainly are solutions as well.

Sysml - Internal Block Diagram with GEF in Eclipse JAVA

I am currently working on a RCP-Application where i can draw an Internal-Block-Diagram.
Maybe most of you know "Papyrus" from eclipse. This modelling tool provides an Internal-Block-Diagram but I think it is a little bit overloaded so I decided to do it on my own.
I found this awesome tutorial :
https://www.vainolo.com/tutorials/gef-tutorials/
It helped me a lot how GEF works but one thing is not explained. How to draw ports. In the picture below you can see what i am capable of.
I am trying to modify my application that a user is able to draw ports. Like in the next picture:
Does somebody know how this is done in GEF ?
As far as I understand it, it has something to do with the figure of a node. Every node has a figure which is displayed inside the diagram. A port is an extension of the edge of a node and it is not possible to exceed the edge of a node. So I think that papyrus uses a different way to make this happen.
I tried to get the source code of Papyrus but i found nothing neither a documentation about it...
I am thankfully for every opinion.
Papyrus use GMF to create these ports.
You may check classes with containing BorderItem, for example AbstractBorderItemEditPart.
Be careful, the tutorial you are following seems to have been written for GEF3.
As far as I know, there is no "easy" way to manage port in pure GEF3.
There was a major change in GEF last year, you should be able to easily create port with the new GEF4 API.

JavaFx Dialogs cannot be resolved

I am kind of confused as i am using Eclipse Luna in my kind of big project, and i was using JavaFX fine, for now.
I am trying to implement a Process Dialog as shown in here
And here is a tricky part, my eclipse does not recognize nor know what to do with those few badly importat lines
Dialogs.create()
.owner(stage)
.title("Progress Dialog")
.masthead("Searching for friends")
.showWorkerProgress(service);
The first word in this code gets underlined and a mysterious
Dialogs cannot be resolved
show up as i hover above it..
I can not understand this matter as i use a lot of JavaFX in this project, and i did not have any issues with any part. Alerts, windows and all stuff like that works fine, only this thing is kind of strange for me.
Also, i do use JavaFX ver 8.0.45-b11, and it disturbs me as somewhere i found that
JavaFX has never had a dialogs API, which has always seemed to be a
glaring omission – but no more! It has (finally!!!) been decided that
JavaFX 8u40 will be the first release that will include a dialogs API.
Could someone please tell me if there is any mysterious thing that one must do to use this JavaFX Dialogs API?
No need to use 3rd party dialogs going forward. Learn how to use the dialogs native to jdk8u40+ from this JavaFX Dialogs page.

Scroll able Arc Menu android

we have got a requirement in our ongoing project where we need to show menu items in arc style at both upper space and lower space of the screen in reverse direction(will show you samples). i've tried to use some of the code from the demo of ArcMenu used in Path android application, but what i came up with is this:
This is not what i want to achieve but something like menus in following images.
I am trying to achieve this from last 4 to 5 days but not getting it right. if any one out there has done any research on such problem then please guide me.
any help would be greatly appreciated.
Make ListView in Circular
Follow this its working code. Code is provided by Samsung
may be it will workfor your issues
http://developer.samsung.com/android/samples/Circle-Launcher
That's quite a complicated task, especially since you want it to scroll while respecting its arc shape. There are probably no fixed answers for this, you'll have to manually create this type of interaction. Unless you have specific code examples of what you've tried and failed at, I don't think anyone can really help you here. Besides the technical difficulty, you could wonder if it is really a smart idea to have THAT many options in an already pretty unclear/overwhelming widget, that you can scroll to even more options. Maybe some design re-thinking is a better option.
Some examples though which could you get on the way would be here;
https://stackoverflow.com/questions/12072692/a-circular-layout-with-scrollable-contents-in-it

Is there something like CodeRush from Java?

Is there something like CodeRush for Java?
The real answer is that Many Java IDE's give the same types of features (as relevant for Java), so you should really check them out and then ask about a specific missing feature that you had in CodeRush that you think would be relevant to a Java IDE.
While not quite like CodeRush, you can try JetBrains IDE for java (IntelliJ) to get similar functionality to what Resharper offers (not that dissimilar to CodeRush)
Nothing exist that is exactly like CodeRush for Java. The closest thing you will find is the JetBrains IDE as saret said.
The design philosophy of CodeRush/Refactor! is to never show a modal dialog like Eclipse/Resharper/Visual Studio does for refactoring. Instead CodeRush uses context sensitivity, by watching the AST, and only shows you refactorings that make sense. CodeRush/Refactor draws on top of the editor and animates things where appropriate.
Animation example:
Image source: http://www.skorkin.com/2012/07/reordering-method-parameters-with-visual-studio-and-coderush/

Categories

Resources