public static void open(File f) {
    FileObject fob = FileUtil.toFileObject(FileUtil.normalizeFile(f));
    if (fob == null) return;

    try {
      // the process succeeded
      DataObject dob = DataObject.find(fob);
      if (f.getName().toLowerCase().endsWith(".properties")) // NOI18N
      {
        EditCookie oc = dob.getCookie(EditCookie.class);
        if (oc != null) oc.edit();
      } else {
        OpenCookie oc = dob.getCookie(OpenCookie.class);
        if (oc != null) oc.open();
      }

    } catch (DataObjectNotFoundException ex) {
      ErrorManager.getDefault().notify(ex);
    }
  }
  /*
   * Method open project
   *
   */
  public void testOpenProject() throws Exception {
    File projectDir = new File(getDataDir(), "projects/" + Utils.EJB_PROJECT_NAME);
    project = (Project) J2eeProjectSupport.openProject(projectDir);
    assertNotNull("Project is null.", project);
    Thread.sleep(1000);

    EjbJarProject ejbJarProject = (EjbJarProject) project;
    ddFo = ejbJarProject.getAPIEjbJar().getDeploymentDescriptor(); // deployment descriptor
    assertNotNull("ejb-jar.xml FileObject is null.", ddFo);

    ddObj = (EjbJarMultiViewDataObject) DataObject.find(ddFo); // MultiView Editor
    assertNotNull("MultiViewDO is null.", ddObj);

    EditCookie edit = (EditCookie) ddObj.getCookie(EditCookie.class);
    edit.edit();
    Thread.sleep(1000);

    // select CustomerBean
    EnterpriseBeans beans = DDProvider.getDefault().getDDRoot(ddFo).getEnterpriseBeans();
    bean = (Entity) beans.findBeanByName(EnterpriseBeans.ENTITY, Ejb.EJB_NAME, "CustomerBean");

    ddObj.showElement(bean); // open visual editor
    Utils.waitForAWTDispatchThread();
  }