org.eclipse.jface.text.codemining.ICodeMiningProvider Java Examples

The following examples show how to use org.eclipse.jface.text.codemining.ICodeMiningProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaMethodParameterCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
private JavaMethodParameterCodeMining(ASTNode node, Expression parameter, int parameterIndex, CompilationUnit cu,
		ICodeMiningProvider provider, boolean showName, boolean showType, boolean showParameterByUsingFilters) {
	super(new Position(parameter.getStartPosition(), 1), provider, null);
	this.cu = cu;
	this.node = node;
	this.parameter = parameter;
	this.parameterIndex = parameterIndex;
	this.showName = showName;
	this.showType = showType;
	this.showParameterByUsingFilters = showParameterByUsingFilters;
}
 
Example #2
Source File: AbstractSARLUiModule.java    From sarl with Apache License 2.0 5 votes vote down vote up
public void configureCodeMinding(Binder binder) {
	try {
		Class.forName("org.eclipse.jface.text.codemining.ICodeMiningProvider");
		binder.bind(ICodeMiningProvider.class)
			.to(SARLCodeMiningProvider.class);
		binder.bind(IReconcileStrategyFactory.class).annotatedWith(Names.named("codeMinding"))
			.to(XtextCodeMiningReconcileStrategy.Factory.class);
	} catch(ClassNotFoundException ignore) {
		// no bindings if code mining is not available at runtime
	}
}
 
Example #3
Source File: AbstractArithmeticsUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public void configureCodeMinding(Binder binder) {
	try {
		Class.forName("org.eclipse.jface.text.codemining.ICodeMiningProvider");
		binder.bind(ICodeMiningProvider.class)
			.to(ArithmeticsCodeMiningProvider.class);
		binder.bind(IReconcileStrategyFactory.class).annotatedWith(Names.named("codeMinding"))
			.to(XtextCodeMiningReconcileStrategy.Factory.class);
	} catch(ClassNotFoundException ignore) {
		// no bindings if code mining is not available at runtime
	}
}
 
Example #4
Source File: AbstractDomainmodelUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public void configureCodeMinding(Binder binder) {
	try {
		Class.forName("org.eclipse.jface.text.codemining.ICodeMiningProvider");
		binder.bind(ICodeMiningProvider.class)
			.to(DomainmodelCodeMiningProvider.class);
		binder.bind(IReconcileStrategyFactory.class).annotatedWith(Names.named("codeMinding"))
			.to(XtextCodeMiningReconcileStrategy.Factory.class);
	} catch(ClassNotFoundException ignore) {
		// no bindings if code mining is not available at runtime
	}
}
 
Example #5
Source File: JavaCodeMiningASTVisitor.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
public JavaCodeMiningASTVisitor(CompilationUnit cu, ITextEditor textEditor, ITextViewer viewer,
		List<ICodeMining> minings, ICodeMiningProvider provider) {
	this.cu = cu;
	this.minings = minings;
	this.provider = provider;
	this.textEditor = textEditor;
	this.viewer = viewer;
}
 
Example #6
Source File: EndStatementCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
public EndStatementCodeMining(Statement node, ITextEditor textEditor, ITextViewer viewer, int minLineNumber,
		ICodeMiningProvider provider) {
	super(new Position(node.getStartPosition() + node.getLength(), 1), provider, e -> {
		textEditor.selectAndReveal(node.getStartPosition(), 0);
	});
	String label = getLabel(node, viewer.getDocument(), minLineNumber);
	super.setLabel(label);
}
 
Example #7
Source File: RevisionRecentChangeCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
public RevisionRecentChangeCodeMining(int beforeLineNumber, ILineRange lineRange, IDocument document,
		boolean showAvatar, boolean showDate, ICodeMiningProvider provider, IRevisionRangeProvider rangeProvider)
		throws JavaModelException, BadLocationException {
	super(beforeLineNumber, document, provider);
	this.rangeProvider = rangeProvider;
	this.lineRange = lineRange;
	this.showAvatar = showAvatar;
	this.showDate = showDate;
	if (rangeProvider.isInitialized()) {
		updateLabel();
	}
}
 
