This article is actually the lower part of the "Eclipse RCP editor closing button blocking method". The reason why it is not put together is that the original text is easy to misunderstand, so it is split.
In the createeditorpresentationfactory class createeditorpresentation () method of the uncloseableeditorpresentation class, we can customize the standardviewsystemmenu class to remove the close, closeall, new editor and other menus in the menu on the Editor folder in RCP.
Import Org. eclipse. SWT. graphics. point; <br/> Import Org. eclipse. SWT. widgets. control; <br/> Import Org. eclipse. UI. internal. workbenchmessages; <br/> Import Org. eclipse. UI. internal. presentations. util. standardviewsystemmenu; <br/> Import Org. eclipse. UI. presentations. ipresentablepart; <br/> Import Org. eclipse. UI. presentations. istackpresentationsite; <br/> public class mystandardeditorsystemmenu extends standardviewsystemmenu {<br/> Public mystandardeditorsystemmenu (istackpresentationsite site) {<br/> super (SITE ); <br/> // todo auto-generated constructor stub <br/>}< br/> string getmovemenutext () {<br/> return workbenchmessages. editorpane_moveeditor; <br/>}< br/> Public void show (control parent, point displaycoordinates, ipresentablepart currentselection) {<br/> super. show (parent, displaycoordinates, currentselection); <br/>}< br/>}
Then, in the createeditorpresentation () method, modify the Code as follows:
Tabbedstackpresentation result = new tabbedstackpresentation (site, partfolder, new mystandardeditorsystemmenu (SITE ));