Example usage for org.springframework.ide.eclipse.beans.ui BeansUIImages IMG_OBJS_PROPERTY

List of usage examples for org.springframework.ide.eclipse.beans.ui BeansUIImages IMG_OBJS_PROPERTY

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.beans.ui BeansUIImages IMG_OBJS_PROPERTY.

Prototype

String IMG_OBJS_PROPERTY

To view the source code for org.springframework.ide.eclipse.beans.ui BeansUIImages IMG_OBJS_PROPERTY.

Click Source Link

Usage

From source file:org.dozer.eclipse.plugin.sourcepage.util.DozerPluginUtils.java

public static void createMethodProposal(ContentAssistRequest request, IMethod method, String prefix) {
    try {//w  ww  .  j  a  v  a2  s  .  c o m
        String[] parameterNames = method.getParameterNames();
        String[] parameterTypes = JdtUtils.getParameterTypesString(method);
        String propertyName = JdtUtils.getPropertyNameFromMethodName(method);

        String replaceText = prefix + propertyName;

        StringBuilder buf = new StringBuilder();
        buf.append(propertyName);
        buf.append(" - ");
        buf.append(method.getParent().getElementName());
        buf.append('.');
        buf.append(method.getElementName());
        buf.append('(');
        buf.append(parameterTypes[0]);
        buf.append(' ');
        buf.append(parameterNames[0]);
        buf.append(')');
        String displayText = buf.toString();

        Image image = BeansUIImages.getImage(BeansUIImages.IMG_OBJS_PROPERTY);

        BeansJavaCompletionProposal proposal = new BeansJavaCompletionProposal(replaceText,
                request.getReplacementBeginPosition(), request.getReplacementLength(), replaceText.length(),
                image, displayText, null, 0, method);
        request.addProposal(proposal);
    } catch (JavaModelException e) {
        // do nothing
    }
}