I am using Motodev, an Eclipse-based development tool for Java ME / Motorola. The problem is when you type a line of code that has a method, such as:
super.
It doesnt give options of what methods it has available?
How do I configure it to do this?
Or I'm guessing the instructions for eclipse would work the same.
#android_king22 MOTODEV Studio should work just like Eclipse does. Pressing '.' or ctrl-space should bring up the list of suggestions. What context are you typing 'super'? Are you able to build your project (i.e. is the SDK path correct)?
Is there a folder inside your SDK called "platforms/android-X/sources"? This is a common workaround to a particularly ugly problem in Eclipse where it takes 20-30 seconds for auto-complete to work. If you do have this folder but no actual source inside, it could be preventing the auto-complete mechanism from working.
You must enable "Java Proposals" and "Java Type Proposals" in Preferences|Java|Editor|Content assist|Advanced
"super" calls a method in the superclass of whatever object you are currently using. If no method is available (or your current class is not a subclass), then it won't show anything. However, if there are methods available, it will automatically show (if you have Intellisense on).
Related
I have used IntelliJ for many projects and recently, when I try to find usages of an overridden method by pressing ALT+F7, it usually brings up a prompt asking if I want to search for the base method instead.
It is no longer doing that.
Is there an option to re-enable that back? I don't remember if there were any recent plugins or updates installed that disabled this.
I found the problem. There was a plugin called Gauge that was installed and a month ago, they released a version that "enhanced find usages functionality". I disabled that plugin, restarted IntelliJ and I have my find usages back to normal! I don't remember installing this plugin and I don't think I need it or use it. It is possibly a plugin that came with IntelliJ. Nevertheless, that was the cause of the issue.
Using Ctrl+Shift+Alt+F7 should show the prompt.
See: https://www.jetbrains.com/help/idea/find-usages-method-options.html
When you search for usages of a method implementation with this dialog Ctrl+Shift+Alt+F7, IntelliJ IDEA will ask whether or not you want to search for the base method. With any other find usages actions such as Alt+F7 or Ctrl+Alt+F7, the base method will be included in the search results automatically.
I am using eclipse for Java ee. One thing I noticed is in the computer in my office, eclipse auto complete is working even though I didn't finish writing the full name of the method.
For example: as soon as I write
getSer
It suggests me the
getServletContex
However at home the suggestion only appear when I am done with the method name and enter "."
At the office I am using Helios and at home Juno.
Anyone knows how to make the other eclipse to auto complete before I finish the name of the method?
Go to Preferences>java>Editor>Content Assist and configure your settings.
The IDE only suggests these auto-complete sometimes. Use CTRL+space to call it yourself.
I'm trying to learn some Android and java programming in Eclipse. I can run sample projects and tutorials fine, but when I try to create a new java class with File->New->Class and press the Browse button to look for superclasses to use, nothing shows up in the "Matching items:" area, even when I delete the "java.lang.Object" default type. I should be seeing lots of class names there, shouldn't I?
The same lack of results happens when I try to add and interface or an enclosing type. I'm new to Eclipse and java. I suppose that I have some setting messed up? I'm running the most recent Eclipse on Linux:
Version: Indigo Service Release 1
Build id: 20110916-0149
I eventually realized that code completion was not working either. I checked the settings in 'Windows > Preferences > Java > Editor > Content Assist > Advanced' and they seemed OK. I then re-ran with 'eclipse -clean'. After I did that, code completion and the new class wizard are working.
Thanks
You have to type some characters and then it will start looking for classes that start with those characters. Also, check that you don't have any filters set that you don't expect. You will see a tiny upside-down triangle on the upper right, click on that and go to the filters dialog.
No. Every public and non final class could be your superclass. Proposing them all would force Eclipse to show thousands of classes, and would not really help you. You're supposed to know which class you want to extend. Just type its name, the beginning of its name, or the first letter of each of its words (ATM for AbstractTableModel, for example), and Eclipse will then show you matching classes.
I'm writing an Eclipse plugin, that has the functionallity of auto completion (the thing when you press Ctrl+Space).
Generally, I know how it works, I made a completion for my own proposals.
But the problem is, that my boss want me to make a completion the same as is in eclipse already. For example if I type "Str", or "org" and press Ctrl+Space, I want to have a completion lists from Java, for example for "Str" a "String", for "org" "org.eclipse...." + a long list. So I need to compute proposals for packages and for classes, just like in Eclipse's JDT editor.
I know that may sound stupid, making it the same as already is, but I need this solution.
Has anyone done a similar thing earlier? Which class do I need to implement? What changes do I need to make (plugin.xml?)?
Try org.eclipse.jdt.ui.text.java.CompletionProposalCollector. There's an example on how to use it in the class' Javadoc.
I wonder if someone can help me... I've been developing VB.Net for years and C++/VB before that. I've also got some PHP experience. I'm now moving to Java to write an app for my Android mobile. I'm trying to use MOTODev Studio (Which extends eclipse)
I've not developed in Java before so it's a bit of a learning curve anyway. I'm fairly confident I'll be able to work out the important bits but I'm in a new IDE in a new language developing for a new platform.
As I'm new to Java, I was hoping to be able to rely on auto-code generation, intellisense, etc. I'm starting to think this was either very optimistic or I'm using eclipse very poorly.
For example, I know I need to override the OnClickListener() event but am unsure of the exact syntax. In VS, I'd just start typing Override in a class and up would pop intellisense with everything I can override and the appropriate signature, however, in eclipse none of the intellisense options seem to apply when I type public voidor #Override. Is this because I'm doing something wrong/is eclipse intellisense incomplete not very good?
In VS there's a bar at the top of the code page which lists objects in the file on the left and methods of the current object on the right. Does eclipse have an equivalent? If so, where?
I've managed to use the IDE to the extent that I've got a "Hello World" installed on my mob so it's more code generation techniques than windows/dialogues/etc.
I suppose what I really need is for someone to recommend some good resources to help me transition. I'd also appreciate any comments or advice from others that have done similar
Thanks in advance
So you learning three items at once
Language (Java)
Platform (Android)
Tool (Eclipse)
Here are my two cents for each of them:
Java - besides annotations guide already mentioned by Falmarri all java tutorials on oracle site are worth seeing you can find them here
Android - From my point of view very good entering points into android development are Android Developer Dev guide and API Demos project which demonstrates many android aspects ( You can add this project into your workspace in Eclipse via ->New Android Project-> Select from sample ->Choose target version -> Click OK , Voila you have new project in your workspace with a lot of useful android related code, describing many advanced and not so advanced topics). BTW Android developers blog is worth reading but
it usually covers more advanced topics
Eclipse - Falmarri already pointed and pretty good tutorial about Eclipse, I from my side would suggest to start from Help-> Help Contents -> Java Development User Guide
It covers all basic tasks and concepts. For your particular problem with overriding ( actually implementing) an interface method you've to first indicate that your class implements View.OnClickListener via class MyClass implements OnClickListener at this point eclipse will notice that you claiming to implement interface but didn't actually implemented some of it methods ( in this situation onClick(View v)) and will mark class declaration with error marker. Go to your class declaration and press Ctrl + 1 ( also known as "quick fix") and you will get some options to fix broken code. At the other hand if you really want to override parent class method you can press Ctrl + Space in a class body ( e.g not inside the method) and you will get option to override avalible methods.
Hope it helps
http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html
yes, it's the default java perspective. Have you even installed the IDE yet?
http://www.vogella.de/articles/Eclipse/article.html
I'm not entirely sure I fully understand your questions, but if I'm in a Java class in Eclipse that implements some Interface and I want to implement methods I either select the quick fix (Ctrl+1) for the compiler error telling me I'm not implementing the Interface or I trigger content assist (Ctrl+Space) in the class body to get a list of methods to override. And with the bar you mention, do you mean something like the breadcrumb navigation (Alt+Shift+B)?