简体   繁体   English

在eclipse中创建一个新文件

[英]creating a new file in eclipse

是否有可能在eclipse中创建一个新文件而不将其作为项目的一部分?

It's possible. 这是可能的。 If you create new file, select General and Untitled Text File. 如果创建新文件,请选择“常规”和“无标题文本文件”。

For convenience, you can also create shortcut for that. 为方便起见,您还可以为其创建快捷方式。 I use Ctrl + N, Ctrl + N for that. 我使用Ctrl + N,Ctrl + N。

Doesn't look like it. 看起来不像。 This is a huge oversight by the Eclipse people :) What you can do is create a project in the New Project wizard, and then specify the same name as the folder (don't think it matters though). 这是Eclipse人员的巨大疏忽:)你可以做的是在New Project向导中创建一个项目,然后指定与文件夹相同的名称(尽管不要认为它很重要)。 After that, you can create files in that directory using the project. 之后,您可以使用该项目在该目录中创建文件。

Another thing you can do is create an empty workspace project and then link to files outside of the workspace (New File Wizard > Advanced.. > Link to file in the file system). 您可以做的另一件事是创建一个空的工作区项目,然后链接到工作区外的文件(文件系统中的新文件向导>高级..>链接到文件)。

Edit: as hollsk says, it's possible to drag the file in. In the newer versions of Eclipse, this will ask you if you want to make a link or a copy of the file, AFAIK. 编辑:正如霍尔斯克所说,可以将文件拖入。在较新版本的Eclipse中,这将询问您是否要创建文件的链接或副本AFAIK。 You can combine this with an empty project as mentioned. 您可以将其与上述空项目结合使用。

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

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