X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Fassist%2FSCLContentProposal.java;h=3d837aacef126286ecd742668a0e3207832abb6b;hb=refs%2Fchanges%2F84%2F2484%2F12;hp=f111780330419403d38ca56b1fcdfafb3fe6be24;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/assist/SCLContentProposal.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/assist/SCLContentProposal.java index f11178033..3d837aace 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/assist/SCLContentProposal.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/assist/SCLContentProposal.java @@ -1,55 +1,55 @@ -package org.simantics.scl.ui.assist; - -import org.eclipse.jface.fieldassist.IContentProposal; -import org.simantics.scl.compiler.common.names.Name; -import org.simantics.scl.compiler.elaboration.modules.SCLValue; -import org.simantics.scl.compiler.types.Type; - -public class SCLContentProposal implements IContentProposal { - - private final String content; - private final String name; - private final String module; - private final Type type; - private final String documentation; - - public SCLContentProposal(SCLValue value) { - Name n = value.getName(); - this.name = n.name; - this.module = n.module; -// this.content = name.substring(prefixLength-namespaceLength); - this.content = name; - this.type = value.getType(); - this.documentation = value.getDocumentation(); - } - - public SCLContentProposal(String name, String module, Type type) { - this.name = name; - this.module = module; -// this.content = name.substring(prefixLength-namespaceLength); - this.content = name; - this.type = type; - this.documentation = null; - } - - @Override - public String getContent() { - return content; - } - - @Override - public int getCursorPosition() { - return content.length(); - } - - @Override - public String getLabel() { - return name + " :: " + type + " (" + module + ")"; - } - - @Override - public String getDescription() { - return documentation; - } - -} +package org.simantics.scl.ui.assist; + +import org.eclipse.jface.fieldassist.IContentProposal; +import org.simantics.scl.compiler.common.names.Name; +import org.simantics.scl.compiler.elaboration.modules.SCLValue; +import org.simantics.scl.compiler.types.Type; + +public class SCLContentProposal implements IContentProposal { + + private final String content; + private final String name; + private final String module; + private final Type type; + private final String documentation; + + public SCLContentProposal(SCLValue value) { + Name n = value.getName(); + this.name = n.name; + this.module = n.module; +// this.content = name.substring(prefixLength-namespaceLength); + this.content = name; + this.type = value.getType(); + this.documentation = value.getDocumentation(); + } + + public SCLContentProposal(String name, String module, Type type) { + this.name = name; + this.module = module; +// this.content = name.substring(prefixLength-namespaceLength); + this.content = name; + this.type = type; + this.documentation = null; + } + + @Override + public String getContent() { + return content; + } + + @Override + public int getCursorPosition() { + return content.length(); + } + + @Override + public String getLabel() { + return name + " :: " + type + " (" + module + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + + @Override + public String getDescription() { + return documentation; + } + +}