本文整理汇总了Java中org.eclipse.jdt.core.IJavaElementDelta.F_OPENED属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaElementDelta.F_OPENED属性的具体用法?Java IJavaElementDelta.F_OPENED怎么用?Java IJavaElementDelta.F_OPENED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.IJavaElementDelta
的用法示例。
在下文中一共展示了IJavaElementDelta.F_OPENED属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processJavaDelta
private void processJavaDelta(WorkingSetDelta result, IJavaElementDelta delta) {
IJavaElement jElement= delta.getElement();
int index= result.indexOf(jElement);
int type= jElement.getElementType();
int kind= delta.getKind();
int flags= delta.getFlags();
if (type == IJavaElement.JAVA_PROJECT && kind == IJavaElementDelta.CHANGED) {
if (index != -1 && (flags & IJavaElementDelta.F_CLOSED) != 0) {
result.set(index, ((IJavaProject)jElement).getProject());
} else if ((flags & IJavaElementDelta.F_OPENED) != 0) {
index= result.indexOf(((IJavaProject)jElement).getProject());
if (index != -1)
result.set(index, jElement);
}
}
if (index != -1) {
if (kind == IJavaElementDelta.REMOVED) {
if ((flags & IJavaElementDelta.F_MOVED_TO) != 0) {
result.set(index, delta.getMovedToElement());
} else {
result.remove(index);
}
}
}
IResourceDelta[] resourceDeltas= delta.getResourceDeltas();
if (resourceDeltas != null) {
for (int i= 0; i < resourceDeltas.length; i++) {
processResourceDelta(result, resourceDeltas[i]);
}
}
IJavaElementDelta[] children= delta.getAffectedChildren();
for (int i= 0; i < children.length; i++) {
processJavaDelta(result, children[i]);
}
}
示例2: processJavaDelta
private void processJavaDelta(List<IAdaptable> elements, IJavaElementDelta delta) {
IJavaElement jElement= delta.getElement();
int type= jElement.getElementType();
if (type == IJavaElement.JAVA_PROJECT) {
int index= elements.indexOf(jElement);
int kind= delta.getKind();
int flags= delta.getFlags();
if (kind == IJavaElementDelta.CHANGED) {
if (index != -1 && (flags & IJavaElementDelta.F_CLOSED) != 0) {
elements.set(index, ((IJavaProject)jElement).getProject());
fWorkingSet.setElements(elements.toArray(new IAdaptable[elements.size()]));
} else if ((flags & IJavaElementDelta.F_OPENED) != 0) {
index= elements.indexOf(((IJavaProject)jElement).getProject());
if (index != -1) {
elements.set(index, jElement);
fWorkingSet.setElements(elements.toArray(new IAdaptable[elements.size()]));
}
}
}
// don't visit below projects
return;
}
IJavaElementDelta[] children= delta.getAffectedChildren();
for (int i= 0; i < children.length; i++) {
processJavaDelta(elements, children[i]);
}
}
示例3: changedProject
/*******************************************************
* A java project has been changed. This tests, based on the given delta
* flags, if it was opened or closed.
*
* @param project
* The modified project.
* @param flags
* The delta flags.
*******************************************************/
private void changedProject(IJavaProject project, int flags)
{
if ((flags & IJavaElementDelta.F_OPENED) != 0)
{
// A java project has been opened, add it to the list of projects
addJavaProject(project);
}
else if ((flags & IJavaElementDelta.F_CLOSED) != 0)
{
// A java project has been closed, remove it from the list of
// projects
removeJavaProjects(project);
}
}