use of org.eclipse.che.ide.ext.java.shared.dto.model.Type in project che by eclipse.
the class TypeNode method getChildrenImpl.
/** {@inheritDoc} */
@Override
public Promise<List<Node>> getChildrenImpl() {
return createFromAsyncRequest(callback -> {
List<Node> child = new ArrayList<>();
createTypeChildren(child, type, isFromSuper);
if (type.isPrimary()) {
for (Type type : compilationUnit.getSuperTypes()) {
createTypeChildren(child, type, true);
}
}
Collections.sort(child, new NodeComparator());
callback.onSuccess(child);
});
}
use of org.eclipse.che.ide.ext.java.shared.dto.model.Type in project che by eclipse.
the class OpenImplementationPresenter method showNoImplementations.
private void showNoImplementations(NoImplementationWidget noImplementationWidget, TextEditor editorPartPresenter) {
int offset = editorPartPresenter.getCursorOffset();
PositionConverter.PixelCoordinates coordinates = editorPartPresenter.getPositionConverter().offsetToPixel(offset);
Type type = dtoFactory.createDto(Type.class);
type.setFlags(-1);
noImplementationWidget.addItem(type);
noImplementationWidget.show(coordinates.getX(), coordinates.getY());
}
use of org.eclipse.che.ide.ext.java.shared.dto.model.Type in project che by eclipse.
the class PackageFragmentNode method getChildrenImpl.
@Override
protected Promise<List<Node>> getChildrenImpl() {
return createFromAsyncRequest(callback -> {
final List<Node> children = new ArrayList<>();
if (packageFragment.getKind() == PackageFragmentRoot.K_SOURCE) {
for (CompilationUnit compilationUnit : packageFragment.getCompilationUnits()) {
final List<Type> types = compilationUnit.getTypes();
final List<Node> nodes = types.stream().filter(Type::isPrimary).map(type -> nodeFactory.create(type, compilationUnit, null, matches)).collect(Collectors.toList());
children.addAll(nodes);
}
} else {
children.addAll(packageFragment.getClassFiles().stream().map(classFile -> nodeFactory.create(classFile.getType(), null, classFile, matches)).collect(Collectors.toList()));
}
callback.onSuccess(children);
});
}
Aggregations