use of com.google.security.zynamics.binnavi.Tagging.CTag in project binnavi by google.
the class PostgreSQLProviderTest method testTagView1.
@Test
public void testTagView1() throws CouldntSaveDataException, CouldntLoadDataException, CPartialLoadException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final CView view = (CView) module.getContent().getViewContainer().getViews().get(224);
view.load();
final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
final CTag tag = tagManager.getRootTag().getChildren().get(0).getObject();
getProvider().tagView(view, tag);
}
use of com.google.security.zynamics.binnavi.Tagging.CTag in project binnavi by google.
the class PostgreSQLProviderTest method testCTagFunctionsMoveTag.
@Test
public void testCTagFunctionsMoveTag() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException {
final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
tagManager.addTag(tagManager.getRootTag(), "Node Tag I");
tagManager.addTag(tagManager.getRootTag(), "Node Tag II");
tagManager.addTag(tagManager.getRootTag().getChildren().get(0), "Node Tag III");
final ITreeNode<CTag> tag1 = tagManager.getRootTag().getChildren().get(0);
final ITreeNode<CTag> tag2 = tagManager.getRootTag().getChildren().get(1);
final INaviModule module = getProvider().loadModules().get(0);
module.load();
tagManager.moveTag(tag1, tag2);
tagManager.moveTag(tag2, tag1);
// m_sql.moveTag(tag1, tag2, TagType.VIEW_TAG);
// m_sql.moveTag(tag2, tag1, TagType.VIEW_TAG);
// PostgreSQLTagFunctions.moveTag((AbstractSQLProvider) m_sql, tag1, tag2);
// PostgreSQLTagFunctions.moveTag((AbstractSQLProvider) m_sql, tag2, tag1);
}
use of com.google.security.zynamics.binnavi.Tagging.CTag in project binnavi by google.
the class TagTreeManager method clone.
/**
* Converts an internal tag tree into an API tag tree.
*
* @param currentNode The internal tag tree node to convert.
* @param parentExpression Parent of the converted API tag tree node.
*
* @return The converted API tag tree node.
*/
private Tag clone(final ITreeNode<CTag> currentNode, final Tag parentExpression) {
final Tag childExpression = new Tag(currentNode);
m_allTags.put(currentNode, childExpression);
if (parentExpression != null) {
Tag.link(parentExpression, childExpression);
}
for (final ITreeNode<CTag> child : currentNode.getChildren()) {
clone(child, childExpression);
}
return childExpression;
}
use of com.google.security.zynamics.binnavi.Tagging.CTag in project binnavi by google.
the class CCodeNodeUpdater method removeListeners.
/**
* Removes all listeners this class has attached.
*/
private void removeListeners() {
try {
codeNode.getParentFunction().removeListener(functionUpdater);
codeNode.getParentFunction().getModule().removeListener(moduleUpdater);
} catch (final MaybeNullException exception) {
// The code nodes does not have a parent function, therefore the information
// about the parent function is not shown in the code and does not have to
// be processed when updating.
}
codeNode.removeListener(codeNodeListener);
for (final INaviInstruction instruction : codeNode.getInstructions()) {
instruction.removeListener(instructionUpdater);
}
final Iterator<CTag> it = codeNode.getTagsIterator();
while (it.hasNext()) {
it.next().removeListener(tagUpdater);
}
for (final IDebugger debugger : provider.getDebuggers()) {
debugger.getProcessManager().removeListener(debuggerUpdater);
}
provider.removeListener(debuggerProviderListener);
graph.getSettings().getDisplaySettings().removeListener(settingsUpdater);
}
use of com.google.security.zynamics.binnavi.Tagging.CTag in project binnavi by google.
the class ZyNodeBuilder method addTagLines.
/**
* Adds the name of a tag to the content of a label.
*
* @param content The label content where the line content object is added.
* @param node The node that provides the tags.
* @param prefix The prefix that is written in front of all tag lines.
* @param color The color used for the tag line.
*/
private static void addTagLines(final ZyLabelContent content, final INaviViewNode node, final String prefix, final Color color) {
Preconditions.checkNotNull(content, "IE00918: Content argument can't be null");
Preconditions.checkNotNull(node, "IE00919: Node argument can't be null");
Preconditions.checkNotNull(color, "IE00920: Color argument can't be null");
final Iterator<CTag> it = node.getTagsIterator();
while (it.hasNext()) {
final CTag tag = it.next();
if (!"".equals(tag.getName())) {
final ZyLineContent lineComment = new ZyLineContent(prefix + tag.getName(), null);
lineComment.setTextColor(color);
lineComment.setFont(ITALIC_BOLD_FONT);
content.addLineContent(lineComment);
}
}
}
Aggregations