KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > spi > editor > DialogFactory


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.spi.editor;
21
22 import java.awt.Dialog JavaDoc;
23 import java.awt.event.*;
24 import javax.swing.*;
25
26 /**
27  * DialogFactory implementation is a class responsible for providing
28  * proper implementation of Dialog containing required widgets.
29  * It can provide the dialog itself or delegate the functionality
30  * to another piece of code, e.g some windowing system.
31  *
32  * @author pnejedly
33  * @version 1.0
34  */

35 public interface DialogFactory {
36     
37     /**
38      * The method for creating a dialog with specified properties.
39      *
40      * @param title The title of created dialog.
41      * @param panel The content of the dialog to be displayed.
42      * @param modal Whether the dialog should be modal.
43      * @param buttons The array of JButtons to be added to the dialog.
44      * @param sidebuttons The buttons could be placed under the panel (false),
45      * or on the right side of the panel (true).
46      * @param defaultIndex The index of default button in the buttons array,
47      * if <CODE>index < 0</CODE>, no default button is set.
48      * @param cancelIndex The index of cancel button - the button that will
49      * be <I>pressed</I> when closing the dialog.
50      * @param listener The listener which will be notified of all button
51      * events.
52      *
53      * @return newly created <CODE>Dialog</CODE>
54      */

55     public Dialog JavaDoc createDialog( String JavaDoc title, JPanel panel, boolean modal,
56             JButton[] buttons, boolean sidebuttons, int defaultIndex,
57             int cancelIndex, ActionListener listener );
58 }
59
Popular Tags