Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: IBM Corporation - initial API and implementation /
import  org.eclipse.swt.widgets.Composite;
public class TocWizardPage extends PDEWizardNewFileCreationPage {
	private static String EXTENSION = "xml"//$NON-NLS-1$
	public TocWizardPage(String pageNameIStructuredSelection selection) {
		// Force the file extension to be 'xml'
	public void createControl(Composite parent) {
	protected void createAdvancedControls(Composite parent) {
	protected boolean validatePage() {
		String tocName = getTocName();
		if (tocName == null) {
			return false;
		tocName = tocName.trim();
		// Verify the TOC name is non-empty
		if (tocName.length() == 0) {
			// Set the appropriate error message
			return false;
		// Perform default validation
		return super.validatePage();
	public String getTocName() {
New to GrepCode? Check out our FAQ X