Commit e51735d1 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

BS-2064

fix group display in generated connector wizard page
parent b035a8dc
......@@ -41,7 +41,7 @@ public class BonitaStudioFontRegistry {
}
public static Font getHighlightedFont() {
FontData[] data = Display.getDefault().getSystemFont().getFontData();
final FontData[] data = Display.getDefault().getSystemFont().getFontData();
int height = 8;
if (data.length > 0 && data[0].height > 0) {
height = (int) data[0].height;
......@@ -82,14 +82,14 @@ public class BonitaStudioFontRegistry {
* the font with style and size + cache it into font registry
*
*/
private static Font getFont(String fontID, int size, int style) {
private static Font getFont(final String fontID, final int size, final int style) {
if (fontRegistry == null) {
fontRegistry = JFaceResources.getFontRegistry();
}
if (fontRegistry.hasValueFor(fontID)) {
return fontRegistry.get(fontID);
} else {
FontData fd = new FontData(fontID, size, style);
final FontData fd = new FontData(fontID, size, style);
fontRegistry.put(fontID, new FontData[] { fd });
return fontRegistry.get(fontID);
}
......@@ -99,4 +99,8 @@ public class BonitaStudioFontRegistry {
return getFont("italic_font", 9, SWT.ITALIC);
}
public static Font getBoldFont() {
return getFont("bold_font", 9, SWT.BOLD);
}
}
......@@ -18,6 +18,7 @@ import java.util.HashSet;
import java.util.Set;
import org.bonitasoft.studio.common.ExpressionConstants;
import org.bonitasoft.studio.common.jface.BonitaStudioFontRegistry;
import org.bonitasoft.studio.common.jface.databinding.validator.EmptyInputValidator;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.connector.model.definition.Array;
......@@ -512,8 +513,17 @@ public class PageComponentSwitchBuilder {
}
public Section createGroupControl(final Composite composite, final Group object) {
final Section groupSection = new Section(composite, Section.NO_TITLE_FOCUS_BOX | Section.TWISTIE | Section.CLIENT_INDENT);
final String desc = messageProvider.getFieldDescription(definition, object.getId());
int style = Section.NO_TITLE_FOCUS_BOX | Section.TWISTIE | Section.CLIENT_INDENT;
if (desc != null && !desc.isEmpty()) {
style = style | Section.DESCRIPTION;
}
final Section groupSection = new Section(composite, style);
groupSection.setText(getLabel(object.getId()));
groupSection.setFont(BonitaStudioFontRegistry.getBoldFont());
if (desc != null && !desc.isEmpty()) {
groupSection.setDescription(desc);
}
groupSection.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
return groupSection;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment