org.apache.tools.ant.Project.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.apache.tools.ant.Project.getName()方法的一些代码示例,展示了Project.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getName()方法的具体详情如下:
包路径:org.apache.tools.ant.Project
类名称:Project
方法名:getName

Project.getName介绍

[英]Return the project name, if one has been set.
[中]返回项目名称(如果已设置)。

代码示例

代码示例来源:origin: org.apache.ant/ant

/**
   * Get the project name or null
   * @param event the event
   * @return the project that raised this event
   * @since Ant1.7.1
   */
  protected String extractProjectName(BuildEvent event) {
    Project project = event.getProject();
    return (project != null) ? project.getName() : null;
  }
}

代码示例来源:origin: Ant-Grand/Grand

/**
 * Creates a new graph.
 *
 * @param project
 *            the graph's project.
 */
public AntGraph(final Project project) {
  super(project.getName());
  this.project = project;
}

代码示例来源:origin: dita-ot/dita-ot

/**
   * Get the project name or null
   *
   * @param event the event
   * @return the project that raised this event
   * @since Ant1.7.1
   */
  protected String extractProjectName(final BuildEvent event) {
    final Project project = event.getProject();
    return (project != null) ? project.getName() : null;
  }
}

代码示例来源:origin: randomizedtesting/randomizedtesting

/**
 * Return the project name or the default project name.
 */
private String getProjectName() {
 String pName = Strings.emptyToNull(projectName);
 if (pName == null) { 
  pName = Strings.emptyToNull(junit4.getProject().getName());
 }
 if (pName == null) {
  pName = "(unnamed project)";      
 }
 return pName;
}

代码示例来源:origin: stackoverflow.com

private void populateListView() {
  ArrayAdapter<Project> adapter = new MyListAdapter();
  ListView list = (ListView)findViewById(R.id.listView);
  list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Project proj = mProject.get(position);
        String message = "you clicked on: " + proj.getName();
        Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG).show();

      }
    });
  list.setAdapter(adapter);
}

代码示例来源:origin: stackoverflow.com

List<ProjectObject> list = pm.getProjectObjects();
for(Project po : list){
  System.out.println(po.getKey() + " " + po.getName() + " " + getDescription()); 
}

代码示例来源:origin: stackoverflow.com

private void populateListView() {
ArrayAdapter<Project> adapter = new MyListAdapter();
ListView list = (ListView)findViewById(R.id.listView);
list.setAdapter(adapter);

list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    Project proj = mProject.get(position);
    String message = "you clicked on: " + proj.getName();
    Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG).show();

  }
});
}

代码示例来源:origin: stackoverflow.com

c.appendChild(doc.createTextNode(entity.getName()));
a.appendChild(c);

代码示例来源:origin: com.carrotsearch.randomizedtesting/junit4-ant

/**
 * Return the project name or the default project name.
 */
private String getProjectName() {
 String pName = Strings.emptyToNull(projectName);
 if (pName == null) { 
  pName = Strings.emptyToNull(junit4.getProject().getName());
 }
 if (pName == null) {
  pName = "(unnamed project)";      
 }
 return pName;
}

代码示例来源:origin: stackoverflow.com

public void insert(Project entity) {
  Project pr = new Project();
  pr.setName("pr1");
  //-Create a Layer-
  Layer testLayer = new Layer();
  testLayer.setIdLayer(1);
  testLayer.setLayerName("Layer 1");
  //Add that layer to your Project's list by first getting it and then calling add method on it.
  pr.getLayer().add(testLayer);
  try {
    JAXBContext jc = JAXBContext.newInstance(Project.class);
    javax.xml.bind.Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty(marshaller.JAXB_FORMATTED_OUTPUT,
        Boolean.TRUE);
    File XMLfile = new File("Projects" + "//" + pr.getName() + "//" +"ProjectDataBase.xml");
    marshaller.marshal(pr, XMLfile);
  } catch (JAXBException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: org.apache.ant/ant-commons-logging

/** {@inheritDoc}. */
@Override
public void buildFinished(final BuildEvent event) {
  if (initialized) {
    final Log log = getLog(PROJECT_LOG, event.getProject().getName());
    if (event.getException() == null) {
      realLog(log, "Build finished.", Project.MSG_INFO, null);
    } else {
      realLog(log, "Build finished with error.", Project.MSG_ERR,
          event.getException());
    }
  }
}

代码示例来源:origin: net.sf.antenna/antenna

StringBuffer s = new StringBuffer("Antenna " + ANTENNA_VERSION + " initialized for project \"" + project.getName()
    + "\"");
while (s.length() < 58)

代码示例来源:origin: org.apache.ant/ant-commons-logging

if (categoryObject == null) {
  categoryString = PROJECT_LOG;
  categoryDetail = event.getProject().getName();
} else {
  categoryString = TARGET_LOG;

代码示例来源:origin: net.sf.antenna/antenna

StringBuffer t0 = new StringBuffer("RAPC Ant Task v0.1 initialized for project \"" + getProject().getName() + "\"");
while (t0.length() < 58) t0.append(' ');
StringBuffer t1 = new StringBuffer("Ant task by C. Enrique Ortiz, eortiz@j2medeveloper.com");

代码示例来源:origin: com.mattbertolini/jxr-ant

this.windowTitle = new StringResource(this.getProject(), String.format(DEFAULT_WINDOW_TITLE, this.getProject().getName()));
this.docTitle = new StringResource(this.getProject(), String.format(DEFAULT_DOC_TITLE, this.getProject().getName()));

相关文章