⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wizardnewmidletsuitecreationpage.java

📁 eclipseme的最新版本的source,欢迎j2me程序员使用
💻 JAVA
字号:
/**
 * Copyright (c) 2003-2006 Craig Setera
 * All Rights Reserved.
 * Licensed under the Eclipse Public License - v 1.0
 * For more information see http://www.eclipse.org/legal/epl-v10.html
 */
package eclipseme.ui.internal.wizards;

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.ui.dialogs.WizardNewProjectCreationPage;

/**
 * A specializatino of the {@link WizardNewProjectCreationPage} that
 * adds the ability to specify whether or not the newly created 
 * midlet suite project should support preprocessing.
 * <p />
 * Copyright (c) 2003-2006 Craig Setera<br>
 * All Rights Reserved.<br>
 * Licensed under the Eclipse Public License - v 1.0<p/>
 * <br>
 * $Revision: 1.3 $
 * <br>
 * $Date: 2006/11/26 14:13:16 $
 * <br>
 * @author Craig Setera
 */
public class WizardNewMidletSuiteCreationPage extends WizardNewProjectCreationPage {
	/** The name of the main page as registered in the wizard */
	public static final String MAIN_PAGE_NAME = "NewProjectCreationPage";
	
	private Button preprocessedButton;
	private boolean preprocessingEnabled;
	
	/**
	 * Construct a new instance.
	 */
	public WizardNewMidletSuiteCreationPage() {
		super(MAIN_PAGE_NAME);
	}

	/**
	 * @see org.eclipse.ui.dialogs.WizardNewProjectCreationPage#createControl(org.eclipse.swt.widgets.Composite)
	 */
	public void createControl(Composite parent) {
		super.createControl(parent);
		
		// Snag the composite created by the superclass and add to
		// the composite
		Composite composite = (Composite) getControl();
		
		// Add an extra composite to get the layout to match up the 
		// components vertically
		Composite layoutComposite = new Composite(composite, SWT.NONE);
		layoutComposite.setLayout(new GridLayout(1, true));
		layoutComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
		
		preprocessedButton = new Button(layoutComposite, SWT.CHECK);
		preprocessedButton.setText("Enable Preprocessing");
		preprocessedButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		preprocessedButton.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				preprocessingEnabled = preprocessedButton.getSelection();
			}
		});
	}

	/**
	 * Return a boolean concerning whether preprocessing is enabled for the
	 * newly created project.
	 * 
	 * @return the preprocessingEnabled
	 */
	public boolean isPreprocessingEnabled() {
		return preprocessingEnabled;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -