Package edit.VMAD

Source Code of edit.VMAD.ScriptCountHolder

package edit.VMAD;

import skyproc.MajorRecord;
import skyproc.ScriptPackage;
import skyproc.Type;
import skyproc.exceptions.NotFound;
import edit.HolderInterface;
import edit.StaticRecordHolder;

public class ScriptCountHolder implements HolderInterface {

  @Override
  public String getDescription() {
    // TODO Auto-generated method stub
    return "Script Count";
  }

  @Override
  public Object getValueAt(int index) {

    MajorRecord tempRecord = null;
    try {
      tempRecord = StaticRecordHolder.getMasters().get(index).getRecord(StaticRecordHolder.getRecord().getForm());
     
      ScriptPackage sp = (ScriptPackage) tempRecord.getSubRecords().get(Type.VMAD);
     
      return sp.getScripts().size();
    } catch (NotFound e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
   
    return null;
  }

  @Override
  public boolean isLeaf() {
    // TODO Auto-generated method stub
    return true;
  }

  @Override
  public Object getChild(Object parent, int index) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public int getChildCount() {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public int getIndexOfChild(Object parent, Object child) {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public Object getHeldObject() {
    // TODO Auto-generated method stub
    return null;
  }

}
TOP

Related Classes of edit.VMAD.ScriptCountHolder

TOP
Copyright © 2018 www.massapi.com. 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.