Search in sources :

Example 1 with ICodeBuilder

use of org.eclipse.xtend.ide.codebuilder.ICodeBuilder in project xtext-xtend by eclipse.

the class CodeBuilderQuickfix method addQuickfix.

public void addQuickfix(final ICodeBuilder builder, final String label, final Issue issue, final IssueResolutionAcceptor acceptor) {
    boolean _isValid = builder.isValid();
    if (_isValid) {
        IModification _switchResult = null;
        boolean _matched = false;
        if (builder instanceof ICodeBuilder.Xtend) {
            _matched = true;
            _switchResult = this.getXtendModification(((ICodeBuilder.Xtend) builder));
        }
        if (!_matched) {
            if (builder instanceof ICodeBuilder.Java) {
                _matched = true;
                _switchResult = this.getJavaModification(((ICodeBuilder.Java) builder));
            }
        }
        final IModification modification = _switchResult;
        acceptor.accept(issue, label, builder.getPreview(), builder.getImage(), modification);
    }
}
Also used : ICodeBuilder(org.eclipse.xtend.ide.codebuilder.ICodeBuilder) IModification(org.eclipse.xtext.ui.editor.model.edit.IModification)

Aggregations

ICodeBuilder (org.eclipse.xtend.ide.codebuilder.ICodeBuilder)1 IModification (org.eclipse.xtext.ui.editor.model.edit.IModification)1