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


Java ProblemsLabelDecorator类代码示例

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


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

示例1: createWorkspaceFileSelectionDialog

import org.eclipse.jdt.ui.ProblemsLabelDecorator; //导入依赖的package包/类
/**
 * Creates and returns a dialog to choose an existing workspace file.
 * @param title the title
 * @param message the dialog message
 * @return the dialog
 */
protected ElementTreeSelectionDialog createWorkspaceFileSelectionDialog(String title, String message) {
	int labelFlags= JavaElementLabelProvider.SHOW_BASICS
					| JavaElementLabelProvider.SHOW_OVERLAY_ICONS
					| JavaElementLabelProvider.SHOW_SMALL_ICONS;
	final DecoratingLabelProvider provider= new DecoratingLabelProvider(new JavaElementLabelProvider(labelFlags), new ProblemsLabelDecorator(null));
	ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), provider, new StandardJavaElementContentProvider());
	dialog.setComparator(new JavaElementComparator());
	dialog.setAllowMultiple(false);
	dialog.setValidator(new ISelectionStatusValidator() {
		public IStatus validate(Object[] selection) {
			StatusInfo res= new StatusInfo();
			// only single selection
			if (selection.length == 1 && (selection[0] instanceof IFile))
				res.setOK();
			else
				res.setError(""); //$NON-NLS-1$
			return res;
		}
	});
	dialog.addFilter(new EmptyInnerPackageFilter());
	dialog.addFilter(new LibraryFilter());
	dialog.setTitle(title);
	dialog.setMessage(message);
	dialog.setStatusLineAboveButtons(true);
	dialog.setInput(JavaCore.create(JavaPlugin.getWorkspace().getRoot()));
	return dialog;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:34,代码来源:JarManifestWizardPage.java

示例2: SearchLabelProvider

import org.eclipse.jdt.ui.ProblemsLabelDecorator; //导入依赖的package包/类
public SearchLabelProvider(JavaSearchResultPage page) {
	super(DEFAULT_SEARCH_TEXTFLAGS, DEFAULT_SEARCH_IMAGEFLAGS);
	addLabelDecorator(new ProblemsLabelDecorator(null));

	fPage= page;
	fLabelProviderMap= new HashMap<IMatchPresentation, ILabelProvider>(5);

	fSearchPreferences= new ScopedPreferenceStore(InstanceScope.INSTANCE, NewSearchUI.PLUGIN_ID);
	fSearchPropertyListener= new IPropertyChangeListener() {
		public void propertyChange(PropertyChangeEvent event) {
			doSearchPropertyChange(event);
		}
	};
	fSearchPreferences.addPropertyChangeListener(fSearchPropertyListener);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:SearchLabelProvider.java

示例3: JavaEditorErrorTickUpdater

import org.eclipse.jdt.ui.ProblemsLabelDecorator; //导入依赖的package包/类
public JavaEditorErrorTickUpdater(JavaEditor editor) {
	Assert.isNotNull(editor);
	fJavaEditor= editor;
	fLabelProvider=  new JavaUILabelProvider(0, JavaElementImageProvider.SMALL_ICONS);
	fLabelProvider.addLabelDecorator(new ProblemsLabelDecorator(null));
	JavaPlugin.getDefault().getProblemMarkerManager().addListener(this);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:JavaEditorErrorTickUpdater.java

示例4: createTreeViewer

import org.eclipse.jdt.ui.ProblemsLabelDecorator; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected TreeViewer createTreeViewer(Composite parent, int style) {
	Tree tree= new Tree(parent, SWT.SINGLE | (style & ~SWT.MULTI));
	GridData gd= new GridData(GridData.FILL_BOTH);
	gd.heightHint= tree.getItemHeight() * 12;
	tree.setLayoutData(gd);

	final TreeViewer treeViewer= new OutlineTreeViewer(tree);

	// Hard-coded filters
	treeViewer.addFilter(new NamePatternFilter());
	treeViewer.addFilter(new MemberFilter());

	fInnerLabelProvider= new OutlineLabelProvider();
	fInnerLabelProvider.addLabelDecorator(new ProblemsLabelDecorator(null));
	IDecoratorManager decoratorMgr= PlatformUI.getWorkbench().getDecoratorManager();
	if (decoratorMgr.getEnabled("org.eclipse.jdt.ui.override.decorator")) //$NON-NLS-1$
		fInnerLabelProvider.addLabelDecorator(new OverrideIndicatorLabelDecorator(null));

	treeViewer.setLabelProvider(new ColoringLabelProvider(fInnerLabelProvider));

	fLexicalSortingAction= new LexicalSortingAction(treeViewer);
	fSortByDefiningTypeAction= new SortByDefiningTypeAction(treeViewer);
	fShowOnlyMainTypeAction= new ShowOnlyMainTypeAction(treeViewer);
	fCategoryFilterActionGroup= new CategoryFilterActionGroup(treeViewer, getId(), getInputForCategories());

	fOutlineContentProvider= new OutlineContentProvider(false);
	treeViewer.setContentProvider(fOutlineContentProvider);
	fOutlineSorter= new OutlineSorter();
	treeViewer.setComparator(fOutlineSorter);
	treeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);


	treeViewer.getTree().addKeyListener(getKeyAdapter());

	return treeViewer;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:41,代码来源:JavaOutlineInformationControl.java

示例5: createPackageDialog

import org.eclipse.jdt.ui.ProblemsLabelDecorator; //导入依赖的package包/类
/**
 * Creates a selection dialog that lists all packages under the given package
 * fragment root.
 * The caller is responsible for opening the dialog with <code>Window.open</code>,
 * and subsequently extracting the selected packages (of type
 * <code>IPackageFragment</code>) via <code>SelectionDialog.getResult</code>.
 *
 * @param packageFragments the package fragments
 * @return a new selection dialog
 */
protected SelectionDialog createPackageDialog(Set<IJavaElement> packageFragments) {
	List<IPackageFragment> packages= new ArrayList<IPackageFragment>(packageFragments.size());
	for (Iterator<IJavaElement> iter= packageFragments.iterator(); iter.hasNext();) {
		IPackageFragment fragment= (IPackageFragment)iter.next();
		boolean containsJavaElements= false;
		int kind;
		try {
			kind= fragment.getKind();
			containsJavaElements= fragment.getChildren().length > 0;
		} catch (JavaModelException ex) {
			ExceptionHandler.handle(ex, getContainer().getShell(), JarPackagerMessages.JarManifestWizardPage_error_jarPackageWizardError_title, Messages.format(JarPackagerMessages.JarManifestWizardPage_error_jarPackageWizardError_message, JavaElementLabels.getElementLabel(fragment, JavaElementLabels.ALL_DEFAULT)));
			continue;
		}
		if (kind != IPackageFragmentRoot.K_BINARY && containsJavaElements)
			packages.add(fragment);
	}
	StandardJavaElementContentProvider cp= new StandardJavaElementContentProvider() {
		@Override
		public boolean hasChildren(Object element) {
			// prevent the + from being shown in front of packages
			return !(element instanceof IPackageFragment) && super.hasChildren(element);
		}
	};
	final DecoratingLabelProvider provider= new DecoratingLabelProvider(new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT), new ProblemsLabelDecorator(null));
	ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getContainer().getShell(), provider, cp);
	dialog.setDoubleClickSelects(false);
	dialog.setComparator(new JavaElementComparator());
	dialog.setInput(JavaCore.create(JavaPlugin.getWorkspace().getRoot()));
	dialog.addFilter(new EmptyInnerPackageFilter());
	dialog.addFilter(new LibraryFilter());
	dialog.addFilter(new SealPackagesFilter(packages));
	dialog.setValidator(new ISelectionStatusValidator() {
		public IStatus validate(Object[] selection) {
			StatusInfo res= new StatusInfo();
			for (int i= 0; i < selection.length; i++) {
				if (!(selection[i] instanceof IPackageFragment)) {
					res.setError(JarPackagerMessages.JarManifestWizardPage_error_mustContainPackages);
					return res;
				}
			}
			res.setOK();
			return res;
		}
	});
	return dialog;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:57,代码来源:JarManifestWizardPage.java

示例6: DecoratingJavaLabelProvider

import org.eclipse.jdt.ui.ProblemsLabelDecorator; //导入依赖的package包/类
/**
 * Decorating label provider for Java. Combines a JavaUILabelProvider
 * (if enabled with problem indicator) with the workbench
 * decorator (label decorator extension point).
 * 	@param labelProvider the label provider to decorate
 * @param errorTick show error ticks
 * @param flatPackageMode configure flat package mode
 */
public DecoratingJavaLabelProvider(JavaUILabelProvider labelProvider, boolean errorTick, boolean flatPackageMode) {
	super(labelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), DecorationContext.DEFAULT_CONTEXT);
	if (errorTick) {
		labelProvider.addLabelDecorator(new ProblemsLabelDecorator(null));
	}
	setFlatPackageMode(flatPackageMode);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:DecoratingJavaLabelProvider.java


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