2011-10-18 15 views
1

私は簡単な質問がありますが、自分で解決できませんでした。CompletionProcessor Eclipse Plugin - エディタの実際の値を置き換えます

私はEclipseプラグインを作成しました。これはCompletionProcessor(intelisense assitant)を持つエディタです。このアシスタントは、辞書を考慮してフレーズのセットを取得します。私は、エディタで「ワード例」を書き、アシスタントが「例としてWordを」提案した場合

事がある私は私のアシスタントから取得した値のため私の実際の値を置き換えるしたいと思います。私は私のエディタで、そのオプションを選ぶとき

は、私は次のような何かを得る実際に要約する:

"word example Word as an Example" 

そして、私はちょうど取得したいと思います:

"Word as an Example" 

任意のアイデアを?私が使用している

クラスは、次のとおりです。

org.eclipse.jface.text.contentassist.CompletionProposal; 
org.eclipse.jface.text.contentassist.ICompletionProposal; 
org.eclipse.jface.text.contentassist.IContentAssistProcessor; 
org.eclipse.jface.text.contentassist.IContextInformation; 
org.eclipse.jface.text.contentassist.IContextInformationValidator; 

答えて

1

私はつもりは自分の質問に答えて:)です。

はあなたが完了提案の次のコンストラクタを使用する必要があり、この解決するために:あなたは、その引数の2つですreplacementOffsetとreplacementLengthを見ることができるように

http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/text/contentassist/CompletionProposal.html#CompletionProposal(java.lang.String,%20int,%20int,%20int,%20org.eclipse.swt.graphics.Image,%20java.lang.String,%20org.eclipse.jface.text.contentassist.IContextInformation,%20java.lang.String

を、これらの指標は、交換を開始しており、長さ自体。

関連する問題