Package ghidra.program.model.data
Class CycleGroup
- java.lang.Object
-
- ghidra.program.model.data.CycleGroup
-
public class CycleGroup extends java.lang.Object
Class to define a set of dataTypes that a single action can cycle through.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<CycleGroup>
ALL_CYCLE_GROUPS
static CycleGroup
BYTE_CYCLE_GROUP
protected javax.swing.KeyStroke
defaultKeyStroke
static CycleGroup
FLOAT_CYCLE_GROUP
static CycleGroup
STRING_CYCLE_GROUP
-
Constructor Summary
Constructors Constructor Description CycleGroup(java.lang.String name)
Construct empty group no name, data types or keystroke.CycleGroup(java.lang.String name, DataType[] dataTypes, javax.swing.KeyStroke keyStroke)
Constructs a new cycle group with the given dataTypes.CycleGroup(java.lang.String name, DataType dt, javax.swing.KeyStroke keyStroke)
Constructor cycle group with one data type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataType(DataType dt)
Add a data type to this group.void
addFirst(DataType dt)
Add the data type as the first in the list.boolean
contains(DataType dt)
Return true if the given data type is in this cycle group.DataType[]
getDataTypes()
Get the data types in this group.javax.swing.KeyStroke
getDefaultKeyStroke()
java.lang.String
getName()
DataType
getNextDataType(DataType currentDataType, boolean stackPointers)
Get next data-type which should be usedvoid
removeDataType(DataType dt)
Remove the data type from this group.void
removeFirst()
Remove first data type in the list.void
removeLast()
Remove the last data type in the list.int
size()
Returns number of types in group
-
-
-
Field Detail
-
BYTE_CYCLE_GROUP
public static final CycleGroup BYTE_CYCLE_GROUP
-
FLOAT_CYCLE_GROUP
public static final CycleGroup FLOAT_CYCLE_GROUP
-
STRING_CYCLE_GROUP
public static final CycleGroup STRING_CYCLE_GROUP
-
ALL_CYCLE_GROUPS
public static final java.util.List<CycleGroup> ALL_CYCLE_GROUPS
-
defaultKeyStroke
protected javax.swing.KeyStroke defaultKeyStroke
-
-
Constructor Detail
-
CycleGroup
public CycleGroup(java.lang.String name, DataType[] dataTypes, javax.swing.KeyStroke keyStroke)
Constructs a new cycle group with the given dataTypes.- Parameters:
name
- cycle group name which will be the suggested action name for those plugins which implement a cycle group action.dataTypes
- data types in the groupkeyStroke
- default key stroke for the action to cycle through the data types
-
CycleGroup
public CycleGroup(java.lang.String name, DataType dt, javax.swing.KeyStroke keyStroke)
Constructor cycle group with one data type.- Parameters:
name
- cycle group name which will be the suggested action name for those plugins which implement a cycle group action.dt
- single data type for the groupkeyStroke
- default key stroke for the action to cycle through the data types
-
CycleGroup
public CycleGroup(java.lang.String name)
Construct empty group no name, data types or keystroke.
-
-
Method Detail
-
getDataTypes
public DataType[] getDataTypes()
Get the data types in this group.
-
getName
public java.lang.String getName()
- Returns:
- cycle group name.
-
size
public int size()
Returns number of types in group
-
getDefaultKeyStroke
public javax.swing.KeyStroke getDefaultKeyStroke()
-
addDataType
public void addDataType(DataType dt)
Add a data type to this group.- Parameters:
dt
- the datatype to be added.
-
addFirst
public void addFirst(DataType dt)
Add the data type as the first in the list.- Parameters:
dt
- the dataType to be added.
-
removeDataType
public void removeDataType(DataType dt)
Remove the data type from this group.- Parameters:
dt
- the dataType to remove.
-
removeFirst
public void removeFirst()
Remove first data type in the list.
-
removeLast
public void removeLast()
Remove the last data type in the list.
-
contains
public boolean contains(DataType dt)
Return true if the given data type is in this cycle group.
-
getNextDataType
public DataType getNextDataType(DataType currentDataType, boolean stackPointers)
Get next data-type which should be used- Parameters:
currentDataType
- current data type to which this cycle group is to be appliedstackPointers
- if true and currentDataType is a pointer, the pointer's base type will be cycled- Returns:
- next data-type
-
-