Java 类org.eclipse.ui.navigator.PipelinedViewerUpdate 实例源码

项目:Eclipse-Postfix-Code-Completion    文件:JavaSynchronizationContentProvider.java   
/**
 * Converts the viewer update to use java elements.
 *
 * @param update
 *            the viewer update to convert
 * @return <code>true</code> if any elements have been converted,
 *         <code>false</code> otherwise
 */
private boolean convertToJavaElements(final PipelinedViewerUpdate update) {
    final Set<IJavaElement> result= new HashSet<IJavaElement>();
    for (final Iterator<IAdaptable> iterator= update.getRefreshTargets().iterator(); iterator.hasNext();) {
        final Object element= iterator.next();
        if (element instanceof IProject) {
            final IJavaElement project= asJavaProject((IProject) element);
            if (project != null) {
                iterator.remove();
                result.add(project);
            }
        }
    }
    update.getRefreshTargets().addAll(result);
    return !result.isEmpty();
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSynchronizationContentProvider.java   
/**
 * Converts the viewer update to use java elements.
 *
 * @param update
 *            the viewer update to convert
 * @return <code>true</code> if any elements have been converted,
 *         <code>false</code> otherwise
 */
private boolean convertToJavaElements(final PipelinedViewerUpdate update) {
    final Set<IJavaElement> result= new HashSet<IJavaElement>();
    for (final Iterator<IAdaptable> iterator= update.getRefreshTargets().iterator(); iterator.hasNext();) {
        final Object element= iterator.next();
        if (element instanceof IProject) {
            final IJavaElement project= asJavaProject((IProject) element);
            if (project != null) {
                iterator.remove();
                result.add(project);
            }
        }
    }
    update.getRefreshTargets().addAll(result);
    return !result.isEmpty();
}
项目:Pydev    文件:PythonModelProviderTest.java   
/**
 * Test if intercepting an object that does not have a parent works. 
 */
public void testInterceptRefresh() throws Exception {
    PythonNature nature = createNature(TestDependent.TEST_PYSRC_NAVIGATOR_LOC + "projroot/source/python");

    project = new ProjectStub(new File(TestDependent.TEST_PYSRC_NAVIGATOR_LOC + "projroot"), nature);
    provider = new PythonModelProvider();

    PipelinedViewerUpdate update = new PipelinedViewerUpdate();
    Set<Object> refreshTargets = update.getRefreshTargets();
    refreshTargets.add(project);
    refreshTargets.add(null);
    refreshTargets.add("string");
    provider.interceptRefresh(update);
    assertEquals(2, refreshTargets.size());
    for (Object wrappedResource : refreshTargets) {
        assertTrue(wrappedResource == project || wrappedResource.equals("string"));
    }
}
项目:Pydev    文件:PythonModelProvider.java   
@Override
public boolean interceptRefresh(PipelinedViewerUpdate refreshSynchronization) {
    if (DEBUG) {
        System.out.println("interceptRefresh");
    }
    return convertToPythonElementsUpdateOrRefresh(refreshSynchronization.getRefreshTargets());
}
项目:Pydev    文件:PythonModelProvider.java   
@Override
public boolean interceptUpdate(PipelinedViewerUpdate updateSynchronization) {
    if (DEBUG) {
        debug("Before interceptUpdate", updateSynchronization);
    }
    boolean ret = convertToPythonElementsUpdateOrRefresh(updateSynchronization.getRefreshTargets());
    if (DEBUG) {
        debug("After interceptUpdate", updateSynchronization);
    }
    return ret;
}
项目:Pydev    文件:PythonModelProvider.java   
/**
 * Helper for debugging the things we have in an update
 */
private void debug(String desc, PipelinedViewerUpdate updateSynchronization) {
    System.out.println("\nDesc:" + desc);
    System.out.println("Refresh targets:");
    for (Object o : updateSynchronization.getRefreshTargets()) {
        System.out.println(o);
    }
}
项目:n4js    文件:N4JSProjectExplorerContentProvider.java   
@Override
public boolean interceptRefresh(final PipelinedViewerUpdate aRefreshSynchronization) {
    return true;
}
项目:n4js    文件:N4JSProjectExplorerContentProvider.java   
@Override
public boolean interceptUpdate(final PipelinedViewerUpdate anUpdateSynchronization) {
    return true;
}
项目:jsbuild-eclipse    文件:NavigatorJSBuildFileContentProvider.java   
@Override
public boolean interceptRefresh(
        PipelinedViewerUpdate paramPipelinedViewerUpdate) {
    return false;
}
项目:jsbuild-eclipse    文件:NavigatorJSBuildFileContentProvider.java   
@Override
public boolean interceptUpdate(
        PipelinedViewerUpdate paramPipelinedViewerUpdate) {
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSynchronizationContentProvider.java   
/**
 * {@inheritDoc}
 */
public boolean interceptRefresh(final PipelinedViewerUpdate update) {
    return convertToJavaElements(update);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSynchronizationContentProvider.java   
/**
 * {@inheritDoc}
 */
public boolean interceptUpdate(final PipelinedViewerUpdate anUpdateSynchronization) {
    return convertToJavaElements(anUpdateSynchronization);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaNavigatorContentProvider.java   
public boolean interceptUpdate(PipelinedViewerUpdate updateSynchronization) {
    return convertToJavaElements(updateSynchronization.getRefreshTargets());
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSynchronizationContentProvider.java   
/**
 * {@inheritDoc}
 */
public boolean interceptRefresh(final PipelinedViewerUpdate update) {
    return convertToJavaElements(update);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSynchronizationContentProvider.java   
/**
 * {@inheritDoc}
 */
public boolean interceptUpdate(final PipelinedViewerUpdate anUpdateSynchronization) {
    return convertToJavaElements(anUpdateSynchronization);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaNavigatorContentProvider.java   
public boolean interceptUpdate(PipelinedViewerUpdate updateSynchronization) {
    return convertToJavaElements(updateSynchronization.getRefreshTargets());
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaNavigatorContentProvider.java   
public boolean interceptRefresh(PipelinedViewerUpdate refreshSynchronization) {
    return convertToJavaElements(refreshSynchronization.getRefreshTargets());

}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaNavigatorContentProvider.java   
public boolean interceptRefresh(PipelinedViewerUpdate refreshSynchronization) {
    return convertToJavaElements(refreshSynchronization.getRefreshTargets());

}