SwingWindowManager.java
01 /*
02  * Copyright 2008-2016 the original author or authors.
03  *
04  * Licensed under the Apache License, Version 2.0 (the "License");
05  * you may not use this file except in compliance with the License.
06  * You may obtain a copy of the License at
07  *
08  *     http://www.apache.org/licenses/LICENSE-2.0
09  *
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  */
16 package griffon.swing;
17 
18 import griffon.core.view.WindowManager;
19 
20 import javax.annotation.Nonnull;
21 import javax.annotation.Nullable;
22 import javax.swing.JInternalFrame;
23 import java.awt.Window;
24 import java.util.Set;
25 
26 /**
27  @author Andres Almiray
28  @since 2.0.0
29  */
30 public interface SwingWindowManager extends WindowManager<Window> {
31     /**
32      * Returns a set of names related to all JInternalFrames managed by this manager.
33      *
34      @return a Set of managed window names
35      @since 2.3.0
36      */
37     @Nonnull
38     Set<String> getInternalWindowNames();
39 
40     /**
41      * Lookups a name related to a JInternalFrame.
42      *
43      @param window the window to be looked up
44      @return the name of the window if it's managed by this manager, <tt>null</tt> otherwise.
45      @since 2.3.0
46      */
47     @Nullable
48     String findInternalWindowName(@Nonnull JInternalFrame window);
49 
50     /**
51      * Lookups the index related to a JInternalFrame.
52      *
53      @param window the window to be looked up
54      @return the index of the window if it's managed by this manager, <tt>-1</tt> otherwise.
55      @since 2.3.0
56      */
57     int indexOfInternal(@Nonnull JInternalFrame window);
58 }