Does Eclipse support Virtual White space?

2019-06-18 13:02发布

问题:

Shortly I will be joining a company that relies heavily on Eclipse for Java development. For my own development I've used other tools exclusively so I am now getting acquainted with Eclipse before I begin my contract.

One of the features I've grown accustomed to is Virtual White space. This allows you to click anywhere in a given text area and begin typing. If no white space exists up until your cursor, it will automatically be filled in. You can see an example of this behavior with the text editor ConTEXT or by turning in on in the Editor settings of Visual Studio.

I can't find an option for it in Eclipse though. Is there an option I'm missing or will I have to search for a plug-in to enable this feature?

回答1:

Eclipse does not have a plug-in that provides this functionality right now.

As far as I can see from the TextEditor class (the basis for almost all Eclipse editors), it will not be an easy task to create such an editor.

You can get the Point of the click easily - via addMouseListener(...) - but there are no way to add spaces to the document of the editor without it being an separate undoable operation that changes the document. Which must be an additional requirement.