|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.addins.desktop.Button
public abstract class Button
Abstract base implementation of ArcGIS application buttons.
This class should be subclassed by clients wishing to define new buttons.
The name of the subclass should be given as the "class
" attribute
in a Button
extension contributed to the ArcGIS application framework.
For example, the add-in's config.xml markup might contain:
<Commands> <Button id="com.acme.addins.AcmeButton" class="com.acme.addins.AcmeButton" caption="Bookmark" category="Map Tools" image="images/bookmark.png"> <Tip>Creates a bookmark</Tip> <Message>Creates a bookmark</Message> </Button> </Commands>
onClick
- to define the action performed when the button is clickedinit
- to initializes this button and get a reference to the hosting ArcGIS application isChecked
- if this button is not always uncheckedisEnabled
- if this button is not always enabled
Constructor Summary | |
---|---|
Button()
|
Method Summary | |
---|---|
void |
init(IApplication app)
Initializes this button with the ArcGIS application it is hosted in. |
boolean |
isChecked()
Returns whether this button is checked. |
boolean |
isEnabled()
Returns whether this button is enabled. |
abstract void |
onClick()
Called when the button is clicked. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Button()
Method Detail |
---|
public abstract void onClick() throws IOException, AutomationException
IOException
- if there are interop problems.
AutomationException
- if the component throws an ArcObjects exception.public void init(IApplication app) throws IOException, AutomationException
This method is automatically called by the host ArcGIS application when the button is initialized. It marks the start of the button's lifecycle. Clients must not call this method.
app
- the ArcGIS application that hosts this button
IOException
- if there are interop problems.
AutomationException
- if the component throws an ArcObjects exception.public boolean isChecked() throws IOException, AutomationException
The default implementation returns false to indicate that the button is always unchecked.
Override this method if the button is not always unchecked.
true
if checked, and
false
if unchecked
IOException
AutomationException
public boolean isEnabled() throws IOException, AutomationException
The default implementation returns true to indicate that the button is always enabled.
Override this method if the button is not always enabled.
true
if enabled, and
false
if disabled
IOException
AutomationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |