@Override public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) { if (proposal instanceof IStatusLineProposal) { IStatusLineProposal statusLineProposal= (IStatusLineProposal)proposal; String message= statusLineProposal.getStatusMessage(); if (message != null) { fAssistant.setStatusMessage(message); return; } } fAssistant.setStatusMessage(getJumpHintStatusLineMessage()); }
public static IStatus collectAssists(IInvocationContext context, IProblemLocation[] locations, Collection<IJavaCompletionProposal> proposals) { ContributedProcessorDescriptor[] processors= getAssistProcessors(); SafeAssistCollector collector= new SafeAssistCollector(context, locations, proposals); collector.process(processors); return collector.getStatus(); }
@Override public void assistSessionStarted(ContentAssistEvent event) { fAssistant.setStatusLineVisible(true); fAssistant.setStatusMessage(getJumpHintStatusLineMessage()); }
public static boolean hasCorrections(ICompilationUnit cu, int problemId, String markerType) { ContributedProcessorDescriptor[] processors= getCorrectionProcessors(); SafeHasCorrections collector= new SafeHasCorrections(cu, problemId); for (int i= 0; i < processors.length; i++) { if (processors[i].canHandleMarkerType(markerType)) { collector.process(processors[i]); if (collector.hasCorrections()) { return true; } } } return false; }
public static IStatus collectCorrections(IInvocationContext context, IProblemLocation[] locations, Collection proposals) { ContributedProcessorDescriptor[] processors= getCorrectionProcessors(); SafeCorrectionCollector collector= new SafeCorrectionCollector(context, proposals); for (int i= 0; i < processors.length; i++) { ContributedProcessorDescriptor curr= processors[i]; IProblemLocation[] handled= getHandledProblems(locations, curr); if (handled != null) { collector.setProblemLocations(handled); collector.process(curr); } } return collector.getStatus(); }
public static boolean hasAssists(IInvocationContext context) { ContributedProcessorDescriptor[] processors= getAssistProcessors(); SafeHasAssist collector= new SafeHasAssist(context); for (int i= 0; i < processors.length; i++) { collector.process(processors[i]); if (collector.hasAssists()) { return true; } } return false; }
private static boolean getConvertSwitchToIfProposals(IInvocationContext context, ASTNode covering, Collection<ICommandAccess> resultingCollections) { if (!(covering instanceof SwitchStatement)) { return false; } // we could produce quick assist (if all 'case' statements end with 'break') if (resultingCollections == null) { return true; } if (!getConvertSwitchToIfProposals(context, covering, resultingCollections, false)) return false; return getConvertSwitchToIfProposals(context, covering, resultingCollections, true); }
public QuickAssistLightBulbUpdater(ITextEditor part, ITextViewer viewer) { fEditor= part; fViewer= viewer; fAnnotation= new AssistAnnotation(); fIsAnnotationShown= false; fPropertyChangeListener= null; }
private static boolean getConvertIfElseToSwitchProposals(IInvocationContext context, ASTNode coveringNode, ArrayList<ICommandAccess> resultingCollections) { if (!(coveringNode instanceof IfStatement)) { return false; } // we could produce quick assist if (resultingCollections == null) { return true; } if(!getConvertIfElseToSwitchProposals(context, coveringNode, resultingCollections, true)) return false; return getConvertIfElseToSwitchProposals(context, coveringNode, resultingCollections, false); }
private void importNodeTypes(ASTNode node, final CompilationUnitRewrite cuRewrite, final ImportRewriteContext context) { ASTResolving.visitAllBindings(node, new TypeBindingVisitor() { @Override public boolean visit(ITypeBinding nodeBinding) { importBinding(nodeBinding, cuRewrite, context); return false; } }); } }
/** * Gets the text change that is invoked when the change is applied. * * @return returns the text change that is invoked when the change is applied. * @throws CoreException throws an exception if accessing the change failed */ public final TextChange getTextChange() throws CoreException { return (TextChange) getChange(); }
public static boolean hasCorrections(ICompilationUnit cu, int problemId, String markerType) { ContributedProcessorDescriptor[] processors= getCorrectionProcessors(); SafeHasCorrections collector= new SafeHasCorrections(cu, problemId); for (int i= 0; i < processors.length; i++) { if (processors[i].canHandleMarkerType(markerType)) { collector.process(processors[i]); if (collector.hasCorrections()) { return true; } } } return false; }
public static IStatus collectAssists(IInvocationContext context, IProblemLocation[] locations, Collection proposals) { ContributedProcessorDescriptor[] processors= getAssistProcessors(); SafeAssistCollector collector= new SafeAssistCollector(context, locations, proposals); collector.process(processors); return collector.getStatus(); }
public static boolean hasAssists(IInvocationContext context) { ContributedProcessorDescriptor[] processors= getAssistProcessors(); SafeHasAssist collector= new SafeHasAssist(context); for (int i= 0; i < processors.length; i++) { collector.process(processors[i]); if (collector.hasAssists()) { return true; } } return false; }
@Override public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) { if (proposal instanceof IStatusLineProposal) { IStatusLineProposal statusLineProposal= (IStatusLineProposal)proposal; String message= statusLineProposal.getStatusMessage(); if (message != null) { fAssistant.setStatusMessage(message); return; } } fAssistant.setStatusMessage(getJumpHintStatusLineMessage()); }
@Override public void assistSessionStarted(ContentAssistEvent event) { fAssistant.setStatusLineVisible(true); fAssistant.setStatusMessage(getJumpHintStatusLineMessage()); }
private static boolean getConvertSwitchToIfProposals(IInvocationContext context, ASTNode covering, Collection<ICommandAccess> resultingCollections) { if (!(covering instanceof SwitchStatement)) { return false; } // we could produce quick assist (if all 'case' statements end with 'break') if (resultingCollections == null) { return true; } if (!getConvertSwitchToIfProposals(context, covering, resultingCollections, false)) return false; return getConvertSwitchToIfProposals(context, covering, resultingCollections, true); }
public static boolean hasCorrections(ICompilationUnit cu, int problemId, String markerType) { ContributedProcessorDescriptor[] processors= getCorrectionProcessors(); SafeHasCorrections collector= new SafeHasCorrections(cu, problemId); for (int i= 0; i < processors.length; i++) { if (processors[i].canHandleMarkerType(markerType)) { collector.process(processors[i]); if (collector.hasCorrections()) { return true; } } } return false; }
public static IStatus collectAssists(IInvocationContext context, IProblemLocation[] locations, Collection<IJavaCompletionProposal> proposals) { ContributedProcessorDescriptor[] processors= getAssistProcessors(); SafeAssistCollector collector= new SafeAssistCollector(context, locations, proposals); collector.process(processors); return collector.getStatus(); }
public static boolean hasAssists(IInvocationContext context) { ContributedProcessorDescriptor[] processors= getAssistProcessors(); SafeHasAssist collector= new SafeHasAssist(context); for (int i= 0; i < processors.length; i++) { collector.process(processors[i]); if (collector.hasAssists()) { return true; } } return false; }