Package help.screenshot
Class GhidraScreenShotGenerator
Extend this class to create screen shot images for help. The name of the class determines the
topic directory where the captured image will be stored. So if the class name is
XyzShreenShots, the resulting captured image will appear in help topic directly "Xyz", regardless
of which module has that topic. The test name will determine the name of the image file
that is generated. So if the test name is testHappyBirthday, the filename will be
HappyBirthday.png.
-
Nested Class Summary
Nested classes/interfaces inherited from class generic.test.AbstractGuiTest
AbstractGuiTest.ExceptionHandlingRunner -
Field Summary
Fields inherited from class help.screenshot.AbstractScreenShotGenerator
DEFAULT_FILENAME_SUFFIX, DIALOG_HEADER_HEIGHT, env, image, NEW_FILENAME_SUFFIX, NEW_FILENAME_SUFFIX_KEY, program, SAVE_CREATED_IMAGE_FILE, SAVE_CREATED_IMAGE_FILE_KEY, toolFields inherited from class ghidra.test.AbstractGhidraHeadlessIntegrationTest
PROJECT_NAMEFields inherited from class generic.test.AbstractGenericTest
concurrentTestExceptionRule, DEFAULT_TEST_TOOL_NAME, DEFAULT_TOOL_NAME, ruleChain, TESTDATA_DIRECTORY_NAME, watchmanFields inherited from class generic.test.AbstractGTest
BATCH_MODE, DEFAULT_WAIT_DELAY, DEFAULT_WAIT_TIMEOUT, DEFAULT_WINDOW_TIMEOUT, ignoreUnfinishedRule, PARALLEL_MODE, PRIVATE_LONG_WAIT_TIMEOUT, repeatedRule, testName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCall when you are finished generating a new image.protected FrontEndToolprotected Fileprotected FilegetHelpTopicDir(String helpTopic) protected Stringprotected ImagegetOldImage(File helpTopicDir, String imageName) protected voidhandleGIFImage(File gifFile) voidvoidperformFrontEndAction(String actionName, String owner, boolean wait) protected voidreallySaveToHelp(File helpTopicDir, String imageName) voidGenerally, you shouldn't use this.voidsaveOrDisplayImage(String name) voidsaveToHelp(String helpTopic, String imageName) Deprecated.voidDeprecated.use insteadfinished(File, String).protected voidvoidtearDown()Methods inherited from class help.screenshot.AbstractScreenShotGenerator
addr, address, addSelection, captureActionIcon, captureComponent, captureComponents, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureIcon, captureIsolatedComponent, captureIsolatedProvider, captureIsolatedProvider, captureIsolatedProviderWindow, captureListingField, captureListingRange, captureMenu, captureMenuBarMenu, captureMenuBarMenuHierachy, captureProvider, captureProvider, captureProvider, captureProviderWindow, captureProviderWindow, captureProviderWindow, captureProviderWindow, captureProviderWindow, captureProviderWithScreenShot, captureToolWindow, captureWindow, captureWindow, captureWindow, closeNonProgramArchives, closeProvider, createBookmark, createEmptyImage, crop, doubleClickCursor, drawArrow, drawArrow, drawBorder, drawLine, drawOval, drawRectangle, drawRectangle, drawRectangleAround, drawRectangleAround, drawRectangleWithDropShadowAround, drawText, drawText, error, exit, fillRectangle, findProviderToolBarButton, findRowByPartialText, generateImage, getBounds, getCursorBounds, getDialog, getDialog, getDockableComponent, getDockableComponent, getField, getPopupMenu, getProvider, getProvider, go, goToListing, goToListing, goToListing, hideTableColumn, leftClickCursor, loadPlugin, loadPlugin, loadProgram, loadProgram, makeSelection, makeSelection, middleClickCursor, moveProvider, moveProviderToFront, moveProviderToFront, moveProviderToItsOwnWindow, moveProviderToItsOwnWindow, moveWindowUp, newTestEnv, padImage, paintFix, performAction, performAction, performDialogAction, performMemorySearch, placeImagesSideBySide, positionCursor, positionCursor, positionListingCenter, positionListingTop, prepareCommentsDialog, prepareTool, pressButtonOnDialog, pressOkOnDialog, readImage, removeField, removeFlowArrows, rightClickCursor, scrollToRow, selectRow, selectRow, setDividerPercentage, setDockIcon, setListingFieldWidth, setSelected, setSelectedAnayzer, setToolSize, setUp, setUser, setWindowSize, showAnalysisOptions, showColumnSettings, showCommentDialog, showMenuBarMenu, showOptions, showProgramOptions, showProvider, showTab, showTableColumn, takeSnippet, topOfListing, writeFileMethods inherited from class ghidra.test.AbstractGhidraHeadedIntegrationTest
addPlugin, click, click, click, click, createApplicationConfiguration, createApplicationLayout, getAction, getPluginByName, saveTool, showDialogWithoutBlocking, showTool, waitForBusyTool, waitForProgramMethods inherited from class ghidra.test.AbstractGhidraHeadlessIntegrationTest
applyCmd, cleanDbTestDir, clearSelection, createDefaultProgram, createDefaultProgram, debugProgramInTool, deleteProject, getLanguageCompilerSpecPair, getLanguageService, getPlugin, getSLEIGH_8051_LANGUAGE, getSLEIGH_X86_64_LANGUAGE, getSLEIGH_X86_LANGUAGE, getUniqueSymbol, getUniqueSymbol, getZ80_LANGUAGE, goTo, goTo, initializeSystemProperties, makeSelection, makeSelection, makeSelection, makeSelection, modifyProgram, modifyProgram, redo, redo, redo, replaceService, toAddressSet, toAddressSet, toAddressSet, toAddressSet, tx, tx, tx, undo, undo, undo, undo, waitForScriptCompletionMethods inherited from class docking.test.AbstractDockingTest
assertEnabled, assertIconsEqual, assertToggleButtonSelected, capture, clickComponentProvider, clickComponentProvider, close, close, closeAllWindows, closeAllWindows, closeAllWindowsAndFrames, closeProvider, closeSaveChangesDialog, createContext, createContext, createRenderedImage, createScreenImage, disposeErrorGUI, dockingSetUp, dockingTearDown, expandPath, expandTree, findButtonByActionName, findButtonByIcon, findButtonByName, findButtonByText, findComponent, findComponentByName, getAction, getAction, getAction, getActionsByName, getActionsByOwner, getActionsByOwnerAndName, getClipboardText, getComponentProvider, getDialogComponent, getDialogComponentProvider, getDockableComponent, getLocalAction, getMessageText, getNode, getOpenWindowsAsString, getStatusText, getTitleForWindow, getURL, getWindow, getWindowByTitle, getWindowByTitleContaining, getWindows, isEnabled, isEnabled, isEnabled, isSelected, isToggleButttonSelected, isUseErrorGUI, performAction, performAction, performAction, performAction, performDialogAction, pressButtonByText, pressButtonByText, printOpenWindows, selectPath, selectTabIfAvailable, setErrorGUIEnabled, setToggleActionSelected, setToggleActionSelected, setToggleButtonSelected, setToggleButtonSelected, showProvider, triggerActionKey, triggerActionKey, triggerBackspace, triggerEnter, triggerEscape, triggerKey, triggerKey, triggerKey, triggerText, triggerText, waitForComponentProvider, waitForComponentProvider, waitForComponentProvider, waitForDialogComponent, waitForDialogComponent, waitForDialogComponent, waitForErrorDialog, waitForInfoDialog, waitForJDialog, waitForJDialog, waitForTableModel, waitForTree, waitForUpdateOnChooser, waitForWindow, waitForWindow, waitForWindow, waitForWindowByName, waitForWindowByTitleContaining, writeImage, writeImageMethods inherited from class generic.test.AbstractGuiTest
assertColorsEqual, clickListRange, clickMouse, clickMouse, clickTableCell, clickTableRange, doubleClick, dragMouse, editCell, executeOnSwingWithoutBlocking, findAbstractButtonByName, findAbstractButtonByText, findButtonByIcon, findButtonByName, findButtonByText, findComponent, findComponent, findComponentByName, findComponentByName, findComponents, findComponents, findOwnedWindows, findPathToText, findTreePathToText, fixupGUI, getAllWindows, getRenderedTableCellValue, getSwing, getText, leftClick, middleClick, moveMouse, postEvent, pressButton, pressButton, pressButtonByName, pressButtonByName, pressButtonByText, pressButtonByText, printMemory, privatewaitForSwing_SwingSafe, rightClick, runSwing, runSwing, runSwing, runSwingLater, runSwingWithException, setComboBoxSelection, setText, waitForExpiringSwingTimers, waitForPostedSwingRunnables, waitForSwing, waitForTasks, waitForTasks, yieldToSwingMethods inherited from class generic.test.AbstractGenericTest
createStackTraceForAllThreads, createTempDirectory, createTempFile, createTempFile, createTempFileForTest, createTempFileForTest, createTempFilePath, createTempFilePath, deleteMatchingTempFiles, deleteSimilarTempFiles, findTestDataFile, getDebugFileDirectory, getFontMetrics, getInstanceField, getInstanceFieldByClassType, getTestDataDir, getTestDataDirectory, getTestDataFile, hasTestFailed, initializeLayout, invokeConstructor, invokeInstanceMethod, invokeInstanceMethod, loadTextResource, loadTextResource, resetLogging, setErrorsExpected, setInstanceField, setLogLevel, setLogLevel, testFailed, toString, windowForComponentMethods inherited from class generic.test.AbstractGTest
assertArraysEqualOrdered, assertArraysEqualUnordered, assertArraysEqualUnordered, assertContainsExactly, assertContainsExactly, assertContainsString, assertContainsStringIgnoringCase, assertListEqualOrdered, assertListEqualOrdered, assertListEqualsArrayOrdered, assertListEqualsArrayUnordered, assertListEqualUnordered, bytes, failWithException, getName, getRandomInt, getRandomInt, getRandomString, getRandomString, getTestDirectoryPath, sleep, waitFor, waitFor, waitFor, waitFor, waitFor, waitForCondition, waitForCondition, waitForCondition, waitForConditionWithoutFailing, waitForValue, waitForValueWithoutFailing
-
Constructor Details
-
GhidraScreenShotGenerator
protected GhidraScreenShotGenerator()
-
-
Method Details
-
tearDown
- Overrides:
tearDownin classAbstractScreenShotGenerator- Throws:
Exception
-
showResults
protected void showResults() -
saveOrDisplayImage
public void saveOrDisplayImage()Generally, you shouldn't use this. This is only visible for those who do not directly extend this class. -
saveOrDisplayImage
-
handleGIFImage
-
getHelpTopic
-
loadDefaultTool
public void loadDefaultTool() -
getHelpTopicName
-
finished
Call when you are finished generating a new image. This method will either show the newly created image or write it to disk, depending upon the value ofAbstractScreenShotGenerator.SAVE_CREATED_IMAGE_FILE, which is a system property.- Parameters:
helpTopic- The help topic that contains the imageoldImageName- The name of the image
-
getOldImage
-
showImage
Deprecated.use insteadfinished(File, String).- Parameters:
helpTopic- The help topic that contains the imageoldImageName- The name of the image
-
saveToHelp
Deprecated.use insteadfinished(File, String).- Parameters:
helpTopic- The help topic that contains the imageimageName- The name of the image
-
reallySaveToHelp
-
getHelpTopicDir
-
getHelpTopicDirs
-
getFrontEndTool
-
performFrontEndAction
-
finished(File, String).