Package com.dubture.symfony.ui.contentassist

Source Code of com.dubture.symfony.ui.contentassist.EmptyCompletionProposal

/*******************************************************************************
* This file is part of the Symfony eclipse plugin.
*
* (c) Robert Gruendler <r.gruendler@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
******************************************************************************/
package com.dubture.symfony.ui.contentassist;

import org.eclipse.dltk.ui.text.completion.ScriptCompletionProposal;
import org.eclipse.php.internal.ui.editor.contentassist.PHPCompletionProposal;
import org.eclipse.swt.graphics.Image;

import com.dubture.symfony.core.model.Service;


/**
* A {@link ScriptCompletionProposal} for Symfony routes.
*
*
*
* @author "Robert Gruendler <r.gruendler@gmail.com>"
*
*/
@SuppressWarnings("restriction")
public class EmptyCompletionProposal extends PHPCompletionProposal {

  public EmptyCompletionProposal(String replacementString,
      int replacementOffset, int replacementLength, Image image,
      String displayString, int relevance) {
    super(replacementString, replacementOffset, replacementLength, image,
        displayString, relevance);

  }
   
 
  @Override
  public String getAdditionalProposalInfo() {

    return ""
 
  }
 
 
  @Override
  public String getReplacementString() {

    if (getModelElement() instanceof Service) {
     
      Service service = (Service) getModelElement();
     
      if (service.getId() != null)
        return service.getId();     
     
    }
   
    return super.getReplacementString();
  }
 
}
TOP

Related Classes of com.dubture.symfony.ui.contentassist.EmptyCompletionProposal

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.