/** * Creates and initializes the action for the given text editor and operation * code. The action configures its visual representation from the given resource * bundle. The action works by asking the text editor at the time for its * text operation target adapter (using * <code>getAdapter(ITextOperationTarget.class)</code>. The action runs that * operation with the given opcode. * * @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 * @param operationCode the operation code * @see TextEditorAction#TextEditorAction(ResourceBundle, String, ITextEditor) */ public TextOperationAction(ResourceBundle bundle, String prefix, ITextEditor editor, int operationCode) { super(bundle, prefix, editor); fOperationCode= operationCode; fAllowUpdate= true; update(); }
/** * Creates and initializes the action for the given text editor and operation * code. The action configures its visual representation from the given resource * bundle. The action works by asking the text editor at the time for its * text operation target adapter (using * <code>getAdapter(ITextOperationTarget.class)</code>. The action runs that * operation with the given opcode. * * @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 * @param operationCode the operation code * @param runsOnReadOnly <code>true</code> if action can be executed on read-only files * * @see TextEditorAction#TextEditorAction(ResourceBundle, String, ITextEditor) * @since 2.0 */ public TextOperationAction(ResourceBundle bundle, String prefix, ITextEditor editor, int operationCode, boolean runsOnReadOnly) { super(bundle, prefix, editor); fOperationCode= operationCode; fRunsOnReadOnly= runsOnReadOnly; fAllowUpdate= true; update(); }
/** * Creates and initializes the action for the given text editor and operation * code. The action configures its visual representation from the given resource * bundle. The action works by asking the text editor at the time for its * text operation target adapter (using * <code>getAdapter(ITextOperationTarget.class)</code>. The action runs that * operation with the given opcode. * * @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 * @param operationCode the operation code * @see TextEditorAction#TextEditorAction(ResourceBundle, String, ITextEditor) */ public TextOperationAction(ResourceBundle bundle, String prefix, ITextEditor editor, int operationCode) { super(bundle, prefix, editor); fOperationCode= operationCode; fAllowUpdate= true; update(); }
/** * Creates and initializes the action for the given text editor and operation * code. The action configures its visual representation from the given resource * bundle. The action works by asking the text editor at the time for its * text operation target adapter (using * <code>getAdapter(ITextOperationTarget.class)</code>. The action runs that * operation with the given opcode. * * @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 * @param operationCode the operation code * @see TextEditorAction#TextEditorAction(ResourceBundle, String, ITextEditor) */ public TextOperationAction(ResourceBundle bundle, String prefix, ITextEditor editor, int operationCode) { super(bundle, prefix, editor); fOperationCode= operationCode; fAllowUpdate= true; update(); }
/** * Creates and initializes the action for the given text editor and operation * code. The action configures its visual representation from the given resource * bundle. The action works by asking the text editor at the time for its * text operation target adapter (using * <code>getAdapter(ITextOperationTarget.class)</code>. The action runs that * operation with the given opcode. * * @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 * @param operationCode the operation code * @param runsOnReadOnly <code>true</code> if action can be executed on read-only files * * @see TextEditorAction#TextEditorAction(ResourceBundle, String, ITextEditor) * @since 2.0 */ public TextOperationAction(ResourceBundle bundle, String prefix, ITextEditor editor, int operationCode, boolean runsOnReadOnly) { super(bundle, prefix, editor); fOperationCode= operationCode; fRunsOnReadOnly= runsOnReadOnly; fAllowUpdate= true; update(); }
/** * Creates and initializes the action for the given text editor and operation * code. The action configures its visual representation from the given resource * bundle. The action works by asking the text editor at the time for its * text operation target adapter (using * <code>getAdapter(ITextOperationTarget.class)</code>. The action runs that * operation with the given opcode. * * @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 * @param operationCode the operation code * @param runsOnReadOnly <code>true</code> if action can be executed on read-only files * * @see TextEditorAction#TextEditorAction(ResourceBundle, String, ITextEditor) * @since 2.0 */ public TextOperationAction(ResourceBundle bundle, String prefix, ITextEditor editor, int operationCode, boolean runsOnReadOnly) { super(bundle, prefix, editor); fOperationCode= operationCode; fRunsOnReadOnly= runsOnReadOnly; fAllowUpdate= true; update(); }
/** * Updates the actions. */ protected void update() { if (isEnabled()) { fToggle.update(); fToggle.setChecked(fViewer.isProjectionMode()); fExpand.update(); fExpandAll.update(); fCollapse.update(); fCollapseAll.update(); fRestoreDefaults.update(); fCollapseMembers.update(); fCollapseComments.update(); } }
/** * Updates the actions. */ protected void update() { if (isEnabled()) { fToggle.update(); fToggle.setChecked(fViewer.isProjectionMode()); fExpand.update(); fExpandAll.update(); fCollapse.update(); fCollapseAll.update(); fRestoreDefaults.update(); fCollapseMembers.update(); fCollapseComments.update(); } }
/** * Updates the actions. */ protected void update() { if (isEnabled()) { fToggle.update(); fToggle.setChecked(fViewer.isProjectionMode()); fExpand.update(); fExpandAll.update(); fCollapse.update(); fCollapseAll.update(); fRestoreDefaults.update(); fCollapseMembers.update(); fCollapseComments.update(); } }