Skip to content

Package: TableControlService

TableControlService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2016 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.emf.ecp.view.spi.table.swt;
15:
16: import org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecore.EStructuralFeature;
19: import org.eclipse.emf.ecp.view.spi.table.model.VTableControl;
20: import org.eclipse.emfforms.common.Optional;
21:
22: /**
23: * Service used by the {@link TableControlSWTRenderer} to customize button behaviour.
24: *
25: * @author Johannes Faltermeier
26: * @since 1.9
27: *
28: */
29: public interface TableControlService {
30:
31:         /**
32:          * This method is called by the {@link TableControlSWTRenderer} when the add button was pressed. Implementors are
33:          * supposed to create a new element <b>but not yet add</b> it to the multireference.
34:          *
35:          * @param clazz the {@link EClass} defining the EObject to create
36:          * @param eObject The reference {@link EObject}
37:          * @param structuralFeature The reference {@link EStructuralFeature}
38:          * @return the object which will be added
39:          */
40:         Optional<EObject> createNewElement(EClass clazz, EObject eObject, EStructuralFeature structuralFeature);
41:
42:         /**
43:          * Called when an object in the table is double clicked.
44:          *
45:          * @param table the table control
46:          * @param eObject the object which was double clicked
47:          */
48:         void doubleClick(VTableControl table, EObject eObject);
49: }