You cannot modify the Java source code of a class or an interface from their Preview tab.
In the Model Explorer, right-click a model name and select Model Options in the contextual menu.
In the All Objects group box, the Preview editable option is unavailable.