Ignore:
Timestamp:
01/26/06 15:36:27 (19 years ago)
Author:
boris
Message:
  • added an abstraction around modelica nested lists and updated relevant methods to use it instead of the old Collection<Object> way
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/editor/ModelicaCompletionProcessor.java

    r273 r287  
    5656import org.eclipse.jface.text.contentassist.IContextInformationValidator;
    5757import org.modelica.mdt.core.CompilerProxy;
     58import org.modelica.mdt.core.Element;
     59import org.modelica.mdt.core.List;
     60import org.modelica.mdt.core.ListElement;
    5861import org.modelica.mdt.core.compiler.CompilerException;
    5962import org.modelica.mdt.core.compiler.ConnectException;
     
    8184     * proposals. This allows us to backtrace the proposals.
    8285     */
    83     Vector<Object> narrowedProposals = new Vector<Object>();
    84     Vector<Object> proposals = new Vector<Object>();
     86    List narrowedProposals = new List();
     87    List proposals = new List();
    8588    int typeAhead = 0;
    8689
     
    155158    {
    156159        if(proposals != null)
     160        {
    157161            proposals.clear();
     162        }
    158163        else
    159             proposals = new Vector<Object>();
     164        {
     165            proposals = new List();
     166        }
    160167        if(narrowedProposals != null)
     168        {
    161169            narrowedProposals.clear();
     170        }
    162171        else
    163             narrowedProposals = new Vector<Object>();
     172        {
     173            narrowedProposals = new List();
     174        }
    164175       
    165176        typeAhead = 0;
     
    180191        {
    181192            if(proposals != null)
     193            {
    182194                narrowedProposals.addAll(proposals);
     195            }
    183196        }
    184197    }
     
    198211        narrowedProposals.clear();
    199212       
    200         for(Object proposedClass : proposals)
    201         {
    202             if(((String)proposedClass).startsWith(classPrefix))
    203             {
    204                 narrowedProposals.add(proposedClass);
     213        for (ListElement proposedClass : proposals)
     214        {
     215            if (((Element)proposedClass).toString().startsWith(classPrefix))
     216            {
     217                narrowedProposals.append(proposedClass);
    205218            }
    206219        }
     
    275288        outputParameters.clear();
    276289       
    277         Vector<Object> elementsInfo = new Vector<Object>(0);
     290        List elementsInfo;
    278291       
    279292        try
     
    302315            boolean elementNamesFound = false;
    303316            boolean typenameFound = false;
    304             Vector names = new Vector(0);
     317            List names = new List();
    305318            String typename = "";
    306319           
     
    355368                    && elementIsInput && elementNamesFound && typenameFound)
    356369            {
    357                 inputParameters.add(typename + " " + (String)names.get(0));
     370                inputParameters.add(typename + " " + names.elementAt(0).toString());
    358371            }
    359372            else if(elementIsPublic && elementIsComponent
    360373                    && elementIsOutput && elementNamesFound && typenameFound)
    361374            {
    362                 outputParameters.add(typename + " " + (String)names.get(0));
    363                
     375                outputParameters.add(typename + " " + names.elementAt(0).toString());
    364376            }
    365377        }
     
    401413        for(int i = 0;i < narrowedProposals.size();i++)
    402414        {
    403             String proposal = (String)narrowedProposals.get(i);
     415            String proposal = narrowedProposals.elementAt(i).toString();
    404416            completionProposals[i] =
    405417                new CompletionProposal(proposal, offset - typeAhead, typeAhead,
Note: See TracChangeset for help on using the changeset viewer.