Search in sources :

Example 16 with BaseType

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);
    }
}
Also used : BaseType(com.google.security.zynamics.binnavi.disassembly.types.BaseType) Style(javax.swing.text.Style) BadLocationException(javax.swing.text.BadLocationException)

Example 17 with BaseType

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);
        }
    }
}
Also used : BaseType(com.google.security.zynamics.binnavi.disassembly.types.BaseType) CouldntSaveDataException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException) MemberDialog(com.google.security.zynamics.binnavi.Gui.GraphWindows.types.MemberDialog)

Example 18 with BaseType

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;
}
Also used : JTree(javax.swing.JTree) BaseType(com.google.security.zynamics.binnavi.disassembly.types.BaseType)

Aggregations

BaseType (com.google.security.zynamics.binnavi.disassembly.types.BaseType)18 TypeMember (com.google.security.zynamics.binnavi.disassembly.types.TypeMember)6 BadLocationException (javax.swing.text.BadLocationException)3 Style (javax.swing.text.Style)3 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)2 MemberDialog (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.MemberDialog)2 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)2 TreePath (javax.swing.tree.TreePath)2 Test (org.junit.Test)2 Node (y.base.Node)2 AppendMemberAction (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.actions.AppendMemberAction)1 EditMemberAction (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.actions.EditMemberAction)1 EditTypeAction (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.actions.EditTypeAction)1 InsertMemberAction (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.actions.InsertMemberAction)1 CFunction (com.google.security.zynamics.binnavi.disassembly.CFunction)1 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)1 INaviOperandTreeNode (com.google.security.zynamics.binnavi.disassembly.INaviOperandTreeNode)1 RawTypeInstance (com.google.security.zynamics.binnavi.disassembly.types.RawTypeInstance)1 Section (com.google.security.zynamics.binnavi.disassembly.types.Section)1 TypeInstance (com.google.security.zynamics.binnavi.disassembly.types.TypeInstance)1