com.ibm.jdg2e.msseditor.extras
Class DoubleActionDelegate

java.lang.Object
  extended bycom.ibm.jdg2e.msseditor.extras.DoubleActionDelegate
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IEditorActionDelegate

public class DoubleActionDelegate
extends java.lang.Object
implements org.eclipse.ui.IEditorActionDelegate

Contributed action to double the integer values in the selected row(s) of the mini-spreadsheet.


Constructor Summary
DoubleActionDelegate()
           
 
Method Summary
 void run(org.eclipse.jface.action.IAction action)
          Double the cells containing integers in the selected rows.
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
          Enable the action if there is at least one cell containing an integer.
 void setActiveEditor(org.eclipse.jface.action.IAction action, org.eclipse.ui.IEditorPart targetEditor)
          Not used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleActionDelegate

public DoubleActionDelegate()
Method Detail

run

public void run(org.eclipse.jface.action.IAction action)
Double the cells containing integers in the selected rows.

Specified by:
run in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate.run(IAction)

selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)
Enable the action if there is at least one cell containing an integer. This evaluation is done checking each cell, but note that MiniSSRowActionFilter allows action delegates to do the same thing without having to load their code first. Below is an excerpt from com.ibm.jdg2e.msseditor.extras. that demonstrates this point.
 <extension point="org.eclipse.ui.popupMenus">
   <objectContribution
       objectClass="com.ibm.jdg2e.msseditor.core.MiniSSRow"
       id="com.ibm.jdg2e.msseditor.extras.objectcontribution">
   <action
         label="&Incremement*"
         class="com.ibm.jdg2e.msseditor.extras.IncrementRowValuesObjectActionDelegate"
         menubarPath="additions"
         id="com.ibm.jdg2e.msseditor.extras.incrementrowvaluesaction">
       <enablement>
         <objectState
           name="hasInts"
           value="true">
         </objectState>
       </enablement>
     </action>
   </objectContribution>
 </extension>
 

Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate.selectionChanged(IAction, ISelection), MiniSSRowActionFilter

setActiveEditor

public void setActiveEditor(org.eclipse.jface.action.IAction action,
                            org.eclipse.ui.IEditorPart targetEditor)
Not used.

Specified by:
setActiveEditor in interface org.eclipse.ui.IEditorActionDelegate