示例#1
0
 public static String getProjectName(final Project p) {
   if (p == null) {
     return null;
   }
   ProjectInformation pi = ProjectUtils.getInformation(p);
   return pi == null ? null : pi.getDisplayName();
 }
示例#2
0
  private File getFileToRender() throws IOException {
    FileObject render = toRender;
    if (render == null) {
      PovrayProject proj = renderService.getProject();
      MainFileProvider provider =
          (MainFileProvider) proj.getLookup().lookup(MainFileProvider.class);
      if (provider == null) {
        throw new IllegalStateException("Main file provider missing");
      }
      render = provider.getMainFile();
      if (render == null) {
        ProjectInformation info =
            (ProjectInformation) proj.getLookup().lookup(ProjectInformation.class);

        // XXX let the user choose
        throw new IOException(
            NbBundle.getMessage(Povray.class, "MSG_NoMainFile", info.getDisplayName()));
      }
    }
    assert render != null;
    File result = FileUtil.toFile(render);
    if (result == null) {
      throw new IOException(NbBundle.getMessage(Povray.class, "MSG_VirtualFile", render.getName()));
    }
    assert result.exists();
    assert result.isFile();
    return result;
  }
 private void initProjectInfo() {
   Project p = FileOwnerQuery.getOwner(fileObject);
   if (p != null) {
     ProjectInformation pi = ProjectUtils.getInformation(p);
     projectName = pi.getDisplayName();
     projectIcon = pi.getIcon();
   }
 }
  public static String GetProjectName(Project p) {

    if (p != null) {
      ProjectInformation info = p.getLookup().lookup(ProjectInformation.class);
      return info.getDisplayName();
    }
    return null;
  }