blob: f1ea508c9f1de67a67bfeb0151377cb77fcdff09 [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 /**
Thomas Vachuska2b4de872021-03-30 16:31:34 -070059 * Registers the specified topo hilighter factory.
60 *
61 * @param factory UI topo higlighter factory to register
62 */
63 default void register(UiTopoHighlighterFactory factory) {
64 }
65
66 /**
67 * Unregisters the specified user interface extension.
68 *
69 * @param factory UI topo higlighter factory to unregister
70 */
71 default void unregister(UiTopoHighlighterFactory factory) {
72 }
73
74 /**
Simon Hunt8add9ee2016-09-20 17:05:07 -070075 * Returns the list of registered user interface extensions.
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080076 *
77 * @return list of extensions
78 */
79 List<UiExtension> getExtensions();
80
81 /**
82 * Returns the user interface extension that contributed the specified view.
83 *
84 * @param viewId view identifier
Simon Hunt8add9ee2016-09-20 17:05:07 -070085 * @return contributing user interface extension
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -080086 */
87 UiExtension getViewExtension(String viewId);
Simon Hunt23f9c7b2017-07-10 20:00:30 -070088
89 /**
Laszlo Papp759f0d32018-03-05 13:24:30 +000090 * Returns the list of registered user interface glyphs.
91 *
92 * @return list of glyphs
93 */
94 default List<UiGlyph> getGlyphs() {
95 return new ArrayList<UiGlyph>();
96 }
97
98 /**
Thomas Vachuska2b4de872021-03-30 16:31:34 -070099 * Returns the list of registered topo highlighter factories.
100 *
101 * @return list of highlighter factories
102 */
103 default List<UiTopoHighlighterFactory> getTopoHighlighterFactories() {
104 return new ArrayList<UiTopoHighlighterFactory>();
105 }
106
107 /**
Simon Hunt23f9c7b2017-07-10 20:00:30 -0700108 * Returns the navigation pane localization bundle.
109 *
110 * @return the navigation localization bundle
111 */
112 LionBundle getNavLionBundle();
Thomas Vachuska1b1355d2018-02-06 16:53:58 -0800113
114 /**
115 * Refreshes the backing model.
116 */
117 void refreshModel();
Thomas Vachuskafe8c98a2015-02-04 01:24:32 -0800118}