|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.ui.actions.SelectionConverter
public class SelectionConverter
Constructor Summary | |
---|---|
SelectionConverter()
|
Method Summary | |
---|---|
static org.eclipse.jface.viewers.IStructuredSelection |
allResources(org.eclipse.jface.viewers.IStructuredSelection selection,
int resourceMask)
Returns the selection adapted to IResource. |
static boolean |
allResourcesAreOfType(org.eclipse.jface.viewers.IStructuredSelection selection,
int resourceMask)
|
static boolean |
canOperateOn(CEditor editor)
|
static org.eclipse.cdt.core.model.ICElement[] |
codeResolve(CEditor editor)
|
static org.eclipse.cdt.core.model.ICElement |
codeResolve(CEditor editor,
org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String message)
Converts the text selection provided by the given editor a Java element by asking the user if code reolve returned more than one result. |
static org.eclipse.cdt.core.model.ICElement[] |
codeResolve(org.eclipse.cdt.core.model.ICElement input,
org.eclipse.jface.text.ITextSelection selection)
|
static org.eclipse.cdt.core.model.ICElement[] |
codeResolveOrInput(CEditor editor)
Converts the text selection provided by the given editor into an array of C elements. |
static org.eclipse.cdt.core.model.ICElement[] |
codeResolveOrInputHandled(CEditor editor,
org.eclipse.swt.widgets.Shell shell,
java.lang.String title)
|
static org.eclipse.jface.viewers.IStructuredSelection |
convertSelectionToCElements(org.eclipse.jface.viewers.ISelection s)
Converts objects of a structured selection to c elements if possible. |
static org.eclipse.jface.viewers.IStructuredSelection |
convertSelectionToCElements(org.eclipse.jface.viewers.ISelection s,
boolean keepNonCElements)
Converts objects of a structured selection to c elements if possible. |
static org.eclipse.jface.viewers.IStructuredSelection |
convertSelectionToResources(org.eclipse.jface.viewers.ISelection s)
|
static org.eclipse.cdt.core.model.ICElement |
getElementAtOffset(org.eclipse.cdt.core.model.ICElement input,
org.eclipse.jface.text.ITextSelection selection)
|
static org.eclipse.cdt.core.model.ICElement |
getElementAtOffset(org.eclipse.ui.texteditor.ITextEditor editor)
|
static org.eclipse.cdt.core.model.ICElement[] |
getElementsAtOffset(org.eclipse.cdt.core.model.ICElement input,
org.eclipse.jface.text.ITextSelection selection)
|
static org.eclipse.cdt.core.model.ICElement[] |
getElementsAtOffset(org.eclipse.ui.texteditor.ITextEditor editor)
|
static org.eclipse.cdt.core.model.ICElement |
getInput(org.eclipse.ui.texteditor.ITextEditor editor)
|
static org.eclipse.jface.viewers.IStructuredSelection |
getStructuredSelection(org.eclipse.ui.IWorkbenchPart part)
Converts the selection provided by the given part into a structured selection. |
static boolean |
resourceIsType(org.eclipse.core.resources.IResource resource,
int resourceMask)
Returns whether the type of the given resource is among the specified resource types. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectionConverter()
Method Detail |
---|
public static org.eclipse.jface.viewers.IStructuredSelection getStructuredSelection(org.eclipse.ui.IWorkbenchPart part) throws org.eclipse.cdt.core.model.CModelException
part instanceof CEditor
: returns a structured selection
using code resolve to convert the editor's text selection.part instanceof IWorkbenchPart
: returns the part's selection
if it is a structured selection.default
: returns an empty structured selection.
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.jface.viewers.IStructuredSelection convertSelectionToCElements(org.eclipse.jface.viewers.ISelection s)
convertSelectionToCElements(s, false)
.
s
- The structured selection
public static org.eclipse.jface.viewers.IStructuredSelection convertSelectionToCElements(org.eclipse.jface.viewers.ISelection s, boolean keepNonCElements)
s
- The structured selectionkeepNonCElements
- Whether to keep objects in selection if they cannot be converted
public static org.eclipse.jface.viewers.IStructuredSelection convertSelectionToResources(org.eclipse.jface.viewers.ISelection s)
public static boolean allResourcesAreOfType(org.eclipse.jface.viewers.IStructuredSelection selection, int resourceMask)
public static org.eclipse.jface.viewers.IStructuredSelection allResources(org.eclipse.jface.viewers.IStructuredSelection selection, int resourceMask)
selection
- the selectionresourceMask
- resource mask formed by bitwise OR of resource type constants
(defined on IResource
)
IResource.getType()
public static org.eclipse.cdt.core.model.ICElement getElementAtOffset(org.eclipse.ui.texteditor.ITextEditor editor) throws org.eclipse.cdt.core.model.CModelException
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement[] getElementsAtOffset(org.eclipse.ui.texteditor.ITextEditor editor) throws org.eclipse.cdt.core.model.CModelException
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement getElementAtOffset(org.eclipse.cdt.core.model.ICElement input, org.eclipse.jface.text.ITextSelection selection) throws org.eclipse.cdt.core.model.CModelException
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement[] getElementsAtOffset(org.eclipse.cdt.core.model.ICElement input, org.eclipse.jface.text.ITextSelection selection) throws org.eclipse.cdt.core.model.CModelException
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement getInput(org.eclipse.ui.texteditor.ITextEditor editor)
public static boolean resourceIsType(org.eclipse.core.resources.IResource resource, int resourceMask)
resource
- the resourceresourceMask
- resource mask formed by bitwise OR of resource type constants
(defined on IResource
)
true
if the resources has a matching type, and
false
otherwiseIResource.getType()
public static org.eclipse.cdt.core.model.ICElement[] codeResolve(CEditor editor) throws org.eclipse.cdt.core.model.CModelException
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement[] codeResolve(org.eclipse.cdt.core.model.ICElement input, org.eclipse.jface.text.ITextSelection selection) throws org.eclipse.cdt.core.model.CModelException
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement codeResolve(CEditor editor, org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String message) throws org.eclipse.cdt.core.model.CModelException
null
is returned.
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement[] codeResolveOrInput(CEditor editor) throws org.eclipse.cdt.core.model.CModelException
org.eclipse.cdt.core.model.CModelException
public static org.eclipse.cdt.core.model.ICElement[] codeResolveOrInputHandled(CEditor editor, org.eclipse.swt.widgets.Shell shell, java.lang.String title)
public static boolean canOperateOn(CEditor editor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |