Ignore:
Timestamp:
10/25/05 11:49:11 (19 years ago)
Author:
boris
Message:
  • you can now click in the plus thingie on the packages and see classes also
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt/src/org/modelica/mdt/ModelicaElementContentProvider.java

    r83 r88  
    5050import org.modelica.mdt.core.IModelicaProject;
    5151import org.modelica.mdt.core.IModelicaRoot;
     52import org.modelica.mdt.core.IParent;
    5253
    5354/**
     
    7778    public void dispose()
    7879    {
     80        System.out.println("disposed " + ModelicaElementContentProvider.class);
    7981    }
    8082
    8183    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
    8284    {
     85        System.out.println("input changed " + ModelicaElementContentProvider.class);
    8386    }
    8487
     
    99102        {
    100103            IModelicaProject mp = (IModelicaProject)parent;
    101             return concatenate(mp.getPackages(), mp.getClasses());
     104            return MdtPlugin.concatenate(mp.getPackages(), mp.getClasses());
     105        }
     106        else if (parent instanceof IParent)
     107        {
     108            System.out.println("get children of " + parent);
     109            Object[] ch = ((IParent)parent).getChildren();
     110            for (Object ob : ch)
     111            {
     112                System.out.println("got " + ob.getClass());
     113            }
     114           
     115            return ch;
     116            //return ((IParent)parent).getChildren();
    102117        }
    103118        return null;
     
    106121    public Object getParent(Object element)
    107122    {
     123        System.out.println("get parent " + ModelicaElementContentProvider.class);
    108124        return null;
    109125    }
     
    123139            return ((IModelicaProject)element).getProject().isOpen();
    124140        }
     141        else if (element instanceof IParent)
     142        {
     143            return true;
     144        }
    125145        return false;
    126146    }
    127 
    128     /**
    129      * Note: This method is for internal use only. Clients should not call this method.
    130      */
    131     protected static Object[] concatenate(Object[] a1, Object[] a2) {
    132         int a1Len= a1.length;
    133         int a2Len= a2.length;
    134         Object[] res= new Object[a1Len + a2Len];
    135         System.arraycopy(a1, 0, res, 0, a1Len);
    136         System.arraycopy(a2, 0, res, a1Len, a2Len);
    137         return res;
    138     }
    139 
    140147}
Note: See TracChangeset for help on using the changeset viewer.