Community
Participate
Working Groups
A label size of 0 pixel should be forbidden. Indeed, SWT does not handle a Font with 0 pixel. Currently, if the specifier uses 0 for a label size, this provides the below error: java.lang.IllegalArgumentException: Argument not valid at org.eclipse.swt.SWT.error(SWT.java:4462) at org.eclipse.swt.SWT.error(SWT.java:4396) at org.eclipse.swt.SWT.error(SWT.java:4367) at org.eclipse.swt.graphics.FontData.setHeight(FontData.java:340) at org.eclipse.swt.graphics.FontData.<init>(FontData.java:200) at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refreshFont(GraphicalEditPart.java:890) at org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramContainerEditPart.refreshFont(AbstractDiagramContainerEditPart.java:125) There are 2 concerned fields: * BasicLabelStyleDescription.labelSize (for diagram and tree) * ForegroundStyleDescription.labelSize (for table) The corresponding property sections, BasicLabelStyleDescriptionLabelSizePropertySection and ForegroundStyleDescriptionLabelSizePropertySection, should forbid that. And perhaps a validation rule should be added.
New Gerrit change created: https://git.eclipse.org/r/45001
DTreeElementSynchronizerSpec, StyleHelper and DtableElementSynchronizer should also avoid to set 0 value for the font size. They might set 1 as minimum value.
Steps to reproduce (User): Open a diagram Select an element Change the label size in the style tab of the properties views The error is logged in the error log Step to reproduce (Specifier) Open a VSM Select or create any label (style) description Descrese the label size in the label tab: 1 should the minimum possible value.
DTreeElementSynchronizerSpec, StyleHelper and DtableElementSynchronizer modification will prevent the error also in case of a style custmization forcing a 0 value. Note: the hide label and hide label per defualt capabilities should soon arrive on container and lists. This should cover the cases for which a specifier might want to set a 0 size.
New Gerrit change created: https://git.eclipse.org/r/52347
Gerrit change https://git.eclipse.org/r/52347 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2a946ad66da34123bdcd0f49ce540d03316240fc
Pushed on the master branch
Verified with 3.1.0.201509211006
Available in Sirius 3.1.0.