org.eclipse.ui.dialogs.WizardNewProjectCreationPage类的使用及代码示例

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

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

WizardNewProjectCreationPage介绍

[英]Standard main page for a wizard that is creates a project resource.

This page may be used by clients as-is; it may be also be subclassed to suit.

Example usage:

mainPage = new WizardNewProjectCreationPage("basicNewProjectPage"); 
mainPage.setTitle("Project"); 
mainPage.setDescription("Create a new project resource.");

[中]用于创建项目资源的向导的标准主页。
客户可以按原样使用本页面;也可以将其分为子类以适合。
用法示例:

mainPage = new WizardNewProjectCreationPage("basicNewProjectPage"); 
mainPage.setTitle("Project"); 
mainPage.setDescription("Create a new project resource.");

代码示例

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

/**
 * Returns the project handle. Subclasses should override this 
 * method if they don't provide a main page or if they provide 
 * their own main page implementation.
 * 
 * @return the project handle
 */
protected IProject getProjectHandle() {
  Assert.isNotNull(fMainPage);
  return fMainPage.getProjectHandle();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

@Override
public void createControl(Composite parent) {
  Composite composite = new Composite(parent, SWT.NULL);
  initializeDialogUnits(parent);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(composite,
      IIDEHelpContextIds.NEW_PROJECT_WIZARD_PAGE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  createProjectNameGroup(composite);
  locationArea = new ProjectContentsLocationArea(getErrorReporter(), composite);
  if(initialProjectFieldValue != null) {
    locationArea.updateProjectName(initialProjectFieldValue);
  }
  // Scale the button based on the rest of the dialog
  setButtonLayoutData(locationArea.getBrowseButton());
  setPageComplete(validatePage());
  // Show description on opening
  setErrorMessage(null);
  setMessage(null);
  setControl(composite);
  Dialog.applyDialogFont(composite);
}

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

/**
 * Returns the project location path. Subclasses should override this
 * method if they don't provide a main page or if they provide
 * their own main page implementation.
 *
 * @return the project location path
 */
protected IPath getLocationPath() {
  Assert.isNotNull(fMainPage);
  return fMainPage.getLocationPath();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 * Get an error reporter for the receiver.
 * @return IErrorMessageReporter
 */
private IErrorMessageReporter getErrorReporter() {
  return (errorMessage, infoOnly) -> {
    if (infoOnly) {
      setMessage(errorMessage, IStatus.INFO);
      setErrorMessage(null);
    }
    else
      setErrorMessage(errorMessage);
    boolean valid = errorMessage == null;
    if(valid) {
      valid = validatePage();
    }
    setPageComplete(valid);
  };
}

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

page.setTitle(ImporterPlugin.INSTANCE.getString("_UI_EMFProjectWizard_name"));
page.setDescription(ImporterPlugin.INSTANCE.getString("_UI_CreateEMFProject_label"));
addPage(page);
 page.setInitialProjectName(path.charAt(0) == '/' ? path.substring(1) : path);
 page.setPageComplete(page.isPageComplete());

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

@Override
  protected boolean validatePage() {
    if (!super.validatePage())
      return false;
    String webLocation = getWebLocation();
    if (webLocation != null && webLocation.trim().length() == 0) {
      setErrorMessage(PDEUIMessages.SiteHTML_webError);
      return false;
    }
    return true;
  }
}

代码示例来源: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);
  }
}

代码示例来源: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

private IProject createNewProject() {
  final OpenLProjectCreator creator = new OpenLProjectCreator(mainPage.getProjectHandle(),
      mainPage.useDefaults() ? null : mainPage.getLocationPath());

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

IWorkspace workspace = IDEWorkbenchPlugin.getPluginWorkspace();
String projectFieldContents = getProjectNameFieldValue();
if (projectFieldContents.equals("")) { //$NON-NLS-1$
  setErrorMessage(null);
  setMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectNameEmpty);
  return false;
    IResource.PROJECT);
if (!nameStatus.isOK()) {
  setErrorMessage(nameStatus.getMessage());
  return false;
IProject handle = getProjectHandle();
if (handle.exists()) {
  setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectExistsMessage);
  return false;
    getProjectNameFieldValue());
locationArea.setExistingProject(project);
  setErrorMessage(validLocationMessage);
  return false;
setErrorMessage(null);
setMessage(null);
return true;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

