Issue recreating the ExpandButtonView example from docs #772
-
Hello, I'm having trouble recreating the ExpandButtonView example in the docs. I followed the steps/code example in the docs, and it appears the ExpandableCompartment expands when the ExpandButton is clicked, but the outer node is not changing its size. Here is what it looks like: It looks to me like the outer node should adjust its size when the compartment expands, per this example from the docs: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Thanks for your interest in the GLSP examples and for pointing out that glitch in the implementation example. Another approach could be to store the information of the expansion state in the model directly and solve it on the server to avoid bound manipulation on the client. HTH and best regards from Vienna, |
Beta Was this translation helpful? Give feedback.
-
Hi @rileydanejohnston, For the moment your can use this approach: import { GLSPVscodeDiagramWidget } from '@eclipse-glsp/vscode-integration-webview/lib/glsp-vscode-diagram-widget';
@injectable()
export class MyGlspDiagramWidget extends GLSPVscodeDiagramWidget {
protected override initializeSprotty(): void {
super.initializeSprotty();
setTimeout(() => {
this.actionDispatcher.dispatch(SetUIExtensionVisibilityAction.create({ extensionId: 'button-overlay', visible: true }));
}, 50);
}
} The you have to customize your GLSP starter by overriding the class TaskListStarter extends GLSPStarter {
...
protected override addVscodeBindings(container: Container, diagramIdentifier: GLSPDiagramIdentifier): void {
super.addVscodeBindings(container, diagramIdentifier);
container.rebind(GLSPVscodeDiagramWidget).to(MyGlspDiagramWidget).inSingletonScope();
}
} This should activate the |
Beta Was this translation helpful? Give feedback.
-
I'm also having trouble with the GIssueMarkerView example found here. When I try to create the GIssueMarker in my gmodel-factory, I get an error saying "builder() does not exist on type GIssueMarker". I went to the definition of the class and sure enough there is no builder() or build(). Is it supposed to be like that? I can get the icon to render but nothing happens with the message I pass to it. |
Beta Was this translation helpful? Give feedback.
-
it looks like the static builder() method for the Nevertheless, the builder() method is just a utility method that returns a new GIssueMarkerBuilder with the default type configured. GNode.builder()
.type(DefaultTypes.NODE_RECTANGLE)
.position(point ?? Point.ORIGIN)
.size(50, 35)
.add(
new GIssueMarkerBuilder(GIssueMarker)
.type(DefaultTypes.ISSUE_MARKER)
.addIssue({ message: "Information message", severity: "info" })
.position(-8, -8)
.build()
)
.build(); |
Beta Was this translation helpful? Give feedback.
Hi @rileydanejohnston,
Thanks for your interest in the GLSP examples and for pointing out that glitch in the implementation example.
Indeed you are right, on expanding the node it also should adjust its size.
There are different approaches to do this:
If we stick to the simple implementation example, we would adjust the node's height on the client if the status
expanded = true
. To showcase this, I updated the example implementation on the GLSP website (please see PR eclipse-glsp/glsp-website-source#68 andthe preview of the website here: https://deploy-preview-68--glsp.netlify.app/documentation/rendering/#default-views).Edit: In the meantime it was merged and the website was updated: htt…