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

📄 midletselectiondialogcreator.java

📁 eclipseme的最新版本的source,欢迎j2me程序员使用
💻 JAVA
字号:
/**
 * Copyright (c) 2003-2005 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.utils;

import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.SelectionDialog;

import eclipseme.core.internal.utils.MidletSearchScope;

/**
 * A simple helper class for creating a Type selection dialog
 * that allows for selection of Midlet subclasses.
 * <p />
 * Copyright (c) 2003-2005 Craig Setera<br>
 * All Rights Reserved.<br>
 * Licensed under the Eclipse Public License - v 1.0<p/>
 * <br>
 * $Revision: 1.5 $
 * <br>
 * $Date: 2005/08/13 01:59:06 $
 * <br>
 * @author Craig Setera
 */
public class MidletSelectionDialogCreator {

	/**
	 * Create a new midlet selection dialog.
	 * 
	 * @param shell
	 * @param context
	 * @param javaProject
	 * @param multipleSelect
	 * @return
	 * @throws JavaModelException
	 */
	public static SelectionDialog createMidletSelectionDialog(
			Shell shell,
			IRunnableContext context,
			IJavaProject javaProject,
			boolean multipleSelect) 
				throws JavaModelException
	{
		IJavaSearchScope searchScope = new MidletSearchScope(javaProject);

		SelectionDialog dialog =
			JavaUI.createTypeDialog(
				shell,
				context,
				searchScope,
				IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES,	
				multipleSelect,
				"*"); 

		dialog.setTitle("Choose Midlet");
		dialog.setMessage("Choose midlet to be emulated");
		
		return dialog;
	}
	
	// Private constructor for static access
	private MidletSelectionDialogCreator() {}
}

⌨️ 快捷键说明

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