|
|
|
|
Re: How to use a custom IAllContainersState [message #1836572 is a reply to message #1836571] |
Thu, 07 January 2021 18:26   |
Yannick DAVELUY Messages: 36 Registered: July 2020 |
Member |
|
|
I finally solved the problem, my configure function in MyDslSharedModule was empty...
So in myDsl UI project I created :
The module:
public class MyDslSharedModule extends AbstractModule {
@Override
protected void configure() {
bind(MyDslProjectsState.class);
bind(MyDslProjectsStateHelper.class);
}
}
In the MyDslUiModule
public class MyDslUiModuleextends AbstractMyDslUiModule {
=
@Override
public Provider<IAllContainersState> provideIAllContainersState() {
return Access.<IAllContainersState>contributedProvider(MyDslProjectsState.class);
}
}
The MyDslProjectState:
public class MyDslProjectsState extends WorkspaceProjectsState {
@Inject
private MyDslProjectsStateHelper projectsHelper;
@Override
protected String doInitHandle(URI uri) {
return projectsHelper.initHandle(uri);
}
@Override
protected Collection<URI> doInitContainedURIs(String containerHandle) {
return projectsHelper.initContainedURIs(containerHandle);
}
@Override
protected List<String> doInitVisibleHandles(String handle) {
return projectsHelper.initVisibleHandles(handle);
}
}
And the Helper
public class MyDslProjectsStateHelper extends WorkspaceProjectsStateHelper {
}
And the plugin.xml
<extension
point="org.eclipse.xtext.ui.shared.sharedStateContributingModule">
<module
class="mydsl.MyDslSharedModule">
</module>
</extension>
I have to implements the MyDslProjectsStateHelper to retrieve visible handlers from the manifest
[Updated on: Thu, 07 January 2021 18:26] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02436 seconds