org.gnu.gnome
Class App

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gtk.GtkObject
              |
              +--org.gnu.gtk.Widget
                    |
                    +--org.gnu.gtk.Container
                          |
                          +--org.gnu.gtk.Bin
                                |
                                +--org.gnu.gtk.Window
                                      |
                                      +--org.gnu.gnome.App

public class App
extends Window

The App widget is the main window of a GNOME application. It is a container widget that can hold a single child widget. It also includes facilities for attaching menus, toolbars, a status bar, and widgets that can be docked.


Constructor Summary
App(int handle)
           
App(java.lang.String appname, java.lang.String title)
          Instinates a new Application window with the indicated name and title.
 
Method Summary
 void createMenus(UIInfo[] uiinfos)
          Construct a menu bar and attach it to the specified application window.
 void createToolBar(UIInfo[] uiinfos)
          Construct a toolbar and attach it to the specified application window.
 Widget error(java.lang.String error)
          Display an important error message in an OK dialog or the status bar.
 void flash(java.lang.String flash)
          Flash a message in the status bar for a few moments.
 Widget getDock()
          Returns the dock.
 MenuBar getMenuBar()
          Returns the menu bar.
 java.lang.String getName()
          Gets the name of the application.
 java.lang.String getPrefix()
          Gets the prefix for gnome-config, which is used to save the layout.
 StatusBar getStatusBar()
          Gets the status bar of the application windows.
static Type getType()
          Retrieve the runtime type used by the GLib library.
 VBox getVBox()
          From gnome-app.hThe vbox widget that ties them.
 void insertMenu(java.lang.String path, UIInfo[] uiinfos)
          Inserts a menu in the existing app's menu structure right after the item described by path.
 void installMenuHints(UIInfo[] uiinfos)
          Activate the menu item hings, displaying in the statusbar or appbar.
 boolean layoutConfig()
          If true, the application uses gnome-config to retrieve and save the docking configuration automatically.
 void layoutConfig(boolean enabled)
          If true, the application uses gnome-config to retrieve and save the docking configuration automatically.
 Widget message(java.lang.String message)
          Display a simple message in an OK dialog or the status bar.
 void removeMenus(java.lang.String path, int num)
          Removes num items from the existing app's menu structure beginning with the item described by path.
 void setContent(Widget contents)
          Sets the content area of the application window.
 void setMenuBar(MenuBar menuBar)
          Sets the menu bar of the window.
 void setStatusBar(AppBar appBar)
          Sets the status bar of the application window.
 void setStatusBar(AppBar appBar, Container container)
          Sets the status bar of the application window, but uses the given container widget rather than creating a new one.
 void setStatusBar(StatusBar statusBar)
          Sets the status bar of the application window.
 void setStatusBar(StatusBar statusBar, Container container)
          Sets the status bar of the application window, but uses the given container widget rather than creating a new one.
 void setToolBar(ToolBar toolBar)
          Sets the tool bar of the window.
 Widget warning(java.lang.String warning)
          Display a not-so-important error message in an OK dialog or the status bar.
 
Methods inherited from class org.gnu.gtk.Window
addAccelGroup, deiconify, getFocusWidget, getGravity, getPosition, getSize, getTitle, iconify, maximize, move, present, removeAccelGroup, resize, setDecorated, setDefaultSize, setDefaultWidget, setFocusWidget, setGeometryHints, setGravity, setIcon, setModal, setPosition, setResizable, setTitle, stick, unmaximize, unstick
 
Methods inherited from class org.gnu.gtk.Bin
getChild
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, getBorderWidth, getEventListenerClass, getEventType, getResizeMode, remove, removeListener, resizeChildren, setBorderWidth, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addListener, addListener, addListener, addListener, addListener, addListener, createContext, createLayout, destroy, draw, drawArea, drawArea, getAccessible, getColormap, getContext, getModifierStyle, getParent, getParentWindow, getPointer, getSensitive, getStyle, getToplevel, grabDefault, grabFocus, hasFocus, hide, hideAll, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setColormap, setDoubleBuffered, setDragDestination, setDragSource, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

App

public App(java.lang.String appname,
           java.lang.String title)
Instinates a new Application window with the indicated name and title.

