Class ClearHandler
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
com.developer.nefarious.zjoule.plugin.core.functions.ClearHandler
- All Implemented Interfaces:
org.eclipse.jface.action.IAction
public class ClearHandler
extends org.eclipse.jface.action.Action
Handles the "Clear Chat" action in the application.
This class extends Action
and provides functionality to clear the chat message history
and reset the associated browser state. It also manages the display icon for the action.
-
Field Summary
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClearHandler
create
(org.eclipse.swt.browser.Browser browser) Factory method to create a newClearHandler
instance.void
run()
Executes the "Clear Chat" action.Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Method Details
-
create
Factory method to create a newClearHandler
instance.- Parameters:
browser
- theBrowser
instance associated with the action.- Returns:
- a new
ClearHandler
instance.
-
run
public void run()Executes the "Clear Chat" action.If the user is logged in, this method clears the chat message history stored in
MemoryMessageHistory
and resets the browser state by executing theclearMessages()
JavaScript function.- Specified by:
run
in interfaceorg.eclipse.jface.action.IAction
- Overrides:
run
in classorg.eclipse.jface.action.Action
-