/******************************************************************************* * Copyright (c) 2008 Red Hat, Inc. * Distributed under license by Red Hat, Inc. All rights reserved. * This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ package org.jboss.tools.smooks.configuration.editors.utils; import java.lang.reflect.Method; import org.eclipse.jface.fieldassist.IContentProposal; /** * @author Dart (dpeng@redhat.com) * */ public class SetterMethodContentProposal implements IContentProposal { private String content = null; public SetterMethodContentProposal(Method method){ content = method.getName(); } /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getContent() */ public String getContent() { return content; } /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getCursorPosition() */ public int getCursorPosition() { if(content != null){ return content.length(); } return 0; } /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getDescription() */ public String getDescription() { return null; } /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getLabel() */ public String getLabel() { return content; } }