fRootDialogField= new StringButtonDialogField(adapter); fRootDialogField.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_root_label); fRootDialogField.setButtonLabel(NewWizardMessages.NewSourceFolderWizardPage_root_button);
if (linkedMode) { fRootDialogField= new StringDialogField(); } else { fRootDialogField= new StringButtonDialogField(adapter); ((StringButtonDialogField)fRootDialogField).setButtonLabel(NewWizardMessages.NewSourceFolderWizardPage_root_button); } fRootDialogField.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_root_label);
	public AddSourceFolderWizardPage(CPListElement newElement, List/*<CPListElement>*/ existingEntries, IPath outputLocation, 			boolean linkedMode, boolean canCommitConflictingBuildpath,			boolean allowIgnoreConflicts, boolean allowRemoveProjectFolder, boolean allowAddExclusionPatterns) {				super(PAGE_NAME);				fLinkedMode= linkedMode;		fCanCommitConflictingBuildpath= canCommitConflictingBuildpath;		fAllowConflict= allowIgnoreConflicts;		fAllowRemoveProjectFolder= allowRemoveProjectFolder;		fAllowAddExclusionPatterns= allowAddExclusionPatterns;						fOrginalExlusionFilters= new Hashtable();		fOrginalInclusionFilters= new Hashtable();		fOrginalExlusionFiltersCopy= new Hashtable();		fOrginalInclusionFiltersCopy= new Hashtable();		for (Iterator iter= existingEntries.iterator(); iter.hasNext();) {			CPListElement element= (CPListElement)iter.next();			IPath[] exlusions= (IPath[])element.getAttribute(CPListElement.EXCLUSION);			if (exlusions != null) {				IPath[] save= new IPath[exlusions.length];				for (int i= 0; i < save.length; i++) {					save[i]= exlusions[i];				}				fOrginalExlusionFiltersCopy.put(element, save);				fOrginalExlusionFilters.put(element, exlusions);			}			IPath[] inclusions= (IPath[])element.getAttribute(CPListElement.INCLUSION);			if (inclusions != null) {				IPath[] save= new IPath[inclusions.length];				for (int i= 0; i < save.length; i++) {					save[i]= inclusions[i];				}				fOrginalInclusionFiltersCopy.put(element, save);				fOrginalInclusionFilters.put(element, inclusions);			}		}				setTitle(NewWizardMessages.NewSourceFolderWizardPage_title);		fOrginalPath= newElement.getPath();		if (fOrginalPath == null) {			if (linkedMode) {				setDescription(Messages.format(NewWizardMessages.NewFolderDialog_createIn, newElement.getJavaProject().getElementName()));			} else {				setDescription(NewWizardMessages.NewSourceFolderWizardPage_description);			}		} else {			setDescription(NewWizardMessages.NewSourceFolderWizardPage_edit_description);		}				fNewElement= newElement;		fExistingEntries= existingEntries;		fModifiedElements= new ArrayList();		fRemovedElements= new ArrayList();		fOutputLocation= outputLocation;				RootFieldAdapter adapter= new RootFieldAdapter();				fRootDialogField= new StringButtonDialogField(adapter);		fRootDialogField.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_root_label); 		fRootDialogField.setButtonLabel(NewWizardMessages.NewSourceFolderWizardPage_root_button); 		if (fNewElement.getPath() == null) {			fRootDialogField.setText(""); //$NON-NLS-1$		} else {			setFolderDialogText(fNewElement.getPath());		}		fRootDialogField.setEnabled(fNewElement.getJavaProject() != null);				int buttonStyle= SWT.CHECK;		if ((fAllowConflict && fAllowAddExclusionPatterns) ||			(fAllowConflict && fAllowRemoveProjectFolder) ||			(fAllowAddExclusionPatterns && fAllowRemoveProjectFolder)) {			buttonStyle= SWT.RADIO;		}				fAddExclusionPatterns= new SelectionButtonDialogField(buttonStyle);		fAddExclusionPatterns.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_exclude_label); 		fAddExclusionPatterns.setSelection(!fCanCommitConflictingBuildpath && !fAllowRemoveProjectFolder);				fRemoveProjectFolder= new SelectionButtonDialogField(buttonStyle);		fRemoveProjectFolder.setLabelText(NewWizardMessages.NewSourceFolderWizardPage_ReplaceExistingSourceFolder_label); 		fRemoveProjectFolder.setSelection(!fCanCommitConflictingBuildpath && fAllowRemoveProjectFolder);				fIgnoreConflicts= new SelectionButtonDialogField(buttonStyle);		fIgnoreConflicts.setLabelText(NewWizardMessages.AddSourceFolderWizardPage_ignoreNestingConflicts);		fIgnoreConflicts.setSelection(fCanCommitConflictingBuildpath);				fLinkFields= new LinkFields();		if (fNewElement.getLinkTarget() != null) {			fLinkFields.setLinkTarget(fNewElement.getLinkTarget());		}				fRemoveProjectFolder.setDialogFieldListener(adapter);		fAddExclusionPatterns.setDialogFieldListener(adapter);		fIgnoreConflicts.setDialogFieldListener(adapter);		fRootDialogField.setDialogFieldListener(adapter);		fLinkFields.setDialogFieldListener(adapter);				packRootDialogFieldChanged();	}