use of com.google.security.zynamics.zylib.gui.SwingInvoker in project binnavi by google.
the class CMemorySectionPanelSynchronizer method updateGui.
/**
* Updates the GUI of the synchronized memory section box depending on the current state of the
* debug GUI perspective and the active debugger.
*/
private void updateGui() {
final IDebugger activeDebugger = debugPerspectiveModel.getCurrentSelectedDebugger();
final TargetProcessThread activeThread = activeDebugger == null ? null : activeDebugger.getProcessManager().getActiveThread();
final boolean enable = (activeThread != null) && (activeDebugger != null) && activeDebugger.isConnected() && (activeDebugger.getProcessManager().getTargetInformation() != null) && activeDebugger.getProcessManager().getTargetInformation().getDebuggerOptions().canMemmap() && (memorySectionBox.getItemCount() != 0);
new SwingInvoker() {
@Override
protected void operation() {
memorySectionBox.setEnabled(enable);
}
}.invokeAndWait();
}
use of com.google.security.zynamics.zylib.gui.SwingInvoker in project binnavi by google.
the class CMemorySectionPanelSynchronizer method updateMemoryBox.
/**
* Updates the memory selection box.
*/
private void updateMemoryBox() {
final IDebugger activeDebugger = debugPerspectiveModel.getCurrentSelectedDebugger();
final ArrayList<CMemorySectionWrapper> sections = new ArrayList<>();
if ((activeDebugger != null) && activeDebugger.isConnected()) {
for (final MemorySection section : activeDebugger.getProcessManager().getMemoryMap()) {
sections.add(new CMemorySectionWrapper(section));
}
}
new SwingInvoker() {
@Override
protected void operation() {
memorySectionBox.removeAllItems();
if ((activeDebugger != null) && activeDebugger.isConnected()) {
for (final CMemorySectionWrapper sectionWrapper : sections) {
memorySectionBox.addItem(sectionWrapper);
}
}
}
}.invokeAndWait();
}
use of com.google.security.zynamics.zylib.gui.SwingInvoker in project binnavi by google.
the class CAddressSpaceFunctions method loadAddressSpaces.
/**
* Loads one or more address spaces.
*
* @param projectTree Project tree of the main window.
* @param addressSpaces The address spaces to load.
*/
public static void loadAddressSpaces(final JTree projectTree, final INaviAddressSpace[] addressSpaces) {
new Thread() {
@Override
public void run() {
final CDefaultProgressOperation operation = new CDefaultProgressOperation("Loading address spaces", false, true);
operation.getProgressPanel().setMaximum(addressSpaces.length);
for (final INaviAddressSpace addressSpace : addressSpaces) {
operation.getProgressPanel().setText("Loading address spaces" + ": '" + addressSpace.getConfiguration().getName() + "'");
try {
addressSpace.load();
new SwingInvoker() {
@Override
protected void operation() {
CNodeExpander.expandNode(projectTree, addressSpace);
}
}.invokeLater();
} catch (final CouldntLoadDataException exception) {
CUtilityFunctions.logException(exception);
final String message = "E00109: " + "Address space could not be loaded";
final String description = CUtilityFunctions.createDescription(String.format("The address space '%s' could not be loaded. Try loading the address space again. If the problem persists, disconnect from and reconnect to the database, restart com.google.security.zynamics.binnavi, or contact the BinNavi support.", addressSpace.getConfiguration().getName()), new String[] { "Database connection problems." }, new String[] { "The address space was not loaded." });
NaviErrorDialog.show(SwingUtilities.getWindowAncestor(projectTree), message, description, exception);
} catch (final LoadCancelledException e) {
// Do nothing
} finally {
operation.getProgressPanel().next();
}
}
operation.stop();
}
}.start();
}
use of com.google.security.zynamics.zylib.gui.SwingInvoker in project binnavi by google.
the class CProgressPanel method setText.
public void setText(final String description) {
m_description = description;
String text = convertTextToHtml(description);
text = fitTextToLabel(text);
m_label.setText(text);
new SwingInvoker() {
@Override
public void operation() {
m_label.updateUI();
}
}.invokeLater();
}
use of com.google.security.zynamics.zylib.gui.SwingInvoker in project binnavi by google.
the class CProgressPanel method setSubText.
public void setSubText(final String subDescription) {
String text = fitTextToLabel(m_description) + "\n";
text += fitTextToLabel(subDescription);
m_label.setText(convertTextToHtml(text));
new SwingInvoker() {
@Override
public void operation() {
m_label.updateUI();
}
}.invokeLater();
}
Aggregations