org.eclipse.xtext.ui.shared.SharedStateModule Java Examples

The following examples show how to use org.eclipse.xtext.ui.shared.SharedStateModule. 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: ContentAssistTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public ISetup doGetSetup() {
	return new ContentAssistTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(
					new ContentAssistTestLanguageRuntimeModule(),
					new ContentAssistTestLanguageUiModule(TestsActivator.getInstance()) {
						@Override
						public Class<? extends IJavaProjectProvider> bindIJavaProjectProvider() {
							return MockJavaProjectProvider.class;
						}
					}, 
					new SharedStateModule()));
		}
	};
}
 
Example #2
Source File: ContentAssistCustomizingTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public ISetup doGetSetup() {
	return new ContentAssistCustomizingTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(
					new ContentAssistCustomizingTestLanguageRuntimeModule(),
					new ContentAssistCustomizingTestLanguageUiModule(TestsActivator.getInstance()) {
						@Override
						public Class<? extends IContentProposalProvider> bindIContentProposalProvider() {
							return TestableProposalProvider.class;
						}
						@SuppressWarnings("unused")
						public ContentAssistCustomizingTest bindTestClass() {
							return ContentAssistCustomizingTest.this;
						}
						@Override
						public Class<? extends ITemplateProposalProvider> bindITemplateProposalProvider() {
							return TestableTemplateProposalProvider.class;
						}
					}, new SharedStateModule()));
		}
	};
}
 
Example #3
Source File: AbstractBug326948Test.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public ISetup doGetSetup() {
	return new BeeLangTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(
					Modules2.mixin(
							new BeeLangTestLanguageRuntimeModule(), 
							new BeeLangTestLanguageUiModule(TestsActivator.getInstance()) {
								@Override
								public Class<? extends IContentProposalProvider> bindIContentProposalProvider() {
									return ProposalProvider.class;
								}
								
								@SuppressWarnings("unused")
								public AbstractBug326948Test bindTest() {
									return AbstractBug326948Test.this;
								}
							},
							new SharedStateModule()));
		}
	};
}
 
Example #4
Source File: TwoContextsContentAssistTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * @return
 */
private ISetup getGrammarSetup() {
	return new TwoContextsTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(
					new TwoContextsTestLanguageRuntimeModule(),
					new TwoContextsTestLanguageUiModule(TestsActivator.getInstance()){
				@Override
				public Class<? extends IContentProposalProvider> bindIContentProposalProvider() {
					return TwoContextsTestLanguageTestProposals.class;
				}
			},
			new SharedStateModule()));
		}
	};
}
 
Example #5
Source File: CurrentModelBugTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
private ISetup getSetup() {
	return new DomainModelTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(new DomainModelTestLanguageRuntimeModule(), new DomainModelTestLanguageUiModule(TestsActivator.getInstance()){

				@Override
				public Class<? extends IContentProposalProvider> bindIContentProposalProvider() {
					return MockedProposals.class;
				}
				
				@SuppressWarnings("unused")
				public CurrentModelBugTest bindCurrentModelBugTest() {
					return CurrentModelBugTest.this;
				}
			}, new SharedStateModule()));
		}
	};
}
 
Example #6
Source File: Bug297909Test.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public ISetup doGetSetup() {
	return new ContentAssistTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(new ContentAssistTestLanguageRuntimeModule(), new ContentAssistTestLanguageUiModule(TestsActivator
					.getInstance()), new SharedStateModule()));
		}
		
		@Override
		public void register(Injector injector) {
			super.register(injector);
			// simulate a EPackage that was not registered
			EPackage.Registry.INSTANCE.remove("http://www.eclipse.org/2008/xtext/ui/common/tests/ContentAssist");
			Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().remove("contentassisttestlanguage");
		}
	};
}
 
Example #7
Source File: Bug282031ParserTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setUp() throws Exception {
	super.setUp();
	with(new LookAheadContentAssistTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(
					Modules2.mixin(new LookAheadContentAssistTestLanguageRuntimeModule(),
					new LookAheadContentAssistTestLanguageUiModule(TestsActivator.getInstance()),
					new SharedStateModule()));
		}
	});
	grammarAccess = get(LookAheadContentAssistTestLanguageGrammarAccess.class);
}
 
