本文整理了Java中org.eclipse.jdt.core.IJavaElement.isStructureKnown()
方法的一些代码示例,展示了IJavaElement.isStructureKnown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IJavaElement.isStructureKnown()
方法的具体详情如下:
包路径:org.eclipse.jdt.core.IJavaElement
类名称:IJavaElement
方法名:isStructureKnown
[英]Returns whether the structure of this element is known. For example, for a compilation unit that has syntax errors, false
is returned. If the structure of an element is unknown, navigations will return reasonable defaults. For example, getChildren
for a compilation unit with syntax errors will return a collection of the children that could be parsed.
Note: This does not imply anything about consistency with the underlying resource/buffer contents.
[中]返回此元素的结构是否已知。例如,对于有语法错误的编译单元,将返回false
。如果元素的结构未知,导航将返回合理的默认值。例如,对于有语法错误的编译单元,getChildren
将返回可以解析的子级集合。
注意:这并不意味着与底层资源/缓冲区内容的一致性。
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
@Override
public boolean isStructureKnown() throws JavaModelException {
return ((IJavaElement)getOpenableParent()).isStructureKnown();
}
/*
代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion
public boolean isStructureKnown() throws JavaModelException {
return ((IJavaElement)getOpenableParent()).isStructureKnown();
}
/*
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public boolean isStructureKnown() throws JavaModelException {
return ((IJavaElement)getOpenableParent()).isStructureKnown();
}
/*
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public boolean isStructureKnown() throws JavaModelException {
return ((IJavaElement)getOpenableParent()).isStructureKnown();
}
/*
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public boolean isStructureKnown() throws JavaModelException {
return ((IJavaElement)getOpenableParent()).isStructureKnown();
}
/*
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public boolean isStructureKnown() throws JavaModelException {
return ((IJavaElement)getOpenableParent()).isStructureKnown();
}
/*
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public static boolean isAvailable(IJavaElement javaElement) throws JavaModelException {
if (javaElement == null)
return false;
if (! javaElement.exists())
return false;
if (javaElement.isReadOnly())
return false;
// work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=48422
// the Java project is now cheating regarding its children so we shouldn't
// call isStructureKnown if the project isn't open.
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=52474
if (!(javaElement instanceof IJavaProject) && !(javaElement instanceof ILocalVariable) && !javaElement.isStructureKnown())
return false;
if (javaElement instanceof IMember && ((IMember)javaElement).isBinary())
return false;
return true;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
public static boolean isAvailable(IJavaElement javaElement) throws JavaModelException {
if (javaElement == null)
return false;
if (! javaElement.exists())
return false;
if (javaElement.isReadOnly())
return false;
// work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=48422
// the Java project is now cheating regarding its children so we shouldn't
// call isStructureKnown if the project isn't open.
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=52474
if (!(javaElement instanceof IJavaProject) && !(javaElement instanceof ILocalVariable) && !javaElement.isStructureKnown())
return false;
if (javaElement instanceof IMember && ((IMember)javaElement).isBinary())
return false;
return true;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation
public static boolean isAvailable(IJavaElement javaElement) throws JavaModelException {
if (javaElement == null)
return false;
if (! javaElement.exists())
return false;
if (javaElement.isReadOnly())
return false;
// work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=48422
// the Java project is now cheating regarding its children so we shouldn't
// call isStructureKnown if the project isn't open.
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=52474
if (!(javaElement instanceof IJavaProject) && !(javaElement instanceof ILocalVariable) && !javaElement.isStructureKnown())
return false;
if (javaElement instanceof IMember && ((IMember)javaElement).isBinary())
return false;
return true;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_readonly);
if (!javaElement.isStructureKnown())
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_readonly);
if (!javaElement.isStructureKnown())
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_readonly);
if (!javaElement.isStructureKnown())
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation
/**
* Checks whether it is possible to modify the given IJavaElement
.
* The IJavaElement
must exist and be non read-only to be modifiable.
* Moreover, if it is a IMember
it must not be binary.
* The returned RefactoringStatus
has ERROR
severity if
* it is not possible to modify the element.
* @param javaElement
* @return the status
* @throws JavaModelException
*
* @see IJavaElement#exists
* @see IJavaElement#isReadOnly
* @see IMember#isBinary
* @see RefactoringStatus
*/
public static RefactoringStatus checkAvailability(IJavaElement javaElement) throws JavaModelException{
RefactoringStatus result= new RefactoringStatus();
if (! javaElement.exists())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_not_in_model, getJavaElementName(javaElement)));
if (javaElement.isReadOnly())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_read_only, getJavaElementName(javaElement)));
if (javaElement.exists() && !javaElement.isStructureKnown())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_unknown_structure, getJavaElementName(javaElement)));
if (javaElement instanceof IMember && ((IMember)javaElement).isBinary())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_binary, getJavaElementName(javaElement)));
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
/**
* Checks whether it is possible to modify the given IJavaElement
.
* The IJavaElement
must exist and be non read-only to be modifiable.
* Moreover, if it is a IMember
it must not be binary.
* The returned RefactoringStatus
has ERROR
severity if
* it is not possible to modify the element.
* @param javaElement
* @return the status
* @throws JavaModelException
*
* @see IJavaElement#exists
* @see IJavaElement#isReadOnly
* @see IMember#isBinary
* @see RefactoringStatus
*/
public static RefactoringStatus checkAvailability(IJavaElement javaElement) throws JavaModelException{
RefactoringStatus result= new RefactoringStatus();
if (! javaElement.exists())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_not_in_model, getJavaElementName(javaElement)));
if (javaElement.isReadOnly())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_read_only, getJavaElementName(javaElement)));
if (javaElement.exists() && !javaElement.isStructureKnown())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_unknown_structure, getJavaElementName(javaElement)));
if (javaElement instanceof IMember && ((IMember)javaElement).isBinary())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_binary, getJavaElementName(javaElement)));
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
/**
* Checks whether it is possible to modify the given IJavaElement
.
* The IJavaElement
must exist and be non read-only to be modifiable.
* Moreover, if it is a IMember
it must not be binary.
* The returned RefactoringStatus
has ERROR
severity if
* it is not possible to modify the element.
* @param javaElement
* @return the status
* @throws JavaModelException
*
* @see IJavaElement#exists
* @see IJavaElement#isReadOnly
* @see IMember#isBinary
* @see RefactoringStatus
*/
public static RefactoringStatus checkAvailability(IJavaElement javaElement) throws JavaModelException{
RefactoringStatus result= new RefactoringStatus();
if (! javaElement.exists())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_not_in_model, javaElement.getElementName()));
if (javaElement.isReadOnly())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_read_only, javaElement.getElementName()));
if (javaElement.exists() && !javaElement.isStructureKnown())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_unknown_structure, javaElement.getElementName()));
if (javaElement instanceof IMember && ((IMember)javaElement).isBinary())
result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_binary, javaElement.getElementName()));
return result;
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
if (!javaElement.isStructureKnown()) {
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);