Java Code Examples for org.eclipse.jdt.ui.wizards.NewTypeWizardPage#setEnclosingTypeSelection()

The following examples show how to use org.eclipse.jdt.ui.wizards.NewTypeWizardPage#setEnclosingTypeSelection() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CreateAsyncInterfaceProposal.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Fill-in the "Package" and "Name" fields.
 *
 * @param page the wizard page.
 */
private void configureWizardPage(NewTypeWizardPage page) {
  /*
   * Don't allow this to be edited. If do allow edits then we should only allow either the type
   * parameters from the sync type or no type parameters at all.
   */
  page.setTypeName(typeNameWithParameters, false);

  boolean isInEnclosingType = typeContainer instanceof IType;
  if (isInEnclosingType) {
    page.setEnclosingType((IType) typeContainer, false);
  } else {
    page.setPackageFragment((IPackageFragment) typeContainer, false);
  }
  page.setEnclosingTypeSelection(isInEnclosingType, false);
}
 
Example 2
Source File: NewCUUsingWizardProposal.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Fill-in the "Package" and "Name" fields.
 * @param page the wizard page.
 */
private void fillInWizardPageName(NewTypeWizardPage page) {
	// allow to edit when there are type parameters
	page.setTypeName(fTypeNameWithParameters, fTypeNameWithParameters.indexOf('<') != -1);

	boolean isInEnclosingType= fTypeContainer instanceof IType;
	if (isInEnclosingType) {
		page.setEnclosingType((IType) fTypeContainer, true);
	} else {
		page.setPackageFragment((IPackageFragment) fTypeContainer, true);
	}
	page.setEnclosingTypeSelection(isInEnclosingType, true);
}