本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例6: PackageRenderer
public PackageRenderer() {
super(JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_POST_QUALIFIED | JavaElementLabelProvider.SHOW_ROOT);
}
示例7: PackageRenderer
public PackageRenderer() {
super(JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_POST_QUALIFIED | JavaElementLabelProvider.SHOW_ROOT);
}