當前位置: 首頁>>代碼示例>>Java>>正文


Java IJavaProject.getElementName方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.IJavaProject.getElementName方法的典型用法代碼示例。如果您正苦於以下問題:Java IJavaProject.getElementName方法的具體用法?Java IJavaProject.getElementName怎麽用?Java IJavaProject.getElementName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.IJavaProject的用法示例。


在下文中一共展示了IJavaProject.getElementName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleProjectButtonSelected

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
/**
 * Here is what happen when the button is selected (Selection of a project)
 */
private void handleProjectButtonSelected() {
	IJavaProject project = GraphWalkerContextManager.chooseGW4EProject(getJavaProject());
	if (project == null) {
		return;
	}

	String projectName = project.getElementName();
	fProjText.setText(projectName);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:13,代碼來源:GW4ELaunchConfigurationTab.java

示例2: handleProjectButtonSelected

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
private void handleProjectButtonSelected() {
	IJavaProject project = chooseJavaProject();
	if (project == null) {
		return;
	}
	String projectName = project.getElementName();
	fProjectText.setText(projectName);

}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:10,代碼來源:GW4ELaunchConfigurationTab.java

示例3: getClassFilesLocation

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
/**
 * @param javaProject
 * @return
 * @throws JavaModelException
 */
protected String getClassFilesLocation(IJavaProject javaProject) throws JavaModelException {
	String path = javaProject.getOutputLocation().toString();
	IResource binFolder = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
	if (binFolder != null)
		return binFolder.getLocation().toString();
	throw new RuntimeException("Could not retrieve Soot classpath for project " + javaProject.getElementName());
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:13,代碼來源:JimpleBuilder.java

示例4: build

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
/**
 * Start a build on given project or workspace using given options.
 * 
 * @param javaProject Project which must be (full) build or null if all
 * workspace has to be built.
 * @param options Options used while building
 */
void build(final IJavaProject javaProject, Hashtable options, boolean noWarning) throws IOException, CoreException {
  if (DEBUG)
    System.out.print("\tstart build...");
  JavaCore.setOptions(options);
  if (PRINT)
    System.out.println("JavaCore options: " + options);

  // Build workspace if no project
  if (javaProject == null) {
    // single measure
    ENV.fullBuild();
  } else {
    if (PRINT)
      System.out.println("Project options: " + javaProject.getOptions(false));
    IWorkspaceRunnable compilation = new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        ENV.fullBuild(javaProject.getPath());
      }
    };
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    workspace.run(compilation, null/* don't take any lock */, IWorkspace.AVOID_UPDATE, null/*
                                                                                            * no
                                                                                            * progress
                                                                                            * available
                                                                                            * here
                                                                                            */);
  }

  // Verify markers
  IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
  IMarker[] markers = workspaceRoot.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
  List resources = new ArrayList();
  List messages = new ArrayList();
  int warnings = 0;
  for (int i = 0, length = markers.length; i < length; i++) {
    IMarker marker = markers[i];
    switch (((Integer) marker.getAttribute(IMarker.SEVERITY)).intValue()) {
    case IMarker.SEVERITY_ERROR:
      resources.add(marker.getResource().getName());
      messages.add(marker.getAttribute(IMarker.MESSAGE));
      break;
    case IMarker.SEVERITY_WARNING:
      warnings++;
      if (noWarning) {
        resources.add(marker.getResource().getName());
        messages.add(marker.getAttribute(IMarker.MESSAGE));
      }
      break;
    }
  }
  workspaceRoot.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);

  // Assert result
  int size = messages.size();
  if (size > 0) {
    StringBuffer debugBuffer = new StringBuffer();
    for (int i = 0; i < size; i++) {
      debugBuffer.append(resources.get(i));
      debugBuffer.append(":\n\t");
      debugBuffer.append(messages.get(i));
      debugBuffer.append('\n');
    }
    System.out.println("Unexpected ERROR marker(s):\n" + debugBuffer.toString());
    System.out.println("--------------------");
    String target = javaProject == null ? "workspace" : javaProject.getElementName();
    // assertEquals("Found "+size+" unexpected errors while building "+target,
    // 0, size);
  }
  if (DEBUG)
    System.out.println("done");
}
 
開發者ID:RuiChen08,項目名稱:dacapobench,代碼行數:79,代碼來源:FullSourceWorkspaceBuildTests.java


注:本文中的org.eclipse.jdt.core.IJavaProject.getElementName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。