Example #8
Source File: JUnitLaunchCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
public JUnitLaunchCodeMining(IJavaElement element, String label, String mode, IDocument document,
		ICodeMiningProvider provider) throws JavaModelException, BadLocationException {
	super(element, document, provider, e -> {
		JUnitLaunchShortcut shortcut = new JUnitLaunchShortcut();
		shortcut.launch(new StructuredSelection(element), mode);
	});
	super.setLabel(label);
}
 
Example #9
Source File: JavaLaunchCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
public JavaLaunchCodeMining(IJavaElement element, String label, String mode, IDocument document,
		ICodeMiningProvider provider) throws JavaModelException, BadLocationException {
	super(element, document, provider, e -> {
		JavaApplicationLaunchShortcut shortcut = new JavaApplicationLaunchShortcut();
		shortcut.launch(new StructuredSelection(element), mode);
	});
	super.setLabel(label);
}
 
Example #10
Source File: RevisionAuthorsCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 5 votes vote down vote up
public RevisionAuthorsCodeMining(int beforeLineNumber, ILineRange lineRange, IDocument document,
		ICodeMiningProvider provider, IRevisionRangeProvider rangeProvider)
		throws JavaModelException, BadLocationException {
	super(beforeLineNumber, document, provider);
	this.lineRange = lineRange;
	this.rangeProvider = rangeProvider;
	if (rangeProvider.isInitialized()) {
		updateLabel();
	}
}
 
Example #11
Source File: JavaMethodParameterCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public JavaMethodParameterCodeMining(ClassInstanceCreation constructor, Expression parameter, int parameterIndex,
		CompilationUnit cu, ICodeMiningProvider provider, boolean showName, boolean showType,
		boolean showParameterByUsingFilters) {
	this((ASTNode) constructor, parameter, parameterIndex, cu, provider, showName, showType,
			showParameterByUsingFilters);
}
 
Example #12
Source File: JavaMethodParameterCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public JavaMethodParameterCodeMining(MethodInvocation method, Expression parameter, int parameterIndex,
		CompilationUnit cu, ICodeMiningProvider provider, boolean showName, boolean showType,
		boolean showParameterByUsingFilters) {
	this((ASTNode) method, parameter, parameterIndex, cu, provider, showName, showType,
			showParameterByUsingFilters);
}
 
Example #13
Source File: AbstractJavaCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public AbstractJavaCodeMining(IJavaElement element, IDocument document, ICodeMiningProvider provider,
		Consumer<MouseEvent> action) throws JavaModelException, BadLocationException {
	super(getLineNumber(element, document), document, provider, action);
	this.element = element;
}
 
Example #14
Source File: JavaVarTypeCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public JavaVarTypeCodeMining(SimpleType node, ITextViewer viewer, ICodeMiningProvider provider) {
	super(new Position(node.getStartPosition() + node.getLength(), 1), provider, null);
	this.node = node;
}
 
Example #15
Source File: JavaReferenceCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public JavaReferenceCodeMining(IJavaElement element, JavaEditor editor, IDocument document,
		ICodeMiningProvider provider, boolean referencesCodeMiningsAtLeastOne)
		throws JavaModelException, BadLocationException {
	super(element, document, provider, e -> new FindReferencesAction(editor).run(element));
	this.referencesCodeMiningsAtLeastOne = referencesCodeMiningsAtLeastOne;
}
 
Example #16
Source File: JavaImplementationCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public JavaImplementationCodeMining(IType element, IDocument document, ICodeMiningProvider provider,
		boolean implementationsCodeMiningsAtLeastOne) throws JavaModelException, BadLocationException {
	super(element, document, provider, null);
	this.implementationsCodeMiningsAtLeastOne = implementationsCodeMiningsAtLeastOne;
}
 
Example #17
Source File: JUnitStatusCodeMining.java    From jdt-codemining with Eclipse Public License 1.0 4 votes vote down vote up
public JUnitStatusCodeMining(IJavaElement element, JUnitStatusRegistry testRegistry, IDocument document,
		ICodeMiningProvider provider) throws JavaModelException, BadLocationException {
	super(element, document, provider, null);
	this.testRegistry = testRegistry;
}