SEBSERV-203 fixed

This commit is contained in:
anhefti 2021-06-29 13:26:21 +02:00
parent d76f1f5ca9
commit 24d5c4feea
4 changed files with 33 additions and 19 deletions

View file

@ -61,9 +61,10 @@ public class ActionPane implements TemplateComposer {
@Override
public void compose(final PageContext pageContext) {
final Composite root = pageContext.getParent();
final Map<String, Tree> actionTrees = new HashMap<>();
final Label label = this.widgetFactory.labelLocalized(
pageContext.getParent(),
root,
CustomVariant.TEXT_H2,
TITLE_KEY);
@ -75,10 +76,24 @@ public class ActionPane implements TemplateComposer {
}
label.setLayoutData(titleLayout);
final Composite scroll = PageService.createManagedVScrolledComposite(
root,
scrolledComposite -> {
final Composite composite = new Composite(scrolledComposite, SWT.NONE);
final GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
final GridLayout gridLayout = new GridLayout();
gridLayout.horizontalSpacing = 0;
gridData.heightHint = 0;
composite.setLayoutData(gridData);
composite.setLayout(gridLayout);
return composite;
},
false, false, true);
label.setData(
PageEventListener.LISTENER_ATTRIBUTE_KEY,
(ActionPublishEventListener) event -> {
final Composite parent = pageContext.getParent();
final Composite parent = scroll;
final Tree treeForGroup = getTreeForGroup(actionTrees, parent, event.action.definition, true);
final TreeItem actionItem = ActionPane.this.widgetFactory.treeItemLocalized(
treeForGroup,
@ -101,18 +116,10 @@ public class ActionPane implements TemplateComposer {
parent.layout();
});
final Composite composite = new Composite(pageContext.getParent(), SWT.NONE);
final GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
final GridLayout gridLayout = new GridLayout();
gridLayout.horizontalSpacing = 0;
gridData.heightHint = 0;
composite.setLayoutData(gridData);
composite.setLayout(gridLayout);
composite.setData(
scroll.setData(
PageEventListener.LISTENER_ATTRIBUTE_KEY,
(ActionActivationEventListener) event -> {
final Composite parent = pageContext.getParent();
final Composite parent = scroll;
for (final ActionDefinition ad : event.actions) {
final TreeItem actionItem = findAction(actionTrees, parent, ad);
if (actionItem == null) {

View file

@ -378,7 +378,7 @@ public interface PageService {
final Composite parent,
final Function<ScrolledComposite, Composite> contentFunction,
final boolean showScrollbars) {
return createManagedVScrolledComposite(parent, contentFunction, showScrollbars, false);
return createManagedVScrolledComposite(parent, contentFunction, showScrollbars, true, false);
}
/** Creates a ScrolledComposite with content supplied the given content creation function.
@ -391,16 +391,21 @@ public interface PageService {
* @param parent the parent Composite of the ScrolledComposite
* @param contentFunction the content creation function
* @param showScrollbars indicates whether the scrollbar shall always be shown
* @param showBorder indicates whether a border is shown for the composite or not
* @param fill indicates if the content shall be vertically filled
* @return the child composite that is scrolled by the newly created ScrolledComposite */
static Composite createManagedVScrolledComposite(
final Composite parent,
final Function<ScrolledComposite, Composite> contentFunction,
final boolean showScrollbars,
final boolean showBorder,
final boolean fill) {
final ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.BORDER | SWT.V_SCROLL);
scrolledComposite.setLayoutData(new GridData(SWT.FILL, (fill) ? SWT.FILL : SWT.TOP, true, true));
final ScrolledComposite scrolledComposite = new ScrolledComposite(
parent,
(showBorder) ? SWT.BORDER | SWT.V_SCROLL : SWT.V_SCROLL);
final GridData gridData = new GridData(SWT.FILL, (fill) ? SWT.FILL : SWT.TOP, true, true);
scrolledComposite.setLayoutData(gridData);
final Composite content = contentFunction.apply(scrolledComposite);
scrolledComposite.setContent(content);

View file

@ -323,6 +323,7 @@ public class WidgetFactory {
return g;
},
false,
true,
false);
}
@ -340,6 +341,7 @@ public class WidgetFactory {
return g;
},
false,
true,
true);
}

View file

@ -3,7 +3,8 @@
color: #4a4a4a;
background-image: none;
background-color: #FFFFFF;
padding: 0;
padding: 0;
border: none;
}
*:disabled {
@ -142,10 +143,9 @@ Label.colorlight {
Composite {
background-color: transparent;
border: none;
}
Composite.bordered {
border: 2px;
}
@ -402,7 +402,7 @@ Combo-Field {
padding: 3px 0px 1px 10px;
}
Combo.error, , Combo[BORDER].error {
Combo.error, Combo[BORDER].error {
border: 1px solid #aa0000;
border-radius: 0 2px 2px 0;
}