当前位置: 首页>>代码示例>>Java>>正文


Java SuperInterfaceSelectionDialog类代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog的典型用法代码示例。如果您正苦于以下问题:Java SuperInterfaceSelectionDialog类的具体用法?Java SuperInterfaceSelectionDialog怎么用?Java SuperInterfaceSelectionDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SuperInterfaceSelectionDialog类属于org.eclipse.jdt.internal.ui.wizards包,在下文中一共展示了SuperInterfaceSelectionDialog类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: chooseSuperInterfaces

import org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog; //导入依赖的package包/类
/**
 * Opens a selection dialog that allows to select the super interfaces. The selected interfaces are
 * directly added to the wizard page using {@link #addSuperInterface(String)}.
 *
 * 	<p>
 * Clients can override this method if they want to offer a different dialog.
 * </p>
 *
 * @since 3.2
 */
protected void chooseSuperInterfaces() {
	IJavaProject project= getJavaProject();
	if (project == null) {
		return;
	}

	SuperInterfaceSelectionDialog dialog= new SuperInterfaceSelectionDialog(getShell(), getWizard().getContainer(), this, project);
	dialog.setTitle(getInterfaceDialogTitle());
	dialog.setMessage(NewWizardMessages.NewTypeWizardPage_InterfacesDialog_message);
	dialog.open();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:NewTypeWizardPage.java

示例2: changeControlPressed

import org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog; //导入依赖的package包/类
public void changeControlPressed(DialogField field) {
	if (field == fAspectClassDialogField) {
		IType type= chooseAspectClass();
		if (type != null) {
			fAspectClassDialogField.setText(SuperInterfaceSelectionDialog.getNameWithTypeParameters(type));
		}
	}
}
 
开发者ID:diverse-project,项目名称:k3,代码行数:9,代码来源:NewXtendClassK3AspectWizardPage.java

示例3: initTypePage

import org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog; //导入依赖的package包/类
/**
 * Initializes all fields provided by the page with a given selection.
 *
 * @param elem the selection used to initialize this page or <code>
 * null</code> if no selection was available
 */
protected void initTypePage(IJavaElement elem) {
	String initSuperclass= "java.lang.Object"; //$NON-NLS-1$
	ArrayList<String> initSuperinterfaces= new ArrayList<String>(5);

	IJavaProject project= null;
	IPackageFragment pack= null;
	IType enclosingType= null;

	if (elem != null) {
		project= elem.getJavaProject();
		pack= (IPackageFragment) elem.getAncestor(IJavaElement.PACKAGE_FRAGMENT);
		if (pack == null && project != null) {
			pack= getPackage(project);
		}
		// evaluate the enclosing type
		IType typeInCU= (IType) elem.getAncestor(IJavaElement.TYPE);
		if (typeInCU != null) {
			if (typeInCU.getCompilationUnit() != null) {
				enclosingType= typeInCU;
			}
		} else {
			ICompilationUnit cu= (ICompilationUnit) elem.getAncestor(IJavaElement.COMPILATION_UNIT);
			if (cu != null) {
				enclosingType= cu.findPrimaryType();
			}
		}

		try {
			IType type= null;
			if (elem.getElementType() == IJavaElement.TYPE) {
				type= (IType)elem;
				if (type.exists()) {
					String superName= SuperInterfaceSelectionDialog.getNameWithTypeParameters(type);
					if (type.isInterface()) {
						initSuperinterfaces.add(superName);
					} else {
						initSuperclass= superName;
					}
				}
			}
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
			// ignore this exception now
		}
	}

	String typeName= ""; //$NON-NLS-1$

	ITextSelection selection= getCurrentTextSelection();
	if (selection != null) {
		String text= selection.getText();
		if (text != null && validateJavaTypeName(text, project).isOK()) {
			typeName= text;
		}
	}

	setPackageFragment(pack, true);
	setEnclosingType(enclosingType, true);
	setEnclosingTypeSelection(false, true);

	setTypeName(typeName, true);
	setSuperClass(initSuperclass, true);
	setSuperInterfaces(initSuperinterfaces, true);

	setAddComments(StubUtility.doAddComments(project), true); // from project or workspace
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:73,代码来源:NewTypeWizardPage.java

示例4: initTypePage

import org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog; //导入依赖的package包/类
/**
 * Initializes all fields provided by the page with a given selection.
 *
 * @param elem the selection used to initialize this page or <code>
 * null</code> if no selection was available
 */
protected void initTypePage(IJavaElement elem) {
	String initSuperclass= "java.lang.Object"; //$NON-NLS-1$
	ArrayList<String> initSuperinterfaces= new ArrayList<String>(5);

	IJavaProject project= null;
	IPackageFragment pack= null;
	IType enclosingType= null;

	if (elem != null) {
		// evaluate the enclosing type
		project= elem.getJavaProject();
		pack= (IPackageFragment) elem.getAncestor(IJavaElement.PACKAGE_FRAGMENT);
		IType typeInCU= (IType) elem.getAncestor(IJavaElement.TYPE);
		if (typeInCU != null) {
			if (typeInCU.getCompilationUnit() != null) {
				enclosingType= typeInCU;
			}
		} else {
			ICompilationUnit cu= (ICompilationUnit) elem.getAncestor(IJavaElement.COMPILATION_UNIT);
			if (cu != null) {
				enclosingType= cu.findPrimaryType();
			}
		}

		try {
			IType type= null;
			if (elem.getElementType() == IJavaElement.TYPE) {
				type= (IType)elem;
				if (type.exists()) {
					String superName= SuperInterfaceSelectionDialog.getNameWithTypeParameters(type);
					if (type.isInterface()) {
						initSuperinterfaces.add(superName);
					} else {
						initSuperclass= superName;
					}
				}
			}
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
			// ignore this exception now
		}
	}

	String typeName= ""; //$NON-NLS-1$

	ITextSelection selection= getCurrentTextSelection();
	if (selection != null) {
		String text= selection.getText();
		if (text != null && validateJavaTypeName(text, project).isOK()) {
			typeName= text;
		}
	}

	setPackageFragment(pack, true);
	setEnclosingType(enclosingType, true);
	setEnclosingTypeSelection(false, true);

	setTypeName(typeName, true);
	setSuperClass(initSuperclass, true);
	setSuperInterfaces(initSuperinterfaces, true);

	setAddComments(StubUtility.doAddComments(project), true); // from project or workspace
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:70,代码来源:NewTypeWizardPage.java


注:本文中的org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。