Example #8
Source File: XtextContentAssistTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public ISetup doGetSetup() {
	return new XtextStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(new XtextRuntimeModule(),new XtextUIModuleInternal(Activator.getDefault()) {
				@Override
				public void configureContentProposalLabelProvider(com.google.inject.Binder binder) {
					binder.bind(ILabelProvider.class).annotatedWith(ContentProposalLabelProvider.class).to(DefaultEObjectLabelProvider.class);
				}
			}, new SharedStateModule()));
		}
	};
}
 
Example #9
Source File: ResourceModuleProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Module getModule(String... options) {
	if (isHeadless(options)) {
		return getLanguageRuntimeModule();
	}
	Module module = Modules.override(getLanguageRuntimeModule())
			.with(new STextUiModule(StextActivator.getInstance()));
	module = Modules.override(module).with(new Module() {
		@Override
		public void configure(Binder binder) {
			binder.bind(Resource.class).to(StextResource.class);
		}
	});
	return Modules.override(module).with(new SharedStateModule());
}
 
Example #10
Source File: DefaultEObjectHoverProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public ISetup getTestLanguageSetup(final IEObjectDocumentationProvider ieObjectDocumentationProvider) {
	return new KeywordsUiTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(
					new TestLanguageRuntimeModule(),
					new TestModule(TestsActivator.getInstance(),ieObjectDocumentationProvider),
					new SharedStateModule()));
		}
	};
}
 
Example #11
Source File: Bug281198ParserTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setUp() throws Exception {
	super.setUp();
	with(new DatatypeRuleTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(new DatatypeRuleTestLanguageRuntimeModule(),
					new DatatypeRuleTestLanguageUiModule(TestsActivator.getInstance()),
					new SharedStateModule()));
		}
	});
	grammarAccess = get(DatatypeRuleTestLanguageGrammarAccess.class);
}
 
Example #12
Source File: Bug303200Test.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setUp() throws Exception {
	super.setUp();
	with(new Bug303200TestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(new Bug303200TestLanguageRuntimeModule(),
					new Bug303200TestLanguageUiModule(TestsActivator.getInstance()),
					new SharedStateModule()));
		}
	});
}
 
Example #13
Source File: AbstractEMFBasedPersisterTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
	tempFile = temporaryFolder.createTempFile("foo", "bar");
	SharedStateModule module = new SharedStateModule();
	Module m = Modules.override(module).with(new AbstractModule() {
		@Override
		protected void configure() {
			bind(EMFBasedPersister.class).toInstance(new EMFBasedPersister() {
				@Override
				protected File getBuilderStateLocation() {
					return tempFile;
				}
				@Override
				protected void scheduleRecoveryBuild() {
					// do nothing
				}
				@Override
				protected void addSaveParticipant() throws CoreException {
					// do nothing
				}
			});
		}});
	persister = Guice.createInjector(m).getInstance(EMFBasedPersister.class);
	descriptions = Lists.newArrayList(
			createResourceDescription(1),
			createResourceDescription(2),
			createResourceDescription(3)
	);
}
 
Example #14
Source File: PurexbaseActivator.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected com.google.inject.Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #15
Source File: TestLanguageActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #16
Source File: FormatActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #17
Source File: ValidActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #18
Source File: HelloworldActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected com.google.inject.Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #19
Source File: XtendActivator.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
protected com.google.inject.Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #20
Source File: ExportActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #21
Source File: TestlanguagesActivator.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected com.google.inject.Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #22
Source File: ScopeActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #23
Source File: ArithmeticsActivator.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected com.google.inject.Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #24
Source File: ExpressionActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #25
Source File: CheckActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #26
Source File: CheckCfgActivator.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getSharedStateModule() {
	return new SharedStateModule();
}
 
Example #27
Source File: SCTExecutableExtensionFactory.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected Injector getInjector() {
	// TODO: Provide a sharedDomainModule via DomainRegistry to allow
	// overriding of generic bindings
	return Guice.createInjector(new SharedStateModule(), new SCTXtextIntegrationModule());
}
 
Example #28
Source File: EclipseContextGeneratorExecutorLookup.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected Module getContextModule() {
	return Modules.combine(new EclipseContextModule(), new SharedStateModule());
}
 
Example #29
Source File: EditorModuleProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
protected Module getLanguageModule() {
	Module languageModule = Modules.override(getLanguageRuntimeModule()).with(getLanguageUiModule());
	return Modules.override(languageModule).with(new SharedStateModule());
}
 
Example #30
Source File: ModelingActivator.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
protected com.google.inject.Module getSharedStateModule() {
	return new SharedStateModule();
}