Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Eclipse "Open Type" window to show project classes first in list, third-party classes last?

Tags:

eclipse

When you work with a project you more often open classes from your project and less often third party classes, so it would be good to have project classes displayed first in "Open Type" window. Is there a way to do this ?

like image 454
Bulgar Sadykov Avatar asked Feb 22 '12 14:02

Bulgar Sadykov


1 Answers

Eclipse doesn't provide any configuration for Open Type dialog. You can only filter an unwanted packages so they will not be shown (Settings->Java->Appearance->Type Filters).

It's very simple with patterns to search for a classes within a given package. Assume I want to go to the Node class in the pl.toro package. If I just type node it will return more than 20 classes with my class at the end of the list. But with a pattern p.Node the class will be first and only. p stands for the first letter of the package (pl).

More from Eclipse's help:

Wildcards: "*" for any string and "?" for any character

terminating "<" or " " (space) to prevent the automatic prefix matching, e.g.

"java.*Access<" to match java.util.RandomAccess but not java.security.AccessControlContext

Camel case:

"TZ" for types containing "T" and "Z" as upper-case letters in camel-case notation, e.g.

java.util.TimeZone

"NuPoEx" or "NuPo" for types containing "Nu", "Po", (and "Ex") as parts in camel-case notation, e.g.

java.lang.NullPointerException

terminating "<" or " " (space) to fix the number of camel-case parts, e.g.

"HMap<" and "HaMap<" match "HashMap" and "HatMapper", but not "HashMapEntry" nor "Hashmap".

Both pattern kinds also support package prefixes, e.g. "j.util.*Map<".

like image 77
tomrozb Avatar answered Oct 24 '22 08:10

tomrozb