Parameters:
appname - The name of the application.
title - The title of the application window. The title can be null, in which case the window's title will not be set.

App

public App(int handle)
Method Detail

getDock

public Widget getDock()
Returns the dock.

Returns:
The dock.

getMenuBar

public MenuBar getMenuBar()
Returns the menu bar.

Returns:
The MenuBar.

getName

public java.lang.String getName()
Gets the name of the application.

Overrides:
getName in class Widget
Returns:
The name of the application.

getPrefix

public java.lang.String getPrefix()
Gets the prefix for gnome-config, which is used to save the layout.

Returns:
The prefix for gnome-config.

getStatusBar

public StatusBar getStatusBar()
Gets the status bar of the application windows.

Returns:
The status bar.

getVBox

public VBox getVBox()
From gnome-app.hThe vbox widget that ties them.

Returns:
The VBox.

layoutConfig

public boolean layoutConfig()
If true, the application uses gnome-config to retrieve and save the docking configuration automatically.

Returns:
True if the docking configuration is to be handled & automatically, else false.

layoutConfig

public void layoutConfig(boolean enabled)
If true, the application uses gnome-config to retrieve and save the docking configuration automatically.


setContent

public void setContent(Widget contents)
Sets the content area of the application window.

Parameters:
contents - The widget that contains the content of the window.

setMenuBar

public void setMenuBar(MenuBar menuBar)
Sets the menu bar of the window.

Parameters:
menuBar - The menu bar to be used for the window.

createMenus

public void createMenus(UIInfo[] uiinfos)
Construct a menu bar and attach it to the specified application window.

Parameters:
uiinfos - An array of UIInfo objects that define the menu.

removeMenus

public void removeMenus(java.lang.String path,
                        int num)
Removes num items from the existing app's menu structure beginning with the item described by path.

Parameters:
path - The path to first item to remove.
num - The number of items to remove.

insertMenu

public void insertMenu(java.lang.String path,
                       UIInfo[] uiinfos)
Inserts a menu in the existing app's menu structure right after the item described by path.

Parameters:
path - The path to the item that preceeds the insertion.
uiinfos - An array of UIInfo objects that describe the menu to be inserted.

setToolBar

public void setToolBar(ToolBar toolBar)
Sets the tool bar of the window.

Parameters:
toolBar - The tool bar to be used for the window.

createToolBar

public void createToolBar(UIInfo[] uiinfos)
Construct a toolbar and attach it to the specified application window.

Parameters:
uiinfos - An array of UIInfo objects that define the toolbar.

setStatusBar

public void setStatusBar(AppBar appBar)
Sets the status bar of the application window.

Parameters:
appBar - The app bar to use for the window.

setStatusBar

public void setStatusBar(StatusBar statusBar)
Sets the status bar of the application window.

Parameters:
statusBar - The status bar to use for the window.

setStatusBar

public void setStatusBar(AppBar appBar,
                         Container container)
Sets the status bar of the application window, but uses the given container widget rather than creating a new one.

Parameters:
appBar - The app bar to use for the window.
container - The container for the status bar.

setStatusBar

public void setStatusBar(StatusBar statusBar,
                         Container container)
Sets the status bar of the application window, but uses the given container widget rather than creating a new one.

Parameters:
statusBar - The status bar to use for the window.
container - The container for the status bar.

installMenuHints

public void installMenuHints(UIInfo[] uiinfos)
Activate the menu item hings, displaying in the statusbar or appbar.

Parameters:
uiinfos - An array of UIInfo objects that contain the menu items for which the hints will be created.

message

public Widget message(java.lang.String message)
Display a simple message in an OK dialog or the status bar. Requires confirmation from the user before it goes away.

Parameters:
message - The text to display.
Returns:
The dialog created or null.

flash

public void flash(java.lang.String flash)
Flash a message in the status bar for a few moments. If this app doesn't have a status bar this method will do nothing.

Parameters:
flash - The message to flash.

warning

public Widget warning(java.lang.String warning)
Display a not-so-important error message in an OK dialog or the status bar.

Parameters:
warning - The text to display.
Returns:
The dialog created or null.

error

public Widget error(java.lang.String error)
Display an important error message in an OK dialog or the status bar.

Parameters:
error - The text to display.
Returns:
The dialog created or null.

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.


Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net