/** * Creates a new action. * * @param viewer the viewer * @param operationCode the opcode */ public TextViewerAction(ITextViewer viewer, int operationCode) { fOperationCode = operationCode; fOperationTarget = viewer.getTextOperationTarget(); update(); }
/** * Creates and initializes the action for the given text editor. The action configures its visual * representation from the given resource bundle. * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys (described in <code> * ResourceAction</code> constructor), or <code>null</code> if none * @param editor the text editor * @see ResourceAction#ResourceAction(ResourceBundle, String, int) */ public ToggleSLCommentAction(ITextViewer viewer) { fViewer = viewer; fOperationTarget = viewer.getTextOperationTarget(); }