Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
GObject
public class Dialog
extends Window
VBox
, and is where widgets such as a Label
or a
Entry
should be packed. The bottom area is known as the
actionArea. This is generally used for packing buttons into the
dialog which may perform functions such as cancel, ok, or apply. The two
areas are separated by a HSeparator
.
A 'modal' dialog (that is, one which freezes the rest of the application from
user input), can be created by calling Window.setModal(boolean)
on
the dialog.
If you want to block waiting for a dialog to return before returning control
flow to your code, you can call run()
. This function enters a
recursive main loop and waits for the user to respond to the dialog,
returning the response ID corresponding to the button the user clicked.
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
void | |
HButtonBox |
|
static Dialog |
|
VBox |
|
Class |
|
EventType |
|
boolean |
|
ResponseType |
|
static Type |
|
void |
|
int |
|
void |
|
void |
|
Methods inherited from class org.gnu.gtk.Container | |
add , addListener , getBooleanChildProperty , getBorderWidth , getChildProperty , getChildren , getEventListenerClass , getEventType , getIntChildProperty , getResizeMode , getType , remove , removeListener , resizeChildren , setBooleanChildProperty , setBorderWidth , setChildProperty , setIntChildProperty , setResizeMode |
public Dialog()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Construct a new Dialog object
public Dialog(Handle handle)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Construct a dialog using a handle to a native resource.
public void addButton(String buttonText, int responseId)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Adds a button with the given text and sets things up so that clicking the button will emit the "response" event with the givenresponseId
.
- Parameters:
buttonText
- The text string to display on the button.responseId
- The response ID to emit when the user clicks the button that is to be added.
public void addButton(GtkStockItem stockItem, int responseId)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Adds a button with the given stock button and sets things up so that clicking the button will emit the "response" event with the givenresponseId
.
- Parameters:
stockItem
- The stock ID for the button to be added.responseId
- The response ID to emit when the user clicks the button that is to be added.
public void addListener(DialogListener listener)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Register an object to handle dialog events.
- See Also:
DialogListener
public void addWidget(Widget child, int responseId)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Adds an activatable widget to the action area of the Dialog, connecting a signal handler that will emit the "response" signal on the dialog when the widget is activated. The Widget is appended to the end of the Dialog's action area.
- Parameters:
child
- An activatable Widget to add to the dialog.responseId
- The response ID to emit when the user clicks the widget.
public HButtonBox getActionArea()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
The lower area of the Dialog where the buttons are located is a HButtonBox. This method will return that container.
- Returns:
- The HButton box that is known as the action area.
public static Dialog getDialog(Handle handle)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Internal static factory method to be used by Java-Gnome only.
public VBox getDialogLayout()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
The upper area of the Dialog where widgets can be added is a VBox. This method will return that layout control.
- Returns:
- The VBox that is the layout control for the dialog.
public Class getEventListenerClass(String signal)
- Overrides:
- getEventListenerClass in interface Container
public EventType getEventType(String signal)
- Overrides:
- getEventType in interface Container
public boolean getHasSeparator()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Access for whether the dialog has a separator.
- Returns:
- true if the Dialog has a separator.
public ResponseType getResponseForWidget(Widget widget)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Gets the response id of a widget in the action area of a dialog.
- Parameters:
widget
- a widget in the action area of this Dialog.
- Returns:
- the response id of the widget, or ResponseType.NONE if the widget doesn't have a response id set.
public static Type getType()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Retrieve the runtime type used by the GLib library.
public void removeListener(DialogListener listener)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Removes a listener
- See Also:
addListener(DialogListener)
public int run()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Blocks in a recursive main loop until the dialog either emits a response signal or is destroyed. The return value can be compared against aResponseType
to determine if a standard return value is emitted. The developer can also set the response type when a button or widget is added to the dialog. If the dialog is destroyed the run method will returnResponseType.NONE
.
- Returns:
- The response that indicates which button the user pressed or
ResponseType.NONE
if the window was destroyed.
public void setDefaultResponse(int responseId)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Sets the last widget in the dialog's action area with the given responseId as the default widget for the dialog. Pressing "Enter" normally activates the default widget.
- Parameters:
responseId
- The response ID.
public void setHasSeparator(boolean setting)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.
Sets whether the dialog has a separator above the buttons. This is true by default.
- Parameters:
setting
- Indicates if a separator should be added to the dialog.