获取Eclipse中类中所有方法的概述视图 [英] getting an overview perspective of all methods in a class in Eclipse

查看:558
本文介绍了获取Eclipse中类中所有方法的概述视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了一些xCode编程,并发现一个类中的方法的概述透视图真的很有帮助。它看起来像这样:

  MY_GROUP_1<  - 用#pragma标记定义MY_GROUP_1 
M方法11
M method12
M ....
MY_GROUP_2
M method21
M method22
M ....

在Eclipse中,我只找到没有标题的分组的大纲视图。所以我开始定义方法只是为了滥用它们作为这样的组名称

  / ** 
*
* @category MessageSequence
* /
public void __GROUP_1 __(){

}

至少我现在有一个大纲视图中的列表,如下所示:

  __GROUP_1__ 
method11
method12
method ..
__GROUP_2__
method21
method22
method ..

虽然它比没有更好,我怀疑这是使用它的方法来获取一个类结构的概述的最好方法。



这样做的正确方法是什么?



非常感谢!



ps我也不知道为什么groupd标题的方法必须被公开。 Eclipse不会在概览视图中显示私有方法。



编辑:根据指甲给出的答案,我在此更新它,以便每个人都可以看到它的工作原理并且不必浪费时间去尝试...


  1. 按照安装说明 http://kosiara87.blogspot.com/2011/12/how-to-install-coffee -bytes-plugin-in.html -

  2. 中的链接在settings-> java-> editor-> folding->用户定义区域中设置标识符开始标识符:区域,endidentifier:endregion

现在可以做:

  // region Y 
public void y1(){
}

public void y2(){
}

// endregion Y

没有折叠设置无效我..
哦,是的,不要忘了重新启动Eclipse我f它不能立即工作!

解决方案

其实这是一个在Java / Eclipse中分组方法的任何方式?



提到的咖啡字节插件在引用的位置不再可用。但是,似乎Bartosz Kosarzycki昨天发布了一个更新版本:



http://kosiara87.blogspot.com/2011/12/how-to-install-coffee-bytes-plugin-in.html



请注意,为大纲视图提供分组,只需在编辑器中自定义折叠。


I have done quite some xCode programming and found the overview perspective of the methods in a class really helpful. It looks like this:

MY_GROUP_1 <- defined with #pragma mark MY_GROUP_1
M method11
M method12
M....
MY_GROUP_2
M method21
M method22
M....

In Eclipse I only found the outline view, which does not have a grouping with a headline. So I started to define methods just to abuse them as group names like this

 /**
     * 
     * @category MessageSequence
     */
    public void __GROUP_1__() {

    }

At least I have now a list in the outline view that looks like this:

    __GROUP_1__
    method11
    method12
    method..
   __GROUP_2__
    method21
    method22
    method..

While its better than nothing, I doubt that this is the best way to get an overview of ones class structure with its methods.

What would be the right way to do this?

Many thanks!

ps also I don't know why the groupd headline methods have to be public. Eclipse does not show private methods in the overview view.

EDIT: based on the answer given by "The Nail" I update it here so that everyone can see how it works and does not have to waste time trying around...

  1. Follow the install instructions http://kosiara87.blogspot.com/2011/12/how-to-install-coffee-bytes-plugin-in.html - link found by
  2. set the identifiers in settings->java->editor->folding-> user defined regions (tab on the right) to start identifier: region, endidentifier: endregion

Now you can do:

 //region Y
    public void y1() {
    }

    public void y2() {
    }

    //endregion Y

Without the settings folding did not work for me.. Oh, yes and don't forget to restart Eclipse if it doesn't work immediately!

解决方案

In fact, this is a duplicate of Any way to group methods in Java/Eclipse?.

The Coffee Bytes plugin is mentioned is no longer available at the referred locations. But, it seems that Bartosz Kosarzycki has posted an updated version yesterday:

http://kosiara87.blogspot.com/2011/12/how-to-install-coffee-bytes-plugin-in.html

Note that this does not provide grouping for the outline view, just (customized) folding in the editor.

这篇关于获取Eclipse中类中所有方法的概述视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