use of org.whole.lang.e4.ui.actions.RedoAction in project whole by wholeplatform.
the class EditorPart method createPartControl.
@Override
public void createPartControl(Composite parent) {
IImportAsModelDialogFactory factory = ContextInjectionFactory.make(ImportAsModelDialogFactory.class, getContext());
getContext().set(IImportAsModelDialogFactory.class, factory);
super.createPartControl(parent);
getContext().get(MPart.class).setElementId("org.eclipse.e4.ui.compatibility.editor");
setPartName(getEditorInput().getName());
final IEntityPartViewer viewer = getComponent().getViewer();
viewer.getCommandStack().addCommandStackEventListener(listener = new CommandStackEventListener() {
@Override
public void stackChanged(CommandStackEvent event) {
if ((event.getDetail() & CommandStack.POST_MASK) != 0)
setDirtyState(viewer.isDirty());
}
});
undoAction = new UndoAction(getContext(), UNDO_LABEL);
undoAction.update();
redoAction = new RedoAction(getContext(), REDO_LABEL);
redoAction.update();
if (getEditorInput() instanceof IFileEditorInput) {
IWorkspace workspace = ((IFileEditorInput) getEditorInput()).getFile().getWorkspace();
workspace.addResourceChangeListener(resourceListener = new ResourceChangeListener());
}
}
use of org.whole.lang.e4.ui.actions.RedoAction in project whole by wholeplatform.
the class ViewPart method createPartControl.
@Override
public void createPartControl(Composite parent) {
IImportAsModelDialogFactory factory = ContextInjectionFactory.make(ImportAsModelDialogFactory.class, getContext());
getContext().set(IImportAsModelDialogFactory.class, factory);
super.createPartControl(parent);
getContext().get(MPart.class).setElementId(partId);
undoAction = new UndoAction(getContext(), UNDO_LABEL);
undoAction.update();
redoAction = new RedoAction(getContext(), REDO_LABEL);
redoAction.update();
}
Aggregations