use of com.google.security.zynamics.binnavi.disassembly.types.TypeMember in project binnavi by google.
the class ArrayTypePanel method populateControls.
private void populateControls() {
if (existingType == null) {
return;
}
final TypeMember arrayMember = existingType.iterator().next();
numberElements.setValue(arrayMember.getNumberOfElements().get());
baseTypes.getModel().selectByBaseType(arrayMember.getBaseType());
updatePreview();
}
use of com.google.security.zynamics.binnavi.disassembly.types.TypeMember in project binnavi by google.
the class BaseTypeTransferHandler method createOrUpdateTypeSubstitution.
/**
* Locate operand tree node and use type manager to assign type substitution.
*/
private boolean createOrUpdateTypeSubstitution(final DragAndDropSupportWrapper wrapper) throws UnsupportedFlavorException, IOException, CouldntSaveDataException {
final INaviOperandTreeNode node = wrapper.determineDropNode();
if (!isLegalDropNode(node)) {
return false;
}
final BaseType baseType = wrapper.getDroppedBaseType();
if (node.getTypeSubstitution() != null) {
typeManager.updateTypeSubstitution(node, node.getTypeSubstitution(), baseType, new ArrayList<TypeMember>(), 0);
} else {
// When creating a substitution via drag and drop, the offset is always zero to have a
// better workflow for the user (otherwise we would need an additional dialog each time).
typeManager.createTypeSubstitution(node, baseType, node.getOperandPosition(), 0, /* offset */
node.getInstructionAddress());
}
return true;
}
use of com.google.security.zynamics.binnavi.disassembly.types.TypeMember in project binnavi by google.
the class ComplexTypePanel method populateControls.
private void populateControls() {
if (existingType == null) {
return;
}
name.setText(existingType.getName());
final MemberTableModel model = members.getModel();
for (final TypeMember member : existingType) {
model.addRow(new MemberTableRowData(member));
}
}
use of com.google.security.zynamics.binnavi.disassembly.types.TypeMember in project binnavi by google.
the class TypeSubstitutionDialog method createOrUpdateSubstitution.
private void createOrUpdateSubstitution(final TypeSelectionPath path) throws CouldntSaveDataException {
final int offset = path.determineTotalMemberOffset();
final BaseType baseType = path.getRootType();
final int position = selectedNode.getOperandPosition();
final IAddress address = selectedNode.getInstructionAddress();
final TypeSubstitution substitution = selectedNode.getTypeSubstitution();
final List<TypeMember> memberPath = path.getMembers();
if (substitution == null) {
typeManager.createTypeSubstitution(selectedNode, baseType, memberPath, position, offset, address);
} else {
typeManager.updateTypeSubstitution(selectedNode, substitution, baseType, path.getMembers(), offset);
}
}
use of com.google.security.zynamics.binnavi.disassembly.types.TypeMember in project binnavi by google.
the class TypeEditorPanel method getSelectedMembers.
@Override
public ImmutableList<TypeMember> getSelectedMembers() {
final Builder<TypeMember> builder = ImmutableList.<TypeMember>builder();
final TreePath[] paths = typesTree.getSelectionPaths();
if (paths != null) {
for (final TreePath path : typesTree.getSelectionPaths()) {
final Object node = path.getLastPathComponent();
if (node instanceof TypeMemberTreeNode) {
builder.add(((TypeMemberTreeNode) node).getTypeMember());
}
}
}
return builder.build();
}
Aggregations