FileDocCategorySizeDatePackage
ToolItemAction.javaAPI DocAndroid 1.5 API2247Wed May 06 22:41:08 BST 2009com.android.ddmuilib.actions

ToolItemAction

public class ToolItemAction extends Object implements ICommonAction
Wrapper around {@link ToolItem} to implement {@link ICommonAction}

Fields Summary
public org.eclipse.swt.widgets.ToolItem
item
Constructors Summary
public ToolItemAction(org.eclipse.swt.widgets.ToolBar parent, int style)

        item = new ToolItem(parent, style);
    
Methods Summary
public voidsetChecked(boolean checked)
Sets the enabled state of this action.

param
enabled true to enable, and false to disable
see
ICommonAction#setChecked(boolean)

        item.setSelection(checked);
    
public voidsetEnabled(boolean enabled)
Sets the enabled state of this action.

param
enabled true to enable, and false to disable
see
ICommonAction#setEnabled(boolean)

        item.setEnabled(enabled);
    
public voidsetRunnable(java.lang.Runnable runnable)
Sets the {@link Runnable} that will be executed when the action is triggered (through {@link SelectionListener#widgetSelected(SelectionEvent)} on the wrapped {@link ToolItem}).

see
ICommonAction#setRunnable(Runnable)

        item.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                runnable.run();
            }
        });