org.eclipse.xtext.ui.editor.IDirtyStateManager Java Examples

The following examples show how to use org.eclipse.xtext.ui.editor.IDirtyStateManager. 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: WorkbenchResolutionAdaptorRunTest.java    From dsl-devkit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void configure() {
  bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("com.avaloq.tools.dsl.TestLang"); //$NON-NLS-1$
  bind(IWorkbench.class).toInstance(mock(IWorkbench.class));
  bind(IResourceDescriptions.class).toInstance(mock(IResourceDescriptions.class));
  bind(IWorkspace.class).toInstance(mock(IWorkspace.class));

  bind(IModificationContextRegistry.class).toInstance(mock(IModificationContextRegistry.class));

  bind(WorkbenchMarkerResolutionGenerator.RegistryProvider.class).toInstance(mockRegistryProvider);
  bind(IStorage2UriMapper.class).toInstance(mockStorage2UriMapper);
  bind(ILanguageResourceHelper.class).toInstance(mockLanguageResourceHelper);
  bind(IssueResolutionProvider.class).toInstance(mockIssueResolutionProvider);

  bind(IResourceSetProvider.class).toInstance(mockResourceSetProvider);
  bind(IDirtyStateManager.class).toInstance(mockDirtyStateManager);
}
 
Example #2
Source File: AbstractBuilderParticipantTest.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/***/
protected void setDocumentContent(String context, IFile file, XtextEditor fileEditor, String newContent) {
	@SuppressWarnings("hiding")
	IDirtyStateManager dirtyStateManager = this.dirtyStateManager.get();

	TestEventListener eventListener = new TestEventListener(context, file);
	dirtyStateManager.addListener(eventListener);

	setDocumentContent(fileEditor, newContent);

	eventListener.waitForFiredEvent();
	dirtyStateManager.removeListener(eventListener);
	waitForUpdateEditorJob();
}
 
Example #3
Source File: DirtyStateAwareResourceDescriptions.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Inject
public DirtyStateAwareResourceDescriptions(
		IBuilderState globalDescriptions, 
		IDirtyStateManager dirtyStateManager, 
		IStateChangeEventBroker stateChangeEventBroker) {
	this.globalDescriptions = globalDescriptions;
	this.dirtyStateManager = dirtyStateManager;
	globalDescriptions.addListener(createGlobalStateListener());
	dirtyStateManager.addListener(createDirtyStateListener());
	addListener(stateChangeEventBroker);
}
 
Example #4
Source File: DirtyStateAwareResourceDescriptions2.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public DirtyStateAwareResourceDescriptions2(final IBuilderState globalDescriptions, final IDirtyStateManager dirtyStateManager, final IStateChangeEventBroker stateChangeEventBroker) {
  super(globalDescriptions, dirtyStateManager, stateChangeEventBroker);
  dirtyResources = Sets.newHashSet();
  this.dirtyStateManager = dirtyStateManager;
  this.globalDescriptions = (IResourceDescriptions2) (globalDescriptions instanceof IResourceDescriptions2 ? globalDescriptions
      : new ResourceDescriptions2(globalDescriptions));
}
 
Example #5
Source File: EditorAwareCanLoadFromDescriptionHelper.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Inject
private void setDirtyStateManager(IDirtyStateManager dirtyStateManager) {
	if (dirtyStateManager instanceof IDirtyStateManagerExtension) {
		this.dirtyStateManager = (IDirtyStateManagerExtension) dirtyStateManager;
	}
}
 
Example #6
Source File: Access.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public static Provider<IDirtyStateManager> getIDirtyStateManager() {
	return provider(IDirtyStateManager.class);
}
 
Example #7
Source File: SharedStateModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Provider<IDirtyStateManager> provideIDirtyStateManager() {
	return Access.getIDirtyStateManager();
}
 
Example #8
Source File: DefaultUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IExternalContentSupport.IExternalContentProvider> bindIExternalContentSupport$IExternalContentProvider() {
	return IDirtyStateManager.class;
}