@Override
public void addPages() {
  super.addPages();
  mainPage = new WizardNewProjectCreationPage("basicNewProjectPage") { //$NON-NLS-1$
    @Override
    public void createControl(Composite parent) {
      super.createControl(parent);
      createWorkingSetGroup(
          (Composite) getControl(),
          getSelection(),
          new String[] { "org.eclipse.ui.resourceWorkingSetPage" }); //$NON-NLS-1$
      Dialog.applyDialogFont(getControl());
    }
  };
  mainPage.setTitle(ResourceMessages.NewProject_title);
  mainPage.setDescription(ResourceMessages.NewProject_description);
  this.addPage(mainPage);
  // only add page if there are already projects in the workspace
  if (ResourcesPlugin.getWorkspace().getRoot().getProjects().length > 0) {
    referencePage = new WizardNewProjectReferencePage(
        "basicReferenceProjectPage");//$NON-NLS-1$
    referencePage.setTitle(ResourceMessages.NewProject_referenceTitle);
    referencePage
        .setDescription(ResourceMessages.NewProject_referenceDescription);
    this.addPage(referencePage);
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

final IProject newProjectHandle = mainPage.getProjectHandle();
if (!mainPage.useDefaults()) {
  location = mainPage.getLocationURI();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

@Override
  public void createControl(Composite parent) {
    super.createControl(parent);
    createWorkingSetGroup(
        (Composite) getControl(),
        getSelection(),
        new String[] { "org.eclipse.ui.resourceWorkingSetPage" }); //$NON-NLS-1$
    Dialog.applyDialogFont(getControl());
  }
};

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 * Creates a new project creation wizard page.
 *
 * @param pageName the name of this page
 */
public WizardNewProjectCreationPage(String pageName) {
  super(pageName);
  setPageComplete(false);
}

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

@Override
protected boolean validatePage() {
  boolean valid = super.validatePage();
  if (!valid)
    return valid;
  if (fUpdateName)
    updateNameRelativeFields();
  return validateBaseContent(false);
}

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

super.createControl(parent);
Composite control = (Composite) getControl();
GridLayout layout = new GridLayout();

代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui

/**
 * @see org.eclipse.ui.dialogs.WizardNewProjectCreationPage#validatePage()
 */
protected boolean validatePage() {
  if (!super.validatePage()) {
    return false;
  }
  String projectName = getProjectName();
  if (projectName == null) {
    return false;
  }
  IWizard wizard = getWizard();
  if (wizard instanceof ExampleProjectCreationWizard) {
    IWizardPage[] pages = wizard.getPages();
    for (int i = 0; i < pages.length; i++) {
      if ((pages[i] != this) && (pages[i] instanceof ExampleProjectCreationWizardPage)) {
        if (projectName.equals(((ExampleProjectCreationWizardPage) pages[i]).getProjectName())) {
          setErrorMessage(XMLWizardsMessages.ExampleProjectCreationWizardPage_error_alreadyexists);
          return false;
        }
      }
    }
  }
  return true;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Returns the project handle. Subclasses should override this
 * method if they don't provide a main page or if they provide
 * their own main page implementation.
 *
 * @return the project handle
 */
protected IProject getProjectHandle() {
  Assert.isNotNull(fMainPage);
  return fMainPage.getProjectHandle();
}

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

/**
 * Returns the project location path. Subclasses should override this 
 * method if they don't provide a main page or if they provide 
 * their own main page implementation.
 * 
 * @return the project location path
 */
protected IPath getLocationPath() {
  Assert.isNotNull(fMainPage);
  return fMainPage.getLocationPath();
}

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

@Override
public void createControl(Composite parent) {
  super.createControl(parent);
  Composite control = (Composite) getControl();
  GridLayout layout = new GridLayout();
  control.setLayout(layout);
  createProjectTypeGroup(control);
  createFormatGroup(control);
  createWorkingSetGroup(control, fSelection, new String[] {"org.eclipse.jdt.ui.JavaWorkingSetPage", //$NON-NLS-1$
      "org.eclipse.pde.ui.pluginWorkingSet", "org.eclipse.ui.resourceWorkingSetPage"}); //$NON-NLS-1$ //$NON-NLS-2$
  updateRuntimeDependency();
  Dialog.applyDialogFont(control);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(control, fFragment ? IHelpContextIds.NEW_FRAGMENT_STRUCTURE_PAGE : IHelpContextIds.NEW_PROJECT_STRUCTURE_PAGE);
  setControl(control);
}

相关文章