|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.addinframework.AddIn com.esri.arcgis.addinframework.InternalButton
public class InternalButton
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 | |
---|---|
InternalButton()
|
Method Summary | |
---|---|
void |
init(IApplication app)
Initializes this button with the ArcGIS application it is hosted in. |
boolean |
isChecked()
Indicates if this command is checked. |
boolean |
isEnabled()
Indicates if this command is enabled. |
void |
onClick()
Occurs when this command is clicked. |
void |
seed(Object delegate)
|
Methods inherited from class com.esri.arcgis.addinframework.AddIn |
---|
getApp, nativeGetPictureFromIStream, nativeGetPictureFromStream, read, readCursorFromStream, readPictureFromIStream, readPictureFromStream, readSubnode, setParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.systemUI.ICommand |
---|
getBitmap, getCaption, getCategory, getHelpContextID, getHelpFile, getMessage, getName, getTooltip, onCreate |
Constructor Detail |
---|
public InternalButton()
Method Detail |
---|
public void seed(Object delegate)
seed
in class AddIn
public void onClick() throws IOException, AutomationException
When implementing ICommand to create a custom command, write the code that performs the action when the command is clicked in the OnClick method.
public void onClick() {//In this example, a message is displayed in console.System.out.println("Clicked on my command");}
onClick
in interface ICommand
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an 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 Checked property indicates the state of this Command. If a command item appears depressed on a commandbar, the command is checked. The active tool will appear checked. Also commands that serve as a toggle will be checked when that toggle is on.
A system event is periodically called to set the state of the commands on the commandbars indicating which ones are checked.
isChecked
in interface ICommand
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isEnabled() throws IOException, AutomationException
When implementing ICommand to create a custom command, add some logic to the Enabled property to specify in what state the application should be in for the command to be enabled.
isEnabled
in interface ICommand
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |