Coverage Report - org.openpermis.editor.policy.view.View
 
Classes in this File Line Coverage Branch Coverage Complexity
View
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport
 3  
  *                     (http://www.vbs.admin.ch)
 4  
  * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch)
 5  
  * All rights reserved.
 6  
  *
 7  
  * Licensed under the Open Permis License which accompanies this distribution,
 8  
  * and is available at http://www.openpermis.org/BSDlicenceKent.txt
 9  
  */
 10  
 package org.openpermis.editor.policy.view;
 11  
 
 12  
 import javax.swing.Icon;
 13  
 import javax.swing.JComponent;
 14  
 
 15  
 /**
 16  
  * Describes a user interface view element.
 17  
  * <p>There are two types of views:</p>
 18  
  * <ul>
 19  
  * <li>{@link Tool} Views</li>
 20  
  * <li>{@link Editor} Views</li>
 21  
  * </ul>
 22  
  * @since 0.1.0
 23  
  */
 24  
 public interface View {
 25  
         
 26  
         //---- Methods
 27  
         
 28  
         /**
 29  
          * Attaches this object to the specified context.
 30  
          * @param context the context to attach the object to.
 31  
          * @since 0.1.0
 32  
          */
 33  
         public void attach (ViewContext context);
 34  
         
 35  
         /**
 36  
          * Detaches this object from the specified context.
 37  
          * @param context the context to attach the object to.
 38  
          * @since 0.1.0
 39  
          */
 40  
         public void detach (ViewContext context);
 41  
         
 42  
         /**
 43  
          * Returns the title of this view.
 44  
          * @return the title of this view.
 45  
          * @since 0.1.0
 46  
          */
 47  
         public String getTitle ();
 48  
         
 49  
         /**
 50  
          * Returns the icon of this view.
 51  
          * @return the icon of this view.
 52  
          * @since 0.1.0
 53  
          */
 54  
         public Icon getIcon ();
 55  
         
 56  
         /**
 57  
          * Returns the content pane of this view.
 58  
          * @return the content pane of this view.
 59  
          * @since 0.1.0
 60  
          */
 61  
         public JComponent getContentPane ();
 62  
         
 63  
         /**
 64  
          * Prompts the view to save unsaved changes before closing.
 65  
          * @return {@code true} if the view may be closed, {@code false} otherwise.
 66  
          * @since 0.1.0
 67  
          */
 68  
         public boolean canClose ();
 69  
 
 70  
 }