Uses of Record Class
com.vaadin.copilot.javarewriter.ComponentInfo
Packages that use ComponentInfo
Package
Description
-
Uses of ComponentInfo in com.vaadin.copilot.exception.report
Methods in com.vaadin.copilot.exception.report with parameters of type ComponentInfoModifier and TypeMethodDescriptionvoidExceptionReportCreator.addComponentInfo(ComponentInfo componentInfo) Adds singleComponentInfoto the list of component information that are used to extract source codeMethod parameters in com.vaadin.copilot.exception.report with type arguments of type ComponentInfoModifier and TypeMethodDescriptionvoidExceptionReportCreator.addComponentInfo(List<ComponentInfo> componentInfos) Adds multipleComponentInfoobjects to the list of component information that are used to extract source code -
Uses of ComponentInfo in com.vaadin.copilot.javarewriter
Methods in com.vaadin.copilot.javarewriter that return ComponentInfoModifier and TypeMethodDescriptionComponentInfoBuilder.build()Builds a newComponentInfoinstance based on the values set in this builder.static ComponentInfoJavaRewriterUtil.createComponentInfoForTemplateComponent(JavaSource javaSource, com.github.javaparser.ast.expr.ObjectCreationExpr objectCreationExpr, AttachExpression attachExpression) JavaRewriter.createComponentStatements(InsertionPoint insertionPoint, JavaComponent parent, JavaComponent maybeJavaComponent, boolean attach, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaRewriter.Where where, JavaSource javaSource) ComponentInfoFinder.find()Finds and compiles information about a component's creation and (if applicable) attachment in the project.Methods in com.vaadin.copilot.javarewriter that return types with arguments of type ComponentInfoModifier and TypeMethodDescriptionJavaRewriter.addComponentUsingTemplate(ComponentInfo referenceComponent, JavaRewriter.Where where, List<JavaComponent> template, JavaRewriter.AddTemplateOptions options) Adds the given code snippet to the source code either before the reference component (Where.BEFORE) or by appending to the layout (Where.APPEND).JavaRewriter.createComponentStatements(InsertionPoint insertionPoint, JavaComponent parent, List<JavaComponent> template, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaRewriter.Where where, JavaSource javaSource) Methods in com.vaadin.copilot.javarewriter with parameters of type ComponentInfoModifier and TypeMethodDescriptionvoidJavaBatchRewriter.Callback.accept(ComponentTypeAndSourceLocation source, ComponentInfo component, JavaRewriter rewriter) voidJavaRewriter.addCall(ComponentInfo componentInfo, String function, Object... parameters) Adds a function call to the source code.static booleanLumoRewriterUtil.addClassNameWithArgs(ComponentInfo component, List<com.github.javaparser.ast.expr.Expression> arguments) Creates addClassNames(...) statement with given arguments if there is none.voidJavaRewriter.addComment(ComponentInfo componentInfo, String comment, JavaRewriter.CommentType commentType) Adds a comment to the specified component in the source code.JavaRewriter.addComponentUsingTemplate(ComponentInfo referenceComponent, JavaRewriter.Where where, List<JavaComponent> template, JavaRewriter.AddTemplateOptions options) Adds the given code snippet to the source code either before the reference component (Where.BEFORE) or by appending to the layout (Where.APPEND).JavaRewriter.addConstructorParameterToClass(ComponentInfo referenceComponent, String parameterTypeName, String suggestedParameterName, boolean storeAsField) Adds a parameter of the given type to the constructor for the class containing the given component.static com.github.javaparser.ast.expr.MethodCallExprJavaRewriterUtil.addFunctionCall(ComponentInfo componentInfo, String function, List<com.github.javaparser.ast.expr.Expression> parameterExpressions) Adds a function call to the given component.JavaRewriter.attachComponent(InsertionPoint insertionPoint, JavaComponent component, JavaComponent parent, String layoutVariableName, ComponentInfo referenceComponent, com.github.javaparser.ast.expr.Expression variableNameExpr, String variableName, JavaRewriter.AddTemplateOptions options, JavaRewriter.Where where) static booleanJavaRewriterUtil.containsMethodInEmptyConstructorCall(ComponentInfo componentInfo, String methodName) Analyzes bytecode of the given component to search for method with methodName is called in an empty constructorJavaRewriter.createComponentStatements(InsertionPoint insertionPoint, JavaComponent parent, JavaComponent maybeJavaComponent, boolean attach, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaRewriter.Where where, JavaSource javaSource) JavaRewriter.createComponentStatements(InsertionPoint insertionPoint, JavaComponent parent, List<JavaComponent> template, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaRewriter.Where where, JavaSource javaSource) booleanJavaRewriter.delete(ComponentInfo componentInfo) Deletes a component from the source code.voidJavaRewriter.duplicate(ComponentInfo component) JavaRewriter.duplicate(ComponentInfo component, boolean handleAdd) Duplicates a component in the source code.voidJavaRewriter.extractComponent(ComponentInfo component, IdentityHashMap<ComponentInfo, List<ComponentInfo>> componentChildren, String extractedComponentClassNameSuggestion) Extracts the given component, including its children, to a new component.JavaRewriterUtil.extractInlineVariableToLocalVariable(ComponentInfo componentInfo) Extracts an inline variable to local variable with a new variable name.static List<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.findCalls(Class<?> classWithMethods, ComponentInfo componentInfo) Find all calls done to methods in the given class through a reference to the given component.static StringJavaRewriterUtil.findFreeVariableName(ComponentInfo componentInfo, com.github.javaparser.ast.stmt.BlockStmt block) Finds a free variable name based on the component type.JavaRewriter.findInsertionPointForAppend(ComponentInfo component, JavaRewriter.Where where) static List<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.findMethodCallNonStatements(ComponentInfo componentDefinition) Finds usage of the variable outside of method call statements, i.e. all usage not reported byJavaRewriterUtil.findMethodCallStatements(ComponentInfo).static Stream<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.findMethodCallNonStatements(ComponentInfo componentDefinition, String functionName) Finds usage of the variable outside of method call statements, i.e. all usage not reported byJavaRewriterUtil.findMethodCallStatements(ComponentInfo).static List<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.findMethodCalls(ComponentInfo componentInfo) Finds all method calls that are related to the given component.static List<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.findMethodCalls(ComponentInfo componentInfo, com.github.javaparser.ast.Node.TreeTraversal traversalOrder) Finds all method calls that are related to the given component.static List<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.findMethodCallStatements(ComponentInfo componentDefinition) Find all method calls that are statements, i.e. calls like foo.bar() or baz.qux("zug")).static Stream<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.findMethodCallStatements(ComponentInfo componentInfo, String functionName) Find all method calls statements for the given function, i.e. calls like foo.bar() or baz.qux("zug")).static List<com.github.javaparser.ast.expr.Expression> JavaRewriterUtil.findParameterUsage(ComponentInfo componentDefinition) Find all expressions where the given component is used as a call parameter.static Optional<com.github.javaparser.ast.expr.Expression> JavaRewriterUtil.findReference(com.github.javaparser.ast.NodeList<com.github.javaparser.ast.expr.Expression> nodes, ComponentInfo componentDefinition) Finds a node among the nodes which refer to the given component.static List<com.github.javaparser.ast.stmt.ReturnStmt> JavaRewriterUtil.findReturnStatements(ComponentInfo componentInfo) Find return statements referring to the component.static Optional<com.github.javaparser.ast.expr.Expression> JavaRewriterUtil.getAttachArgument(ComponentInfo component) Finds the attach argument reference of the given component.static com.github.javaparser.ast.expr.ExpressionJavaRewriterUtil.getAttachArgumentOrThrow(ComponentInfo component) Find the attach argument reference of given component or throwsIllegalArgumentExceptionif not found.static StringJavaRewriterUtil.getFieldOrVariableName(ComponentInfo componentInfo) Gets the field or local variable name for the given component.JavaRewriter.getPropertyValue(ComponentInfo componentInfo, String property) Gets the (active) value of a property of a component.static Optional<com.github.javaparser.ast.expr.Expression> JavaRewriterUtil.getScopeIgnoreComposite(ComponentInfo componentInfo, com.github.javaparser.ast.expr.MethodCallExpr expr) Returns the scope by ignoring thegetContent()if component is in a composite container.JavaRewriter.getStyles(ComponentInfo componentInfo) Gets the (active) styles of a component.static List<JavaStyleRewriter.StyleInfo> JavaStyleRewriter.getStyles(ComponentInfo componentInfo) Gets the (active) styles of a component.static StringJavaRewriterUtil.getVariableNameForAdd(ComponentInfo referenceComponent) static booleanJavaRewriterUtil.isObjectCreationExprInConstructor(ComponentInfo componentInfo) Checks if the given component is created inside the constructor of the class (as opposed to being created in another method).static booleanJavaRewriterUtil.isVariableNameAutoGenerated(ComponentInfo componentInfo, String currentText, String currentLabel) Checks if the given component has a variable name that is auto-generated based on the type/label/text of the component.voidJavaRewriter.moveComponent(ComponentInfo component, ComponentInfo container, ComponentInfo reference, JavaRewriter.Where where) Moves a component in the source code.static StringJavaRewriterUtil.regenerateVariableName(ComponentInfo componentInfo, String newText, String newLabel) Regenerates the variable name for the given component.voidJavaRewriter.removeCalls(ComponentInfo componentInfo, String function) Removes all calls to the given function from the source code.static voidLumoRewriterUtil.removeClassNameArgs(ComponentInfo component, String... lumoUtilityClassNames) Searches addClassName, addClassNames, setClassName methods for given component and then remove given lumo utility class names. e.g. if self-start is given for removal, LumoUtility.AlignSelf.START and "self-start" are removed from args.voidJavaRewriter.removePropertySetter(ComponentInfo componentInfo, String setter) Removes all property set calls or references in constructors initializationsJavaRewriter.replaceFunctionCall(ComponentInfo componentInfo, String function, Object value) Replaces a constructor parameter (if it is mapped to the given setter function) or a function call in the source code.voidJavaRewriter.replaceOrAddCall(ComponentInfo componentInfo, String function, Object... parameters) Replaces a function call in the source code, if found, otherwise adds the function call.voidJavaFileSourceProvider.saveComponentInfoSourceFiles(ComponentInfo componentInfo) voidJavaRewriter.setAlignment(ComponentInfo component, String alignItemsClassName, String justifyContentClassName) voidJavaRewriter.setComboBoxDataSource(ComponentInfo comboBox, String serviceClassName, String serviceMethodName, List<JavaReflectionUtil.ParameterTypeInfo> parameterTypes, String itemTypeClassName, UIServiceCreator.FieldInfo displayProperty) Connects the given combo box to the given service method, using the given item type and order for the columns.voidJavaRewriter.setGap(ComponentInfo component, String lumoClassAll, String lumoClassColumn, String lumoClassRow) Sets gap to selected componentvoidJavaRewriter.setGridDataSource(ComponentInfo grid, String serviceClassName, String serviceMethodName, List<JavaReflectionUtil.ParameterTypeInfo> parameterTypes, String itemTypeClassName, List<UIServiceCreator.FieldInfo> itemPropertiesOrder) Connects the given grid to the given service method, using the given item type and order for the columns.voidJavaRewriter.setPadding(ComponentInfo component, String all, String top, String right, String bottom, String left) voidJavaRewriter.setSizing(ComponentInfo componentInfo, Map<String, String> changes) Sets sizing properties of the given component using the Style API.static voidJavaStyleRewriter.setSizing(ComponentInfo componentInfo, Map<String, String> changes) Handles calls of the given component and adjust them based on the given properties.voidJavaRewriter.setStyle(ComponentInfo component, String property, String value) Sets the given inline style on the given component, replacing an existing style property if present.static voidJavaStyleRewriter.setStyle(ComponentInfo componentInfo, String dashSeparatedProperty, String value) /** Sets the given inline style on the given component, replacing an existing style property if present.static com.vaadin.copilot.javarewriter.JavaStyleRewriter.StylingResultJavaStyleRewriter.setStyle(ComponentInfo componentInfo, String dashSeparatedProperty, String value, boolean allowNullValue) Sets the given inline style on the given component, replacing an existing style property if present.static Predicate<com.github.javaparser.ast.expr.MethodCallExpr> JavaRewriterUtil.testMethodInClass(Class<?> classWithMethods, ComponentInfo componentInfo) Looks for given method call is a member of given class for the componentMethod parameters in com.vaadin.copilot.javarewriter with type arguments of type ComponentInfoModifier and TypeMethodDescriptionvoidJavaRewriter.extractComponent(ComponentInfo component, IdentityHashMap<ComponentInfo, List<ComponentInfo>> componentChildren, String extractedComponentClassNameSuggestion) Extracts the given component, including its children, to a new component.voidJavaRewriter.extractComponent(ComponentInfo component, IdentityHashMap<ComponentInfo, List<ComponentInfo>> componentChildren, String extractedComponentClassNameSuggestion) Extracts the given component, including its children, to a new component.voidJavaRewriter.mergeAndReplace(List<ComponentInfo> components, JavaComponent wrapperComponent) Merges all the components and wraps them using the given component and places the result in place of the first component. -
Uses of ComponentInfo in com.vaadin.copilot.javarewriter.custom
Methods in com.vaadin.copilot.javarewriter.custom with parameters of type ComponentInfoModifier and TypeMethodDescriptionList<com.github.javaparser.ast.body.VariableDeclarator> CrudComponentHandle.createComponentStatements(JavaRewriter javaRewriter, JavaComponent component, InsertionPoint insertionPoint, JavaComponent parent, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaSource javaSource) abstract List<com.github.javaparser.ast.body.VariableDeclarator> CustomComponentHandle.createComponentStatements(JavaRewriter javaRewriter, JavaComponent component, InsertionPoint insertionPoint, JavaComponent parent, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaSource javaSource) List<com.github.javaparser.ast.body.VariableDeclarator> DashboardComponentHandle.createComponentStatements(JavaRewriter javaRewriter, JavaComponent component, InsertionPoint insertionPoint, JavaComponent parent, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaSource javaSource) List<com.github.javaparser.ast.body.VariableDeclarator> DetailsComponentHandle.createComponentStatements(JavaRewriter javaRewriter, JavaComponent component, InsertionPoint insertionPoint, JavaComponent parent, String layoutVariableName, ComponentInfo referenceComponent, JavaRewriter.AddTemplateOptions options, JavaSource javaSource)