use of org.eclipse.n4js.ui.wizard.contentproposal.ModuleSpecifierContentProposalProviderFactory.ModuleSpecifierProposalLabelProvider in project n4js by eclipse.
the class WorkspaceWizardPage method setupContentProposal.
private void setupContentProposal(WorkspaceWizardPageForm wizardForm) {
// Get the active binding's content assist key strokes
KeyStroke keyInitiator = getActiveContentAssistBinding();
// If unbound don't configure the content proposal
if (null == keyInitiator) {
return;
}
// Setup project content proposal
ContentProposalAdapter projectAdapter = new ContentProposalAdapter(wizardForm.getProjectText(), new TextContentAdapter(), projectContentProposalProvider, keyInitiator, null);
projectAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
ImageDescriptor projectSymbol = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
projectAdapter.setLabelProvider(new SimpleImageContentProposalLabelProvider(projectSymbol));
createContentProposalDecoration(wizardForm.getProjectText());
sourceFolderContentProposalAdapter = new ContentProposalAdapter(wizardForm.getSourceFolderText(), new TextContentAdapter(), null, keyInitiator, null);
sourceFolderContentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
sourceFolderContentProposalAdapter.setLabelProvider(new SimpleImageContentProposalLabelProvider(ImageDescriptorCache.ImageRef.SRC_FOLDER.asImageDescriptor().orNull()));
createContentProposalDecoration(wizardForm.getSourceFolderText());
moduleSpecifierContentProposalAdapter = new ContentProposalAdapter(wizardForm.getModuleSpecifierText().getInternalText(), new TextContentAdapter(), null, keyInitiator, null);
wizardForm.getModuleSpecifierText().createDecoration(contentProposalDecorationImage);
// Update proposal context whenever the model changes
model.addPropertyChangeListener(evt -> {
if (evt.getPropertyName() == WorkspaceWizardModel.PROJECT_PROPERTY || evt.getPropertyName() == WorkspaceWizardModel.SOURCE_FOLDER_PROPERTY) {
updateProposalContext();
}
});
updateProposalContext();
moduleSpecifierContentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
moduleSpecifierContentProposalAdapter.setLabelProvider(new ModuleSpecifierProposalLabelProvider());
}
Aggregations