Example usage for org.eclipse.jface.action Action setHelpListener

List of usage examples for org.eclipse.jface.action Action setHelpListener

Introduction

In this page you can find the example usage for org.eclipse.jface.action Action setHelpListener.

Prototype

@Override
    public void setHelpListener(HelpListener listener) 

Source Link

Usage

From source file:com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutCanvas.java

License:Open Source License

/**
 * Helper for {@link #setupGlobalActionHandlers()}.
 * Copies the action attributes form the given {@link ActionFactory}'s action to
 * our action./*from   ww w  .  jav  a2s .c om*/
 * <p/>
 * {@link ActionFactory} provides access to the standard global actions in Eclipse.
 * <p/>
 * This allows us to grab the standard labels and icons for the
 * global actions such as copy, cut, paste, delete and select-all.
 */
private void copyActionAttributes(Action action, ActionFactory factory) {
    IWorkbenchAction wa = factory.create(mEditorDelegate.getEditor().getEditorSite().getWorkbenchWindow());
    action.setId(wa.getId());
    action.setText(wa.getText());
    action.setEnabled(wa.isEnabled());
    action.setDescription(wa.getDescription());
    action.setToolTipText(wa.getToolTipText());
    action.setAccelerator(wa.getAccelerator());
    action.setActionDefinitionId(wa.getActionDefinitionId());
    action.setImageDescriptor(wa.getImageDescriptor());
    action.setHoverImageDescriptor(wa.getHoverImageDescriptor());
    action.setDisabledImageDescriptor(wa.getDisabledImageDescriptor());
    action.setHelpListener(wa.getHelpListener());
}