use of com.google.security.zynamics.binnavi.Gui.GraphWindows.types.TypesTree.TypeSelectionPath in project binnavi by google.
the class TypeSubstitutionDialog method createControls.
private void createControls(final BaseType stackFrame) {
setBounds(100, 100, 691, 470);
final JPanel panel = new JPanel();
getContentPane().add(panel, BorderLayout.SOUTH);
panel.setLayout(new FlowLayout(FlowLayout.RIGHT));
final JButton buttonOk = new JButton("OK");
buttonOk.addActionListener(new OkActionListener());
panel.add(buttonOk);
final JButton buttonCancel = new JButton("Cancel");
buttonCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
dispose();
}
});
buttonCancel.setActionCommand("Cancel");
panel.add(buttonCancel);
final JPanel panel1 = new JPanel();
getContentPane().add(panel1, BorderLayout.NORTH);
final GridBagLayout gblPanel1 = new GridBagLayout();
gblPanel1.columnWidths = new int[] { 0, 143, 114, 0 };
gblPanel1.rowHeights = new int[] { 23, 0 };
gblPanel1.columnWeights = new double[] { 0.0, 0.0, 1.0, Double.MIN_VALUE };
gblPanel1.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
panel1.setLayout(gblPanel1);
JCheckBox onlyFitting = new JCheckBox("Only show structs that fit immediate offset");
onlyFitting.setEnabled(false);
GridBagConstraints gbcOnlyFitting = new GridBagConstraints();
gbcOnlyFitting.anchor = GridBagConstraints.WEST;
gbcOnlyFitting.insets = new Insets(0, 0, 0, 5);
gbcOnlyFitting.gridx = 0;
gbcOnlyFitting.gridy = 0;
panel1.add(onlyFitting, gbcOnlyFitting);
types = new TypesTree();
types.setModel(new TypesTreeModel(typeManager, new LocalTypesFilter(stackFrame)));
types.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
types.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent event) {
final TypeSelectionPath path = types.determineTypePath();
if (validateUserInput(path)) {
updatePreview(path);
}
}
});
final JPanel centerPanel = new JPanel();
centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.PAGE_AXIS));
centerPanel.add(new JScrollPane(types));
centerPanel.add(preview);
getContentPane().add(centerPanel, BorderLayout.CENTER);
}
Aggregations