Community
Participate
Working Groups
Table creation is available when the selected element is not an Element. Steps to reproduce : 1/ Create a new diagram or a new table in a model 2/ Select the table of the diagram in the ModelExplorer 3/ In the menu "New Table", the Default Table is available (the table will be created using the root of the model)
A first part has been done in R5531 on branch and merged in R5532 on the trunk and reverted in R5533 The action is not correctly refreshed in the Menu table and in the Toolbar. I think we should create a new PropertyTester to refresh the action. We give it as argument the ClassName of the Handler for the command creation. We load the handler class from its name and the property tester return handler.isEnabled(). I think this solution should be generalized to force the refresh of the action. Drawback : we use java reflexive with the method class.load + we should comment the following lines in AbstractCreateNattableEditorCommand.getTableContext() : //we shouldn't try to find a valid context when the selection is not valid! ModelSet modelSet = null; ServicesRegistry serviceRegistry; try { serviceRegistry = ServiceUtilsForActionHandlers.getInstance().getServiceRegistry(); modelSet = ServiceUtils.getInstance().getModelSet(serviceRegistry); } catch (NullPointerException npe) { // } catch (ServiceException exception) { } if(modelSet != null) { IModel model = modelSet.getModel(org.eclipse.papyrus.resource.uml.UmlModel.MODEL_ID); if(model instanceof AbstractBaseModel) { return getRootElement(((AbstractBaseModel)model).getResource()); } }
Works as expected in the current version (New table implementation)