Search in sources :

Example 1 with ProposalAction

use of org.eclipse.che.ide.ext.java.client.action.ProposalAction in project che by eclipse.

the class JavaQuickAssistProcessor method showProposals.

private void showProposals(final CodeAssistCallback callback, final Proposals responds, TextEditor editor) {
    List<ProposalPresentation> presentations = responds.getProposals();
    final List<CompletionProposal> proposals = new ArrayList<>(presentations.size());
    HasLinkedMode linkedEditor = editor instanceof HasLinkedMode ? (HasLinkedMode) editor : null;
    for (ProposalPresentation proposal : presentations) {
        CompletionProposal completionProposal;
        String actionId = proposal.getActionId();
        if (actionId != null) {
            ProposalAction action = proposalActions.get(actionId);
            completionProposal = new ActionCompletionProposal(insertStyle(javaResources, proposal.getDisplayString()), actionId, action, JavaCodeAssistProcessor.getIcon(proposal.getImage()));
        } else {
            completionProposal = new JavaCompletionProposal(proposal.getIndex(), insertStyle(javaResources, proposal.getDisplayString()), JavaCodeAssistProcessor.getIcon(proposal.getImage()), client, responds.getSessionId(), linkedEditor, refactoringUpdater, editorAgent);
        }
        proposals.add(completionProposal);
    }
    callback.proposalComputed(proposals);
}
Also used : ProposalAction(org.eclipse.che.ide.ext.java.client.action.ProposalAction) CompletionProposal(org.eclipse.che.ide.api.editor.codeassist.CompletionProposal) HasLinkedMode(org.eclipse.che.ide.api.editor.link.HasLinkedMode) ProposalPresentation(org.eclipse.che.ide.ext.java.shared.dto.ProposalPresentation) ArrayList(java.util.ArrayList)

Example 2 with ProposalAction

use of org.eclipse.che.ide.ext.java.client.action.ProposalAction in project che by eclipse.

the class JavaGinModule method configure.

