Class BaseExplorerFileTypeHandler
- java.lang.Object
-
- org.apache.hop.ui.hopgui.perspective.explorer.file.types.base.BaseExplorerFileTypeHandler
-
- All Implemented Interfaces:
IActionContextHandlersProvider,IHopFileTypeHandler
- Direct Known Subclasses:
BaseTextExplorerFileTypeHandler,SvgExplorerFileTypeHandler
public abstract class BaseExplorerFileTypeHandler extends Object implements IHopFileTypeHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected ExplorerFileexplorerFileprotected HopGuihopGuiprotected ExplorerPerspectiveperspective
-
Constructor Summary
Constructors Constructor Description BaseExplorerFileTypeHandler(HopGui hopGui, ExplorerPerspective perspective, ExplorerFile explorerFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyStateProperties(Map<String,Object> stateProperties)voidclose()Actually close the file, remove it from the user interface.voidcopySelectedToClipboard()Copy the selected items to the clipboardvoidcutSelectedToClipboard()Cut the selected items to the clipboardvoiddebug()Debug the filevoiddeleteSelected()Delete the selected itemsList<IGuiContextHandler>getContextHandlers()ExplorerFilegetExplorerFile()Gets explorerFileStringgetFilename()IHopFileTypegetFileType()Get a hold of the file type detailsHopGuigetHopGui()Gets hopGuiStringgetName()Get the user friendly name of the file being handledExplorerPerspectivegetPerspective()Gets perspectiveMap<String,Object>getStateProperties()Describe the state properties of the file being handled: zoomLevel, scrollX, scrollY, active, ...ObjectgetSubject()What is this handling? (pipeline, workflow, ...)IVariablesgetVariables()The variables associated with the file.booleanhasChanged()See if there anything has been changed by the userbooleanisCloseable()Perform any task needed to close a file, save it if neededvoidpasteFromClipboard()Paste items from the clipboardvoidpause()Pause executionvoidpreview()Preview this fileprotected StringreadTextFileContent(String encoding)voidredo()Redo a change to the filevoidredraw()Refresh the graphical file representation after model changesvoidresume()Resume executionvoidsave()Save the file without asking for a new filenamevoidsaveAs(String filename)Save the file after asking for a filenamevoidselectAll()Select all items in the current filesvoidsetExplorerFile(ExplorerFile explorerFile)voidsetFilename(String filename)Change the filename of the hop filevoidsetHopGui(HopGui hopGui)voidsetName(String name)Set the user friendly name of the underlying filevoidsetPerspective(ExplorerPerspective perspective)voidstart()Start executionvoidstop()Stop executionvoidundo()Undo a change to the filevoidunselectAll()Unselect all items in the current filevoidupdateGui()Update the toolbar, menus and so on.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hop.ui.hopgui.file.IHopFileTypeHandler
markDeleted, reload
-
-
-
-
Field Detail
-
hopGui
protected HopGui hopGui
-
perspective
protected ExplorerPerspective perspective
-
explorerFile
protected ExplorerFile explorerFile
-
-
Constructor Detail
-
BaseExplorerFileTypeHandler
public BaseExplorerFileTypeHandler(HopGui hopGui, ExplorerPerspective perspective, ExplorerFile explorerFile)
-
-
Method Detail
-
readTextFileContent
protected String readTextFileContent(String encoding) throws HopException
- Throws:
HopException
-
getContextHandlers
public List<IGuiContextHandler> getContextHandlers()
- Specified by:
getContextHandlersin interfaceIActionContextHandlersProvider
-
getSubject
public Object getSubject()
Description copied from interface:IHopFileTypeHandlerWhat is this handling? (pipeline, workflow, ...)- Specified by:
getSubjectin interfaceIHopFileTypeHandler- Returns:
- The subject being handled
-
getName
public String getName()
Description copied from interface:IHopFileTypeHandlerGet the user friendly name of the file being handled- Specified by:
getNamein interfaceIHopFileTypeHandler- Returns:
- The user friendly name
-
setName
public void setName(String name)
Description copied from interface:IHopFileTypeHandlerSet the user friendly name of the underlying file- Specified by:
setNamein interfaceIHopFileTypeHandler- Parameters:
name- The user friendly name
-
getFileType
public IHopFileType getFileType()
Description copied from interface:IHopFileTypeHandlerGet a hold of the file type details- Specified by:
getFileTypein interfaceIHopFileTypeHandler- Returns:
-
getFilename
public String getFilename()
- Specified by:
getFilenamein interfaceIHopFileTypeHandler- Returns:
- The filename of the hop file
-
setFilename
public void setFilename(String filename)
Description copied from interface:IHopFileTypeHandlerChange the filename of the hop file- Specified by:
setFilenamein interfaceIHopFileTypeHandler- Parameters:
filename- The new filename
-
save
public void save() throws HopExceptionDescription copied from interface:IHopFileTypeHandlerSave the file without asking for a new filename- Specified by:
savein interfaceIHopFileTypeHandler- Throws:
HopException
-
saveAs
public void saveAs(String filename) throws HopException
Description copied from interface:IHopFileTypeHandlerSave the file after asking for a filename- Specified by:
saveAsin interfaceIHopFileTypeHandler- Throws:
HopException
-
start
public void start()
Description copied from interface:IHopFileTypeHandlerStart execution- Specified by:
startin interfaceIHopFileTypeHandler
-
stop
public void stop()
Description copied from interface:IHopFileTypeHandlerStop execution- Specified by:
stopin interfaceIHopFileTypeHandler
-
pause
public void pause()
Description copied from interface:IHopFileTypeHandlerPause execution- Specified by:
pausein interfaceIHopFileTypeHandler
-
resume
public void resume()
Description copied from interface:IHopFileTypeHandlerResume execution- Specified by:
resumein interfaceIHopFileTypeHandler
-
preview
public void preview()
Description copied from interface:IHopFileTypeHandlerPreview this file- Specified by:
previewin interfaceIHopFileTypeHandler
-
debug
public void debug()
Description copied from interface:IHopFileTypeHandlerDebug the file- Specified by:
debugin interfaceIHopFileTypeHandler
-
redraw
public void redraw()
Description copied from interface:IHopFileTypeHandlerRefresh the graphical file representation after model changes- Specified by:
redrawin interfaceIHopFileTypeHandler
-
updateGui
public void updateGui()
Description copied from interface:IHopFileTypeHandlerUpdate the toolbar, menus and so on. This is needed after a file, context or capabilities changes- Specified by:
updateGuiin interfaceIHopFileTypeHandler
-
selectAll
public void selectAll()
Description copied from interface:IHopFileTypeHandlerSelect all items in the current files- Specified by:
selectAllin interfaceIHopFileTypeHandler
-
unselectAll
public void unselectAll()
Description copied from interface:IHopFileTypeHandlerUnselect all items in the current file- Specified by:
unselectAllin interfaceIHopFileTypeHandler
-
copySelectedToClipboard
public void copySelectedToClipboard()
Description copied from interface:IHopFileTypeHandlerCopy the selected items to the clipboard- Specified by:
copySelectedToClipboardin interfaceIHopFileTypeHandler
-
cutSelectedToClipboard
public void cutSelectedToClipboard()
Description copied from interface:IHopFileTypeHandlerCut the selected items to the clipboard- Specified by:
cutSelectedToClipboardin interfaceIHopFileTypeHandler
-
deleteSelected
public void deleteSelected()
Description copied from interface:IHopFileTypeHandlerDelete the selected items- Specified by:
deleteSelectedin interfaceIHopFileTypeHandler
-
pasteFromClipboard
public void pasteFromClipboard()
Description copied from interface:IHopFileTypeHandlerPaste items from the clipboard- Specified by:
pasteFromClipboardin interfaceIHopFileTypeHandler
-
isCloseable
public boolean isCloseable()
Description copied from interface:IHopFileTypeHandlerPerform any task needed to close a file, save it if needed- Specified by:
isCloseablein interfaceIHopFileTypeHandler- Returns:
- true if the file is ready to close. Return false if there was a problem saving or any other issue.
-
hasChanged
public boolean hasChanged()
Description copied from interface:IHopFileTypeHandlerSee if there anything has been changed by the user- Specified by:
hasChangedin interfaceIHopFileTypeHandler- Returns:
- true if there were changes worth saving, false if nothing has been changed.
-
undo
public void undo()
Description copied from interface:IHopFileTypeHandlerUndo a change to the file- Specified by:
undoin interfaceIHopFileTypeHandler
-
redo
public void redo()
Description copied from interface:IHopFileTypeHandlerRedo a change to the file- Specified by:
redoin interfaceIHopFileTypeHandler
-
getStateProperties
public Map<String,Object> getStateProperties()
Description copied from interface:IHopFileTypeHandlerDescribe the state properties of the file being handled: zoomLevel, scrollX, scrollY, active, ...- Specified by:
getStatePropertiesin interfaceIHopFileTypeHandler- Returns:
- The state properties
-
close
public void close()
Description copied from interface:IHopFileTypeHandlerActually close the file, remove it from the user interface.- Specified by:
closein interfaceIHopFileTypeHandler
-
applyStateProperties
public void applyStateProperties(Map<String,Object> stateProperties)
- Specified by:
applyStatePropertiesin interfaceIHopFileTypeHandler
-
getVariables
public IVariables getVariables()
Description copied from interface:IHopFileTypeHandlerThe variables associated with the file. It's usually keeping internal variables and other file specific settings like active unit test settings.- Specified by:
getVariablesin interfaceIHopFileTypeHandler- Returns:
- The variables associated with the loaded file
-
getHopGui
public HopGui getHopGui()
Gets hopGui- Returns:
- value of hopGui
-
setHopGui
public void setHopGui(HopGui hopGui)
- Parameters:
hopGui- The hopGui to set
-
getPerspective
public ExplorerPerspective getPerspective()
Gets perspective- Returns:
- value of perspective
-
setPerspective
public void setPerspective(ExplorerPerspective perspective)
- Parameters:
perspective- The perspective to set
-
getExplorerFile
public ExplorerFile getExplorerFile()
Gets explorerFile- Returns:
- value of explorerFile
-
setExplorerFile
public void setExplorerFile(ExplorerFile explorerFile)
- Parameters:
explorerFile- The explorerFile to set
-
-