Skip to content

Package: UIProvider

UIProvider

nameinstructionbranchcomplexitylinemethod
static {...}
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2012 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: * Eike Stepper - initial API and implementation
13: * Eugen Neufeld - JavaDoc
14: *
15: *******************************************************************************/
16:
17: package org.eclipse.emf.ecp.spi.ui;
18:
19: import org.eclipse.core.runtime.IAdaptable;
20: import org.eclipse.emf.ecp.core.util.ECPCheckoutSource;
21: import org.eclipse.emf.ecp.core.util.ECPContainer;
22: import org.eclipse.emf.ecp.core.util.ECPProperties;
23: import org.eclipse.emf.ecp.spi.core.InternalProvider;
24: import org.eclipse.emf.ecp.spi.core.util.AdapterProvider;
25: import org.eclipse.emf.ecp.spi.core.util.InternalRegistryElement;
26: import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
27: import org.eclipse.jface.action.IMenuManager;
28: import org.eclipse.jface.viewers.ILabelProvider;
29: import org.eclipse.swt.graphics.Image;
30: import org.eclipse.swt.widgets.Composite;
31: import org.eclipse.swt.widgets.Control;
32: import org.eclipse.swt.widgets.Text;
33:
34: /**
35: * @author Eike Stepper
36: * @since 1.1
37: */
38: public interface UIProvider extends InternalRegistryElement, IAdaptable, AdapterProvider {
39:         /** The Type of the Element. **/
40:         String TYPE = "UIProvider";
41:         /** The LabelProvider to use in UIProviders. **/
42:         ILabelProvider EMF_LABEL_PROVIDER = new AdapterFactoryLabelProvider(InternalProvider.EMF_ADAPTER_FACTORY);
43:
44:         /**
45:          * Returns the corresponding Provider for this UI Provider.
46:          *
47:          * @return the corresponding {@link InternalProvider}
48:          */
49:         InternalProvider getProvider();
50:
51:         /**
52:          * Returns the name for an element.
53:          *
54:          * @param element the object to return the name for
55:          * @return the name of this element
56:          */
57:         String getText(Object element);
58:
59:         /**
60:          * Returns the image for an element.
61:          *
62:          * @param element the object to return the image for
63:          * @return the name of this element
64:          */
65:         Image getImage(Object element);
66:
67:         /**
68:          * Allows the UIProvider to fill the context menu specifically.
69:          *
70:          * @param manager the {@link IMenuManager} to fill
71:          * @param context the current selected {@link ECPContainer}
72:          * @param elements the selected elements
73:          */
74:         void fillContextMenu(IMenuManager manager, ECPContainer context, Object[] elements);
75:
76:         /**
77:          * The UIProvider can return its provider specific UI to allow the user to fill in provider specific data during the
78:          * creation of an Repository.
79:          *
80:          * @param parent the {@link Composite} to fill
81:          * @param repositoryProperties the {@link ECPProperties} of the repository to create
82:          * @param repositoryNameText the {@link Text} widget handling the repository name
83:          * @param repositoryLabelText the {@link Text} widget handling the repository label
84:          * @param repositoryDescriptionText the {@link Text} widget handling the repository description
85:          * @return the created control
86:          */
87:         Control createAddRepositoryUI(Composite parent, ECPProperties repositoryProperties, Text repositoryNameText,
88:                 Text repositoryLabelText, Text repositoryDescriptionText);
89:
90:         /**
91:          * The UIProvider can return a provider specific UI to allow the user to fill in provider specific data for a
92:          * checkout.
93:          *
94:          * @param parent the {@link Composite} to fill
95:          * @param checkoutSource the Object to checkout
96:          * @param projectProperties the {@link ECPProperties} of the project to create
97:          * @return the created control
98:          */
99:         Control createCheckoutUI(Composite parent, ECPCheckoutSource checkoutSource, ECPProperties projectProperties);
100:
101:         /**
102:          * The UIProvider can return a provider specific UI to allow the user to fill in provider specific data for the
103:          * creation of a new project.
104:          *
105:          * @param parent the {@link Composite} to fill
106:          * @param observer the observer
107:          * @param projectProperties the {@link ECPProperties} of the project to create
108:          * @return the created control
109:          */
110:         Control createNewProjectUI(Composite parent, CompositeStateObserver observer, ECPProperties projectProperties);
111: }