Class ExplorerFileType
- java.lang.Object
-
- org.apache.hop.ui.hopgui.perspective.explorer.file.ExplorerFileType
-
- All Implemented Interfaces:
IHopFileType
public class ExplorerFileType extends Object implements IHopFileType
-
-
Field Summary
-
Fields inherited from interface org.apache.hop.ui.hopgui.file.IHopFileType
CAPABILITY_ALIGN_BOTTOM, CAPABILITY_ALIGN_LEFT, CAPABILITY_ALIGN_RIGHT, CAPABILITY_ALIGN_TOP, CAPABILITY_CLOSE, CAPABILITY_COPY, CAPABILITY_CUT, CAPABILITY_DEBUG, CAPABILITY_DELETE, CAPABILITY_DISTRIBUTE_HORIZONTAL, CAPABILITY_DISTRIBUTE_VERTICAL, CAPABILITY_EXPORT_TO_SVG, CAPABILITY_FILE_HISTORY, CAPABILITY_HANDLE_METADATA, CAPABILITY_NEW, CAPABILITY_PASTE, CAPABILITY_PAUSE, CAPABILITY_PREVIEW, CAPABILITY_SAVE, CAPABILITY_SAVE_AS, CAPABILITY_SELECT, CAPABILITY_SNAP_TO_GRID, CAPABILITY_START, CAPABILITY_STOP
-
-
Constructor Summary
Constructors Constructor Description ExplorerFileType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)PropertiesgetCapabilities()List<IGuiContextHandler>getContextHandlers()StringgetDefaultFileExtension()Returns the default file extension in lowercase prefixed with dot (.xxx) for this file type.StringgetFileTypeImage()The icon image for this file typeString[]getFilterExtensions()String[]getFilterNames()StringgetName()booleanhasCapability(String capability)Check to see if the capability is presentbooleanisHandledBy(String filename, boolean checkContent)Look at the given file and see if it's handled by this type.IHopFileTypeHandlernewFile(HopGui hopGui, IVariables parentVariableSpace)IHopFileTypeHandleropenFile(HopGui hopGui, String filename, IVariables parentVariableSpace)Load and display the filebooleansupportsFile(IHasFilename metaObject)Checks whether or not this file type supports the given metadata class
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceIHopFileType- Returns:
- The name of this file type
-
getDefaultFileExtension
public String getDefaultFileExtension()
Description copied from interface:IHopFileTypeReturns the default file extension in lowercase prefixed with dot (.xxx) for this file type.- Specified by:
getDefaultFileExtensionin interfaceIHopFileType- Returns:
- The default file extension
-
getFilterExtensions
public String[] getFilterExtensions()
- Specified by:
getFilterExtensionsin interfaceIHopFileType- Returns:
- The file type extensions.
-
getFilterNames
public String[] getFilterNames()
- Specified by:
getFilterNamesin interfaceIHopFileType- Returns:
- The file names (matching the extensions)
-
getCapabilities
public Properties getCapabilities()
- Specified by:
getCapabilitiesin interfaceIHopFileType- Returns:
- The capabilities of this file handler
-
hasCapability
public boolean hasCapability(String capability)
Description copied from interface:IHopFileTypeCheck to see if the capability is present- Specified by:
hasCapabilityin interfaceIHopFileType- Parameters:
capability- The capability to check- Returns:
- True if the capability is set to any non-null value
-
openFile
public IHopFileTypeHandler openFile(HopGui hopGui, String filename, IVariables parentVariableSpace) throws HopException
Description copied from interface:IHopFileTypeLoad and display the file- Specified by:
openFilein interfaceIHopFileType- Parameters:
hopGui- The hop GUI to referencefilename- The filename to loadparentVariableSpace- The parent variablespace to inherit from- Returns:
- The hop file handler
- Throws:
HopException
-
newFile
public IHopFileTypeHandler newFile(HopGui hopGui, IVariables parentVariableSpace) throws HopException
- Specified by:
newFilein interfaceIHopFileType- Throws:
HopException
-
isHandledBy
public boolean isHandledBy(String filename, boolean checkContent) throws HopException
Description copied from interface:IHopFileTypeLook at the given file and see if it's handled by this type. Usually this is done by simply looking at the file extension. In rare cases we look at the content.- Specified by:
isHandledByin interfaceIHopFileType- Parameters:
filename- The filenamecheckContent- True if we want to look inside the file content- Returns:
- true if this HopFile is handling the file
- Throws:
HopException- In case something goes wrong like: file doesn't exist, a permission problem, ...
-
supportsFile
public boolean supportsFile(IHasFilename metaObject)
Description copied from interface:IHopFileTypeChecks whether or not this file type supports the given metadata class- Specified by:
supportsFilein interfaceIHopFileType- Parameters:
metaObject- The object to verify support for- Returns:
-
getContextHandlers
public List<IGuiContextHandler> getContextHandlers()
- Specified by:
getContextHandlersin interfaceIHopFileType- Returns:
- A list of context handlers allowing you to see all the actions that can be taken with the current file type. (CRUD, ...)
-
getFileTypeImage
public String getFileTypeImage()
Description copied from interface:IHopFileTypeThe icon image for this file type- Specified by:
getFileTypeImagein interfaceIHopFileType- Returns:
- The path to the SVG file, a logo for this file type
-
-