fCurrent.setName(fNameText.getText());
String name= fNameText.getText();  if (fSuppressError && (name.length() != 0)) fSuppressError= false;  fCurrent.setName(name);
	protected Control createContents(Composite ancestor) {			Composite parent= new Composite(ancestor, SWT.NULL);		GridLayout layout= new GridLayout();		layout.marginHeight= 0;		layout.marginWidth= 0;				parent.setLayout(layout);				TabFolder folder= new TabFolder(parent, SWT.NONE);		folder.setLayout(new TabFolderLayout());			folder.setLayoutData(new GridData(GridData.FILL_BOTH));		Composite firstPage= new Composite(folder, SWT.NONE);		layout= new GridLayout();		layout.numColumns= 2;		firstPage.setLayout(layout);						TabItem item= new TabItem(folder, SWT.NONE);		item.setText(TemplateMessages.getString("TemplatePreferencePage.tab.edit")); //$NON-NLS-1$		item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE));		item.setControl(firstPage);				fTableViewer= new CheckboxTableViewer(firstPage, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);		Table table= fTableViewer.getTable();				GridData data= new GridData(GridData.FILL_BOTH);		data.widthHint= convertWidthInCharsToPixels(80);		data.heightHint= convertHeightInCharsToPixels(10);		fTableViewer.getTable().setLayoutData(data);						table.setHeaderVisible(true);		table.setLinesVisible(true);				TableLayout tableLayout= new TableLayout();		table.setLayout(tableLayout);		//		TableColumn column1= new TableColumn(table, SWT.NULL);		TableColumn column1= table.getColumn(0);		column1.setText(TemplateMessages.getString("TemplatePreferencePage.column.name")); //$NON-NLS-1$			TableColumn column2= new TableColumn(table, SWT.NULL);		column2.setText(TemplateMessages.getString("TemplatePreferencePage.column.description")); //$NON-NLS-1$				tableLayout.addColumnData(new ColumnWeightData(30));		tableLayout.addColumnData(new ColumnWeightData(70));				fTableViewer.setLabelProvider(new TemplateLabelProvider());		fTableViewer.setContentProvider(new TemplateContentProvider(fTableViewer, TemplateSet.getInstance()));				fTableViewer.setSorter(new ViewerSorter() {			public int compare(Viewer viewer, Object object1, Object object2) {				if ((object1 instanceof Template) && (object2 instanceof Template)) {					Template left= (Template) object1;					Template right= (Template) object2;					int result= left.getName().compareToIgnoreCase(right.getName());					if (result != 0)						return result;					return left.getDescription().compareToIgnoreCase(right.getDescription());				}				return super.compare(viewer, object1, object2);			}						public boolean isSorterProperty(Object element, String property) {				return true;			}		});				fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {			public void selectionChanged(SelectionChangedEvent e) {				selectionChanged1();			}		});		fTableViewer.addCheckStateListener(new ICheckStateListener() {			public void checkStateChanged(CheckStateChangedEvent event) {				Template template=  (Template) event.getElement();				template.setEnabled(event.getChecked());			}		});		Composite buttons= new Composite(firstPage, SWT.NULL);		buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));		layout= new GridLayout();		layout.marginHeight= 0;		layout.marginWidth= 0;		buttons.setLayout(layout);				fAddButton= new Button(buttons, SWT.PUSH);		fAddButton.setLayoutData(getButtonGridData(fAddButton));		fAddButton.setText(TemplateMessages.getString("TemplatePreferencePage.new")); //$NON-NLS-1$		fAddButton.addListener(SWT.Selection, new Listener() {			public void handleEvent(Event e) {				add();			}		});				fRemoveButton= new Button(buttons, SWT.PUSH);		fRemoveButton.setLayoutData(getButtonGridData(fRemoveButton));		fRemoveButton.setText(TemplateMessages.getString("TemplatePreferencePage.remove")); //$NON-NLS-1$		fRemoveButton.addListener(SWT.Selection, new Listener() {			public void handleEvent(Event e) {				remove();			}		});				fEnableAllButton= new Button(buttons, SWT.PUSH);		fEnableAllButton.setLayoutData(getButtonGridData(fEnableAllButton));		fEnableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.enable.all")); //$NON-NLS-1$		fEnableAllButton.addListener(SWT.Selection, new Listener() {			public void handleEvent(Event e) {				enableAll(true);			}		});		fDisableAllButton= new Button(buttons, SWT.PUSH);		fDisableAllButton.setLayoutData(getButtonGridData(fDisableAllButton));		fDisableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.disable.all")); //$NON-NLS-1$		fDisableAllButton.addListener(SWT.Selection, new Listener() {			public void handleEvent(Event e) {				enableAll(false);			}		});		fEditor= new Group(firstPage, SWT.NULL);		fEditor.setText(TemplateMessages.getString("TemplatePreferencePage.editor")); //$NON-NLS-1$		fEditor.setLayoutData(new GridData(GridData.FILL_BOTH));		layout= new GridLayout();		layout.numColumns= 2;		fEditor.setLayout(layout);		createLabel(fEditor, TemplateMessages.getString("TemplatePreferencePage.name")); //$NON-NLS-1$				Composite composite= new Composite(fEditor, SWT.NONE);		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));		layout= new GridLayout();		layout.numColumns= 3;		layout.marginWidth= 0;		layout.marginHeight= 0;		composite.setLayout(layout);		fNameText= createText(composite);		fNameText.addModifyListener(new ModifyListener() {			public void modifyText(ModifyEvent e) {				if (fCurrent == null)					return;				fCurrent.setName(fNameText.getText());								fTableViewer.refresh(fCurrent);				updateButtons();			}		});		createLabel(composite, TemplateMessages.getString("TemplatePreferencePage.context")); //$NON-NLS-1$				fContextCombo= new Combo(composite, SWT.READ_ONLY);		fContextCombo.setItems(new String[] {"java", "javadoc"}); //$NON-NLS-1$ //$NON-NLS-2$		fContextCombo.addModifyListener(new ModifyListener() {			public void modifyText(ModifyEvent e) {				if (fCurrent == null)					return;				fCurrent.setContext(fContextCombo.getText());				fTableViewer.refresh(fCurrent);			}		});				createLabel(fEditor, TemplateMessages.getString("TemplatePreferencePage.description")); //$NON-NLS-1$				fDescriptionText= createText(fEditor);		fDescriptionText.addModifyListener(new ModifyListener() {			public void modifyText(ModifyEvent e) {				if (fCurrent == null)					return;									fCurrent.setDescription(fDescriptionText.getText());				fTableViewer.refresh(fCurrent);			}		});		Label patternLabel= createLabel(fEditor, TemplateMessages.getString("TemplatePreferencePage.pattern")); //$NON-NLS-1$		patternLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));		fPatternEditor= createEditor(fEditor);		Composite secondPage= new Composite(folder, SWT.NONE);		layout= new GridLayout();		layout.numColumns= 1;		secondPage.setLayout(layout);				item= new TabItem(folder, SWT.NONE);		item.setText(TemplateMessages.getString("TemplatePreferencePage.tab.options")); //$NON-NLS-1$		item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE));		item.setControl(secondPage);						fFormatButton= new Button(secondPage, SWT.CHECK);		fFormatButton.setText(TemplateMessages.getString("TemplatePreferencePage.use.code.formatter")); //$NON-NLS-1$		IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();		fFormatButton.setSelection(prefs.getBoolean(PREF_FORMAT_TEMPLATES));				fTableViewer.setInput(TemplateSet.getInstance());				fTableViewer.setAllChecked(false);		fTableViewer.setCheckedElements(getEnabledTemplates());				updateButtons();		WorkbenchHelp.setHelp(parent, new DialogPageContextComputer(this, IJavaHelpContextIds.JRE_PREFERENCE_PAGE));				leaveEditor();				return parent;	}