use of com.google.security.zynamics.binnavi.disassembly.types.BaseType in project binnavi by google.
the class BaseTypeTableCellRenderer method renderArray.
private static void renderArray(final TypeInstance instance, final StyledDocument document, final boolean renderData) {
final Style arrayStyle = createDeclarationStyle(document);
try {
document.remove(0, document.getLength());
final BaseType baseType = instance.getBaseType();
appendString(document, baseType.getName(), arrayStyle);
if (renderData) {
appendString(document, renderInstanceData(baseType, instance.getAddress().getOffset(), instance.getSection()), createDataStyle(document));
}
} catch (final BadLocationException exception) {
CUtilityFunctions.logException(exception);
}
}
use of com.google.security.zynamics.binnavi.disassembly.types.BaseType 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);
}
}
}
use of com.google.security.zynamics.binnavi.disassembly.types.BaseType in project binnavi by google.
the class MemberNodeTransferHandler method isDropForbidden.
private boolean isDropForbidden(final TransferSupport support) {
// getDropLocation will throw an IllegalStateException.
if (!support.isDrop() || !(support.getComponent() instanceof TypesTree)) {
return true;
}
final JTree.DropLocation location = (JTree.DropLocation) support.getDropLocation();
// final TreeNode destinationNode = (TreeNode) location.getPath().getLastPathComponent();
final BaseTypeTreeNode destinationNode = determineParentNode(location);
if (destinationNode != null && location.getChildIndex() != -1) {
final BaseType parentType = destinationNode.getBaseType();
// We do not (yet) allow inter-base type member drag and drop operations.
for (final TypeMemberTreeNode memberNode : selectedNodes) {
if (memberNode.getTypeMember().getParentType() != parentType) {
return true;
}
}
return false;
}
return true;
}
Aggregations