Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show models from all opened projects in the submodel dropdown list. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crunsk
Copy link

@crunsk crunsk commented May 27, 2020

Hi,
This is related to issue OpenPonk/openponk#29
The added code code shows models from all opened projects in the submodel dropdown list.

I'm happy to hear suggestions/improvements to the code.

Show models from all opened projects  in the submodel dropdown list.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 35.517% when pulling cacfc78 on crunsk:master into 5862e48 on OpenPonk:master.

@JanBliznicenko
Copy link
Member

JanBliznicenko commented Jun 9, 2020

Hello, great, I think this does what it should. You may also take a look at method flatCollect: which can greatly simplify your code:

bormModels
	^ OPBormDiagramController allInstances flatCollect: [ :each | each editor workbench  projectController project models ]

There are a few downsides:

  1. It lists content even of closed workbenchs, until these instances are garbage collected.
  2. There is still no way to persist it yet. Each Workbench is basically completely separate and currently Workbench does not allow to have multiple models together, so there is not much of a way to link the submodel to the main one.
    This would require implementing option to have multiple models in one workbench like the OP used to in the video.
  3. Whenever there are multiple diagrams of the same model (can be created by "Clone view" button in the middle left part of OP window), it lists the model multiple times (because same model has multiple controllers). This can be fixed by removing duplicities using Set (create the collection as set and then convert to OrderedCollection before returning it), like
bormModels
	^ (OPBormDiagramController allInstances flatCollectAsSet: [ :each | each editor workbench  projectController project models ]) asOrderedCollection

But, if you are fine with these limitation, I have no problem with merging the pull request. Let me know :)

@crunsk
Copy link
Author

crunsk commented Jun 17, 2020

Hi,
Thanks for your tips! I'll experiment with those and probably modify my code so maybe merging is not yet appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants