Community
Participate
Working Groups
The most of the actions provided by Nattable don't use the Eclipse Framework, so they are not visible from the Framework. This visibility can be used to customize perspective and to assign keybinding in the Eclipse Preferences (for example). Each action provided by the plugin should be written using org.eclipse.ui.menu and org.eclipse.ui.command. Using these 2 extension points, others developpers can add there own action in your menus and user can customize easily its IDE.
Created attachment 187953 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, Here is a short list of the contributed modifications/enhancement attached to this comment : - The only exposed package is org.eclipse.emf.facet.widgets.nattable.api. Everyhing goes through this API for code maintenance purpose. - Every widget actions are now exposed using commands and handlers (native NatTable commands are now longer used). Persistable NatTableWidget options are implemented with Editor/View actions. See the plugin.xml for the complete list of available commands. - Every NatTableWidget container has to implement the INatTableWidgetProvider interface. - NatTableWidget class does no longer implements the IMenuListener interface. It has to be provided with a menu manager. - The NatTableWidget tableInstance field is no longer final in order to be able to directly open a saved .table file in an opened view/editor - The hideColumns() method is now deprecated and has been replaced with the selectColumnsToHide() one. - InstantiationMethod provided with the TableConfiguration are now managed with a LaunchHistory manager. - openSavedTable() method has been copied from org.eclipse.emf.facet.widgets.nattable.workbench.view.NatTableView to NatTableWidget The authors for those plug-in modifications are Gregoire Dupe (Commiter) and myself: (a) I, Nicolas Guyomar, wrote 100% of the code I've provided. (b) I have the right to contribute the code to Eclipse. (c) I contribute the content under the EPL. Regards Nicolas Guyomar
Created attachment 187954 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework Hi, Here is a short list of the contributed modifications/enhancement attached to this comment : - Unnecessary handlers have been removed - The programmatically created editor toolbar has been removed and replaced with org.eclipse.ui.menu extension - NatTableView and NatTableEditor now implements INatTableWidgetProvider - All the necessary icons have been added to the icons folder - The org.eclipse.pde.prefs file has been modified in order to hide warnings caused by the use of IShared icons in the plugin.xml. Those icons existence is resolved at runtime. The authors for those plug-in modifications are Gregoire Dupe (Commiter) and myself: (a) I, Nicolas Guyomar, wrote 100% of the code I've provided. (b) I have the right to contribute the code to Eclipse. (c) I contribute the content under the EPL. Regards Nicolas Guyomar
Created attachment 187957 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, There was a missing exposed package in org.eclipse.emf.facet.widgets.nattable Please find attached the updated plug-in. Regards Nicolas Guyomar
Created attachment 187958 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework Hi, Please find attached the updated plug-in org.eclipse.emf.facet.widgets.nattable.workbench consequently to the recent API modification in org.eclipse.emf.facet.widgets.nattable Regards Nicolas Guyomar
Created attachment 187962 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework Hi, I had to update the plugin.xml file to add common menus to both view and editor Regards Nicolas Guyomar
Created attachment 187969 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, The method org.eclipse.emf.facet.widgets.nattable.NatTableWidget.addRows(List<EObject>) has been added to the interface INatTableWidget for visibility purpose. Regards Nicolas Guyomar
Created attachment 188058 [details] Handler and commands definition examples This zip contains the files plugin.xml for oeef.widget.nattable and oeef.widget.nattable.workbench. In these files, we have moved the condition of enablement for the command "org.eclipse.emf.facet.widgets.nattable.hideColumnCommand" : Now this command is not declared with specific condition and she always tests (enableWhen true) if she has a handler in order to be displayed. A handler is provided for this command, and he owns the enablement condition.
With the previous change, we can declare we own handler AND reuse your toolbar declaration.
(In reply to comment #7) Hi Vincent, I have tested your contribution and this new behaviour implies UI changes which are not common in Eclipse. Setting the <enableWhen> at true for a menu forces it to change state as soon as a workbench change is detected. As a consequence, view's menu (button) will change state when the user is using any other part. The usual behaviour is that menu's state is only toogled from inside its related part. The easiest way for you to reuse our editor's menu in your own one is to duplicate it, and to provide your own handlers for the associated commands if your editor does not implement INatTableWidgetProvider. Regards, Nicolas
Created attachment 188134 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable - oeef.widgets.nattable.NatTableWidget.isCellDeletable() checks if a cell is selected - Interface contained in package org.eclipse.emf.facet.widgets.nattable.api have been documented - NatTableWidget actions do now register themselve to the widget in order to be notified when a saved .table file is opened (this allow the widget to update option's state) Regards, Nicolas
Created attachment 188136 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework Hi, Here is an updated version of org.eclipse.emf.facet.widgets.nattable.workbench - Table description has been inserted at the top of the editor. It is initialized by an empty string - The editor toolbar has been named "EMF Facet NatTable" - NatTableView is now a ISelectionListener so that it can notify the workbench of changes occurring on the widget - Delete and Copy actions are now properly activated depending on the selected cell(s). Regards, Nicolas
Thank You for these changes. Regards, Vincent
Created attachment 188240 [details] another way to define visibleWhen for command - part1 Another way to define visibleWhen for command
Created attachment 188241 [details] another Way to define visibleWhen for command - part 2/2 another Way to define visibleWhen for command
(In reply to comment #9) Hi, Nicolas, I'm agree, my last contribution was not good for you. I find another way to have the behavior that we want, without duplicate menus and handler. For the example, I worked on SelectAll handler and Select Column To Hide In the plugin Nattable : - I added a org.eclipse.core.expressions.PropertyTester which provided 2 tests : - one on the activePart - one on the selection (tricks for Papyrus adaptation because activePart was not sufficient) - I modified HideColumnHandler and SelectAll handler in order that they work with Papyrus - in the plugin.xml : I added my property tester and I modify the activation for the SelectAll Handler - In the pluggin workbench : I change the visibleWhen for the Select Column To Hide command I hope I have nothing forget. What do you think about these new changes? Don't hesitate to call me if you want more explanations. Regards, Vincent Lorenzo
Created attachment 188249 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable which solved the synchronization problem with changes occurring outside of the table. This solve Bug 335023 as well. Regards, Nicolas
Comment on attachment 188058 [details] Handler and commands definition examples Hi, Only the EMF Facet’s committers have to flag an attachment with iplog+. An attachment is flagged iplog+ only when it has been committed to the SVN because all the iplog+ flags appear in the automatically generated IP log. Regards, Gregoire Dupe
Created attachment 188317 [details] Contains the property tester and its usages in the plugin.xml files Contains - the property tester declaration in plugin.xml - the plugin.xml using this tester - the class of the tester itself
(In reply to comment #18) > Created attachment 188317 [details] > Contains the property tester and its usages in the plugin.xml files > > Contains > - the property tester declaration in plugin.xml > - the plugin.xml using this tester > - the class of the tester itself (a) I, Vincent Lorenzo, wrote 100% of the code of this contribution. (b) I have the right to contribute the code to Eclipse. (c) I contribute the content under the EPL.
Created attachment 188331 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable which takes in account comment #18 EMF Facet NatTable handler enable state are now using Adapter instead of static Editor/View ID. Regards, Nicolas Guyomar
Created attachment 188332 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable.workbench which takes in account comment #18 EMF Facet NatTable menu enable state are now using a property tester on the current selection. Regards, Nicolas Guyomar
Created attachment 188333 [details] Toogle button in Toolbar example This attachment contains an example for the toggle button. This example provides 2 actions : - Hide Empty Column - Show only the common column The ToggleStateProvider listen the selection in order to manage the state of the command. The buttons for these actions are duplicate in the toolbar, in order to see the synchronization between them. Please notice that when you use the button provided by the nattable editor for doing the action, the selection doesn't changed, so the button provided by my plugin is not refreshed (and vice versa). It's not a bug! (a) I, Vincent Lorenzo, wrote 100% of the code of this contribution. (b) I have the right to contribute the code to Eclipse. (c) I contribute the content under the EPL.
Created attachment 188337 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable I have modified the NatTableWidget.updateColumnSort(). The sorting behaviour is now implemented in the sortColumnsByType() method, which uses now EMF command to update the columns order in the model. The interface INatTableWidget has been modified to takes in account those API changes. I have deleted the uneccessary interfacet ITableSettings which was no longer needed Regards, Nicolas Guyomar
Created attachment 188338 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable.workbench I have modified the action "Sort column byt type" for a menu contribution (push button) using the new command "Sort Column by type" Regards, Nicolas Guyomar
Created attachment 188339 [details] Updated org.eclipse.emf.facet.widgets.nattable.instance Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable.instance I have modified the meta-model in order not to serialize the old option "sort column by type" Regards, Nicolas Guyomar
(In reply to comment #22) Hi Vincent, Unfortunately Eclipse 3.x does not support "local" value for command. A command state is propagated within the workbench as soon as its state changes. Your solution seems to work because you are using 2 editors to check the expected behavior. If you open at the same time a NatTableView and a NatTableEditor you will find out that the menus are still synchronized. The thing is that with 2 editors, when we switch the active part the toolbar is updated thanks to your selectionListener, which give us the impression of a "local" state. Am I correct or do you have another behavior in your Eclipse instance ? Regards, Nicolas
(In reply to comment #26) For the record, a confirmation of this behavior by Prakash G. R. : http://blog.eclipse-tips.com/2009/03/commands-part-6-toggle-radio-menu.html#Blog1_cmt-1392001751312477089 Regards, Nicolas Guyomar
(In reply to comment #26) > (In reply to comment #22) Hi Nicolas, did you change something for the nattable view commands? And what? On my Eclipse, I don't see interaction between the current view and my example plugin...
Created attachment 188567 [details] New version of the plugin.xml for popup menu for the table Currently, after the Nattable Integration in Papyrus, the actions defined in the popup menu popup:org.eclipse.emf.facet.widgets.nattable.workbench.editor.NatTableEditor are not visible from the Nattable Papyrus Editor. In order to correct that, I suggest the following changes : the new path for the popup is popup:org.eclipse.ui.popup.any value for allPopups:true and we add visibleWhen for each command (like for the toolbar command) Moreover, the following popup can be removed popup:org.eclipse.emf.facet.widgets.nattable.workbench.view.NatTableView because it's redundant with the new declaration (a) I, Vincent Lorenzo, wrote 100% of the code of this contribution. (b) I have the right to contribute the code to Eclipse. (c) I contribute the content under the EPL.
I'm sorry, my last contribution is not entirely correct, because the popup appears in each part, when the open editor is a table.
Created attachment 188572 [details] New version of the nattable.workbench.plugin.xml Currently, after the Nattable Integration in Papyrus, the actions defined in the popup menu popup:org.eclipse.emf.facet.widgets.nattable.workbench.editor.NatTableEditor are not visible from the Nattable Papyrus Editor. In order to correct that, I suggest the following changes : the new path for the popup is popup:org.eclipse.ui.popup.any value for allPopups:true With this path, the popup is always available, that's why, we add a visibleWhen on each command : - a test to be sure that the activePart is an Editor, if not, we don't display the commands - a test to know is the activeEditor is a nattable editor (like for the commands in the toolbar) So the popup is restricted to the Editor, when they are nattable editor. (a) I, Vincent Lorenzo, wrote 100% of the code of this contribution. (b) I have the right to contribute the code to Eclipse. © I contribute the content under the EPL.
Created attachment 188669 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework (In reply to comment #31) Hi Vincent, I've added your contribution to the plug-in org.eclipse.emf.facet.widgets.nattable.workbench. Thank you, Regards, Nicolas
Created attachment 188671 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Hi, Please find attached an updated version of org.eclipse.emf.facet.widgets.nattable which solves asynchronous null pointer that can occurred when the table is closed. Regards, Nicolas Guyomar
Comment on attachment 188317 [details] Contains the property tester and its usages in the plugin.xml files This contribution provides only an implementation pattern which can be summarized by the following 17 lines : <command commandId="org.eclipse.emf.facet.widgets.nattable.exportCommand" icon="icons/export.gif" style="push" tooltip="%export.xmi"> <visibleWhen checkEnabled="false"> <with variable="selection"> <test forcePluginActivation="true" property="org.eclipse.emf.facet.widgets.nattable.workbench.tableSelectionTester.isTable" value="true"> </test> </with> </visibleWhen> </command> This contribution is smaller than 250 lines. Then, it can be committed without any CQ. Committed revision 316.
Comment on attachment 188339 [details] Updated org.eclipse.emf.facet.widgets.nattable.instance Here are a contribution from one employee of Mia-Software, targeting future Indigo release. The company has signed a Member Commiter Agreement. The contribution does not need a CQ (see bug 322327). I've committed this contribution. Committed revision 316.
Comment on attachment 188669 [details] Updated org.eclipse.emf.facet.widgets.nattable.workbench to use Eclipse Framework Here are a contribution from one employee of Mia-Software, targeting future Indigo release. The company has signed a Member Commiter Agreement. The contribution does not need a CQ (see bug 322327). I've committed this contribution. Committed revision 316.
Comment on attachment 188671 [details] Updated org.eclipse.emf.facet.widgets.nattable to use Eclipse Framework Here are a contribution from one employee of Mia-Software, targeting future Indigo release. The company has signed a Member Commiter Agreement. The contribution does not need a CQ (see bug 322327). I've committed this contribution. Committed revision 316.
I've added the nattable widget components in the releng. Committed revision 317.
Actions provided by the toolbar : - load a customization - load an EMF-Facet - open a table - select column to hide - sort column by type are always enabled when a Nattable Editor is open, but, when we are in a view, these actions do nothing. Maybe you should use HandlerUtil.getActiveEditor(event) and not HandlerUtil.getActivePart(event) in your handlers.
Created attachment 189680 [details] Bug 335020 Toolbar Visibility (In reply to comment #39) Hi Vincent, Indeed, keeping the editor toolbar opened while working in the view was not Eclipse like. I also removed the "export xmi" and "open saved table" from the editor toolbar (they were added by mistake in previous version), since those actions are performed with the usual "Save As" and "Open" actions. About the attached patch : (a) I, Nicolas Guyomar, wrote 100% of the code I've provided. (b) I have the right to contribute the code to Eclipse. (c) I contribute the content under the EPL. Regards, Nicolas Guyomar
Hi Nicolas, toolbar visibility : your patch works fine! Thank you, but as far as I'm concerned, I prefer see actions changing state, rather than see them appear/disappear from the toolbar, like the GMF behavior. - export xmi : your solution hide the Bug 337134 : when we are in Papyrus, it's the Papyrus Save as action which is done and not the Nattable Save as Action. Nevertheless, I think it should be interesting to fix the bug. In the Papyrus case, this action allows to store the table in a new file (currently, it is stored in the Papyrus .di file) - Open Action, not problem, it's better for us. Regards, Vincent Lorenzo
Comment on attachment 189680 [details] Bug 335020 Toolbar Visibility Here are a contribution from one employee of Mia-Software, targeting future Indigo release. The company has signed a Member Commiter Agreement. The contribution does not need a CQ (see bug 322327). I've committed this contribution. Committed revision 334.
(In reply to comment #41) > I prefer see actions changing state, rather than see them appear/disappear from the toolbar, like the GMF behavior. So do I, but it is not technically possible. The bug can then be marked as fixed. Regards, Grégoire
This bug can be marked as closed.