简体   繁体   English

是否有等效于 Eclipse 工作区的 NetBeans

[英]Is there a NetBeans equivalent to Eclipse's Workspace

I enjoy using NetBeans, especially for development with Maven, however, I've found recently that I've been working with three different branches of the same code base in different parts of the development cycle.我喜欢使用 NetBeans,尤其是使用 Maven 进行开发,但是,我最近发现在开发周期的不同部分,我一直在使用相同代码库的三个不同分支。

One of the things that Eclipse can do is separate the projects into different workspaces, so I can simply start Eclipse with the workspace containing my Maven projects in the production patch branch or the trunk depending upon what I need to be working on. Eclipse 可以做的一件事是将项目分成不同的工作区,因此我可以简单地使用包含生产补丁分支或主干中的 Maven 项目的工作区启动 Eclipse,具体取决于我需要处理的内容。

I'd love to accomplish this in NetBeans, but haven't found a way to do so.我很想在 NetBeans 中实现这一点,但还没有找到这样做的方法。 Any ideas?有任何想法吗?

I am using Mac OS with version 6.7.1.我使用的是 6.7.1 版的 Mac OS。

There is the option of project group.有项目组选项。

In File > Project group .文件 > 项目组中

In here you can create a project group based on a folder location, so any projects underneath this folder will be considered within this project group.在这里,您可以根据文件夹位置创建项目组,因此该文件夹下的任何项目都将被视为该项目组。

When switching between project groups only projects within are displayed, and it maintains the current status of opened files, etc.在项目组之间切换时,只显示其中的项目,并保持打开文件的当前状态等。

Switching between project groups doesn't require closing the IDE.在项目组之间切换不需要关闭 IDE。

Given those options I believe this would be equivalent to the workspace switching in Eclipse.鉴于这些选项,我相信这相当于 Eclipse 中的工作区切换。

I've found two things:我发现了两件事:

First there is a "similar" feature.首先有一个“相似”的特征。 It involves using the userdir switch on the command line.它涉及在命令行上使用 userdir 开关。 The downside being you would need to restart your IDE rather than switching while open.缺点是您需要重新启动 IDE,而不是在打开时切换。 I think I can live with that for the time being.我想我暂时可以忍受。 I found the technique here for Windows:我在这里找到了适用于 Windows 的技术:

  1. Create a shortcut on your desktop to the Netbeans executable: C:\\Program Files\\NetBeans xx\\bin\\netbeans.exe在桌面上创建 Netbeans 可执行文件的快捷方式:C:\\Program Files\\NetBeans xx\\bin\\netbeans.exe
  2. Right-click on the shortcut and click "Properties".右键单击快捷方式,然后单击“属性”。
  3. In the "Target" textbox, add the extra parameter to the very end: --userdir C:\\path\\to\\new_workspace在“目标”文本框中,将额外的参数添加到最后:--userdir C:\\path\\to\\new_workspace
  4. Click "OK" to exit the Properties window and double click the shortcut.单击“确定”退出“属性”窗口并双击快捷方式。 Netbeans will launch and create/load the workspace at that location Netbeans 将在该位置启动并创建/加载工作区

Secondly, someone has submitted a feature to allow for workspace switching (or in this case userdir switching) from the IDE itself.其次,有人提交了一项功能,允许从 IDE 本身进行工作区切换(或在这种情况下用户目录切换)。 Perhaps this will be rolled into 7.0.也许这将被卷入7.0。

Well Netbeans has a group so you can create a group of projects which you want to say put in a eclipse workspace otherwise.好吧,Netbeans 有一个组,因此您可以创建一组项目,否则您想将这些项目放在 Eclipse 工作区中。

So when you switch a group it's like switching workpsace in eclipse因此,当您切换组时,就像在 Eclipse 中切换工作空间一样

I know, that this question is old, but I found it on google, while I was searching for a tool like the following: http://plugins.netbeans.org/plugin/20677/project-group-toolbar With that plugin, you can load different projects in your projects overview.我知道,这个问题很旧,但我在 google 上找到了它,当时我正在搜索如下工具: http : //plugins.netbeans.org/plugin/20677/project-group-toolbar使用该插件,您可以在项目概览中加载不同的项目。 So you can have two or more projects open and change to another "set" of projects.因此,您可以打开两个或多个项目并更改为另一“组”项目。

Neither projects or project groups do not work in a similar way as an Eclipse workspace (yet) as far as I know.据我所知,项目或项目组的工作方式都与 Eclipse 工作区(目前)不同。 When switching workspaces in Eclipse, all the files opened will be closed and the ones in the new project will be opened.在 Eclipse 中切换工作区时,所有打开的文件将被关闭,而新项目中的文件将被打开。 In this way, all projects work as one entity.通过这种方式,所有项目都作为一个实体运行。 The netbeans project/project groups do not work in that way. netbeans 项目/项目组不以这种方式工作。 I hope there will be such a feature soon cause that really helps if you have many windows open and you switch between projects我希望很快就会有这样一个功能,因为如果你打开了很多窗口并在项目之间切换,这真的很有帮助

I'm looking for solution and finally use Project Group solution, this feature has been improved and easy to use.我正在寻找解决方案并最终使用项目组解决方案,此功能已得到改进且易于使用。

Userdir is a good solution at first (i tried to use it first), but "workspace switching" feature doesn't exists, so I have to use different shortcut for different workspace. Userdir 起初是一个很好的解决方案(我尝试先使用它),但是“工作区切换”功能不存在,因此我必须为不同的工作区使用不同的快捷方式。 Finally I used Project Group最后我使用了项目组

NetBeans' equivalent is the "Project". NetBeans 的等效项是“项目”。 In your project explorer you can right click on the current project and close it.在您的项目资源管理器中,您可以右键单击当前项目并将其关闭。 Then go to File > Open Project and select a different branch.然后转到“文件” >“打开项目”并选择一个不同的分支。 You will have to create a new project from each branch of your code.您必须从代码的每个分支创建一个新项目。

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

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