Community
Participate
Working Groups
Hello, I am working with Papyrus team https://eclipse.org/papyrus/ and we found that the Eclipse Cheat Sheet plugin offer really a good way to provide interactive tutorials about our tool. However, we noticed that the current implementation is not easily extended, nor always accessible from outside the org.eclipse.ui.cheatsheets plugin (most of methods and attributes are not public). In fact, we aim to enhance in some cases the current behavior of the Cheatsheet view. For example, when a Cheatsheet task open a wizard and list the sub tasks to be performed each time we move from one wizard page to another, the sub tasks are not automatically set to complete , the user has to set it manually to complete, to be able to move to the following task. https://www.eclipse.org/forums/index.php/m/1764053/?srch=cheatsheet#msg_1764053 To do so, we have to access the CheatsheetViewer attribute associated to the CheatsheatPart but this attribute is private as well as the advanceItem(…) method that allow to mark the task as completed. So, we are wondering what is the best way to use the Cheatsheet plugin as an API ? Thank you very much for your help.
(In reply to smaoui asma from comment #0) > To do so, we have to access the CheatsheetViewer attribute associated to the > CheatsheatPart That class does not exist in the Eclipse SDK.
The java class is named "CheatSheetHelpPart" (the cheatsheet view displayed in the wizard as help part) the viewer is private: "private CheatSheetViewer viewer;" The same thing for CheatSheetViewer->advanceItem(ImageHyperlink link, boolean markAsCompleted) the method is not public Asma
(In reply to smaoui asma from comment #2) > The java class is named "CheatSheetHelpPart" (the cheatsheet view displayed > in the wizard as help part) That class is not API as well. Only what's in the 'org.eclipse.ui.cheatsheets' is currently API. You would have to find out what you need as API and ask here whether we think that's a good idea. After that you could provide a Gerrit change for that. On our team no one has time to add APIs at the moment.
OK that's fine. So, for the use case that I descrtibed in the Description of this bug (set as complete the sub task of a CheatSheetHelpPart when the user hint the Next button in the associated wizard), I need to set to public alll of these: - CheatSheetHelpPart.viewer - CheatSheetViewer.advanceSubItem(ImageHyperlink link, boolean markAsCompleted, int subItemIndex) - CheatSheetViewer.saveCurrentSheet() - SubItemCompositeHolder.setCompleted(boolean isCompleted) but for other use cases, I may need to set also to public - CheatSheetViewer.advanceItem(ImageHyperlink link, boolean markAsCompleted) - ViewItem.setExpanded() - ViewItem.setComplete()... Let me know if it makes sense to change the accessibility of thoses methods/attributes so that I can propose a gerrit for that. Asma
(In reply to smaoui asma from comment #4) > Let me know if it makes sense to change the accessibility of thoses > methods/attributes so that I can propose a gerrit for that. Crafting an API is not just making something public. You need to make sure that the API makes sense, is adopted by clients and works in the future. I doubt that this is the case with the mentioned members. They were never designed to be API.
why this can not make sense ? it is just about allowing the user to set an item as complete and save its cheatSheetHelpPart. Actually when the user open a wizard, the cheatsheet is displayed in the wizard as a helpPart but it did not follow the wizard change page. What does not make sense is to have a an incomplete task while the user has complete it. the sychronization between the wizard page and the cheatsheet task is needed for us and we are not the only users that aks for this kind of sychro https://www.eclipse.org/forums/index.php/m/1764053/?srch=cheatsheet#msg_1764053 we can only ensure this if we have access to advanceSubItem() and the other methods listed in my last comment. Besides, I can notice that advanceIntroItem() is actually public whether advanceSubItem() is not ! and both in the same class and called only by classes of the same plugins.
(In reply to smaoui asma from comment #6) > why this can not make sense ? Because APIs need to be designed. Just changing visibility of members isn't that.
OK, so what do you suggest to be able to sychronize the cheatsheet sub item with the wizard without calling the method advanceSubItem() and saveCurrentSheet() ? My end purpose it to have acces to these methods. and I do not understand why CheatSheetViewer.advanceIntroItem() is public ? and it is not possible to make CheatSheetViewer.advanceSubItem() public ? Thanks Asma
(In reply to smaoui asma from comment #8) > OK, so what do you suggest to be able to sychronize the cheatsheet sub item > with the wizard without calling the method advanceSubItem() and > saveCurrentSheet() ? > > My end purpose it to have acces to these methods. > > and I do not understand why CheatSheetViewer.advanceIntroItem() is public ? > and it is not possible to make CheatSheetViewer.advanceSubItem() public ? > > Thanks > > Asma CheatSheetViewer is also not API it is an internal class that you use at your own risk. Now, if you are comfortable with that, we can open up those methods, but that does not mean they are API.
OK, that will be fine. Thanks Asma
(In reply to smaoui asma from comment #10) > OK, that will be fine. > > Thanks > > Asma OK. Please provide the Gerrit change.
New Gerrit change created: https://git.eclipse.org/r/99734
Gerrit change https://git.eclipse.org/r/99734 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/?id=5969f68015db822366f4eb0df1cf2e855c944fd5