org.eclipse.xtext.ui.notification.IStateChangeEventBroker Java Examples

The following examples show how to use org.eclipse.xtext.ui.notification.IStateChangeEventBroker. 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: TypeResourceUnloaderTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
	eventBroker = TestsActivator.getInstance().getInjector(DUMMY_LANG_NAME).getInstance(IStateChangeEventBroker.class);
	projectProvider = new MockJavaProjectProvider();
	projectProvider.setUseSource(true);
	project = projectProvider.getJavaProject(null);
	type = project.findType(NESTED_TYPES);
	compilationUnit = type.getCompilationUnit();
	compilationUnit.becomeWorkingCopy(null);
	
	// wait until the BackgroundThread for the reconciler was started
	editor = waitForElementChangedEvent(new Callable<IEditorPart>() {
		@Override
		public IEditorPart call() throws Exception {
			return JavaUI.openInEditor(compilationUnit);
		}
	}, true);
	
	eventBroker.addListener(this);
	document = getDocument();
	originalContent = document.get();
	subsequentEvents = Lists.newArrayList();
}
 
Example #2
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 #3
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 #4
Source File: Access.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public static Provider<IStateChangeEventBroker> getIStateChangeEventBroker() {
	return provider(IStateChangeEventBroker.class);
}
 
Example #5
Source File: SharedStateModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Provider<IStateChangeEventBroker> provideIStateChangeEventBroker() {
	return Access.getIStateChangeEventBroker();
}
 
Example #6
Source File: DirtyStateEditorSupport.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public IStateChangeEventBroker getStateChangeEventBroker() {
	return stateChangeEventBroker;
}
 
Example #7
Source File: DirtyStateEditorSupport.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @noreference This method is not intended to be referenced by clients.
 */
public void setStateChangeEventBroker(IStateChangeEventBroker stateChangeEventBroker) {
	this.stateChangeEventBroker = stateChangeEventBroker;
}