use of com.google.security.zynamics.binnavi.Gui.GraphWindows.types.MemberDialog in project binnavi by google.
the class AppendMemberAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent e) {
final MemberDialog dlg = MemberDialog.createBuildNewMemberDialog(owner, typeManager);
GuiHelper.centerChildToParent(owner, dlg, true);
dlg.setVisible(true);
if (!dlg.wasCanceled()) {
final String name = dlg.getMemberName();
final BaseType baseType = dlg.getBaseType();
try {
final TypeMember member = typeManager.appendMember(selectedType, baseType, name);
if (member == null) {
CMessageBox.showInformation(owner, "Unable to append member since that would create a recursive type definition.");
}
} catch (final CouldntSaveDataException exception) {
CUtilityFunctions.logException(exception);
}
}
}
use of com.google.security.zynamics.binnavi.Gui.GraphWindows.types.MemberDialog in project binnavi by google.
the class EditMemberAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent e) {
final MemberDialog dialog = MemberDialog.createEditMemberDialog(owner, typeManager, selectedMember);
GuiHelper.centerChildToParent(owner, dialog, true);
dialog.setVisible(true);
if (!dialog.wasCanceled()) {
try {
switch(selectedMember.getParentType().getCategory()) {
case STRUCT:
typeManager.updateStructureMember(selectedMember, dialog.getBaseType(), dialog.getMemberName(), selectedMember.getBitOffset().get());
break;
case UNION:
typeManager.updateUnionMember(selectedMember, dialog.getBaseType(), dialog.getMemberName());
break;
case FUNCTION_PROTOTYPE:
typeManager.updateFunctionPrototypeMember(selectedMember, dialog.getBaseType(), dialog.getMemberName(), selectedMember.getArgumentIndex().get());
default:
throw new IllegalStateException("Error: can not edit a member of a non compound type.");
}
} catch (final CouldntSaveDataException exception) {
CUtilityFunctions.logException(exception);
}
}
}
use of com.google.security.zynamics.binnavi.Gui.GraphWindows.types.MemberDialog in project binnavi by google.
the class InsertMemberAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent e) {
final MemberDialog dlg = MemberDialog.createBuildNewMemberDialog(owner, typeManager);
dlg.setVisible(true);
if (!dlg.wasCanceled()) {
final BaseType memberType = dlg.getBaseType();
final String memberName = dlg.getMemberName();
try {
typeManager.insertMemberAfter(existingMember, memberType, memberName);
} catch (final CouldntSaveDataException exception) {
CUtilityFunctions.logException(exception);
}
}
}
Aggregations