use of com.liferay.ide.core.model.IModelChangedEvent in project liferay-ide by liferay.
the class ModelUndoManager method undo.
/**
* @see IModelUndoManager#undo()
*/
public void undo() {
IModelChangedEvent op = _getCurrentOperation();
if (op == null) {
return;
}
_ignoreChanges = true;
_openRelatedPage(op);
execute(op, true);
_cursor--;
_updateActions();
_ignoreChanges = false;
}
use of com.liferay.ide.core.model.IModelChangedEvent in project liferay-ide by liferay.
the class InputContext method create.
protected void create() {
_fDocumentProvider = createDocumentProvider(_fEditorInput);
try {
_fDocumentProvider.connect(_fEditorInput);
_fModel = createModel(_fEditorInput);
if (_fModel instanceof IModelChangeProvider) {
_fModelListener = new IModelChangedListener() {
public void modelChanged(IModelChangedEvent e) {
if (e.getChangeType() != IModelChangedEvent.WORLD_CHANGED) {
if (!_fEditor.getLastDirtyState()) {
_fEditor.fireSaveNeeded(_fEditorInput, true);
}
IModelChangeProvider provider = e.getChangeProvider();
if (provider instanceof IEditingModel) {
if (((IEditingModel) provider).isDirty()) {
addTextEditOperation(fEditOperations, e);
}
}
}
}
};
((IModelChangeProvider) _fModel).addModelChangedListener(_fModelListener);
}
IAnnotationModel amodel = _fDocumentProvider.getAnnotationModel(_fEditorInput);
if (amodel != null) {
amodel.connect(_fDocumentProvider.getDocument(_fEditorInput));
}
_fElementListener = new ElementListener();
_fDocumentProvider.addElementStateListener(_fElementListener);
} catch (CoreException ce) {
LiferayUIPlugin.logError(ce);
}
}
use of com.liferay.ide.core.model.IModelChangedEvent in project liferay-ide by liferay.
the class ModelUndoManager method redo.
/**
* @see IModelUndoManager#redo()
*/
public void redo() {
_cursor++;
IModelChangedEvent op = _getCurrentOperation();
if (op == null) {
return;
}
_ignoreChanges = true;
_openRelatedPage(op);
execute(op, false);
_ignoreChanges = false;
_updateActions();
}
Aggregations