org.eclipse.core.commands.operations.DefaultOperationHistory Java Examples

The following examples show how to use org.eclipse.core.commands.operations.DefaultOperationHistory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CustomWorkspaceCommandStackTest.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void should_create_always_valid_emf_transaction_if_command_is_not_a_command_trigger() throws Exception {
    final CustomWorkspaceCommandStack commandStack = new CustomWorkspaceCommandStack(new DefaultOperationHistory());
    commandStack.setEditingDomain(new TransactionalEditingDomainImpl(new ProcessAdapterFactory()));

    final EMFCommandTransaction transaction = commandStack.createTransaction(null, Collections.emptyMap());

    assertThat(transaction).isInstanceOf(AlwaysValidEMFOperationTransaction.class);
}
 
Example #2
Source File: CustomWorkspaceCommandStackTest.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void should_create_always_valid_trigger_command_transaction_if_command_a_command_trigger() throws Exception {
    final CustomWorkspaceCommandStack commandStack = new CustomWorkspaceCommandStack(new DefaultOperationHistory());
    commandStack.setEditingDomain(new TransactionalEditingDomainImpl(new ProcessAdapterFactory()));

    final EMFCommandTransaction transaction = commandStack.createTransaction(new TriggerCommand(Collections.<Command> emptyList()), Collections.emptyMap());

    assertThat(transaction).isInstanceOf(AlwaysValidTriggerCommandTransaction.class);
}
 
Example #3
Source File: MvcFxModule.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Binds {@link IOperationHistory} to {@link DefaultOperationHistory} in
 * adaptable scope of {@link IDomain}.
 */
protected void bindIOperationHistory() {
	binder().bind(IOperationHistory.class)
			.to(DefaultOperationHistory.class);
}
 
Example #4
Source File: AbstractFXEditorTests.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Binds {@link IOperationHistory} to the operation history of the
 * Eclipse workbench.
 */
@Override
protected void bindIOperationHistory() {
	binder().bind(IOperationHistory.class).to(DefaultOperationHistory.class);
}
 
Example #5
Source File: UndoManager.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
protected UndoManager() {
  DefaultOperationHistory.DEBUG_OPERATION_HISTORY_APPROVAL = true;

  OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(historyListener);
}
 
Example #6
Source File: BonitaOperationHistory.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public BonitaOperationHistory() {
    defaultOperationHistory = new DefaultOperationHistory();
}
 
Example #7
Source File: UndoManager.java    From saros with GNU General Public License v2.0 3 votes vote down vote up
public UndoManager(ISarosSessionManager sessionManager, EditorManager editorManager) {

    if (log.isDebugEnabled()) DefaultOperationHistory.DEBUG_OPERATION_HISTORY_APPROVAL = true;

    OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(historyListener);

    sessionManager.addSessionLifecycleListener(sessionLifecycleListener);
    this.sessionManager = sessionManager;

    editorManager.getActivityProducer().addActivityListener(this.activityListener);
    this.editorManager = editorManager;

    editorManager.addSharedEditorListener(sharedEditorListener);
  }