Package ghidra.app.services
Interface ClipboardContentProviderService
-
public interface ClipboardContentProviderService
Determines what types of transfer data can be placed on the clipboard, as well as if cut, copy, and paste operations are supported
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener that will be notified when the state of the service provider changes such that the ability to perform some actions has changed.boolean
canCopy()
Returns true if the given service provider can currently perform a copy operation.boolean
canCopySpecial()
Returns true if the given service provider can currently perform a 'copy special' operation.boolean
canPaste(java.awt.datatransfer.DataFlavor[] availableFlavors)
Returns true if the service can perform a paste operation using the given transferable.java.awt.datatransfer.Transferable
copy(TaskMonitor monitor)
Triggers the default copy operationjava.awt.datatransfer.Transferable
copySpecial(ClipboardType copyType, TaskMonitor monitor)
Triggers a special copy with the specified copy type.boolean
enableCopy()
Returns true if copy should be enabled; false if it should be disabled.boolean
enableCopySpecial()
Returns true if copySpecial actions should be enabled;boolean
enablePaste()
Returns true if paste should be enabled; false if it should be disabled.ComponentProvider
getComponentProvider()
Returns the component provider associated with this servicejava.util.List<ClipboardType>
getCurrentCopyTypes()
Gets the currently active ClipboardTypes for copying with the current contextboolean
isValidContext(ActionContext context)
Return whether the given context is valid for actions on popup menus.void
lostOwnership(java.awt.datatransfer.Transferable transferable)
Notification that the clipboard owner has lost its ownership.boolean
paste(java.awt.datatransfer.Transferable pasteData)
Triggers the default paste operation for the given transferablevoid
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes the given change listener.
-
-
-
Method Detail
-
getComponentProvider
ComponentProvider getComponentProvider()
Returns the component provider associated with this service- Returns:
- the provider
-
copy
java.awt.datatransfer.Transferable copy(TaskMonitor monitor)
Triggers the default copy operation- Parameters:
monitor
- monitor that shows progress of the copy to clipboard, and may be canceled- Returns:
- the created transferable; null if the copy was unsuccessful
-
copySpecial
java.awt.datatransfer.Transferable copySpecial(ClipboardType copyType, TaskMonitor monitor)
Triggers a special copy with the specified copy type.- Parameters:
copyType
- contains the data flavor of the clipboard contentsmonitor
- monitor that shows progress of the copy to clipboard, and may be canceled- Returns:
- the created transferable; null if the copy was unsuccessful
-
paste
boolean paste(java.awt.datatransfer.Transferable pasteData)
Triggers the default paste operation for the given transferable- Parameters:
pasteData
- the paste transferable- Returns:
- true of the paste was successful
-
getCurrentCopyTypes
java.util.List<ClipboardType> getCurrentCopyTypes()
Gets the currently active ClipboardTypes for copying with the current context- Returns:
- the types
-
isValidContext
boolean isValidContext(ActionContext context)
Return whether the given context is valid for actions on popup menus.- Parameters:
context
- the context of where the popup menu will be positioned.- Returns:
- true if valid
-
enableCopy
boolean enableCopy()
Returns true if copy should be enabled; false if it should be disabled. This method can be used in conjunction withcopy(TaskMonitor)
in order to add menu items to popup menus but to have them enabled when appropriate.- Returns:
- true if copy should be enabled
-
enableCopySpecial
boolean enableCopySpecial()
Returns true if copySpecial actions should be enabled;- Returns:
- true if copySpecial actions should be enabled;
-
enablePaste
boolean enablePaste()
Returns true if paste should be enabled; false if it should be disabled. This method can be used in conjunction withpaste(Transferable)
in order to add menu items to popup menus but to have them enabled when appropriate.- Returns:
- true if paste should be enabled
-
lostOwnership
void lostOwnership(java.awt.datatransfer.Transferable transferable)
Notification that the clipboard owner has lost its ownership.- Parameters:
transferable
- the contents which the owner had placed on the clipboard
-
addChangeListener
void addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener that will be notified when the state of the service provider changes such that the ability to perform some actions has changed. For example, the given listener will be called when a copy action can be performed when it was previously not possible.- Parameters:
listener
- The listener to add.
-
removeChangeListener
void removeChangeListener(javax.swing.event.ChangeListener listener)
Removes the given change listener.- Parameters:
listener
- The listener to remove.- See Also:
addChangeListener(ChangeListener)
-
canPaste
boolean canPaste(java.awt.datatransfer.DataFlavor[] availableFlavors)
Returns true if the service can perform a paste operation using the given transferable.- Parameters:
availableFlavors
- data flavors available for the current clipboard transferable- Returns:
- true if the service can perform a paste operation using the given transferable.
-
canCopy
boolean canCopy()
Returns true if the given service provider can currently perform a copy operation.- Returns:
- true if the given service provider can currently perform a copy operation.
-
canCopySpecial
boolean canCopySpecial()
Returns true if the given service provider can currently perform a 'copy special' operation.- Returns:
- true if copy special is enabled
-
-