Package no.hal.jex.resource

Examples of no.hal.jex.resource.JexResource


  public Image getImage(Object obj) {
    String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
    Boolean childrenSatisfied = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getChildrenSatisfied() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      if (ex != null) {
        return getImage(ex);
      }
      imageKey = ISharedImages.IMG_OBJ_FOLDER;
    } else if (obj instanceof Exercise || obj instanceof ExercisePart) {
View Full Code Here


  }

  private String getBrowserText(Object obj) {
    String text = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getText() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      text = (ex != null ? getBrowserText(ex) : res.getURI().toString());
    } else if (obj instanceof ExercisePart) {
      String partText = "Part " + (((ExercisePart)obj).getParent().getRequirements().indexOf(obj) + 1);
      if (text != null) {
        partText = text + ": " + text;
      }
View Full Code Here

  }
 
  private IFile jexFile = null;
 
  public void run(IAction action) {
    JexResource res = getExerciseResource();
    if (res != null) {
      final JexZipFile zipFile = new JexZipFile(res);
      configureZipFile(zipFile);
      zipFile.addClasses(Boolean.TRUE);
      if (zipFile.prepare()) {
View Full Code Here

    return null;
  }

  public boolean hasChildren(Object parent) {
    if (parent instanceof JexResource) {
      JexResource res = (JexResource) parent;
      if (! res.isLoaded()) {
        return true;
      }
    }
    return getChildCount(parent) > 0;
  }
View Full Code Here

  }
 
  protected String getText(Object obj) {
    String text = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getText() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      text = (ex != null ? getText(ex) : res.getURI().toString());
    } else if (obj instanceof Exercise) {
      Resource res = ((Exercise) obj).eResource();
      String exText = (res != null ? res.getURI().toString() : null);
      if (text != null && exText != null) {
        exText = exText + ": " + text;
      }
      text = exText;
    } else if (obj instanceof ExercisePart) {
View Full Code Here

 
  protected Icon getImage(Object obj) {
    String imageKey = null; // ISharedImages.IMG_OBJ_ELEMENT;
    Boolean childrenSatisfied = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getChildrenSatisfied() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      if (ex != null) {
        return getImage(ex);
      }
      imageKey = FOLDER_IMAGE;
    } else if (obj instanceof Exercise || obj instanceof ExercisePart) {
View Full Code Here

    }
  }

  protected void openJexFile(String name) {
    ResourceSet resourceSet = new ResourceSetImpl();
    JexResource resource = (JexResource) resourceSet.getResource(URI.createFileURI(name), true);
    openExercise(resource.getExercise());
  }
View Full Code Here

TOP

Related Classes of no.hal.jex.resource.JexResource

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.