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


Java SelectionDialog.getReturnCode方法代码示例

本文整理汇总了Java中org.eclipse.ui.dialogs.SelectionDialog.getReturnCode方法的典型用法代码示例。如果您正苦于以下问题:Java SelectionDialog.getReturnCode方法的具体用法?Java SelectionDialog.getReturnCode怎么用?Java SelectionDialog.getReturnCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.dialogs.SelectionDialog的用法示例。


在下文中一共展示了SelectionDialog.getReturnCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: browseForBuilderClass

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
private void browseForBuilderClass() {
	try {
		IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { getType().getJavaProject() });
		SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), PlatformUI.getWorkbench().getProgressService(), scope,
				IJavaElementSearchConstants.CONSIDER_CLASSES, false, "*ToString", fExtension); //$NON-NLS-1$
		dialog.setTitle(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_windowTitle);
		dialog.setMessage(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_message);
		dialog.open();
		if (dialog.getReturnCode() == OK) {
			IType type= (IType)dialog.getResult()[0];
			fBuilderClassName.setText(type.getFullyQualifiedParameterizedName());
			List<String> suggestions= fValidator.getAppendMethodSuggestions(type);
			if (!suggestions.contains(fAppendMethodName.getText()))
				fAppendMethodName.setText(suggestions.get(0));
			suggestions= fValidator.getResultMethodSuggestions(type);
			if (!suggestions.contains(fResultMethodName.getText()))
				fResultMethodName.setText(suggestions.get(0));
		}
	} catch (JavaModelException e) {
		JavaPlugin.log(e);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:GenerateToStringDialog.java

示例2: run

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
@Override
public void run() {
	// fail if the action hasn't been initialized
	if (site == null) {
		return;
	}

	final Object[] selectionElements = getStructuredSelection().toArray();

	// get Iterable of selected project names
	Iterable<String> selectionProjectNames = Arrays.asList(selectionElements)
			.stream().filter(item -> item instanceof IProject)
			.map(item -> ((IProject) item).getName())
			.collect(Collectors.toList());

	// double-check that the active Working Sets Manager is {@link ManualAssociationAwareWorkingSetManager}
	if (!(broker.getActiveManager() instanceof ManualAssociationAwareWorkingSetManager)) {
		return;
	}

	// open the dialog
	SelectionDialog dialog = createDialog(Arrays.asList(((ManualAssociationAwareWorkingSetManager) broker
			.getActiveManager()).getWorkingSets()), selectionElements.length);

	dialog.open();

	// Abort if user didn't press OK
	if (dialog.getReturnCode() != Window.OK) {
		return;
	}

	// perform specified working set updates
	performWorkingSetUpdate(dialog.getResult(), selectionProjectNames);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:35,代码来源:AssignWorkingSetsAction.java

示例3: getPackagesFromDialog

import org.eclipse.ui.dialogs.SelectionDialog; //导入方法依赖的package包/类
/**
 * Converts selection dialog results into an array of IPackageFragments.
 * An empty array is returned in case of errors.
 * @param dialog the dialog
 * @return the selected IPackageFragments
 * @throws ClassCastException if results are not IPackageFragments
 */
protected IPackageFragment[] getPackagesFromDialog(SelectionDialog dialog) {
	if (dialog.getReturnCode() == Window.OK && dialog.getResult().length > 0)
		return Arrays.asList(dialog.getResult()).toArray(new IPackageFragment[dialog.getResult().length]);
	else
		return new IPackageFragment[0];
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:JarManifestWizardPage.java


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