blob: 9e03a516304397358015fd65478caa518e78bac3 [file] [log] [blame]
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.ui;
17
Simon Hunt23f9c7b2017-07-10 20:00:30 -070018import org.onosproject.ui.lion.LionBundle;
19
Laszlo Papp759f0d32018-03-05 13:24:30 +000020import java.util.ArrayList;
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080021import java.util.List;
22
23/**
24 * Service for registering user interface extensions.
25 */
26public interface UiExtensionService {
27
28 /**
29 * Registers the specified user interface extension.
30 *
Simon Hunt8add9ee2016-09-20 17:05:07 -070031 * @param extension UI extension to register
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080032 */
33 void register(UiExtension extension);
34
35 /**
36 * Unregisters the specified user interface extension.
37 *
Simon Hunt8add9ee2016-09-20 17:05:07 -070038 * @param extension UI extension to unregister
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080039 */
40 void unregister(UiExtension extension);
41
42 /**
Laszlo Papp759f0d32018-03-05 13:24:30 +000043 * Registers the specified user interface glyph factory.
44 *
45 * @param factory UI glyph factory to register
46 */
47 default void register(UiGlyphFactory factory) {
48 }
49
50 /**
51 * Unregisters the specified user interface glyph factory.
52 *
53 * @param factory UI glyph factory to unregister
54 */
55 default void unregister(UiGlyphFactory factory) {
56 }
57
58 /**
Simon Hunt8add9ee2016-09-20 17:05:07 -070059 * Returns the list of registered user interface extensions.
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080060 *
61 * @return list of extensions
62 */
63 List<UiExtension> getExtensions();
64
65 /**
66 * Returns the user interface extension that contributed the specified view.
67 *
68 * @param viewId view identifier
Simon Hunt8add9ee2016-09-20 17:05:07 -070069 * @return contributing user interface extension
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080070 */
71 UiExtension getViewExtension(String viewId);
Simon Hunt23f9c7b2017-07-10 20:00:30 -070072
73 /**
Laszlo Papp759f0d32018-03-05 13:24:30 +000074 * Returns the list of registered user interface glyphs.
75 *
76 * @return list of glyphs
77 */
78 default List<UiGlyph> getGlyphs() {
79 return new ArrayList<UiGlyph>();
80 }
81
82 /**
Simon Hunt23f9c7b2017-07-10 20:00:30 -070083 * Returns the navigation pane localization bundle.
84 *
85 * @return the navigation localization bundle
86 */
87 LionBundle getNavLionBundle();
Thomas Vachuska1b1355d2018-02-06 16:53:58 -080088
89 /**
90 * Refreshes the backing model.
91 */
92 void refreshModel();
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080093}