org.gnu.gnome

Class 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(Handle handle)
App(String appname, 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(String error)
Deprecated.
void
fillMenu(MenuShell menuShell, UIInfo uiinfos, AccelGroup accelGroup, boolean underline, int position)
Fills the specified MenuShell with items created from the UIInfo array, inserting them from the item number position on.
void
fillToolbar(ToolBar toolbar, UIInfo uiinfos, AccelGroup accelGroup)
Fills a ToolBar with the specified UIInfos.
void
flash(String flash)
Deprecated.
AccelGroup
getAccelGroup()
Main accelerator group for this window (hotkeys live here).
protected static Handle
getAccelGroup(Handle cptr)
Widget
getContents()
Returns the contents of the App.
protected static Handle
getContents(Handle cptr)
Widget
getDock()
Returns the dock.
protected static Handle
getDock(Handle cptr)
protected static boolean
getEnableLayoutConfig(Handle cptr)
MenuBar
getMenuBar()
Returns the menu bar.
protected static Handle
getMenubar(Handle cptr)
String
getName()
Gets the name of the application.
protected static String
getName(Handle cptr)
String
getPrefix()
Gets the prefix for gnome-config, which is used to save the layout.
protected static String
getPrefix(Handle cptr)
StatusBar
getStatusBar()
Gets the status bar of the application windows.
protected static Handle
getStatusbar(Handle cptr)
static Type
getType()
Retrieve the runtime type used by the GLib library.
VBox
getVBox()
From gnome-app.hThe vbox widget that ties them.
protected static Handle
getVbox(Handle cptr)
protected static void
gnome_app_create_menus(Handle app, Handle[] uiinfo)
protected static void
gnome_app_create_menus_custom(Handle app, Handle[] uiinfo, Handle uibdate)
protected static void
gnome_app_create_toolbar(Handle app, Handle[] uiinfo)
protected static void
gnome_app_create_toolbar_custom(Handle app, Handle[] uiinfo, Handle uibdata)
protected static void
gnome_app_enable_layout_config(Handle app, boolean enable)
protected static Handle
gnome_app_error(Handle app, String error)
protected static void
gnome_app_fill_menu(Handle menuShell, Handle[] uiInfo, Handle accelGroup, boolean ulineAccels, int pos)
protected static void
gnome_app_fill_menu_custom(Handle menuShell, Handle[] uiInfo, Handle uiBData, Handle accelGroup, boolean ulineAccels, int pos)
protected static void
gnome_app_fill_menu_with_data(Handle menuShell, Handle[] uiInfo, Handle accelGroup, boolean ulineAccels, int pos, Object userData)
protected static void
gnome_app_fill_toolbar(Handle toolbar, Handle[] uiInfo, Handle accelGroup)
protected static void
gnome_app_fill_toolbar_custom(Handle toolbar, Handle[] uiInfo, int uiBData, Handle accelGroup)
protected static void
gnome_app_fill_toolbar_with_data(Handle toolbar, Handle[] uiInfo, Handle accelGroup, Object userData)
protected static int
gnome_app_find_menu_pos(Handle parent, String path, int pos)
protected static void
gnome_app_flash(Handle app, String flash)
protected static int
gnome_app_get_type()
protected static void
gnome_app_insert_menus(Handle app, String path, Handle[] menuinfo)
protected static void
gnome_app_insert_menus_custom(Handle app, String path, int menuinfo, int uibdata)
protected static void
gnome_app_install_appbar_menu_hints(Handle appbar, Handle[] uiinfo)
protected static void
gnome_app_install_menu_hints(Handle app, Handle[] uiinfo)
protected static void
gnome_app_install_statusbar_menu_hints(Handle bar, Handle[] uiinfo)
protected static Handle
gnome_app_message(Handle app, String message)
protected static Handle
gnome_app_new(String appname, String title)
protected static void
gnome_app_remove_menu_range(Handle app, String path, int start, int items)
protected static void
gnome_app_remove_menus(Handle app, String path, int items)
protected static void
gnome_app_set_contents(Handle app, Handle contents)
protected static void
gnome_app_set_menus(Handle app, Handle menubar)
protected static void
gnome_app_set_statusbar(Handle app, Handle statusbar)
protected static void
gnome_app_set_statusbar_custom(Handle app, Handle container, Handle statusbar)
protected static void
gnome_app_set_toolbar(Handle app, Handle toolbar)
protected static void
gnome_app_ui_configure_configurable(Handle uiinfo)
protected static Handle
gnome_app_warning(Handle app, String warning)
void
insertMenu(String path, UIInfo uiinfos)
Inserts a menu in the existing app's menu structure right after the item described by path.
void
installAppBarMenuHints(AppBar appBar, UIInfo uiinfos)
Activate the menu item hints, displaying in an appbar.
void
installMenuHints(UIInfo uiinfos)
Activate the menu item hings, displaying in the statusbar or appbar.
void
installStatusBarMenuHints(StatusBar statusBar, UIInfo uiinfos)
Activate the menu item hints, displaying in a statusbar.
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(String message)
Deprecated.
void
removeMenuRange(String path, int start, int numItems)
Removes items from the Menu.
void
removeMenus(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(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
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
setToolBar(ToolBar toolBar)
Sets the tool bar of the window.
Widget
warning(String warning)
Deprecated.

Constructor Details

App

public App(Handle handle)


App

public App(String appname,
           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.

Method Details

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.


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.


error

public Widget error(String error)

Deprecated.

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.


fillMenu

public void fillMenu(MenuShell menuShell,
                     UIInfo uiinfos,
                     AccelGroup accelGroup,
                     boolean underline,
                     int position)
Fills the specified MenuShell with items created from the UIInfo array, inserting them from the item number position on. The AccelGroup will be used for all newly created sub menus and servers as the global AccelGroup for all menu item hotkeys.

Parameters:
menuShell -
uiinfos -
accelGroup -
underline -
position -


fillToolbar

public void fillToolbar(ToolBar toolbar,
                        UIInfo uiinfos,
                        AccelGroup accelGroup)
Fills a ToolBar with the specified UIInfos.

Parameters:
toolbar -
uiinfos -
accelGroup -


flash

public void flash(String flash)

Deprecated.

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.


getAccelGroup

public AccelGroup getAccelGroup()
Main accelerator group for this window (hotkeys live here).

Returns:
The accelorator group.


getAccelGroup

protected static final Handle getAccelGroup(Handle cptr)


getContents

public Widget getContents()
Returns the contents of the App.


getContents

protected static final Handle getContents(Handle cptr)


getDock

public Widget getDock()
Returns the dock.

Returns:
The dock.


getDock

protected static final Handle getDock(Handle cptr)


getEnableLayoutConfig

protected static final boolean getEnableLayoutConfig(Handle cptr)


getMenuBar

public MenuBar getMenuBar()
Returns the menu bar.

Returns:
The MenuBar.


getMenubar

protected static final Handle getMenubar(Handle cptr)


getName

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

Returns:
The name of the application.


getName

protected static final String getName(Handle cptr)


getPrefix

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

Returns:
The prefix for gnome-config.


getPrefix

protected static final String getPrefix(Handle cptr)


getStatusBar

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

Returns:
The status bar.


getStatusbar

protected static final Handle getStatusbar(Handle cptr)


getType

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


getVBox

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

Returns:
The VBox.


getVbox

protected static final Handle getVbox(Handle cptr)


gnome_app_create_menus

protected static final void gnome_app_create_menus(Handle app,
                                                   Handle[] uiinfo)


gnome_app_create_menus_custom

protected static final void gnome_app_create_menus_custom(Handle app,
                                                          Handle[] uiinfo,
                                                          Handle uibdate)


gnome_app_create_toolbar

protected static final void gnome_app_create_toolbar(Handle app,
                                                     Handle[] uiinfo)


gnome_app_create_toolbar_custom

protected static final void gnome_app_create_toolbar_custom(Handle app,
                                                            Handle[] uiinfo,
                                                            Handle uibdata)


gnome_app_enable_layout_config

protected static final void gnome_app_enable_layout_config(Handle app,
                                                           boolean enable)


gnome_app_error

protected static final Handle gnome_app_error(Handle app,
                                              String error)


gnome_app_fill_menu

protected static final void gnome_app_fill_menu(Handle menuShell,
                                                Handle[] uiInfo,
                                                Handle accelGroup,
                                                boolean ulineAccels,
                                                int pos)


gnome_app_fill_menu_custom

protected static final void gnome_app_fill_menu_custom(Handle menuShell,
                                                       Handle[] uiInfo,
                                                       Handle uiBData,
                                                       Handle accelGroup,
                                                       boolean ulineAccels,
                                                       int pos)


gnome_app_fill_menu_with_data

protected static final void gnome_app_fill_menu_with_data(Handle menuShell,
                                                          Handle[] uiInfo,
                                                          Handle accelGroup,
                                                          boolean ulineAccels,
                                                          int pos,
                                                          Object userData)


gnome_app_fill_toolbar

protected static final void gnome_app_fill_toolbar(Handle toolbar,
                                                   Handle[] uiInfo,
                                                   Handle accelGroup)


gnome_app_fill_toolbar_custom

protected static final void gnome_app_fill_toolbar_custom(Handle toolbar,
                                                          Handle[] uiInfo,
                                                          int uiBData,
                                                          Handle accelGroup)


gnome_app_fill_toolbar_with_data

protected static final void gnome_app_fill_toolbar_with_data(Handle toolbar,
                                                             Handle[] uiInfo,
                                                             Handle accelGroup,
                                                             Object userData)


gnome_app_find_menu_pos

protected static final int gnome_app_find_menu_pos(Handle parent,
                                                   String path,
                                                   int pos)


gnome_app_flash

protected static final void gnome_app_flash(Handle app,
                                            String flash)


gnome_app_get_type

protected static final int gnome_app_get_type()


gnome_app_insert_menus

protected static final void gnome_app_insert_menus(Handle app,
                                                   String path,
                                                   Handle[] menuinfo)


gnome_app_insert_menus_custom

protected static final void gnome_app_insert_menus_custom(Handle app,
                                                          String path,
                                                          int menuinfo,
                                                          int uibdata)


gnome_app_install_appbar_menu_hints

protected static final void gnome_app_install_appbar_menu_hints(Handle appbar,
                                                                Handle[] uiinfo)


gnome_app_install_menu_hints

protected static final void gnome_app_install_menu_hints(Handle app,
                                                         Handle[] uiinfo)


gnome_app_install_statusbar_menu_hints

protected static final void gnome_app_install_statusbar_menu_hints(Handle bar,
                                                                   Handle[] uiinfo)


gnome_app_message

protected static final Handle gnome_app_message(Handle app,
                                                String message)


gnome_app_new

protected static final Handle gnome_app_new(String appname,
                                            String title)


gnome_app_remove_menu_range

protected static final void gnome_app_remove_menu_range(Handle app,
                                                        String path,
                                                        int start,
                                                        int items)


gnome_app_remove_menus

protected static final void gnome_app_remove_menus(Handle app,
                                                   String path,
                                                   int items)


gnome_app_set_contents

protected static final void gnome_app_set_contents(Handle app,
                                                   Handle contents)


gnome_app_set_menus

protected static final void gnome_app_set_menus(Handle app,
                                                Handle menubar)


gnome_app_set_statusbar

protected static final void gnome_app_set_statusbar(Handle app,
                                                    Handle statusbar)


gnome_app_set_statusbar_custom

protected static final void gnome_app_set_statusbar_custom(Handle app,
                                                           Handle container,
                                                           Handle statusbar)


gnome_app_set_toolbar

protected static final void gnome_app_set_toolbar(Handle app,
                                                  Handle toolbar)


gnome_app_ui_configure_configurable

protected static final void gnome_app_ui_configure_configurable(Handle uiinfo)


gnome_app_warning

protected static final Handle gnome_app_warning(Handle app,
                                                String warning)


insertMenu

public void insertMenu(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.


installAppBarMenuHints

public void installAppBarMenuHints(AppBar appBar,
                                   UIInfo uiinfos)
Activate the menu item hints, displaying in an appbar.

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


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.


installStatusBarMenuHints

public void installStatusBarMenuHints(StatusBar statusBar,
                                      UIInfo uiinfos)
Activate the menu item hints, displaying in a statusbar.

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


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.

Parameters:
enabled - True if the docking configuration is to be handled automatically, else false.


message

public Widget message(String message)

Deprecated.

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.


removeMenuRange

public void removeMenuRange(String path,
                            int start,
                            int numItems)
Removes items from the Menu.

Parameters:
path -
start -
numItems -


removeMenus

public void removeMenus(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.


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.


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(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.


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(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.


setToolBar

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

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


warning

public Widget warning(String warning)

Deprecated.

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.