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.
I have used Eclipse for Java for the last few years and am trying out Intellij. I'm not using it permanently because it isn't as useful for quick programming (like how you can't just drag in files into the src folder) but for doing certain things, I think it will be faster for me.
I know there is Ctrl+Shift+Enter, but this is just annoying to press. Not because it is awkward to press, but because it takes so much time compared to just pressing enter like you can in Eclipse. I tried to rebind it to enter, but then it just doesn't work.
Is there a way to set up the Complete Current Statement so that it happens when I press enter?
Like, is there a way that I can bind it to Enter, but have it checked before the editor checks for enter as move to next line?
If you want only basic Code completion and not Type completion, use Ctrl+Space
IntelliJ and Android Studio are pretty highly customisable. You can rebind shortcuts too, I believe. Have you looked here? https://www.jetbrains.com/idea/help/configuring-keyboard-shortcuts.html
Also cheatsheet might be of use: https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf
And Android specific bindings: https://developer.android.com/sdk/installing/studio-tips.html
So for example with my current object tabPanelMain, I'll type a dot after it and expect to see a drop down menu of all the object's available methods. Instead, the marker which shows my currently selected character on the editor disappears meaning I don't know where I'm typing. Worse than that is that the save and save all buttons stop working. And ctrl-s and the menu saves don't work either. I can't save my eclipse projects and have to restart, thus losing my work.
What could be wrong? This problem never used to exist but now I just can't get the methods of an object like I used to.
I hope that was clear enough, please ask me questions if not.
The save problem with not being able to save is one I've encountered before.
I don't know why it happens but for me it helps to minimize and then maximize eclipse again.
Not a fix but at least a workaround that lets you save.
Never heard of the other problem though.
I couldn't figure out what it was that was causing the problem, and while Martin Larsson provided an effective short term solution, I found it best to fresh install Eclipse.
The most annoying part about this was transferring my previous plug ins (like GWT, Subversion, etc) over to the new install. In the end I ended up re-installing them manually. If anyone could shed some light on how to keep previous plug ins, I'd like to hear how. Though I've heard this can be problematic with path urls in the files or something.
I've just recently become interested in programming, and I want to create Android apps for phones or tablets. I've come a long way in a couple weeks from knowing almost nothing about java/xml. I'm very serious about this. I'm going to find the answer to this question one way or the other. In fact, I hope to have it figured out before anyone answers this. I've fixed many issues without resorting to asking anyone, but I've just been stuck on this issue too long. I figured I'd give this a shot.
I'm using an older tutorial to build a practice twitter app (the tutorials for these seem to be everywhere, which is why I chose it). I'm using Eclipse for an editor.
The following is an example of code from the tutorial. which relates to my question:
#Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.timeline);
Apparently since the intro of ADT 14, you can no longer use the (R.layout.timeline) phrase, which the error message refers to as a "switch statement."
Now, in a post I found on another site, someone who had a similar issue shows a screenshot of the "quick fix" in Eclipse using ctrl+1. in the screenshot, the fix that pops up says "convert switch to 'if-else' statement." This fix does not pop up in my version of Eclipse. My quick fix options are "migrate Android code", "create field 'timeline' in type 'layout'", "create constant 'timeline' in type 'layout'" or "rename in file."
If I choose "migrate Android code", a window pops up informing me of the ADT 14 update, and how switch statements are no longer allowed in library projects. It says to convert the switch statement to an "if-else" statement by pressing ctrl+1 for the quick fix, then choosing "switch to 'if-else' statement" like it does in the screenshot I found. But again, when I do this, that option does not pop up.
I would much rather know what needs to be changed in the code than know how to make the right quick fix pop up. If it isn't too much trouble, an explanation of why exactly these changes are affective would be very helpful. I have many (MANY) errors in my java files right now, but most of them are due to this exact problem in different forms. If I could see just one before/after example I could probably figure it out from there without an explanation. But after hours of searching, I cannot find that so far by googling.
Thanks so much in advance....
And for the record, I don't see any switch classes in any of my java files, if that makes a difference for the answer...
Make sure you click on the switch keyword itself then press Ctrl + 1.
This confused me at first as well...
If it still doesn't show up, what version of Eclipse are you using?
If you are using a Mac select the keyword switch and click Shift + Command + 1.
That will show a prompt to change switch to if else conditions.
I've been having the same issues. For me, I was switching on view.getId(). Before the switch, declare int id = view.getId();. Then switch in id. Then you can ctrl+1 click and the "Convert Switch to If/Else" should pop up.
They made this change to decrease the build speed. My projects now build in roughly 1/10th of the time. I'm glad I upgraded the ADT.
The issue happens because since ADT 14 resource identifiers are no longer final.
The quick solution you can change switch statements with if-else statements.
With Android Studio 4.1.3
Step:1. Just right click on the switch keyword of statement.
Step:2 Click on the first option Show Context Actions.
Step:3 Click replace switch with if.
Done
To me, it looks like you don't have a timeline resource.
Breaking down R.layout.timeline
R refers to Resources
layout refers to the collection of layouts in your application
and timeline refers the specific resource that you are trying to apply setContentView() too.
If my hunch is correct, you don't have the timeline resource.
Create a new XML file in your layout folder in eclipse and name it 'timeline'
That should resolve the issue.
I hope you got things working.
I agree that this sounds like some weird Eclipse error that is not what it seems, and not what Quick Fix says it is. Eclipse has been known to lie from time to time. Cleaning your project (as #Stephen Dubya said), cutting out the offending code, saving the file, pasting it back in, and saving again...these are some of the non-obvious tricks that sometimes get Eclipse to behave.
In general, I think it would be good for you to get more familiar with some of the Java basics like switch; I think it will make your learning of Android a lot easier. Although the tools and documentation keep improving, Android is still young and not always easy to learn using tutorials, especially when you aren't used to writing code at all or using complicated IDEs like Eclipse.
But I digress. It is only in Android library projects, not regular projects, that Android doesn't treat resources as constants (final variables), since ADT 14. That means means that in library projects, you can't use R.layout.timeline or similar resource variables in your switch statements. You can only switch on whole numbers or enum values.
Using if-else all the time may be your best bet, anyway. switch can, especially for beginners, lead to logic errors in your code, and anything you can write using switch can be rewritten using if-else blocks. Personally, I've stopped using switch in Android and other Java code altogether.
You need to place the curse right before the s in the word switch, and the press cmd 1 . If you switch statements have fall-through clauses, the option to convert won't be available.
Somehow I overworked this error. I have deleted my project from workspace. Reverted it's .project files to old ones commited at SVN. Then at Eclipse uninstalling ADT and install it again. Then import my project. - > Libraries are added the old way and as result all fields at R.java are now final. Hope this helps.
I love using an IDE, because I get some great productivity gains. However, I have a couple reasons to stop using a mouse with an IDE:
To code faster - It definitely slows down my coding when my typing is interrupted with all of the constant point and clicking.
To relieve pain - I've never had pain from the keyboard, but I get tendinitis from the mouse.
I've got my cheat sheet for my IDE printed out and now I'm ready.
What's the best way get off the mouse?
Are there any hurdles that I'm going to run into?
Are there any tips for specific IDEs (Visual Studio, Eclipse, etc.) ?
Move it to the wrong side (eg if you are right handed then put it on the left of the keyboard). That way, you can still use it if necessary, but you should find you aren't using it unecessarily.
If changing sides isn't enough to confuse your brain, then moving it to a place where it is accessible but you have to think before reaching for it. As long as you can't reach for the mouse without thinking about it, then you will find that it is easier to use keyboard shortcuts instead. Essentially you want the mouse to be an option but the keyboard to be a better/easier/more convenient one!
As for pitfalls, well you may find that if you have to test any interfaces (web based or dektop) that you need to revert back to using the mouse. Also I find that if I have to work outside of the IDE, then it is just not as efficient to do without the mouse. Often we use WOrd for specifications and documentation, and trying to get away with using that without a mouse, is tricky (in my experience).
Another potential source of annoyance, is when switching between applications (Eclipse, VS, etc), you find that they often use different keyboard shortcuts, and so it can take a while to get back up to speed again, or you have to spend some time reconfiguring the shortcuts to be consistent.
Unplug it.
If your mouse is completely gone then you will be forced to learn how to live without it and therefore will become productive without it.
Anytime you're about to use the mouse, forcibly stop yourself and look up the keyboard shortcut for that operation. Do that a few times per operation and soon your muscle memory will kick in and you won't even have to think about it anymore.
Learn the keyboard short cuts :)
Also some editors are better suited for mouse free operation. I use ViEmu with Visual Studio which has helped me reduce, but not eliminate the need for using the mouse.
Get a trackball.
Your real question is about pain and productivity, the mouse is just a by-product of your circumstances. I would rephrase the question to reflect your real purpose.
Check out the wrist braces. I've heard from people that it makes a huge difference.
For VS, check out Sara Ford's blog.
Bind Macros to Keyboard Shortcuts
Keyboard Shortcuts to navigate task list
Search her blog for plenty of other tips and tricks.
Use the command line whenever you can (Install Powershell)
Switch to vim or emacs for code editing (or use ViEmu if you really need the intellisense)
If you develop web applications and/or spend a lot of time on the web, get the Vimperator or Firemacs extensions
Learn keyboard shortcuts for everything else.
???
Profit!!! (from your increased productivity)
Hide the mouse under a copy of your cheat sheet.
For visual studio I use the ViEmu plugin that allows you to use vi commands in visual studio. It's a bit difficult to get the hang of it but once you're done you'll only be using the mouse on the designer.
Get a webcam and eye-tracking software. Then you can fix bugs just by looking at them. It makes you feel all-powerful.
I've summed up some shortcuts that will get you working faster with Visual Studio in my blog.
I recommend you start at this article, that shows you the shortcuts I'd recommend you should get to know first...
Switch to emacs.
Open the nearest drawer and shove it in and close the drawer. That way, when you really do need it it'll be inconvenient to use it!!!
Also, if you're using multiple IDEs it pays to configure key bindings that are common across them, so that you can switch between them easily.
Change your keys to Emacs setup , Learn the Keyboard Shortcuts. I rarely use the mouse, if ever, in eclipse. i find it alot easier to just use emacs key short cuts.
When I contracted for an investment bank in NYC, there was this guy who didn't use a mouse. He was a java/kdb dev and just used vim. I used to think it was the strangest thing that he didn't have a mouse attached to his computer, but damn.. that guy was productive. Probably the most productive guy I've ever worked with.
So yea, if you really want to go that route you could try using vim, or something similar. You'll lose the features you're used to in your IDE, but it worked for him...
Become a better typer. As a slow
typer, I find myself going to the
mouse so I dont have to type. If I
were more efficient at typing, I would
be less inclined to use the mouse.
If you are using a laptop and a
mouse, remove the mouse and leave the
trackpad as your only option. That
will be so painful that you will be
forced to learn more keyboard
shortcuts.
Some very good answers above.
I spent a while injured with RSI and mousing was an issue. I already used shortcuts a LOT.
But coding using strictly the keyboard was definitely slower, especially when it comes to navigating around the code.
As I was using vi at the time, I would primarily move around the screen by doing searches for text at the location I wanted to go to; this is very fast, assuming you pick unambiguous text. Leaving line-numbers on and then going to the line number is another way to rapidly navigating. Judicious use of code folding (available in many IDEs) helps, too.
Finally, consider an alternate pointing device. A trackpad sucks for games but can be more accessible for coding, especially if you put it in easy reach of the keys (e.g., if you use a split keyboard, between the two hands). Try switching between two or more styles of device, to avoid injury because of one specific device. And don't ignore wrist pain! Treat it before it gets worse and you end up non-productive for a year or something.
Configure your IDE to use VI or EMACS keyboard controls (and learn them.) Both options allow you do do most tasks without moving your hands of the home row. You'll see your productivity drop during the learning curve but jump way up after as you save a lot of time by not moving your hand of the keyboard to use the mouse.
As a side note, learning to use a terminal based editor is a good skill to have in case you ever need to remotely administer a *nix machine. It will save your bacon some day.
MouseFeeds plugin will help you in eclipse:
http://www.mousefeed.com/installation
All these coders and no one suggested to write some code to hide the pointer when the IDE's window is active??
Great question... A co-worker suggested Launchy to me as a way to reduce mouse-use/be more productive. It searches your Start Menu (or non-windows equivalent) for apps, docs, shortcuts, etc. Type alt+spacebar to bring up its prompt where you type what you want to launch. Here are a few examples - what you type depends on other things in your Start Menu.
ch for Chrome, f for Firefox
ca for Calculator
expl for Windows Explorer
A power-user can fiddle with its settings to get more out of it but even basic users will benefit from it. Hope it helps.
Change your keyboard:
(source: datahand.com)
Hide your mouse - at least one arm's length away - then you can always get it back in an emergency
Move it far enough away that it's inconvenient to use, while your cheat sheet is close enough to easily lookup whenever you are in doubt about how to do something. I would not suggest unplugging it, since it is a useful tool for some operations, such as moving files around. I find drag and drop in some sort of tree like file system view is much easier than the alternatives. The majority of editing operations though, are quickly accomplished via key strokes once you remember them.
I am using IntellijIDEA IDE. There is one very annoying plugin - "Key promoter".
For every mouse-inited action it shows annoying alert with keyboard shortcut which you could use to do the same action.
Well, it took about 2 or 3 weeks for me to stop using mouse at all. It was hard to not turn it off (plugin), but very useful :)
IMHO the best answer is combination of two already given answers:
Print out the keyboard shortcut cheat sheet of your IDE and tape it to the wall next to the screen.
Unplug it. Also this makes a bit harder to procrastinate by switching to SO in the other window...
You may also want to consider doing your coding on a Macbook/Macbook pro. I generally HATE touchpads, but I've had to do some coding on the plane and the new touch-sensitive pads are actually really convenient. For example, you can do things like scrolling with a flick of two singers, and it's a lot more accurate.
It may not be perfect, but it might help with your hands.
I don't think avoiding the mouse completely is practical (you need things like hovers, etc.)
First off, don't try to do everything with a keyboard, start by forcing yourself to use keyboards for the top 3 things that you do all the time. Get the biggest bang for your buck/effort and you will quickly want to use more.
Keep a sheet of paper near by where you write down keyboard short cuts you use. (Alternatively, add this to a company wiki so others can benefit.)
Pay attention to menu items, they frequently have keyboard short cuts.
Find out the keyboard shortcuts that show all other keyboard short cuts.
I use Eclipse all the time, there are several keyboard short cuts that I find invaluable:
CTRL + SPACE - Content Assist
CTRL + 3 - Open any UI Element in eclipse by typing
CTRL + SHIFT + T - Open by type (Uses Capital letters to do word searches and * for wild card, for instance NuPoEx would find NullPointerException)
ALT + SHIFT + R - Rename current selection
ALT + SHIFT + T - Refactor Menu
And CTRL+SHIFT + L gives you a list of all keyboard shortcuts