Skip to content

Commit

Permalink
[lang][ui] Add icons to the quick fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Aug 16, 2016
1 parent 5ef6111 commit 94c1d73
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 24 deletions.
Expand Up @@ -24,6 +24,8 @@
import java.text.MessageFormat;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtend.core.xtend.XtendTypeDeclaration;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.resource.XtextResource;
Expand Down Expand Up @@ -72,8 +74,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
MessageFormat.format(Messages.SARLQuickfixProvider_2, actionName),
MessageFormat.format(Messages.SARLQuickfixProvider_3, actionName),
null,
modification);
JavaPluginImages.IMG_CORRECTION_ADD,
modification,
IProposalRelevance.ADD_UNIMPLEMENTED_METHODS);
}
}

Expand Down
Expand Up @@ -22,6 +22,8 @@
package io.sarl.lang.ui.quickfix.acceptors;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -52,8 +54,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
Messages.SARLQuickfixProvider_0,
Messages.SARLQuickfixProvider_4,
null,
modification);
JavaPluginImages.IMG_CORRECTION_REMOVE,
modification,
IProposalRelevance.REMOVE_METHOD_BODY);
}

@Override
Expand Down
Expand Up @@ -22,6 +22,8 @@
package io.sarl.lang.ui.quickfix.acceptors;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -60,8 +62,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
Messages.SARLQuickfixProvider_0,
Messages.SARLQuickfixProvider_5,
null,
modification);
JavaPluginImages.IMG_CORRECTION_REMOVE,
modification,
IProposalRelevance.REMOVE_ARGUMENTS);
}

@Override
Expand Down
Expand Up @@ -25,6 +25,8 @@

import com.google.common.base.Strings;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -107,8 +109,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
msg,
Messages.SARLQuickfixProvider_7,
null,
modification);
JavaPluginImages.IMG_CORRECTION_REMOVE,
modification,
IProposalRelevance.REMOVE_REDUNDANT_SUPER_INTERFACE);
}

@Override
Expand Down
Expand Up @@ -22,6 +22,8 @@
package io.sarl.lang.ui.quickfix.acceptors;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -60,8 +62,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
Messages.SARLQuickfixProvider_0,
Messages.SARLQuickfixProvider_8,
null,
modification);
JavaPluginImages.IMG_CORRECTION_REMOVE,
modification,
IProposalRelevance.REMOVE_EXCEPTIONS);
}

@Override
Expand Down
Expand Up @@ -25,6 +25,7 @@

import com.google.common.base.Strings;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -107,7 +108,7 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
msg,
Messages.SARLQuickfixProvider_9,
null,
JavaPluginImages.IMG_CORRECTION_REMOVE,
modification);
}

Expand Down
Expand Up @@ -22,6 +22,8 @@
package io.sarl.lang.ui.quickfix.acceptors;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtend.core.xtend.XtendMember;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -71,8 +73,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
Messages.SARLQuickfixProvider_0,
Messages.SARLQuickfixProvider_10,
null,
modification);
JavaPluginImages.IMG_CORRECTION_REMOVE,
modification,
IProposalRelevance.REMOVE_METHOD_BODY);
}

/** Create the quick fix if needed.
Expand Down
Expand Up @@ -24,6 +24,8 @@
import java.text.MessageFormat;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
import org.eclipse.xtext.validation.Issue;
Expand Down Expand Up @@ -65,8 +67,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
msg,
MessageFormat.format(Messages.SARLQuickfixProvider_12, newName),
null,
modification);
JavaPluginImages.IMG_CORRECTION_RENAME,
modification,
IProposalRelevance.RENAME_REFACTORING);
}
}

Expand Down
Expand Up @@ -31,6 +31,8 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtend.core.xtend.XtendTypeDeclaration;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.common.types.JvmAnnotationReference;
Expand Down Expand Up @@ -107,8 +109,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
issue,
label,
label,
null,
modification);
JavaPluginImages.IMG_CORRECTION_ADD,
modification,
IProposalRelevance.ADD_UNIMPLEMENTED_METHODS);
}
}

Expand Down
Expand Up @@ -26,6 +26,7 @@
import java.util.Map.Entry;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
import org.eclipse.xtext.validation.Issue;
Expand Down Expand Up @@ -60,7 +61,7 @@ public MultiModification(SARLQuickfixProvider provider, Issue issue, IssueResolu
issue,
label,
description,
null,
JavaPluginImages.IMG_CORRECTION_MULTI_FIX,
this);
}

Expand Down
Expand Up @@ -24,6 +24,8 @@
import java.text.MessageFormat;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtend.core.xtend.XtendExecutable;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.nodemodel.ICompositeNode;
Expand Down Expand Up @@ -70,8 +72,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
MessageFormat.format(Messages.SARLQuickfixProvider_13, expectedType),
Messages.SARLQuickfixProvider_14,
null,
modification);
JavaPluginImages.IMG_CORRECTION_ADD,
modification,
IProposalRelevance.CHANGE_RETURN_TYPE);
}
}

Expand Down
Expand Up @@ -24,6 +24,8 @@
import java.text.MessageFormat;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -65,8 +67,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
MessageFormat.format(Messages.SARLQuickfixProvider_15, expectedType),
Messages.SARLQuickfixProvider_16,
null,
modification);
JavaPluginImages.IMG_CORRECTION_CHANGE,
modification,
IProposalRelevance.CHANGE_RETURN_TYPE);
}
}

Expand Down
Expand Up @@ -22,6 +22,8 @@
package io.sarl.lang.ui.quickfix.acceptors;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor;
Expand Down Expand Up @@ -60,8 +62,9 @@ public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResol
acceptor.accept(issue,
Messages.SARLQuickfixProvider_0,
Messages.SARLQuickfixProvider_17,
null,
modification);
JavaPluginImages.IMG_CORRECTION_REMOVE,
modification,
IProposalRelevance.REMOVE_REDUNDANT_SUPER_INTERFACE);
}

@Override
Expand Down

0 comments on commit 94c1d73

Please sign in to comment.