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


Java JavaElementLabelProvider.SHOW_ROOT属性代码示例

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


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

示例1: selectJavaElement

/**
 * Shows a dialog for resolving an ambiguous Java element. Utility method that can be called by subclasses.
 *
 * @param elements the elements to select from
 * @param shell the parent shell
 * @param title the title of the selection dialog
 * @param message the message of the selection dialog
 * @return returns the selected element or <code>null</code> if the dialog has been cancelled
 */
public static IJavaElement selectJavaElement(IJavaElement[] elements, Shell shell, String title, String message) {
	int nResults= elements.length;
	if (nResults == 0)
		return null;
	if (nResults == 1)
		return elements[0];

	int flags= JavaElementLabelProvider.SHOW_DEFAULT | JavaElementLabelProvider.SHOW_QUALIFIED | JavaElementLabelProvider.SHOW_ROOT;

	ElementListSelectionDialog dialog= new ElementListSelectionDialog(shell, new JavaElementLabelProvider(flags));
	dialog.setTitle(title);
	dialog.setMessage(message);
	dialog.setElements(elements);

	if (dialog.open() == Window.OK) {
		return (IJavaElement) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:28,代码来源:SelectionConverter.java

示例2: MultiMainTypeSelectionDialog

/**
 * Constructor.
 */
public MultiMainTypeSelectionDialog(Shell shell, IRunnableContext context,
	IJavaSearchScope scope, int style)
{
	super(shell, new JavaElementLabelProvider(
		JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_POST_QUALIFIED | JavaElementLabelProvider.SHOW_ROOT));

	setMultipleSelection(true);

	Assert.isNotNull(context);
	Assert.isNotNull(scope);

	fRunnableContext= context;
	fScope= scope;
	fStyle= style;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:MultiMainTypeSelectionDialog.java

示例3: selectClass

/**
 * @param shell
 * @param project
 * @param filter
 * @return the selected file
 */
public static IType selectClass(final Shell shell,
        final IProject project,
        final Filter filter) {
    final int flags = JavaElementLabelProvider.SHOW_DEFAULT |
            JavaElementLabelProvider.SHOW_POST_QUALIFIED |
            JavaElementLabelProvider.SHOW_ROOT;
    final ElementListSelectionDialog dlg =
            new ElementListSelectionDialog(shell, new JavaElementLabelProvider(flags));
    dlg.setTitle("Select Custom Operation(s) Class");
    dlg.setMessage("Select a custom operation(s) class");
    dlg.setMatchEmptyString(true);
    dlg.setHelpAvailable(false);
    final List<IType> types = new ArrayList<>();
    populateClasses(shell, JavaCore.create(project), types, filter);
    dlg.setElements(types.toArray());
    return (dlg.open() == Window.OK) ? (IType) dlg.getFirstResult() : null;
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:23,代码来源:Util.java

示例4: createLabelProvider

private static ILabelProvider createLabelProvider(int dialogFlags) {
	int flags= JavaElementLabelProvider.SHOW_DEFAULT;
	if ((dialogFlags & F_REMOVE_DUPLICATES) == 0) {
		flags= flags | JavaElementLabelProvider.SHOW_ROOT;
	}
	return new JavaElementLabelProvider(flags);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:PackageSelectionDialog.java

示例5: selectFile

/**
 * @param shell
 * @param project
 * @param schemaType
 * @return the selected file
 */
public static String selectFile(final Shell shell,
        final IProject project,
        final String schemaType) {
    final int flags = JavaElementLabelProvider.SHOW_DEFAULT
            | JavaElementLabelProvider.SHOW_POST_QUALIFIED
            | JavaElementLabelProvider.SHOW_ROOT;
    final ElementListSelectionDialog dlg =
            new ElementListSelectionDialog(shell, new JavaElementLabelProvider(flags) {

                @Override
                public String getText(final Object element) {
                    return super.getText(element) + " - "
                            + ((IResource) element).getParent().getFullPath().makeRelative();
                }
            });
    dlg.setTitle("Select " + schemaType);
    dlg.setMessage("Select the " + schemaType + " file for the transformation");
    dlg.setMatchEmptyString(true);
    dlg.setHelpAvailable(false);
    final List<IResource> resources = new ArrayList<>();
    populateResources(shell, project, resources);
    dlg.setElements(resources.toArray());
    if (dlg.open() == Window.OK)
        return ((IFile) dlg.getFirstResult()).getProjectRelativePath().toString();
    return null;
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:32,代码来源:Util.java

示例6: PackageRenderer

public PackageRenderer() {
	super(JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_POST_QUALIFIED | JavaElementLabelProvider.SHOW_ROOT);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:3,代码来源:MainTypeSelectionDialog.java

示例7: PackageRenderer

public PackageRenderer() {
	super(JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_POST_QUALIFIED | JavaElementLabelProvider.SHOW_ROOT);	
}
 
开发者ID:eclipse,项目名称:birt,代码行数:3,代码来源:HandlerClassSelectionDialog.java


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