org.eclipse.ui.dialogs.WizardNewProjectCreationPage.setInitialProjectName()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(74)

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

WizardNewProjectCreationPage.setInitialProjectName介绍

[英]Sets the initial project name that this page will use when created. The name is ignored if the createControl(Composite) method has already been called. Leading and trailing spaces in the name are ignored. Providing the name of an existing project will not necessarily cause the wizard to warn the user. Callers of this method should first check if the project name passed already exists in the workspace.
[中]设置创建此页面时将使用的初始项目名称。如果已调用createControl(Composite)方法,则忽略该名称。名称中的前导空格和尾随空格将被忽略。提供现有项目的名称不一定会导致向导警告用户。此方法的调用方应首先检查传递的项目名称是否已存在于工作区中。

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.emf.importer

page.setInitialProjectName(path.charAt(0) == '/' ? path.substring(1) : path);
page.setPageComplete(page.isPageComplete());

代码示例来源:origin: org.eclipse/org.eclipse.emf.codegen.ecore.ui

@Override
public void addPages()
{
 WizardNewProjectCreationPage newProjectCreationPage = new WizardNewProjectCreationPage("NewProjectCreationPage")
  {
   @Override
   protected boolean validatePage()
   {
    if (super.validatePage())
    {
     IPath locationPath = getLocationPath();
     genModelProjectLocation = Platform.getLocation().equals(locationPath) ? null : locationPath;
     IPath projectPath = getProjectHandle().getFullPath();
     genModelContainerPath = projectPath.append("src");
     return true;
    }
    else
    {
     return false;
    }
   }
  };
  
 newProjectCreationPage.setInitialProjectName(initialProjectName);
 newProjectCreationPage.setTitle(GenModelEditPlugin.INSTANCE.getString("_UI_EmptyProject_title"));
 newProjectCreationPage.setDescription(GenModelEditPlugin.INSTANCE.getString("_UI_EmptyProject_description"));
 addPage(newProjectCreationPage);
}

代码示例来源:origin: org.openl/org.openl.eclipse.ui.wizard

@Override
public void addPages() {
  try {
    super.addPages();
    mainPage = new WizardNewProjectCreationPage("basicNewProjectPage");
    mainPage.setTitle(customizer.getString(KEY_NEWPROJECT_TITLE));
    mainPage.setDescription(customizer.getString(KEY_NEWPROJECT_DESCRIPTION));
    String initialProjectName = customizer.getString(KEY_INITIAL_PROJECT_NAME, null);
    if (initialProjectName != null) {
      mainPage.setInitialProjectName(initialProjectName);
    }
    addPage(mainPage);
  } catch (Throwable t) {
    UtilBase.handleException(t);
  }
}

相关文章