Commit bf7ccf91 authored by Simon Barner's avatar Simon Barner
Browse files

YELLOW

parent bde4eddf
AnnotationConfiguration.java 088cabbbcb9229685e1ffb2dcc34b83e05c0461a GREEN
AnnotationHover.java 358cf5c6da186c300662c5132bc0e8c6e20b7ca8 GREEN
AnnotationMarkerAccess.java f0fdeb10d89a3611249f5334ea76e518baca710f GREEN
CodeEditorConfiguration.java 33a6316f9a589745b3c0b66fa3bada5191368156 RED
CodeEditorConfiguration.java 9cb9c322925d0e38f28300d99c64391b9f64db4a YELLOW
ErrorAnnotation.java a7ec0ad49bb7965c79e99d15844d8a3377572025 GREEN
UndoRedo.java 7009ef378aafc33f1fb8e4c94227e9104ded7ce3 GREEN
......@@ -24,6 +24,7 @@ import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.get
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getPrimitiveTypes;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getPrimitiveValues;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getUsefulExpressions;
import static org.fortiss.tooling.base.ui.fieldassist.FieldAssistImageRegistry.getIcon;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import java.util.ArrayList;
......@@ -59,10 +60,9 @@ import org.eclipse.swt.graphics.Color;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.ui.editor.CodeSpecificationEditor;
import org.fortiss.af3.component.ui.utils.CodeUtils;
import org.fortiss.tooling.base.ui.fieldassist.FieldAssistImageRegistry;
/**
* Class responsible for proper configuration of the code specification editor.
* Class responsible for proper configuration of the {@link CodeSpecificationEditor}.
*
* @author doebber
*/
......@@ -127,6 +127,10 @@ public class CodeEditorConfiguration extends SourceViewerConfiguration {
ContentAssistant assistant = new ContentAssistant();
IContentAssistProcessor proc = new IContentAssistProcessor() {
/** Characters that automatically trigger the presentation of possible completions. */
private final String PROPOSAL_AUTO_ACTIVIATION_LETTERS =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
/** {@inheritDoc} */
@Override
public String getErrorMessage() {
......@@ -151,8 +155,7 @@ public class CodeEditorConfiguration extends SourceViewerConfiguration {
/** {@inheritDoc} */
@Override
public char[] getCompletionProposalAutoActivationCharacters() {
String allLetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
return allLetters.toCharArray();
return PROPOSAL_AUTO_ACTIVIATION_LETTERS.toCharArray();
}
/** {@inheritDoc} */
......@@ -178,9 +181,9 @@ public class CodeEditorConfiguration extends SourceViewerConfiguration {
viewer.getDocument().get(currentWordRegion.getOffset(),
currentWordRegion.getLength());
// TODO(VA) You could store into a variable instead of calling twice
ArrayList<String> prop = getInputPortNames(getAssociatedComponent());
prop.addAll(getOutputPortNames(getAssociatedComponent()));
Component associatedComponent = getAssociatedComponent();
ArrayList<String> prop = getInputPortNames(associatedComponent);
prop.addAll(getOutputPortNames(associatedComponent));
prop.addAll(getFunctions(editor.getEditedObject()));
prop.addAll(getAllConstructors(editor.getEditedObject(), true));
prop.addAll(getPrimitiveValues());
......@@ -190,8 +193,7 @@ public class CodeEditorConfiguration extends SourceViewerConfiguration {
if(proposal.toLowerCase().startsWith(currentWord.toLowerCase())) {
proposalList.add(new CompletionProposal(proposal, currentWordRegion
.getOffset(), currentWordRegion.getLength(), proposal
.length(), FieldAssistImageRegistry.getIcon(proposal),
null, null, null));
.length(), getIcon(proposal), null, null, null));
}
}
......@@ -232,9 +234,9 @@ public class CodeEditorConfiguration extends SourceViewerConfiguration {
final IToken portToken = new Token(new TextAttribute(null, null, SWT.BOLD));
final IToken dataElementToken = new Token(new TextAttribute(DARK_BLUE, null, SWT.ITALIC));
// TODO(VA) You could store into a variable instead of calling twice
ArrayList<String> ports = getInputPortNames(getAssociatedComponent());
ports.addAll(getOutputPortNames(getAssociatedComponent()));
Component associatedComponent = getAssociatedComponent();
ArrayList<String> ports = getInputPortNames(associatedComponent);
ports.addAll(getOutputPortNames(associatedComponent));
addWordsToRule(ports, portsRule, portToken);
ArrayList<String> dataelements = getFunctions(editor.getEditedObject());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment