Java Code Examples for ghidra.program.model.listing.Program#removeListener()

The following examples show how to use ghidra.program.model.listing.Program#removeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultiProgramManager.java    From ghidra with Apache License 2.0 6 votes vote down vote up
void dispose() {
	tool.getProject().getProjectData().removeDomainFolderChangeListener(folderListener);
	fireActivatedEvent(null);
	Iterator<Program> it = programMap.keySet().iterator();
	while (it.hasNext()) {
		Program p = it.next();
		p.removeListener(this);
		p.removeTransactionListener(this);
		fireCloseEvents(p);
		p.release(tool);
	}
	programMap.clear();
	openProgramList.clear();
	tool.setSubTitle("");
	tool.removeStatusComponent(txMonitor);
	tool = null;
	plugin = null;
}
 
Example 2
Source File: AutoTableDisassemblerPlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * @see ghidra.app.plugin.ProgramPlugin#programDeactivated(Program)
 */
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);

	if (addressTableDialog != null) {
		addressTableDialog.close();
	}
}
 
Example 3
Source File: MemoryMapPlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Subclass should override this method if it is interested in
 * close program events.
 */
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
	memManager.setProgram(null);
	provider.setProgram(null);
}
 
Example 4
Source File: SymbolTablePlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public void processEvent(PluginEvent event) {
	if (event instanceof ProgramActivatedPluginEvent) {
		ProgramActivatedPluginEvent progEvent = (ProgramActivatedPluginEvent) event;
		Program oldProg = currentProgram;
		Program newProg = progEvent.getActiveProgram();

		if (oldProg != null) {
			inspector.setProgram(null);
			oldProg.removeListener(this);
			symProvider.setProgram(null, inspector);
			refProvider.setProgram(null, inspector);
			tool.contextChanged(symProvider);
		}
		currentProgram = newProg;
		if (newProg != null) {

			currentProgram.addListener(this);

			inspector.setProgram(currentProgram);

			symProvider.setProgram(currentProgram, inspector);
			refProvider.setProgram(currentProgram, inspector);
		}

		tool.contextChanged(symProvider);
	}
}
 
Example 5
Source File: MultiTabPlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void add(Program prog) {

		if (progService.isVisible(prog)) {
			tabPanel.addProgram(prog);
			prog.removeListener(this);
			prog.addListener(this);
			updateActionEnablement();
		}
	}
 
Example 6
Source File: CallTreeProvider.java    From ghidra with Apache License 2.0 5 votes vote down vote up
void programClosed(Program program) {
	if (program != currentProgram) {
		return; // not my program
	}

	program.removeListener(this);
	clearState();

	currentProgram = null;
}
 
Example 7
Source File: ScalarSearchPlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
protected void programClosed(Program program) {
	program.removeListener(this);

	// Find any providers showing scalars for the closed program and
	// eliminate them.
	Iterator<ScalarSearchProvider> iter = providers.iterator();
	while (iter.hasNext()) {
		ScalarSearchProvider provider = iter.next();
		if (provider.getProgram() == program) {
			provider.programClosed(program);
			iter.remove();
		}
	}
}
 
Example 8
Source File: PropertyManagerPlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
   protected void programDeactivated(Program program) {
	disposeSearchMarks(program);
	if (program != null) {
		program.removeListener(this);
	}
	propertyViewProvider.programDeactivated();
}
 
Example 9
Source File: MyProgramChangesDisplayPlugin.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
protected void programDeactivated(Program program) {

	serverVersion = -1;
	localVersion = -1;
	programChangedLocally = false;
	programChangedRemotely = false;
	programSaved = false;
	program.removeTransactionListener(transactionListener);
	program.removeListener(this);
	disposeMarkerSets(program);
}
 
Example 10
Source File: ViewStringsPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
	provider.setProgram(null);
}
 
Example 11
Source File: MultiTabPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
private void remove(Program prog) {
	prog.removeListener(this);
	tabPanel.removeProgram(prog);
	updateActionEnablement();
}
 
Example 12
Source File: TableServicePlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
}
 
Example 13
Source File: EquateTablePlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
	provider.programClosed();
}
 
Example 14
Source File: DataTypeManagerPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
	dataTypeManagerHandler.programClosed();
	dataTypePropertyManager.programClosed(program);
}
 
Example 15
Source File: FunctionWindowPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
	provider.programClosed();
}
 
Example 16
Source File: DataWindowPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
	provider.programClosed();
	filterAction.programClosed();
}
 
Example 17
Source File: CommentWindowPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
	provider.programClosed();
}
 
Example 18
Source File: TemplateProgramPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
/**
 * Called when the program is closed.
 */
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
}
 
Example 19
Source File: RelocationFixupPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programDeactivated(Program program) {
	program.removeListener(this);
}
 
Example 20
Source File: FunctionComparisonPlugin.java    From ghidra with Apache License 2.0 4 votes vote down vote up
@Override
protected void programClosed(Program program) {
	functionComparisonManager.closeProviders(program);
	program.removeListener(this);
}