/** {@inheritDoc} */
@Override
protected void configure() {
    GinMapBinder<String, ProposalAction> proposalActionMapBinder = GinMapBinder.newMapBinder(binder(), String.class, ProposalAction.class);
    proposalActionMapBinder.addBinding(JAVA_ORGANIZE_IMPORT_ID).to(OrganizeImportsAction.class);
    bind(NewJavaSourceFileView.class).to(NewJavaSourceFileViewImpl.class).in(Singleton.class);
    bind(QuickDocumentation.class).to(QuickDocPresenter.class).in(Singleton.class);
    bind(JavaNavigationService.class).to(JavaNavigationServiceImpl.class);
    bind(JavaClasspathServiceClient.class).to(JavaClasspathServiceClientImpl.class);
    bind(JavaSearchService.class).to(JavaSearchServiceWS.class);
    GinMultibinder.newSetBinder(binder(), NodeInterceptor.class).addBinding().to(TestFolderDecorator.class);
    GinMultibinder.newSetBinder(binder(), NodeInterceptor.class).addBinding().to(JavaPackageConnector.class);
    GinMultibinder.newSetBinder(binder(), NodeIconProvider.class).addBinding().to(SourceFolderDecorator.class);
    GinMultibinder.newSetBinder(binder(), NodeInterceptor.class).addBinding().to(LibraryNodeProvider.class);
    GinMultibinder.newSetBinder(binder(), ResourceInterceptor.class).addBinding().to(SourceFolderInterceptor.class);
    GinMultibinder.newSetBinder(binder(), ResourceInterceptor.class).addBinding().to(ClassInterceptor.class);
    GinMultibinder.newSetBinder(binder(), CommandType.class).addBinding().to(JavaCommandType.class);
    GinMapBinder<String, FqnProvider> fqnProviders = GinMapBinder.newMapBinder(binder(), String.class, FqnProvider.class);
    fqnProviders.addBinding("maven").to(JavaFqnProvider.class);
    install(new GinFactoryModuleBuilder().build(JavaNodeFactory.class));
    install(new GinFactoryModuleBuilder().implement(PropertyWidget.class, PropertyWidgetImpl.class).build(PropertyWidgetFactory.class));
    install(new GinFactoryModuleBuilder().build(NodeFactory.class));
    install(new GinFactoryModuleBuilder().build(org.eclipse.che.ide.ext.java.client.navigation.factory.NodeFactory.class));
    GinMultibinder<PreferencePagePresenter> settingsBinder = GinMultibinder.newSetBinder(binder(), PreferencePagePresenter.class);
    settingsBinder.addBinding().to(JavaCompilerPreferencePresenter.class);
    bind(PreferencesManager.class).annotatedWith(JavaCompilerPreferenceManager.class).to(ErrorsWarningsPreferenceManager.class);
    GinMultibinder.newSetBinder(binder(), PreferencesManager.class).addBinding().to(ErrorsWarningsPreferenceManager.class);
    GinMultibinder.newSetBinder(binder(), Macro.class).addBinding().to(ClasspathMacro.class);
    GinMultibinder.newSetBinder(binder(), Macro.class).addBinding().to(OutputDirMacro.class);
    GinMultibinder.newSetBinder(binder(), Macro.class).addBinding().to(MainClassMacro.class);
    GinMultibinder.newSetBinder(binder(), Macro.class).addBinding().to(SourcepathMacro.class);
    GinMultibinder.newSetBinder(binder(), Macro.class).addBinding().to(CurrentClassFQN_Macro.class);
    GinMultibinder.newSetBinder(binder(), ClasspathPagePresenter.class).addBinding().to(LibEntryPresenter.class);
    GinMultibinder.newSetBinder(binder(), ClasspathPagePresenter.class).addBinding().to(SourceEntryPresenter.class);
    GinMultibinder.newSetBinder(binder(), RenamingSupport.class).addBinding().to(JavaSourceRenameValidator.class);
}
Also used : JavaNodeFactory(org.eclipse.che.ide.ext.java.client.tree.JavaNodeFactory) PreferencePagePresenter(org.eclipse.che.ide.api.preferences.PreferencePagePresenter) JavaClasspathServiceClient(org.eclipse.che.ide.ext.java.client.dependenciesupdater.JavaClasspathServiceClient) GinFactoryModuleBuilder(com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder) PropertyWidgetFactory(org.eclipse.che.ide.ext.java.client.inject.factories.PropertyWidgetFactory) JavaSearchService(org.eclipse.che.ide.ext.java.client.search.JavaSearchService) FqnProvider(org.eclipse.che.ide.api.reference.FqnProvider) JavaFqnProvider(org.eclipse.che.ide.ext.java.client.reference.JavaFqnProvider) ProposalAction(org.eclipse.che.ide.ext.java.client.action.ProposalAction) QuickDocPresenter(org.eclipse.che.ide.ext.java.client.documentation.QuickDocPresenter) NewJavaSourceFileViewImpl(org.eclipse.che.ide.ext.java.client.newsourcefile.NewJavaSourceFileViewImpl) JavaNavigationService(org.eclipse.che.ide.ext.java.client.navigation.service.JavaNavigationService) JavaNodeFactory(org.eclipse.che.ide.ext.java.client.tree.JavaNodeFactory) NodeFactory(org.eclipse.che.ide.ext.java.client.search.node.NodeFactory) JavaCompilerPreferenceManager(org.eclipse.che.ide.ext.java.client.settings.compiler.JavaCompilerPreferenceManager)

Aggregations

ProposalAction (org.eclipse.che.ide.ext.java.client.action.ProposalAction)2 GinFactoryModuleBuilder (com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder)1 ArrayList (java.util.ArrayList)1 CompletionProposal (org.eclipse.che.ide.api.editor.codeassist.CompletionProposal)1 HasLinkedMode (org.eclipse.che.ide.api.editor.link.HasLinkedMode)1 PreferencePagePresenter (org.eclipse.che.ide.api.preferences.PreferencePagePresenter)1 FqnProvider (org.eclipse.che.ide.api.reference.FqnProvider)1 JavaClasspathServiceClient (org.eclipse.che.ide.ext.java.client.dependenciesupdater.JavaClasspathServiceClient)1 QuickDocPresenter (org.eclipse.che.ide.ext.java.client.documentation.QuickDocPresenter)1 PropertyWidgetFactory (org.eclipse.che.ide.ext.java.client.inject.factories.PropertyWidgetFactory)1 JavaNavigationService (org.eclipse.che.ide.ext.java.client.navigation.service.JavaNavigationService)1 NewJavaSourceFileViewImpl (org.eclipse.che.ide.ext.java.client.newsourcefile.NewJavaSourceFileViewImpl)1 JavaFqnProvider (org.eclipse.che.ide.ext.java.client.reference.JavaFqnProvider)1 JavaSearchService (org.eclipse.che.ide.ext.java.client.search.JavaSearchService)1 NodeFactory (org.eclipse.che.ide.ext.java.client.search.node.NodeFactory)1 JavaCompilerPreferenceManager (org.eclipse.che.ide.ext.java.client.settings.compiler.JavaCompilerPreferenceManager)1 JavaNodeFactory (org.eclipse.che.ide.ext.java.client.tree.JavaNodeFactory)1 ProposalPresentation (org.eclipse.che.ide.ext.java.shared.dto.ProposalPresentation)1