org.gnu.gtk
Class Action

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gtk.Action
Direct Known Subclasses:
ToggleAction

Deprecated. This class is part of the java-gnome 2.x family of libraries, which, due to their inefficiency and complexity, are no longer being maintained and have been abandoned by the java-gnome project. This class may in the future have an equivalent in java-gnome 4.0, try looking for org.gnome.gtk.Action. You should be aware that there is a considerably different API in the new library: the architecture is completely different and most notably internals are no longer exposed to public view.

public class Action
extends org.gnu.glib.GObject

An action which can be triggered by a menu or toolbar item.

Actions represent operations that the user can be perform, along with some information how it should be presented in the interface. Each action provides methods to create icons, menu items and toolbar items representing itself.

As well as the callback that is called when the action gets activated, the following also gets associated with the action:

a name (not translated, for path lookup)

a label (translated, for display)

an accelerator

whether label indicates a stock id

a tooltip (optional, translated)

a toolbar label (optional, shorter than label)

The action will also have some state information:

visible (shown/hidden)

sensitive (enabled/disabled)

Apart from regular actions, there are ToggleAction, which can be toggled between two states and RadioAction, of which only one in a group can be in the "active" state. Other actions can be implemented as Action subclasses.

Each action can have one or more proxy menu item, toolbar button or other proxy widgets. Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc), and should change when the action's state changes. When the proxy is activated, it should activate its action.


Constructor Summary
Action(java.lang.String name, java.lang.String label, java.lang.String tooltip, java.lang.String stockId)
          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.
 
Method Summary
 void activate()
          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.
 void addListener(ActionListener 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.
 void connectAccelerator()
          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.
 void connectProxy(Widget proxy)
          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.
 Widget createIcon(IconSize iconSize)
          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.
 Widget createMenuItem()
          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.
 Widget createToolItem()
          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.
 void disconnectAccelerator()
          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.
 void disconnectProxy(Widget proxy)
          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.
 java.lang.String getAcceleratorPath()
          Deprecated.  
 java.lang.String getName()
          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.
 java.util.List getProxies()
          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.
static org.gnu.glib.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.
 boolean isSensitive()
          Deprecated.  
 boolean isVisible()
          Deprecated.  
 void removeListener(ActionListener 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.
 void setAccelGroup(AccelGroup group)
          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.
 void setAccelPath(java.lang.String path)
          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.
 void setSensitive(boolean sensitive)
          Deprecated.  
 void setVisible(boolean visible)
          Deprecated.  
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action(java.lang.String name,
              java.lang.String label,
              java.lang.String tooltip,
              java.lang.String stockId)
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 Action object.

Method Detail

getName

public java.lang.String getName()
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.

Returns the name of the action.

Returns:
the name of the action

activate

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

Emits the "activate" signal on the specified action, if it isn't insensitive. This gets called by the proxy widgets when they get activated. It can also be used to manually activate an action.


createIcon

public Widget createIcon(IconSize iconSize)
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.

This function is intended for use by action implementations to create icons displayed in the proxy widgets.

Parameters:
iconSize - the size of the icon that should be created
Returns:
a widget that displays the icon for this action

createMenuItem

public Widget createMenuItem()
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.

Creates a menu item widget that proxies for the given action.

Returns:
a menu item connected to the action

createToolItem

public Widget createToolItem()
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.

Creates a toolbar item widget that proxies for the given action.

Returns:
a toolbar item connected to the action

connectProxy

public void connectProxy(Widget proxy)
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.

Connects a widget to an action object as a proxy. Synchronises various properties of the action with the widget (such as label text, icon, tooltip, etc), and attaches a callback so that the action gets activated when the proxy widget does. If the widget is already connected to an action, it is disconnected first.

Parameters:
proxy - the proxy widget

disconnectProxy

public void disconnectProxy(Widget proxy)
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.

Disconnects a proxy widget from an action. Does not destroy the widget, however.

Parameters:
proxy - the proxy widget

getProxies

public java.util.List getProxies()
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.

Returns the proxy widgets for an action.

Returns:
a List of proxy widgets

connectAccelerator

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

Installs the accelerator for action if action has an accel path and group. Since multiple proxies may independently trigger the installation of the accelerator, the action counts the number of times this function has been called and doesn't remove the accelerator until disconnectAccelerator() has been called as many times.


disconnectAccelerator

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

Undoes the effect of one call to connectAccelerator().


getAcceleratorPath

public java.lang.String getAcceleratorPath()
Deprecated. 

isSensitive

public boolean isSensitive()
Deprecated. 

setSensitive

public void setSensitive(boolean sensitive)
Deprecated. 

isVisible

public boolean isVisible()
Deprecated. 

setVisible

public void setVisible(boolean visible)
Deprecated. 

getType

public static org.gnu.glib.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.


setAccelPath

public void setAccelPath(java.lang.String path)
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 accel path for this action. All proxy widgets associated with the action will have this accel path, so that their accelerators are consistent.

Parameters:
path - The accelerator path
Since:
2.8

setAccelGroup

public void setAccelGroup(AccelGroup group)
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 AccelGroup in which the accelerator for this action will be installed.

Parameters:
group - an AccelGroup or null
Since:
2.8

addListener

public void addListener(ActionListener 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 receive action activation event notification.

Parameters:
listener - The object that has implemented the ActionListener interface that is to receive the activation events.
Since:
2.8

removeListener

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

Unregister an object that was receiving focus event notification.

Parameters:
listener - The object that is to no longer receive focus events.
Since:
2.8