use of org.eclipse.che.ide.api.editor.texteditor.HasReadOnlyProperty in project che by eclipse.
the class EditorAgentImpl method finalizeInit.
private void finalizeInit(final VirtualFile file, final OpenEditorCallback callback, final EditorPartPresenter editor, EditorProvider editorProvider) {
openedEditors.add(editor);
openedEditorsToProviders.put(editor, editorProvider.getId());
workspaceAgent.setActivePart(editor);
editor.addPropertyListener(new PropertyListener() {
@Override
public void propertyChanged(PartPresenter source, int propId) {
if (propId == EditorPartPresenter.PROP_INPUT) {
if (editor instanceof HasReadOnlyProperty) {
((HasReadOnlyProperty) editor).setReadOnly(file.isReadOnly());
}
if (editor instanceof TextEditor) {
editorContentSynchronizerProvider.get().trackEditor(editor);
}
callback.onEditorOpened(editor);
eventBus.fireEvent(new EditorOpenedEvent(file, editor));
}
}
});
}
Aggregations