简体   繁体   English

在Eclipse新的Java类向导中看不到超类

[英]Not seeing superclasses in Eclipse new java class wizard

I'm trying to learn some Android and java programming in Eclipse. 我正在尝试在Eclipse中学习一些Android和Java编程。 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. 我可以很好地运行示例项目和教程,但是当我尝试使用File-> New-> Class创建一个新的Java类并按Browse按钮查找要使用的超类时,“匹配项:”区域中没有任何显示。 ,即使我删除“ java.lang.Object”默认类型也是如此。 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. 我是Eclipse和Java的新手。 I suppose that I have some setting messed up? 我想我的设置有些混乱了吗? I'm running the most recent Eclipse on Linux: 我正在Linux上运行最新的Eclipse:

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. 我检查了“ Windows>首选项> Java>编辑器> Content Assist>高级”中的设置,它们似乎没问题。 I then re-ran with 'eclipse -clean'. 然后,我使用“ 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. 提出所有建议将迫使Eclipse显示数千个类,但并不能真正帮助您。 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. 只需键入其名称,名称的开头或每个单词的第一个字母(例如,ATM for AbstractTableModel),Eclipse就会向您显示匹配的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM