private IAction createQuickFixAction(final ICompletionProposal proposal) { return new Action(proposal.getDisplayString()) { public void run() { proposal.apply(sourceViewer.getDocument()); } public ImageDescriptor getImageDescriptor() { Image image = proposal.getImage(); if (image != null) return ImageDescriptor.createFromImage(image); return null; } }; }
public void run() { proposal.apply(sourceViewer.getDocument()); }
public int getCursorPosition() { return oldProposal.getSelection( document ).x; }
Image image= /*isMultiFix ? JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_MULTI_FIX) : */proposal.getImage(); if (image != null) { proposalImage.setImage(image); linkText= proposal.getDisplayString();
e.apply(document, trigger, offset); } else { p.apply(document); Point selection= p.getSelection(document); if (selection != null) { fViewer.setSelectedRange(selection.x, selection.y); IContextInformation info= p.getContextInformation(); if (info != null) {
e.apply(document, (char) 0, offset); } else { p.apply(document); Point selection= p.getSelection(document); if (selection != null) { viewer.setSelectedRange(selection.x, selection.y);
private List addContextInformations(JavaContentAssistInvocationContext context, int offset, IProgressMonitor monitor) { List proposals= internalComputeCompletionProposals(offset, context, monitor); List result= new ArrayList(proposals.size()); for (Iterator it= proposals.iterator(); it.hasNext();) { ICompletionProposal proposal= (ICompletionProposal) it.next(); IContextInformation contextInformation= proposal.getContextInformation(); if (contextInformation != null) { ContextInformationWrapper wrapper= new ContextInformationWrapper(contextInformation); wrapper.setContextInformationPosition(offset); result.add(wrapper); } } return result; }
public ImageDescriptor getImageDescriptor() { Image image = proposal.getImage(); if (image != null) return ImageDescriptor.createFromImage(image); return null; } };
public String getDescription() { return oldProposal.getAdditionalProposalInfo(); }
Image image= isMultiFix ? JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_MULTI_FIX) : proposal.getImage(); if (image != null) { proposalImage.setImage(image); linkText= Messages.format(JavaHoverMessages.AbstractAnnotationHover_multifix_variable_description, Integer.valueOf(count)); } else { linkText= proposal.getDisplayString();
e.apply(document, trigger, offset); } else { p.apply(document); Point selection= p.getSelection(document); if (selection != null) { fViewer.setSelectedRange(selection.x, selection.y); IContextInformation info= p.getContextInformation(); if (info != null) {
e.apply(document, (char) 0, offset); } else { p.apply(document); Point selection= p.getSelection(document); if (selection != null) { viewer.setSelectedRange(selection.x, selection.y);
private List<IContextInformation> addContextInformations(JavaContentAssistInvocationContext context, int offset) { List<ICompletionProposal> proposals= internalComputeCompletionProposals(offset, context); List<IContextInformation> result= new ArrayList<>(proposals.size()); List<IContextInformation> anonymousResult= new ArrayList<>(proposals.size()); for (Iterator<ICompletionProposal> it= proposals.iterator(); it.hasNext();) { ICompletionProposal proposal= it.next(); IContextInformation contextInformation= proposal.getContextInformation(); if (contextInformation != null) { ContextInformationWrapper wrapper= new ContextInformationWrapper(contextInformation); wrapper.setContextInformationPosition(offset); if (proposal instanceof AnonymousTypeCompletionProposal) anonymousResult.add(wrapper); else result.add(wrapper); } } if (result.size() == 0) return anonymousResult; return result; }
@Override public void run() { final ICompletionProposal proposal= getCurrentProposal(); if (!fDisplay.isDisposed()) { fDisplay.asyncExec(() -> { synchronized (Timer.this) { if (proposal == getCurrentProposal()) { Object info= proposal.getAdditionalProposalInfo(); showInformation(proposal, info); } } }); } }
public String getLabel() { return oldProposal.getDisplayString(); }
Image image= isMultiFix ? JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_MULTI_FIX) : proposal.getImage(); if (image != null) { proposalImage.setImage(image); linkText= Messages.format(JavaHoverMessages.AbstractAnnotationHover_multifix_variable_description, new Integer(count)); } else { linkText= proposal.getDisplayString();
e.apply(document, trigger, offset); } else { p.apply(document); Point selection= p.getSelection(document); if (selection != null) { fContentAssistSubjectControlAdapter.setSelectedRange(selection.x, selection.y); IContextInformation info= p.getContextInformation(); if (info != null) {
public void apply(IModificationContext context) throws Exception { proposal.apply(context.getXtextDocument()); }
e.apply(document, (char) 0, offset); } else { p.apply(document); Point selection= p.getSelection(document); if (selection != null) { viewer.setSelectedRange(selection.x, selection.y);
Point selection= proposal.getSelection(document); if (selection != null) { viewer.setSelectedRange(selection.x, selection.y);