-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#48 [v2.0] add content assist to tool / presets definition
- implemented simple content assist - disabled variables info and converters group Signed-off-by: Andre Bossert <[email protected]>
- Loading branch information
Showing
3 changed files
with
205 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...de/anbos/eclipse/easyshell/plugin/preferences/CommandVariableContentProposalProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2014 - 2016 Andre Bossert. | ||
* All rights reserved. This program and the accompanying materials | ||
* are 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: | ||
* Andre Bossert - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
|
||
package de.anbos.eclipse.easyshell.plugin.preferences; | ||
|
||
import java.util.Map; | ||
|
||
import org.eclipse.jface.fieldassist.ContentProposal; | ||
import org.eclipse.jface.fieldassist.IContentProposal; | ||
import org.eclipse.jface.fieldassist.IContentProposalProvider; | ||
|
||
public class CommandVariableContentProposalProvider implements IContentProposalProvider { | ||
|
||
private ContentProposal[] contentProposals; | ||
|
||
public CommandVariableContentProposalProvider(Map<String, String> proposals) { | ||
setProposals(proposals); | ||
} | ||
|
||
@Override | ||
public IContentProposal[] getProposals(String contents, int position) { | ||
return contentProposals; | ||
} | ||
|
||
private void setProposals(Map<String, String> proposals) { | ||
contentProposals = new ContentProposal[proposals.size()]; | ||
int i = 0; | ||
for (Map.Entry<String, String> entry : proposals.entrySet()) | ||
{ | ||
ContentProposal proposal = new ContentProposal(entry.getKey(), entry.getValue()); | ||
contentProposals[i++] = proposal; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters