本文整理汇总了Java中org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage类的典型用法代码示例。如果您正苦于以下问题:Java BuildPathsPropertyPage类的具体用法?Java BuildPathsPropertyPage怎么用?Java BuildPathsPropertyPage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BuildPathsPropertyPage类属于org.eclipse.jdt.internal.ui.preferences包,在下文中一共展示了BuildPathsPropertyPage类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage; //导入依赖的package包/类
@Override
public void apply(IDocument document) {
Map<Object, Object> data= null;
if (fReferencedType != null) {
IJavaElement elem= fReferencedType.getJavaElement();
if (elem != null) {
IPackageFragmentRoot root= (IPackageFragmentRoot) elem.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
if (root != null) {
try {
IClasspathEntry entry= root.getRawClasspathEntry();
if (entry != null) {
data= new HashMap<Object, Object>(1);
data.put(BuildPathsPropertyPage.DATA_REVEAL_ENTRY, entry);
if (entry.getEntryKind() != IClasspathEntry.CPE_CONTAINER) {
data.put(BuildPathsPropertyPage.DATA_REVEAL_ATTRIBUTE_KEY, CPListElement.ACCESSRULES);
}
}
} catch (JavaModelException e) {
// ignore
}
}
}
}
PreferencesUtil.createPropertyDialogOn(JavaPlugin.getActiveWorkbenchShell(), fProject, BuildPathsPropertyPage.PROP_ID, null, data).open();
}
示例2: run
import org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage; //导入依赖的package包/类
@Override
public void run() {
IProject project= null;
Object firstElement= getSelectedElements().get(0);
HashMap<Object, IClasspathEntry> data= new HashMap<Object, IClasspathEntry>();
if (firstElement instanceof IJavaElement) {
IJavaElement element= (IJavaElement) firstElement;
IPackageFragmentRoot root= (IPackageFragmentRoot) element.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
if (root != null) {
try {
data.put(BuildPathsPropertyPage.DATA_REVEAL_ENTRY, root.getRawClasspathEntry());
} catch (JavaModelException e) {
// ignore
}
}
project= element.getJavaProject().getProject();
} else if (firstElement instanceof PackageFragmentRootContainer) {
PackageFragmentRootContainer container= (PackageFragmentRootContainer) firstElement;
project= container.getJavaProject().getProject();
IClasspathEntry entry= container instanceof ClassPathContainer ? ((ClassPathContainer) container).getClasspathEntry() : JavaCore.newLibraryEntry(new Path("/x/y"), null, null); //$NON-NLS-1$
data.put(BuildPathsPropertyPage.DATA_REVEAL_ENTRY, entry);
} else {
project= ((IResource) ((IAdaptable) firstElement).getAdapter(IResource.class)).getProject();
}
PreferencesUtil.createPropertyDialogOn(getShell(), project, BuildPathsPropertyPage.PROP_ID, null, data).open();
}
示例3: run
import org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage; //导入依赖的package包/类
public void run(IMarker marker) {
PreferencesUtil.createPropertyDialogOn(JavaPlugin.getActiveWorkbenchShell(), fProject, BuildPathsPropertyPage.PROP_ID, null, null).open();
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:UserLibraryMarkerResolutionGenerator.java