Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2006, 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 http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 
 package org.eclipse.pde.internal.ua.ui.wizards.cheatsheet;
 
 import  org.eclipse.swt.SWT;
 import  org.eclipse.swt.events.SelectionAdapter;
 import  org.eclipse.swt.events.SelectionEvent;
 import  org.eclipse.swt.layout.GridData;
 import  org.eclipse.swt.layout.GridLayout;
 import  org.eclipse.swt.widgets.Button;
 import  org.eclipse.swt.widgets.Composite;
 import  org.eclipse.swt.widgets.Group;
 import  org.eclipse.swt.widgets.Label;
CheatSheetFileWizardPage
 
 public class CSFileWizardPage extends PDEWizardNewFileCreationPage {
 
 	private Button fSimpleCheatSheetButton;
 
 	private Button fCompositeCheatSheetButton;
 
 	private Group fGroup;
 
 	protected static final String F_FILE_EXTENSION = "xml"//$NON-NLS-1$
 
 	public static final int F_SIMPLE_CHEAT_SHEET = 0;
 
 	public static final int F_COMPOSITE_CHEAT_SHEET = 1;

Parameters:
pageName
selection
 
 	public CSFileWizardPage(String pageNameIStructuredSelection selection) {
 		super(pageNameselection);
 
 	}

 
 	protected void initialize() {
 		// Force the file extension to be 'xml'
 	}

Returns:
 
 	public int getCheatSheetType() {
 		if (.getSelection()) {
 		} else if (.getSelection()) {
 		}
 		// Neither selected. Unknown type
 		return -1;
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createAdvancedControls(org.eclipse.swt.widgets.Composite)
 	 */
 	protected void createAdvancedControls(Composite parent) {
 
 		GridData data = null;
 
 		// Cheat Sheet Group
 		 = new Group(parent, SWT.NONE);
 		.setLayout(new GridLayout(1, false));
 		.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 
 		// Simple Cheat Sheet Button
 		 = new Button(, SWT.RADIO);
 		.setSelection(true);
 		.addSelectionListener(new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent e) {
 				getWizard().getContainer().updateButtons();
			}
		});
		// Simple Cheat Sheet Description Label
		final Label simpleCSLabel = new Label(, SWT.WRAP);
		data = new GridData(GridData.FILL_HORIZONTAL);
		data.widthHint = 300;
		data.horizontalIndent = 20;
		simpleCSLabel.setLayoutData(data);
		// Composite Cheat Sheet Button
		 = new Button(, SWT.RADIO);
		.setSelection(false);
		data = new GridData(GridData.FILL_HORIZONTAL);
		data.verticalIndent = 10;
		.setLayoutData(data);
		.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				getWizard().getContainer().updateButtons();
			}
		});
		// Composite Cheat Sheet Description Label
		final Label compositeCSLabel = new Label(, SWT.WRAP);
		data = new GridData(GridData.FILL_HORIZONTAL);
		data.widthHint = 300;
		data.horizontalIndent = 20;
		compositeCSLabel.setLayoutData(data);
	}
	/* (non-Javadoc)
	 * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createControl(org.eclipse.swt.widgets.Composite)
	 */
	public void createControl(Composite parent) {
		super.createControl(parent);
	}
New to GrepCode? Check out our FAQ X