1 /*
2 * Metis: Java Data Framework
3 * Copyright 2026. Tony Washer
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18 package io.github.tonywasher.joceanus.metis.viewer;
19
20 import io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistrar.OceanusEventProvider;
21
22 import java.util.Iterator;
23
24 /**
25 * Viewer Data Manager.
26 */
27 public interface MetisViewerManager
28 extends OceanusEventProvider<MetisViewerEvent> {
29 /**
30 * Set focused entry.
31 *
32 * @param pEntry the entry to focus on
33 */
34 void setFocus(MetisViewerEntry pEntry);
35
36 /**
37 * Get focused entry.
38 *
39 * @return the focused entry
40 */
41 MetisViewerEntry getFocus();
42
43 /**
44 * Fire event.
45 *
46 * @param pEventId the eventId
47 * @param pValue the relevant value
48 */
49 void fireEvent(MetisViewerEvent pEventId,
50 Object pValue);
51
52 /**
53 * Get NextId.
54 *
55 * @return the next id
56 */
57 int getNextId();
58
59 /**
60 * Obtain standard entry.
61 *
62 * @param pEntry the standard entry id
63 * @return the viewer entry
64 */
65 MetisViewerEntry getStandardEntry(MetisViewerStandardEntry pEntry);
66
67 /**
68 * Create a new entry.
69 *
70 * @param pName the name of the new entry
71 * @return the new entry
72 */
73 MetisViewerEntry newEntry(String pName);
74
75 /**
76 * Create a new entry under parent.
77 *
78 * @param pParent the parent entry
79 * @param pName the name of the new entry
80 * @return the new entry
81 */
82 MetisViewerEntry newEntry(MetisViewerEntry pParent,
83 String pName);
84
85 /**
86 * Get root iterator.
87 *
88 * @return the iterator
89 */
90 Iterator<MetisViewerEntry> rootIterator();
91 }