Skip to content

Package: TableViewerCompositeBuilder

TableViewerCompositeBuilder

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.swt.table;
15:
16: import java.util.List;
17:
18: import org.eclipse.emfforms.common.Optional;
19: import org.eclipse.swt.widgets.Composite;
20: import org.eclipse.swt.widgets.Control;
21: import org.eclipse.swt.widgets.Label;
22:
23: /**
24: * <p>
25: * A {@link TableViewerCompositeBuilder} is used to create the overall {@link Composite} hierarchy for the
26: * {@link TableViewerComposite}. The layout will be created by a call to {@link #createCompositeLayout(Composite)}.
27: * This method is supposed to create at least a parent composite for {@link org.eclipse.jface.viewers.TableViewer
28: * TableViewer}.
29: * </p>
30: * <p>
31: * Optionally this builder may create a {@link Label} which will show a title/description for the table.
32: * </p>
33: * <p>
34: * Optionally this builder may create multiple controls which will show status/validation results. These controls will
35: * be accessible.
36: * </p>
37: * <p>
38: * Optionally this builder may create a parent {@link Composite} which will contain all
39: * {@link org.eclipse.swt.widgets.Button Buttons} to
40: * control/modify the table entries.
41: * </p>
42: *
43: * @author Johannes Faltermeier
44: *
45: */
46: public interface TableViewerCompositeBuilder {
47:
48:         /**
49:          * Called to create the {@link Composite composites}.
50:          *
51:          * @param parent the parent
52:          */
53:         void createCompositeLayout(Composite parent);
54:
55:         /**
56:          * Called after {@link #createCompositeLayout(Composite)}.
57:          *
58:          * @return the title {@link Label} if available
59:          */
60:         Optional<Label> getTitleLabel();
61:
62:         /**
63:          * Called after {@link #createCompositeLayout(Composite)}.
64:          *
65:          * @return the list of validation {@link Control controls}.
66:          */
67:         Optional<List<Control>> getValidationControls();
68:
69:         /**
70:          * Called after {@link #createCompositeLayout(Composite)}.
71:          *
72:          * @return the parent {@link Composite} for {@link org.eclipse.swt.widgets.Button control-buttons}.
73:          */
74:         Optional<Composite> getButtonComposite();
75:
76:         /**
77:          * Called after {@link #createCompositeLayout(Composite)}.
78:          *
79:          * @return the parent {@link Composite} for the {@link org.eclipse.jface.viewers.AbstractTableViewer TableViewer}.
80:          */
81:         Composite getViewerComposite();
82:
83: }