java.lang.Objectcom.ibm.jdg2e.jdt.extras.AbstractChangeMemberModifierAction
Abstract superclass for actions wishing to delete/add IMember modifiers.
| Field Summary | |
protected boolean |
isChecked
|
| Constructor Summary | |
AbstractChangeMemberModifierAction()
|
|
| Method Summary | |
protected boolean |
canPerformAction(org.eclipse.jface.action.IAction action,
org.eclipse.jdt.core.IMember member)
Return true if the action can be applied to the
given IMember; can be overridden, but must call superclass. |
protected boolean |
deleteFlag(org.eclipse.jdt.core.IMember member,
int flag,
int flagTokenName)
Delete modifier indicated by flag and
flagTokenName using the compilation unit's
buffer and an IScanner. |
protected boolean |
insertFlag(org.eclipse.jdt.core.IMember member,
int newFlag)
Insert modifier indicated by newFlag (Flags.AccPublic)
compilation unit's buffer and an IScanner. |
protected abstract boolean |
isChecked(org.eclipse.jface.action.IAction action,
org.eclipse.jdt.core.IMember member)
Return true if the given IMember
conforms to the action modifier; subclasses must override. |
protected abstract boolean |
performAction(org.eclipse.jface.action.IAction action,
org.eclipse.jdt.core.IMember member)
Perform the action against the given IMember; subclasses must override. |
protected boolean |
replaceFlag(org.eclipse.jdt.core.IMember member,
int newFlag,
int replacingFlag,
int replacingTokenName)
Replace modifier indicated by replacingFlag
with newFlag using the compilation unit's
buffer and an IScanner. |
void |
run(org.eclipse.jface.action.IAction action)
Delegate the processing of the run
action to subclasses. |
void |
selectionChanged(org.eclipse.jface.action.IAction action,
org.eclipse.jface.viewers.ISelection selection)
Determine if the current action applies to the IMembers, given
their current state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean isChecked
| Constructor Detail |
public AbstractChangeMemberModifierAction()
| Method Detail |
protected boolean canPerformAction(org.eclipse.jface.action.IAction action,
org.eclipse.jdt.core.IMember member)
true if the action can be applied to the
given IMember; can be overridden, but must call superclass.
protected boolean deleteFlag(org.eclipse.jdt.core.IMember member,
int flag,
int flagTokenName)
flag and
flagTokenName using the compilation unit's
buffer and an IScanner.
This is an example of "fine-grained" source code analysis where the
context is very narrow (a member declaration). AST rewriters
would be more appropriate if it were a more complex analysis.
protected boolean insertFlag(org.eclipse.jdt.core.IMember member,
int newFlag)
newFlag (Flags.AccPublic)
compilation unit's buffer and an IScanner.
This is an example of "fine-grained" source code analysis where the
context is very narrow (a member declaration). AST rewriters
would be more appropriate if it were a more complex analysis.
protected abstract boolean isChecked(org.eclipse.jface.action.IAction action,
org.eclipse.jdt.core.IMember member)
true if the given IMember
conforms to the action modifier; subclasses must override.
protected abstract boolean performAction(org.eclipse.jface.action.IAction action,
org.eclipse.jdt.core.IMember member)
IMember; subclasses must override.
protected boolean replaceFlag(org.eclipse.jdt.core.IMember member,
int newFlag,
int replacingFlag,
int replacingTokenName)
replacingFlag
with newFlag using the compilation unit's
buffer and an IScanner. This is an example
of "fine-grained" source code analysis where the
context is very narrow (a member declaration). AST rewriters
would be more appropriate if it were a more complex analysis.
public void run(org.eclipse.jface.action.IAction action)
run
action to subclasses.
run in interface org.eclipse.ui.IActionDelegate
public void selectionChanged(org.eclipse.jface.action.IAction action,
org.eclipse.jface.viewers.ISelection selection)
IMembers, given
their current state. If the selection is homogeneous, also check the
action if all conform to this action's modifier.
selectionChanged in interface org.eclipse.ui.IActionDelegateIMember,
IActionDelegate.selectionChanged(IAction, ISelection)