Package de.innovationgate.eclipse.editors.helpers

Examples of de.innovationgate.eclipse.editors.helpers.ContextInformation


              String display = attName;
              StringBuffer replacement = new StringBuffer();
              replacement.append(attName);
              replacement.append("=\"\"");
              int cursorPosAfterReplace = replacement.toString().length() - 1;
              ContextInformation contextInfo = Plugin.getDefault().getContextInformationProvider().getAttributeInformation(tag.getName(), attrib.getName(), activeFile);
              proposals.add(new TMLCompletionProposal(replacement.toString(), _cursorAbsolute - typed.length(), typed.length(), cursorPosAfterReplace, null, display, contextInfo));
            }
          }
        }
      }
    } else if (getAttributeNameOfValueCursorPosition() != null) {
      // create attribute value proposals
      String attribute = getAttributeNameOfValueCursorPosition();
      String search = _content.substring(0, _cursorRelative);
      int attributeValueStartPos = searchBackwards("\"", search, "=");
      String typed = "";
      if (attributeValueStartPos != -1) {
        typed = _content.substring(attributeValueStartPos + 1, _cursorRelative)
      } else {
        typed = "";
      }     
      TMLTag tag = TMLTagDefinitions.getInstance(WGADesignStructureHelper.getWGAVersionCompliance(activeFile)).getTagByName(getTagName());
      if (tag != null) {
          TMLTagAttribute tagAttribute = tag.getAttribute(attribute);
          if (tagAttribute != null) {
              if (tagAttribute.isTmlscriptExpression()) {
                  // perform tmlscript code completion
                  try {
                            IRegion region = getAttributeValueRegion(attribute);
                            TMLScriptRegion tmlScriptRegion = TMLScriptRegion.parse(region, _document, _cursorAbsolute, WGADesignStructureHelper.getWGAVersionCompliance(activeFile));
                            proposals.addAll(tmlScriptRegion.createProposals());
                        }
                        catch (BadLocationException e) {
                        }
              } else {
                  // lookup attribute values
                    Iterator<String> values = tag.getAttributeValuesByPrefix(attribute, typed, _document, this, viewer, activeFile).iterator();
                    while (values.hasNext()) {
                        String value = values.next();
                        String display = value;
                        StringBuffer replacement = new StringBuffer();
                        replacement.append(value);
                        int cursorPosAfterReplace = replacement.toString().length() + 1;
                        ContextInformation info = Plugin.getDefault().getContextInformationProvider().getAttributeInformation(tag.getName(), attribute, value,activeFile);
          proposals.add(new TMLCompletionProposal(replacement.toString(), _cursorAbsolute - typed.length(), typed.length(), cursorPosAfterReplace, null, display, info));
                    }                 
              }
          }         
      }
View Full Code Here


    List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
   
    if (tag != null && !tag.isDeprecated()) {
   
//        String tagDescription = null;
        ContextInformation info = Plugin.getDefault().getContextInformationProvider().getTagInformation(tag.getName(), file);
//        if (info != null) {
//          tagDescription = info.getInformation();
//        }
   
        //String display = "<tml:" + tagName + "/>";
View Full Code Here

TOP

Related Classes of de.innovationgate.eclipse.editors.helpers.ContextInformation

Copyright © 2018 www.massapicom. 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.